Ok i understand.
structure the save file with keywords and data so that when i read from it the keyword signifies where to place the data. this way the order of the save file dose not matter and if i want to add more data to the save file then old save files can still be read.
(right?)


if you create a level in my game and export it then open it up with a text editor you will see that its structure is simple. its structured like this.

TITLE*SIZE*TILEDATA*

to decode it i read one letter at a time until i reach a "*" then i save the first segment as title. i continue until i reach another "*" then save the contents as size. then i continue until i reach the last "*" and save the contents as tile-data. its simple but it works.
however using this method for a large save file with many variables would be difficult, confusing, and time consuming. not to mention trying to add new stuff to save.


Your way is much cleaner
im trying to figure out the best way to do it...

idea - 1
open file and read it to a really really long string
compare the beginning of the string with a bunch of (ID's) when an ID is located remove it from the string then read the contents from the beginning of the string to a end marker perhaps a "*". to the specified variable for that ID. remove that data from the string.
Continue decoding the string until it is empty. (i could save time loading the tile-data by calculating the length based on the dimensions of the level then copying it all at once instead of one letter at a time)


idea - 2
use a "," to separate all the data in the file (ID,DATA,ID,DATA) then learn more about delimiters and find a way to separate the contents by the "," .
then compare the first ID contents with keys. when found copy data contents into correct variable.
repeat this until all contents is sorted.


I might run into problems with the first idea. i am sure i would exceed some string size limit.


Mikes Wicked Games

www.mikeswickedgames.com