Well, you first have to know how you want to save the map / tiles. For example you can add the tile array to your map file, looks like this:
[Tiles]
2 'TileCount
0="Grass"
1="Water"
2="Lava"
[Map array]
4 3 'Size
0 0 0 1 'Data
2 0 0 1
2 0 0 0
So you have two parts, the first which determines which index stands for which tile and then the map itselves.
That's probably the easiest way to store a map... but it's on you what's the best for your game (maybe you want to use different tile sets for the same map so you only save the filename of your tile-file in the map-file)
However, if you want to make a map editor you should think about such basically things first.
Your question
Well, as you know in your computer everything is stored binary so also your map. What really happens is that VB writes the memory block where you map is stored to the file. Because the whole map are Bytes (or even Integers or whatever you want), you know how many memory you have to copy.
Look at the example:
[Map like you see it (say it's a byte array)]
0 1 2
2 0 7
8 2 1
[Would look like this in binary]
00000000 00000001 00000010
00000010 00000000 00000111
00001000 00000010 00000001
As you can see you won't loose any data
But you're right, you can't edit the map in Notepad (but in HexEdit)
Uh, long post... hope this helps![]()




.
Reply With Quote