I have a game which shall consist of several level packs (and also be extended by additional level packs). Each level pack should contain some levels. Each level will have its own level information. How do I store this information? Do I use one big database, or should I split the information into several databases? (one database for one levelpack, or even one database for one level?)

EDIT: To be more precise, I want to store the following level information:

  • Several simple key-value pairs
  • Some (primitive type) arrays
  • An array-list (with informations like: x-, y-coordinates and an Integer)

This information should be stored for each level. I am planning for creating 10-20 levels. These levels shall be located in level packs. I need to get access to them dynamically (printing a level list with the level information an the display).

  • \$\begingroup\$ What do you mean by "database"? Do you mean a real Relational database, a NoSQL database, or just some file-format that you read (and I wish people would stop trying to call the latter "databases")? \$\endgroup\$ – Nicol Bolas May 1 '12 at 10:07
  • \$\begingroup\$ yes i do mean a real relational (SQL-)database. \$\endgroup\$ – user1349812 May 1 '12 at 10:21
  • \$\begingroup\$ Telling us what you plan to store in these level files would help. \$\endgroup\$ – Nicol Bolas May 1 '12 at 10:23
  • 1
    \$\begingroup\$ You should do more research on what databases are and how to design a relational DB. It makes no sense to have multiple databases for this. \$\endgroup\$ – Toni May 1 '12 at 10:29
  • \$\begingroup\$ i know how to work with databases, but i have no practical experience of how the structure shall look like (especially for this case) - that's why i am asking \$\endgroup\$ – user1349812 May 1 '12 at 10:43

Unless you're making an MMO or something so huge that you need it (and no, 10,000 elements doesn't cut it), you should not be using a relational database of any kind. Especially not for something as trivial as a list of stuff that goes in a level or series of levels. That's tremendous overkill.

Just use a file. An XML file if you must. It contains a list of files that are associated with each level. Or group of levels.

There is no need to go to the level of a relational DB.

  • \$\begingroup\$ Dear God, not XML. XML produces huge files that are not easy to understand. \$\endgroup\$ – ashes999 May 1 '12 at 14:46
  • \$\begingroup\$ @ashes999 I disagree XML is perfectly human readable when done properly, has a huge amount of tools to parse/manipulate it, and the file size difference is rarely going to be noticeable beside your art assets. Nothing so awful as to warrant devine intervention :) \$\endgroup\$ – ClassicThunder May 1 '12 at 18:08
  • \$\begingroup\$ I agree with all your points. But, there are better formats. \$\endgroup\$ – ashes999 May 1 '12 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.