This is more of a question of design theory…
I’ve been trying to scratch together an rpg and I’ve started questioning my approach to coding itself (happens frequently, still very new). Basically I want to save your progress in the game using simple Shared Objects so I need to know where all the items are. The problem is compounded by this not being a Final Fantasy type game where the items go from a list on the monster/merchant to a simple array list for the player. I want to let you drop and pick up items from the ground or tables as you please, all graphically represented.
This basically means that when you save the game it seems like the game has to remember where every item in the world is all at once.
So my instinct shifts from using arrays to just making a new variable for every single item, still an array, listing [name, current_parent, x, y, and then the regular stats of that item]. But then I realize I’d have literally hundreds of variables declared just to start the game.
Is that really regular practices? How did all those old games do this? From Ultima to Fallout to Morrowind, were all the items given their own chunk of the memory to begin with?
Just thought I’d ask somewhere, because there’s nothing funnier than getting halfway into a project before realizing there’s a much better way of doing things.