[dink-develop] New map format
Status: Pre-Alpha
Brought to you by:
aerea
From: Andrew <ae...@co...> - 2004-06-03 01:06:18
|
It turned out that the converter I wrote actually made Desplesda's map format LARGER than the original. That's a no-no. I made a new map file format (this is probably going to turn out all garbled). It replaces the old Map.dat, Dink.dat, DMOD.diz, and could very easily be accomodated for Hard.dat. Someone let me know what I missed: The Map HEADER: First 18 bytes (extra byte for expansion): "WindemereMap v1.0 " -- Used for comparison in any future map versions. -------------- The following replaces the old DMOD.DIZ file -------------- Next 4 bytes: The size of the following map string. Next x bytes: The name of the map. Next 4 bytes: The size of the following author string. Next x bytes: The name of the author. Next 4 bytes: The size of the following string. Next x bytes: A description of the map. ----- Next 4 bytes: Total number of X map segments. -- Used to count the number of X map segments, heh. Next 4 bytes: Total number of Y map segments. -- Ditto above, but for Y. The Map DATA (For each segment): The following repeats throughout the map file for each screen - the total number of which can be found by multiplying the total number of X map segments followed by the total number of Y map segments (above): First 1 byte: 0 if the screen doesn't "exist", 1 if it does. -- If this is 0, the entire rest of this section is skipped and the next tile is parsed. Next 4 bytes: The number assigned to the audio track to play when the screen is entered. This can be left 0. Next 1 byte: Whether to loop the audio track defined in the previous 4 bytes. -- Sometimes, if you stay on a screen, the audio track finishes and there is no audio. Next 4 bytes: The segment offset from the defined center (X coordinate). } This is equal to "posX" and } "posY" Des's old map format. Next 4 bytes: The segment offset from the defined center (Y coordinate). } Next 4 bytes: The number of sprites on the screen. -- Whatever the value of this number, the indented below will be checked that many times. For example, if this is 152, there are 152 sprites on the screen and the following data sizes will occur 152 times before the next tile. ---- BEGIN SPRITE DATA ---- First 4 bytes of the sprite data: The X coordinate of the sprite. Next 4 bytes of the sprite data: The Y coordinate of the sprite. Next 4 bytes: The sprite's sequence. Next 4 bytes: The sprite's frame. Next 4 bytes: The size of the sprite (In percent - the size of the original graphic). Next 4 bytes: Degree of rotation - (0 to 360) Next 4 bytes: The size of the following string. This is 0 if the sprite does not have a script (The following value is then skipped). Next x bytes: The path to the sprite's script. Next 4 bytes: The sequence of the walking sprite (Base walk). Next 4 bytes: The sequence of the idling sprite (Base idle). Next 4 bytes: The sequence of the attacking sprite (Base attack). Next 4 bytes: The sequence of the dying sprite (Base die). Next 4 bytes: The sequence of the touched sprite (Touch sequence). Next 4 bytes: The sprite's depth cue. Next 4 bytes: The sprite's vision (0 for all). Next 1 byte: Sprite Hardness - True or false. Next 1 byte: The possibility of the sprite to be hit - True or false. If false, the next 6 values are missing. Next 4 bytes: The sprite's HP. Next 4 bytes: The sprite's defense. Next 4 bytes: The sprite's experience. Next 4 bytes: The sprite's touch damage. Next 4 bytes: The sprite's speed. Next 4 bytes: The sprite's brain. Next 1 byte: Warp - True or False. If false, this is the end of the sprite data for the current iteration. Next 4 bytes: The screen to warp to - defined in segment offsets from the defined center (X coordinate). Next 4 bytes: The screen to warp to - defined in segment offsets from the defined center (Y coordinate). Next 4 bytes: The X coordinate to be placed on the defined screen. Next 4 bytes: The Y coordinate to be placed on the defined screen. ---- END SPRITE DATA ---- So, that's it. Send all flames to /dev/null. -- Andrew. |