Actions

Dat Format: Difference between revisions

From Populous Wiki

No edit summary
 
No edit summary
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Dat files are stored in the levels directory and contain the land structure and all the initial objects. These are kept in two blocks of data.
Dat files are stored in the levels directory and contain the land structure and all the initial objects. These are kept in two blocks of data.


==Land Structure==
==0x0 - 0x7FFF: Land Heights==


The land data starts at 0x0. Each point of land is a word/integer one after the other. 0 is the lowest point which is water. 1028 is consided to be the highest as [[brave]]s lower the land to build anything higher than that. 900 is easier for players to see when their resolution is 640 x 480.
The land data starts at 0x0. Each point of land is a signed word (two bytes) one after the other. 0 is the lowest point which is water. 1024 is considered to be the highest as [[brave]]s lower the land to build anything higher than that. 900 is easier for players to see when their resolution is 640 x 480.


==Objects==
Max (walkable) land height is 1408.


The object data starts at 0x14043 and carries on for the rest of the file. Each object is 55 bytes containing all the object's infomation. Most of the block is not used. The next object starts after the first object and so on. Having more than 2000 objects will slow the game down too much and will be unplayable.
==0x8000 - 0xBFFF: Land Blocks==
Unused, data is ignored


===General Object Data===
==0xC000 - 0xFFFF: Land Orients==
Unused, data is ignored


The first two bytes determain which object it is. The first byte represents which object in the category and the second byte is the object category. Read [[Object Data]] for a list of objects and their information.
==0x10000 - 0x13FFF: Land No-access Squares==
One byte for each land block, non-zero value sets land block to no-access.


The third byte represents which tribe the object belongs too. (FF is wild)
==0x14000 - 0x1403F: Player Save Info==
For saved games, the positions of all four players.  Consists of four blocks of 16 bytes with the first two SWords being the coordinates.


The fith and sixth bytes is an integer representing the x-axis of where the object is located.
==0x14040 - 0x14042: Sunlight Info==
The seventh and eigth bytes is an integer representing the y-axis of where the object is located.
First two bytes are unused/ignored, third is a UByte for sunlight inclination.


The nith byte is the orintation of the object. (0 to 8 directions)
==0x14043 - 0x2EDF2 Objects==


Triggers, Effects etc. have additional data. For more information visit [[Object Data]]
Each object is 55 bytes containing the object's information. Most of the block is not used. The next object starts after the first object and so on. The maximum number of objects is 2000.
 
For more information visit [[Object Data]]
 
==0x2EDF3 - 0x2EE88: End Padding ==
Unused, data is ignored

Latest revision as of 22:19, 26 November 2016

Dat files are stored in the levels directory and contain the land structure and all the initial objects. These are kept in two blocks of data.

0x0 - 0x7FFF: Land Heights

The land data starts at 0x0. Each point of land is a signed word (two bytes) one after the other. 0 is the lowest point which is water. 1024 is considered to be the highest as braves lower the land to build anything higher than that. 900 is easier for players to see when their resolution is 640 x 480.

Max (walkable) land height is 1408.

0x8000 - 0xBFFF: Land Blocks

Unused, data is ignored

0xC000 - 0xFFFF: Land Orients

Unused, data is ignored

0x10000 - 0x13FFF: Land No-access Squares

One byte for each land block, non-zero value sets land block to no-access.

0x14000 - 0x1403F: Player Save Info

For saved games, the positions of all four players. Consists of four blocks of 16 bytes with the first two SWords being the coordinates.

0x14040 - 0x14042: Sunlight Info

First two bytes are unused/ignored, third is a UByte for sunlight inclination.

0x14043 - 0x2EDF2 Objects

Each object is 55 bytes containing the object's information. Most of the block is not used. The next object starts after the first object and so on. The maximum number of objects is 2000.

For more information visit Object Data

0x2EDF3 - 0x2EE88: End Padding

Unused, data is ignored