THR File format and Calculation
Moderators: Lone Wolf, Snake Man
- Phoenix711
- Captain
- Posts: 186
- Joined: 2007-10-03 07:52:29
- Location: Istanbul Turkey
- Contact:
THR File format and Calculation
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.
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.
-
- 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
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."
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."
- Phoenix711
- Captain
- Posts: 186
- Joined: 2007-10-03 07:52:29
- Location: Istanbul Turkey
- Contact:
Re: THR File format and Calculation
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.
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.
-
- 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
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.
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."
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."
Re: THR File format and Calculation
i am highly interested in this "no river" function. looking forward to more info!!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.
- 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
I am also very interested. Keep up the great work and let us know if there is anything you need that we can provide!ccc wrote:i am highly interested in this "no river" function. looking forward to more info!!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.
Sherlock
Victurous te Saluto
Victurous te Saluto
- Phoenix711
- Captain
- Posts: 186
- Joined: 2007-10-03 07:52:29
- Location: Istanbul Turkey
- Contact:
Re: THR File format and Calculation
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
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
- Phoenix711
- Captain
- Posts: 186
- Joined: 2007-10-03 07:52:29
- Location: Istanbul Turkey
- Contact:
Re: THR File format and Calculation
First post updated with info about 128 theaters.
THRCreator now works for 128 theaters too. Download links and updated source files inbound.
THRCreator now works for 128 theaters too. Download links and updated source files inbound.
- 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
Sweet! You rock!Phoenix711 wrote:First post updated with info about 128 theaters.
THRCreator now works for 128 theaters too. Download links and updated source files inbound.
Sherlock
Victurous te Saluto
Victurous te Saluto
Who is online
Users browsing this forum: No registered users and 14 guests