alpaca
10-04-2005, 15:21
Ok, first off a screenshot:
https://img281.imageshack.us/img281/786/mapheights3ty.th.jpg (https://img281.imageshack.us/my.php?image=mapheights3ty.jpg)
As you can see this is taken from the BI-exe so I'm talking no shit ;)
Ok, I mostly discovered how the height-information is saved in map_heights.hgt, then I created a small tool that let me table-edit the numbers and so I was able to create the plateau you see on the screen.
I think from this discovery it isn't too far to creating a converter that takes the tga file and creates a hgt out of it.
If anybody feels like he can do it (I don't have any experience in reading image files and stuff), this is how the numbers are saved (programmer talk):
You have to read in the first 8 bytes of the file and store them somewhere, they seem to be some kind of header.
The rest of the file consists of single-precision IEEE Floats (32-bit); each float represents a certain height.
If you want you can divide the file in 511*313 fields, which is exactly the size of the tga file it's based upon.
What you have to find out to create a converter is how colors are mapped to heights, but I think you should be able to do this yourself ;)
Oh, and I don't know exactly why there's a peak on my plateau, because all the height informations have the same value.
I'll also try to create a converter, but it might take me a few days, so if anybody can do it faster, you're highly welcome :)
https://img281.imageshack.us/img281/786/mapheights3ty.th.jpg (https://img281.imageshack.us/my.php?image=mapheights3ty.jpg)
As you can see this is taken from the BI-exe so I'm talking no shit ;)
Ok, I mostly discovered how the height-information is saved in map_heights.hgt, then I created a small tool that let me table-edit the numbers and so I was able to create the plateau you see on the screen.
I think from this discovery it isn't too far to creating a converter that takes the tga file and creates a hgt out of it.
If anybody feels like he can do it (I don't have any experience in reading image files and stuff), this is how the numbers are saved (programmer talk):
You have to read in the first 8 bytes of the file and store them somewhere, they seem to be some kind of header.
The rest of the file consists of single-precision IEEE Floats (32-bit); each float represents a certain height.
If you want you can divide the file in 511*313 fields, which is exactly the size of the tga file it's based upon.
What you have to find out to create a converter is how colors are mapped to heights, but I think you should be able to do this yourself ;)
Oh, and I don't know exactly why there's a peak on my plateau, because all the height informations have the same value.
I'll also try to create a converter, but it might take me a few days, so if anybody can do it faster, you're highly welcome :)