Results 1 to 19 of 19

Thread: HGT-Converter release

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

    Default HGT-Converter release

    Ok, this is the first version of my HGT-Converter.
    It takes .tga image files and converts them to .hgt files and vice-versa.

    You will need a JRE 1.50 or higher to use it, which can be found here:
    http://www.java.com/en/download/manual.jsp

    This is the release file, you'll find more detailed info inside:
    http://www.totalwar.org/Downloads/Rt..._Converter.zip

    Oh, and please post what you think about the height-calculation. I'd like to know if my formula is ok.

    A screen:

  2. #2
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: HGT-Converter release

    Is there any method to test the map other than including it in BI? Can it be tested in RTW 1.2?

    I've just downloaded the tool and generated a map_heights.hgt. From a tga of 453 KB I've obtained a hgt of 392 KB. Does it seem correct?

    Anyway, if this tool works properly, I will propose to the TotalWar modders community to build a shrine in your honour.

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

    Default Re: HGT-Converter release

    Hmm this seems to be too small.
    The hgt uses 32 bpp so it should be a third larger than the tga.
    Can you upload the image and send me a link so I can do some tests with it?

    And I don't know if it can be used in 1.2 because I don't have that version anymore ;)

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

    Default Re: HGT-Converter release

    This is good news, very good

    For the time being this should be in Mod Discussion

    When you've smoothed out the problems I'll shift it to the Scriptorium so that it doesn't get lost in the abyss of page 2

  5. #5

    Default Re: HGT-Converter release

    Ok here are my results using this tool.



    My .hgt file is twice as big as the tga file, is that right?

    Anyway i'll continue with my map, thanks! :)

    TFT 's Fall of the Republic - Rise of the Empire (FRRE) Mod Project
    A collection of Post-Marian Reform mods for B.I
    Download The First Triumvirate v 1.75 for RTW

  6. #6
    Member Member blindfaithnogod's Avatar
    Join Date
    Jan 2005
    Location
    Lawrence, KS USA
    Posts
    175

    Default Re: HGT-Converter release

    great job! i tried it, the heights seem good to me. thanks!

    edit: heres a look to prove it works

    Blue Lotus Total War
    --------------------------------------------------------------------------------------
    Byzantium Total War

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

    Default Re: HGT-Converter release

    Quote Originally Posted by Centurion Cato
    Ok here are my results using this tool.


    My .hgt file is twice as big as the tga file, is that right?

    Anyway i'll continue with my map, thanks! :)
    Hum it's a little strange, but if you fully checked the map and it's all right...

    In fact, the R:TW tga uses 24 bpp while the height-information is stored in 32-bit numerical values, so theoretically speaking the hgt file should be 4/3 the size of the tga file.
    And my program reads every pixel for itself and then instantly writes the height info into the file (I'm not running another algorithm on the data later) so it shouldn't be able to produce any other information.
    Unfortunately I forgot to include a check that the image has to be 24 bpp, so the program accepts pretty much anything, but it will most probably convert most of the map to water if the image file isn't supplied as 24-bit.
    If you don't mind, I'd like to be sent your image file, by PM or maybe by email. Or you can upload it somewhere and just post a link.
    If you want to send it by email, just drop me a PM and I'll send you my adress.

    Oh, and as a little note about the heights:
    I think I already stated in the that I am using a mathematical formula to calculate the height-information, and this is it. CA seems to have used some algorithm after calculating heights from the image file that evened out the whole thing somewhat.
    I made the formula with some testing, until it delivered satisfying results. If anyone's interested in it, here goes:
    21.17x - 0.05 * (x - 120)^2 + 1.0313^x + 720 = y (x is the blue-value, y is the height; this formula is only applied to tiles where all three color-values are the same, everything else is water)
    This is a little complex for non-mathematicians but basically it boosts the medium ranges a little and then steepens mountains, which is why the greek mountains you see below (taken from Imperium: TW which Atheist Peace got to work in BI now) look really spiffy, and also ensures that total black (0 0 0) is represented as a height of 1.

  8. #8
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: HGT-Converter release

    @alpaca
    You were right about the size (my mistake).
    From a tga of 453 KB the hgt was 603 KB (exactly 4/3).
    I will check it in BI when I "translate" all the other text files to the "new language".

    Thanks a lot.

  9. #9
    Senior Member Senior Member Oaty's Avatar
    Join Date
    May 2003
    Location
    Indianapolis
    Posts
    2,863

    Default Re: HGT-Converter release

    I get a lot of CTD's when using this tool. I'm thinking it's my TGA editor not saving in the proper format but want to make sure.

    To use this tool properly all I need to do is put the script in the same folder with map_heights.tga, double click on the script and I should have a workable map_heights.hgt right. If not what are the exact steps I need to take?

    I've used both the gimp and avg graphic studio 6.5 I made sure it was in 24 bit.

    What graphics editors have others used successfully to make this script work properly.
    When a fox kills your chickens, do you kill the pigs for seeing what happened? No you go out and hunt the fox.
    Cry havoc and let slip the HOGS of war

  10. #10

    Default Re: HGT-Converter release

    I'm using PS CS2 and it works like a dream


    The Fourth Age: Total War - Map Manager, Editor and Coder

  11. #11

    Default Re: HGT-Converter release

    Quote Originally Posted by oaty
    I get a lot of CTD's when using this tool. I'm thinking it's my TGA editor not saving in the proper format but want to make sure.

    To use this tool properly all I need to do is put the script in the same folder with map_heights.tga, double click on the script and I should have a workable map_heights.hgt right. If not what are the exact steps I need to take?

    I've used both the gimp and avg graphic studio 6.5 I made sure it was in 24 bit.

    What graphics editors have others used successfully to make this script work properly.
    I use MS paint to edit my files and save as bitmap, then I use irfanview to save as TGA true vision.
    I made my map with 1.2 and when i converted to 1.3 the hgt converter worked perfectly using the same steps you describe.

    I hope this helps.

  12. #12
    Senior Member Senior Member Oaty's Avatar
    Join Date
    May 2003
    Location
    Indianapolis
    Posts
    2,863

    Default Re: HGT-Converter release

    This is killing me I tried your method Icetourque. For practice I used the imperial campaign and made a copy as mod_campaign. I took height_maps.tga using irfanview converted it to a .bmp did a small edit in Libya saved it converted it back to a TGA, then converted into a .hgt file with the script, put it into the folder, loaded the game. It makes a RVM file but is incompatable with the descr_strat.

    The file size has always been within 1 kilobyte of the original .hgt file that came with the game. What am I doing wrong here. It's got to be a setting I'm messing up when converting the files.
    When a fox kills your chickens, do you kill the pigs for seeing what happened? No you go out and hunt the fox.
    Cry havoc and let slip the HOGS of war

  13. #13
    Senior Member Senior Member Oaty's Avatar
    Join Date
    May 2003
    Location
    Indianapolis
    Posts
    2,863

    Default Re: HGT-Converter release

    Ok got it working now with Icetorques method. Not exactly sure what was causing the problem but I think it was because I had the file open while I was tring to convert it. Anyways works now thanks for the help.
    When a fox kills your chickens, do you kill the pigs for seeing what happened? No you go out and hunt the fox.
    Cry havoc and let slip the HOGS of war

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

    Default Re: HGT-Converter release

    Hmm, strange. Having the file open shouldn't cause any problems unless your editor establishes a lock on the image but then again HGT-Converter shouldn't be able to read anything and crash without doing anything much (if it generates a rwm it would be empty).

  15. #15

    Default Re: HGT-Converter release

    I;m trying to make a map but the hgt converter doesnt seem to be working. So all I have to do is go to command prompt and type in that stuff you said. The instructions says to open up my map folder. What do you mean by this do I type in the path name in command promt or do I just open it like a normal folder. When I didn't type in the path name it just didn't work nothing happened the hgt file didn't get created...

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

    Default Re: HGT-Converter release

    First of all: Which version of R:TW are you modding for? If you use 1.5 or BI 1.6 there's no need for the HGT converter at all. Just delete map_heights.hgt - the game doesn't require it anymore.

  17. #17

    Default Re: HGT-Converter release

    oh... ok thx hmm not sure if I dld path Ill see if I didnt ill just dl thanks.

  18. #18

    Default Re: HGT-Converter release

    Umm yeah there is a problem for some reason there is something wrong with my computer and I'm not able to get a patch past 1.3 it's really weird. So yeah i'm gonna need some help with the hgt converter...

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

    Default Re: HGT-Converter release

    Ok, you can use the hgt converter from windows. Just put it into the directory where you have your map_heights.tga and double-click it (with java installed). If you have a proper map_heights.tga it should generate a map_heights.hgt

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