Results 1 to 9 of 9

Thread: Minor breakthrough - map_heights.hgt partly deciphered

  1. #1
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Minor breakthrough - map_heights.hgt partly deciphered

    Ok, first off a screenshot:



    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 :)
    Last edited by alpaca; 10-04-2005 at 15:27.

  2. #2
    Shaidar Haran Senior Member SAM Site Champion Myrddraal's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    5,752

    Default Re: Minor breakthrough - map_heights.hgt partly deciphered

    hope this works out
    Last edited by Myrddraal; 10-04-2005 at 18:57.

  3. #3

    Default Re: Minor breakthrough - map_heights.hgt partly deciphered

    Me too!

  4. #4
    Member Member Stuie's Avatar
    Join Date
    Aug 2001
    Location
    Upper Gwynedd, PA
    Posts
    406

    Default Re: Minor breakthrough - map_heights.hgt partly deciphered

    Me three!

    I find it rather discouraging that CA would make a change that so drastically hinders our ability to mod the game. Guess modding isn't their goal anymore. Once again I look at something like Civ4 with xml and Python and wonder why CA is so reluctant to adopt a more mod-friendly attitude. I'm just glad we've had Jerome to help us out so much...

  5. #5
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: Minor breakthrough - map_heights.hgt partly deciphered

    Prob is: RTW is much funnier than Civ4 ;)
    You're right though.

  6. #6
    Member Member Stuie's Avatar
    Join Date
    Aug 2001
    Location
    Upper Gwynedd, PA
    Posts
    406

    Default Re: Minor breakthrough - map_heights.hgt partly deciphered

    Quote Originally Posted by alpaca
    Prob is: RTW is much funnier than Civ4 ;)
    You're right though.
    Yeah, well... Civ4 isn't out yet! When it's out, then we'll see which is "funnier".

  7. #7

    Default Re: Minor breakthrough - map_heights.hgt partly deciphered

    I'd suggest that i may be easier to use a different file format in the converter. i don't know the details on hand , but converting from a bitmap or tiff or anything like that may be easier on you to create and everyone who uses photoshop could just convert their tgas or just create them using the new format.

  8. #8
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: Minor breakthrough - map_heights.hgt partly deciphered

    Ok, guys. I'll release a converter later today.
    I have made a working version last evening, I now have the height-calculation function ready insofar that it produces satisfying results.
    It doesn't produce the same results as CAs does, they are using some kind of nivellating algorithm in making the height-map, but my tests don't suggest that this is necessary.
    I'm currently working on it a little more, i.e. adding export capabilities, making it more safe and user-friendly and I also think about making a converter for real satellite data. But no matter what I'll release a version later.
    It's written in Java, though. So you'll need JRE 1.50 or higher to use it.

  9. #9
    Member Member Stuie's Avatar
    Join Date
    Aug 2001
    Location
    Upper Gwynedd, PA
    Posts
    406

    Default Re: Minor breakthrough - map_heights.hgt partly deciphered



    Looking forward to it!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO