What’s the best way to store data for a text adventure game engine?

0
12
Asked By CuriousCoder92 On

I'm diving into a project to create a text adventure game engine using Python and PyGame, something I've been itching to work on for a while now. I envision including user-supplied backgrounds, different text display formats like a scroll or a screen for various genres, and even background music. A key aspect is having a user-editable data file, specifically for the game designer and not the player. I've already got working demos of some components, like reading data from a YAML file. However, I'm starting to doubt if YAML is enough to handle my data storage needs. My aim is to have a structure that can effectively store details about locations, NPCs, and items that players can interact with, so I'm considering if I should lean toward using a relational database. Can anyone suggest a data storage method that offers the relational capabilities I need but still allows for simple editing like a YAML or flat text file? Is it even possible to organize multiple tables within a single YAML file?

4 Answers

Answered By MinimalistDev On

For user data, it might be best stored right in your `game.py` script. You could also explore using the .ini format for a flexible system without unnecessary complexity.

Answered By DesignNinja42 On

You could set it up so that each location is an index in your database. Use columns for details like descriptions, items, actions, and links to other locations. Each room would be a row in those tables. It’s a straightforward approach and it allows for a lot of flexibility with your design.

CuriousCoder92 -

I was hoping to avoid SQLite for simplicity's sake. My earlier attempts with databases have been pretty overwhelming, so I switched to XML and then YAML to keep things easy.

Answered By SimpleStorage89 On

If you don’t have too many tables and need them user-editable, consider using CSV files. They can be edited in spreadsheet programs without a hassle, and you could designate a folder for images to keep all your assets organized.

Answered By GameDevGuru77 On

You might want to check out SQLite! It's lightweight and can handle your needs well without being overly complex. Plus, it gives you the structure of a relational database.

CuriousCoder92 -

I thought about SQLite. However, it feels like it could complicate things further. Now I would need to develop a user-friendly interface for game creators to manage the data, rather than just letting them edit a simple text file.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.