I'm thinking about making a 2D side scroll platformer (handmade). I've tried looking around but I haven't a good explanation about how one might go about storing the world in memory (also saves on disk)
A rough idea I have at the moment is have the world mapped into some square chunks (which may be tiles). Choose a minimum "unit" say however many pixels in a 4k monitor and divide the chunk into those. Store game object position as a struct consisting the X/Y of the chunk ad then the X/Y inside the chunk. Would it be better to store it as floats, and what is which datastructure/algorithm should be used with floats as they can't be array indexes.
For storing on disk, is it just a question of writing all of the above (along with the current state) in a file? (now that I wrote it down, I assume the answer is yes)
I would appreciate any idea/link/info