J
JapanGamer29
Guest
Hi everyone. I have a puzzle game with an Undo feature that works by taking a snapshot of the game after each move and putting it on a stack.
By 'snapshot", I mean a ds_map that holds all the data I need.
DS_STACK
---- DS_MAPS, with each one containing...
---- ---- two integers
---- ---- a DS_GRID with integers in each cell
---- ---- a DS_LIST of...
---- ---- ---- DS_MAPS , where each map contains the x, y coordinates of each puzzle piece
You might think it looks messy, but it all works nicely. I've even managed to save the stack to a text file so a player can save mid-game, then come back later and continue with all undo actions still possible.
What worries me is that to save this to file, I had to convert the data structures to strings using, for example, ds_list_write(). This means I can easily generate text files 2.5 million lines long that weigh 2,500KB.
What do you think? Is a file of that size too much? It loads fast enough (0.07 seconds), but millions of lines seems crazy to me. Is it crazy? Or is it quite common in game dev? I'm still very much a beginner here.
By 'snapshot", I mean a ds_map that holds all the data I need.
DS_STACK
---- DS_MAPS, with each one containing...
---- ---- two integers
---- ---- a DS_GRID with integers in each cell
---- ---- a DS_LIST of...
---- ---- ---- DS_MAPS , where each map contains the x, y coordinates of each puzzle piece
You might think it looks messy, but it all works nicely. I've even managed to save the stack to a text file so a player can save mid-game, then come back later and continue with all undo actions still possible.
What worries me is that to save this to file, I had to convert the data structures to strings using, for example, ds_list_write(). This means I can easily generate text files 2.5 million lines long that weigh 2,500KB.
What do you think? Is a file of that size too much? It loads fast enough (0.07 seconds), but millions of lines seems crazy to me. Is it crazy? Or is it quite common in game dev? I'm still very much a beginner here.
Last edited: