Well, I suggest using a memblock to organize the data you put into the file. I think memblocks just add a nice structure to things and make it easy to read or write from random parts of the data. Further, you can write the entire memblock to a file and then read it back out with the
write memblock and
read memblock commands.
In a previous post, I explained all about writing to and reading from memblocks
here.
When using memblocks, or any other method to store data, you need to decide on a structure that you want to use. For this case, I might use something like this:
Each tile in the map will use one byte:
1: The number of the tile in this space. 1 for grass, 2 for tree, 3 for whatever, etc.
Each map will have two header words (two bytes) followed by a bunch of tile bytes:
1-2: Map Width (X Size)
3-4: Map Height (Y Size)
5...(5+X*Y): Tile bytes as described above.
And before all of the maps, you could stick another byte to store the number of maps in the word and then that many words or dwords (4 bytes) to store the byte offsets from the beginning of the file of each individual map.
These are just suggestions that might help decide what kind of file structure you want to use.
Ask if you have any questions.