Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 5 - Modders Workshop > Thread: GroundTerrain.bin Format Analysis and Tool
Thread: GroundTerrain.bin Format Analysis and Tool
WindBell
WindBell


Hired Hero
posted December 23, 2009 03:22 AM

GroundTerrain.bin Format Analysis and Tool

Hello everyone.
I spend some days on analysis groundterrain.bin format and have some interesting result.

This is a Terrain Viewer
http://www.boxcn.net/shared/oi2pi1hak5
(with source code ,  written in C# , .net framework 2.0 needed. Localized in English and Chinese. The executable file is put in bin/debug folder)

Each block contains a block size information.
All size with a 1-Byte prefix , All base length with a 2-Byte prefix.
All data represent a VERTEX but not a GRID

Assume it is a 72*72 map:
1 Head. With File size, Base length
2 Texture.  Consist of some textures .  Each has a  block size, and base length (73 = 72+1 , 73 vertex for 72 grid) ,  an array of 73*73 8-bit unsigned byte (represent opaque) , a string represent the path of the texture dds.
3 Height.  32-bit unsigned float.  Only visualible effect in the map. represent height in visual . 0.0 is water , 2.0 in default.
4 Plateau. 8-bit unsigned byte. Only move-block effect in the map. 0x10 is normal , 0x00 is water ( it is automatically , you needn't have water texture for 0x00 Plateau and 0.0 Height terrain grid to show water ).
5 Ramp. 73*73 8-bit unsigned .   0x0 as default. Connect diffrent level in Plateau. If 1 grid with 4 ramp of vertex is 0x1 and connect 2 grid with different Plateau ( cannot pass normally ), then this grid is passible with both side.
A typical ramp on the map:
Height 4 3 2  Plateau 20 18 10    Ramp 01 01 01
          4 3 2               20 18 10              01 01 01
6 Water Depth. 8-bit unsigned. 0x0 default, 0xFF for deepest. represent the depth of water texture. It can also create water on the map - no need for plateau and height adjustment.
7 Passible . 8-bit unsigned. 0x0 for block. "Mask" in Map Editor manipulate this block.
8 End block. just a series of data (it is an arithmetic sequence in 8-bit unsigned), it keeps same in all different map(in 30 maps  I only found ONE exception in a undergroundterrain , BUT replace it with normal one didn't affect anything as what I see)

In the source code I have implement a class represent the terrain file, with create new one with any size (must be square), can be load from file ,  and after any edit it can be  correctly saved to a terrain.bin file which can be put into a h5m file and works .  I'd like  to add function like import bitmap to terrain next.

But I cannot continue my work because I will be busy in next month.  So I public this only partially finished work and hope that some one can use this to do something better than me.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread »
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0195 seconds