03-01-2013, 05:45 PM
Hi puggsoy since you already spent so much time with this I thought you may want to do the rest now that I kinda figured out the .map files after reading your last post and taking a really quick look (they're actually super-easy, though I can understand why you didn't see what I saw as it was your first time while I already looked through at so many hex codes of graphics and maps).
Here's the file structureas far as I can tell:
Header: 2 Bytes, 0x0E00
Map width: 2 Bytes, Number of tiles per row
Then you have 2 Byte (1 Word) per tile until the end of the file.
So, ((file size - 4) div 2) is the number of tiles, divide by map_width and you get the height in tiles, multiply the width and height with 32 to get the needed image size.
Each tile is an ID starting by 0. so 0x0000 would be the white square, 0x0100 would be the first tile after it, 0x0200 the second etc. etc. (Remember what I said about byte order? Usually data is stored in reverse order, so if you store a Word (2 Byte), the lowest comes first (-> little endian), thus 1 is 0x0100 and not 0x0001).
If you need more information or help on how to assemble them, feel free to ask.
I'd advice to calculate how many tiles you have per row in your source image so you can easily calculate the position of a given tile (x = ID mod tiles_per_row; y = ID div tiles_per_row) (mod is the modulp operation, remainder of the whole-number division, I think AS uses %; div is the whole-number division, should be / as usual if you use a variable of an integer type).
Sorry if I tell you things you already know, I don't know what you know
PS: The .xml files just contain enemy/object position stuff.
Here's the file structureas far as I can tell:
Header: 2 Bytes, 0x0E00
Map width: 2 Bytes, Number of tiles per row
Then you have 2 Byte (1 Word) per tile until the end of the file.
So, ((file size - 4) div 2) is the number of tiles, divide by map_width and you get the height in tiles, multiply the width and height with 32 to get the needed image size.
Each tile is an ID starting by 0. so 0x0000 would be the white square, 0x0100 would be the first tile after it, 0x0200 the second etc. etc. (Remember what I said about byte order? Usually data is stored in reverse order, so if you store a Word (2 Byte), the lowest comes first (-> little endian), thus 1 is 0x0100 and not 0x0001).
If you need more information or help on how to assemble them, feel free to ask.
I'd advice to calculate how many tiles you have per row in your source image so you can easily calculate the position of a given tile (x = ID mod tiles_per_row; y = ID div tiles_per_row) (mod is the modulp operation, remainder of the whole-number division, I think AS uses %; div is the whole-number division, should be / as usual if you use a variable of an integer type).
Sorry if I tell you things you already know, I don't know what you know
PS: The .xml files just contain enemy/object position stuff.