BzHgt v1.1


DISCLAIMER

BzHgt is guaranteed to work on MY computer. Make sure you read and understand the instructions before emailing me with questions- Otherwise I wont answer them. I am not responsible for anything, especially not what you do with this program. This program has nothing to do with Activision, neither do I. (except that I play their Games)

Have a nice Day :)


STUFF YOULL NEED TO KNOW

THE IMAGE FILE

Your bitmap image files must be 24bit and uncompressed.

They MUST be 1/10th of the dimensions of the map you create with MakeTRN.
for example. If you used -

MakeTRN multst62 /c /w=1280 /h=5120
then your Image MUST be 128 pixels wide and 512 pixels high.

Installation

No install is required, just copy the exe anywhere and you're good to go.

Usage:

BzHgt works in several ways.

  • For compatability with bmp2hgt, double clicking the exe will look for a file named hgtmap.bmp
    If it finds one, a hgt file called hgtmap.hgt will be created.
  • You can now drag and drop bmp and / or tga files onto the exe.
    Using this method, a similarly named hgt file will be created, for example, dropping the file -
    C:\games\BZ1\addon\multdm55.bmp onto the exe will produce the file -
    multdm55.hgt in the folder C:\games\BZ1\addon\
  • You can convert hgt files into 24 bit tga files. Simply drag a hgt file to the exe, the same as you would a bmp or tga.
    Because hgt files do not contain infomation on the map dimensions, you may be asked to select from a set of possible sizes.
    In order to retain height precision, these use a different method of height calculation to the heightmap files you may be used to working with. This is explained in the next section.

    Be very careful if converting files directly to and from your addon folder!

    NOTE: This Program does not make TRN files. So If you dont have one, make one using MakeTRN /c and then copy over the HGT file that it generates with the HGT file created from your BMP. Also, delete the LGT file that MakeTRN creates before you run BattleZone.

    Height Modifier

    When creating a hgt file from a bmp or tga source, you will be asked to input a height modifier.

    Standard Method:
    Pressing a key from 1 to 5 will select a 'standard' modifier, with height ranges as follows -

    1: elevation 0m - 767m
    2: elevation 0m - 1535m
    3: elevation 0m - 2303m
    4: elevation 0m - 3071m
    5: elevation 0m - 3839m

    In this mode, height values are calculated by adding the red, green and blue components of each pixel, In english that means black is lowest and white is highest. This is the simplest, and recommended method.

    Precision Colour Mode:
    In order to support hgt to bitmap conversion without losing height precision, Method 0 was created.
    Hgt files have a range from 0 to 4095, but adding together three values of red, green and blue gives a range of only 0 to 767. This is more than enough for most purposes, infact most people use purely greyscale maps that have only 256 different levels.
    However, if you need to convert from hgt to bitmap and back again, you will need to work on a scale that handles all 4096 possible levels, or the finer detail will be lost in the conversion.

    The image on the left was created in photoshop, and converted to hgt with the height modifier set to 2.
    The image on the right was created by dragging the hgt file back onto BzHgt.
    The image on the right can be used with BzHgt's precision colour mode to recreate the hgt file exactly.


    Using the RGB values as a bitmask gives a possible range of 0 to 16 million, which is more than enough. BzHgt uses only the green bits and the bottom half of the red bits. If you understand binary numbers, this is easy to explain -

    12 bit hgt value:          ----GGGG GGGGRRRR
    24 bit rgb value: -------- GGGGGGGG ----RRRR
    
    In English;
    Each shade of green represents 16 meters of height.
    Each shade of red represents 1 meter of height.
    Any shade of red over 15 is ignored.
    Any shade of blue is ignored.


    This mode is not really suitable for fine scale 2d editing, but it will allow you to import and edit height maps that were created in the 3d editor.
    Questions & comments go to slight@evilbastard.org