GND - Ground Field File
October 27th, 2005
Ground File, this file contains every polygon, textures and lightmaps of the ground.
| * | Field | Size | Type | Description | |
|---|---|---|---|---|---|
| 0 | Header | 6 | bytes | Integer | GRGN.. |
| 6 | Size X | 4 | bytes | Integer | Size of field |
| 10 | Size Y | 4 | bytes | Integer | Size of field |
| 14 | Ratio | 4 | bytes | Float | Proportion Ratio usually 10.0 |
| 18 | Texture Count | 4 | bytes | Integer | Number of textures used |
| 22 | Size of Texture | 4 | bytes | Integer | Size of Texture Path |
| { | Textures (Texture Path Size/2) | ||||
| 0 | Path | 40 | bytes | Char | Path to file |
| 40 | ?? | 40 | bytes | Char | - |
| } | |||||
| 0 | Nº of Lightmaps | 4 | bytes | Integer | - |
| 4 | Grid Size X | 4 | bytes | Integer | Size of lightmap grid X |
| 8 | Grid Size Y | 4 | bytes | Integer | Size of lightmap grid Y |
| 12 | Grid Size Cell | 4 | bytes | Integer | Number of cells by grid |
| { | Lightmaps (Header + Texture + Unknown + Tiles Offset ) | ||||
| 0 | Brightness | 64 | bytes | char | 8*8 Grid Bright Values |
| 64 | Color RGB | 192 | bytes | char | 8*8 Grid Color Values (RGB Triplets) |
| } | |||||
| 0 | Nº of Tiles | 4 | bytes | Integer | - |
| { | Tiles (Header + Texture + Unknown Offset ) | ||||
| 0 | Texture Start | 4 | bytes | Float | Left Bottom |
| 4 | Texture Start | 4 | bytes | Float | Right Bottom |
| 8 | Texture Start | 4 | bytes | Float | Left Top |
| 12 | Texture Start | 4 | bytes | Float | Right Top |
| 16 | Texture End | 4 | bytes | Float | Left Bottom |
| 20 | Texture End | 4 | bytes | Float | Right Bottom |
| 24 | Texture End | 4 | bytes | Float | Left Top |
| 28 | Texture End | 4 | bytes | Float | Right Top |
| 32 | Texture | 2 | bytes | Integer | Nº of texture used |
| 34 | Lightmap | 2 | bytes | Integer | Nº of lightmap used |
| 36 | Tile Color | 4 | bytes | char | Tile Tint Color (RGBA) |
| } | |||||
| { | Cubes (Header + Texture + Unknown + Tiles + Lightmaps Offset ) | ||||
| 0 | Cell | 4 | bytes | Float | Left Bottom |
| 4 | Cell | 4 | bytes | Float | Right Bottom |
| 8 | Cell | 4 | bytes | Float | Left Top |
| 12 | Cell | 4 | bytes | Float | Right Top |
| 16 | Tile Up | 4 | bytes | Integer | Number of Tile |
| 20 | Tile Side | 4 | bytes | Integer | Number of Tile |
| 20 | Tile Aside | 4 | bytes | Integer | Number of Tile |
| } | |||||
Info :
- - Designs a block type
{ } Designs a loop block
You can adjust scale of texture with Texture Start and Texture End
Nº of cubes are designed by Size X * Size Y
Credits
deufeufeu / ender (previous research)
Victor-san (Update)
5 Responses to “GND - Ground Field File”
Leave a Reply
Hi,
I think Texture Start and End in a Tile section corresponds to the 2D coordinates of the texture to be applied.
for example, if the texture is 256×256,
0.5 0.75 0.5 0.75 1.0 1.0 0.75 0.75 would be a square in the texture defined by :
(128,255)-> (192,255)->(192,192)->(128,192)
Am I right ?
Yes, texture coordinates are following standard texturing techniques, so 1.0 it’s end (max size) and 0 the start, you can also make mirroring by flipping this values.
Hello,
36 ?? 4 bytes Integer ??
-> I think that this field is really a 4 unsigned char field.
If it´s taken as an integer, it´s usually a big number… i splited it into 4 unsigned chars. The result is 255 255 255 255, it repeats in every tile. I think it´s a RGBA value for that tile.
The same strange value appears in the cubes, in the “tile” fields… i don´t know it it´s the same.
Ximosoft give me credit or i kill you
:D .
Akuchimoya
VictorSan, Ximosoft:
The value is most likely ARGB. Alpha comes first in almost every programming language.
it’s actually a 32 bit integer, if you read it as char then the color order are reversed (because of little endian) and RGBA is an invalid format in most graphics libraries but ARGB is supporteprobably the most supported at the moment. So 0×8000FF00 would be a 50% transparent green but you would find as x00 xFF x00 x80 in the file, if I’m not wrong
I want to thank you for all this information you provided here, it’s helping me a lot on my project and probably will help me more later. Maybe I can help you later to upgrade your editor, as I have some experience on graphics programming (and since two days ago, experience on RO files too).
Regards.
GS