1
\$\begingroup\$

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.

\$\endgroup\$
  • 1
    \$\begingroup\$ The answer is "Whatever suits your needs". Then profile to find bottlenecks, only then optimize. \$\endgroup\$ – 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\$ – 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\$ – 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