THR File format and Calculation

F4Browse, CATE, Tacedit, Terrainview & TheaterMaker etc utility related

Moderators: Lone Wolf, Snake Man

Post Reply
User avatar
Phoenix711
Captain
Posts: 186
Joined: 2007-10-03 07:52:29
Location: Istanbul Turkey
Contact:

THR File format and Calculation

Post by Phoenix711 » 2008-12-13 03:46:57

Working on THR, almost finished.

The most important thing about THR calculation is that it is not calculated as rows, but columns.

First of all, THR file format is
4 bytes header,
then,
1 byte for every tile in the L2 file.

For 64 size theaters, the first 4 records are always, 0,4,0,4. As bits:

00000000
00000100
00000000
00000100

If the theater size is 128 (Large like ODS), the first 4 records are always, 0,8,0,8. As bits:

00000000
00001000
00000000
00001000

Then comes the tiles THR info.

For 64 theaters, it is 1024*1024=1048576 bytes. File total is 1048580 bytes with header (1025 K)
For 128 theaters, it is 2048*2048=4194304 bytes. File total is 4194308 bytes with header (4097 K)

THR info is calculated upwards. What I mean is, the first 1024 (or 2048 for 128 theaters) bytes of the THR file is the info for the first 1024 (or 2048 for 128)tiles at the very first (leftmost) column of the terrain, starting from bottom, to top.

If I try to explain:

First 4 bytes header then
next 16 bytes for the 0x0 segments leftmost column, from bottom to top
then
next 16 bytes for the 0x1 segments leftmost column, bottom to top.
then
next 16 bytes for the 0x2 segments leftmost column, bottom to top.
etc...

When we finish the first column (1024 bytes for 64, 2048 bytes for 128 theater), we go to the 2nd column, starting from the bottom of the 0x0 segment, 2nd column, and go upwards.

That means, the last byte of the THR file is the info for the upper right corner tile of the terrain.
Last edited by Phoenix711 on 2009-06-06 10:23:51, edited 1 time in total.

Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Re: THR File format and Calculation

Post by Snake Man » 2008-12-13 09:46:07

Good stuff. Don't forget the larger theater support also from the file format calculations :)
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

User avatar
Phoenix711
Captain
Posts: 186
Joined: 2007-10-03 07:52:29
Location: Istanbul Turkey
Contact:

Re: THR File format and Calculation

Post by Phoenix711 » 2008-12-13 11:41:36

Here we go.

First, info...

64 segment Aegean theater, too many new tiles, a total of 157 sets, 1667 tiles, in compariosn to 110 set - 1120 tiles of the original.

Using the default way of creating the THR files from pathmaker, screws up completely, while terrainview just cannot calculate only the NEW tiles, and shows the relief map for them as SEA. So I think if you use the standart texture.bin, you are not in trouble.

Path maker creates this:

http://92.45.21.211/Web_Yayin/Yarasa/PM ... hMaker.jpg < 290kb

Terrainview creates this

http://92.45.21.211/Web_Yayin/Yarasa/PM ... erView.jpg < 260kb

My Tool (Correct showing of the relief map)

http://92.45.21.211/Web_Yayin/Yarasa/PM ... orrect.jpg < 293kb

It is completely customizable. If you check carefully, in the last map theres no rivers, I closed it. And the ground units are moving very good, except for sometimes, I'll share that later. And, it will also support large (128) terrains. I just need a l2 file to work on, and thats in ODS I guess.

I'll send you the file format info after I completely get my hands on the format.
Last edited by Phoenix711 on 2009-01-14 22:52:16, edited 2 times in total.

Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Re: THR File format and Calculation

Post by Snake Man » 2008-12-13 12:04:08

Very good work, I'm impressed. Keep it up.

BTW but please compress the images file sizes as they are just way too large for hot linking (or don't hotlink them). Thank you.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

ccc
Chief of Staff
Posts: 4857
Joined: 2000-08-06 22:01:01

Re: THR File format and Calculation

Post by ccc » 2008-12-13 12:44:34

If you check carefully, in the last map theres no rivers, I closed it. And the ground units are moving very good, except for sometimes, I'll share that later. And, it will also support large (128) terrains. I just need a l2 file to work on, and thats in ODS I guess.
i am highly interested in this "no river" function. :D looking forward to more info!!

User avatar
Sherlock
Lt. General
Posts: 1167
Joined: 2006-05-24 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Arizona, USA

Re: THR File format and Calculation

Post by Sherlock » 2008-12-13 19:48:40

ccc wrote:
If you check carefully, in the last map theres no rivers, I closed it. And the ground units are moving very good, except for sometimes, I'll share that later. And, it will also support large (128) terrains. I just need a l2 file to work on, and thats in ODS I guess.
i am highly interested in this "no river" function. :D looking forward to more info!!
I am also very interested. Keep up the great work and let us know if there is anything you need that we can provide! :)
Sherlock
Victurous te Saluto

User avatar
Phoenix711
Captain
Posts: 186
Joined: 2007-10-03 07:52:29
Location: Istanbul Turkey
Contact:

Re: THR File format and Calculation

Post by Phoenix711 » 2009-06-06 10:15:41

Very Important Edit:

For 128 theater, the header information, means the first 4 bits of the file, are

0
8
0
8

For 64 it is

0
4
0
4

User avatar
Phoenix711
Captain
Posts: 186
Joined: 2007-10-03 07:52:29
Location: Istanbul Turkey
Contact:

Re: THR File format and Calculation

Post by Phoenix711 » 2009-06-06 10:24:41

First post updated with info about 128 theaters.

THRCreator now works for 128 theaters too. Download links and updated source files inbound.

User avatar
Sherlock
Lt. General
Posts: 1167
Joined: 2006-05-24 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Arizona, USA

Re: THR File format and Calculation

Post by Sherlock » 2009-06-06 15:36:37

Phoenix711 wrote:First post updated with info about 128 theaters.

THRCreator now works for 128 theaters too. Download links and updated source files inbound.
Sweet! You rock! :)
Sherlock
Victurous te Saluto

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests