I'm working on a 2D tile based survival game for my programming class and as I was working on GUIs I realized that I would need an efficient way of storing and recalling not only the tile data and location as the world expands, but the active entities, their inventories, and the item data in said inventories.

What would be the best way to do this? Is there a specific file format or data structure that would be best? I get that my question is kind of vague but I'm stuck.


closed as too broad by Alexandre Vaillancourt, Almo, jgallant, MichaelHouse May 13 '16 at 15:46

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    \$\begingroup\$ The answer is "Whatever suits your needs". Then profile to find bottlenecks, only then optimize. \$\endgroup\$ – Alexandre Vaillancourt May 13 '16 at 14:43
  • \$\begingroup\$ Oh, and you did not specify what was your goal in making it "the most efficient". Space occupied, time taken, ease of use? \$\endgroup\$ – Alexandre Vaillancourt May 13 '16 at 14:47
  • \$\begingroup\$ My bad. when it comes to efficiency, I'm looking for something that does what I need with the least amount of overhead. \$\endgroup\$ – Cody Hausser May 13 '16 at 14:50
  • \$\begingroup\$ Overhead... computationally when using it or to make it work? \$\endgroup\$ – Alexandre Vaillancourt May 13 '16 at 14:53
  • 1
    \$\begingroup\$ How are you stuck exactly? What are you currently doing? Why is it not working for you? \$\endgroup\$ – jgallant May 13 '16 at 15:43