Hi everyone,
I’m prototyping a game that involves working with simulated Linux-type servers; the player logs into a host, and can explore and manipulate files, etc.
This will require storing structured, parented data in the ways you’d expect: Each host contains a number of directories, and each directory contains a number of directories and files.
Players will be able to copy and move files and directories around within a host and between hosts.
I’m considering three different ways of storing this data: SQLite, XML, and the native filesystem of the player’s machine.
SQLite Pros:
- Relational data uses easy to understand IDs and primary key/foreign key relationships
- Database transaction support and data integrity auto-enforced; much more difficult to get data in a bad state
- I’m more familiar with SQL than the other options
SQLite Cons:
- The game now has an external dependency to SQLite
- Cross-platform testing (Windows vs Mac) possibly more complex
- SQLite does not support stored procedures
XML Pros:
- Seems like the most portable option, no external dependencies
- C# XElement seems like it could do everything I’d need, not sure though
XML Cons:
- No data integrity enforcement
- I would need to become an expert with XElement
Native Filesystem Pros:
- Possibly the most intuitive
- C# comes with mature methods for manipulating filesystems, and abstracts platform-specific stuff (Path.DirectorySeparatorChar, etc)
Native Filesystem Cons:
- No idea if this would work on mobile or console platforms
I’d love to hear what you all think. Thanks!