PDA

View Full Version : Importing a height map troubles



Bill_Brooks
02-05-2008, 02:50 AM
I have some gray scale height maps that I wanted to import into the terrain.
So far I have had no luck I did download the hmcs conversion tool http://www.lilchips.com/dgunreal/tools-hmcs.asp and changed my height map to a bmp with the unreal g16 heightmap .

When I check the height map only box and then click import height map I get a large box in map not in terrain.

So I tried again checking the box into currant and also height map when I click import the editor crashes on me.

I tried it that way three times and crashed every time.

The editor for the most part doesn't crash for me and btw the video tutorials that came with the limited addition of this game are great but also so lacking on more of the medium to advanced editing that I was hoping for.

ShadeMistress
02-05-2008, 02:59 AM
How big is your heightmap resolution-wise?

keep in mind that a really large map needs not be larger than 256x256 and most maps don't go higher than 128x128. For example, my WAR-Dune map is slightly larger than Torlan-sized and it's at 256x256 and has more than ample space to support 32 players.

Bill_Brooks
02-05-2008, 11:45 AM
It's 512*512 I will try making it smaller I will try exporting the height map then I will know how big it is, if it exports.

DGUnreal
02-05-2008, 12:09 PM
What source file format are you using when loading it into HMCS?
If they are not 16-bit you will have to scale them.

I assume that you are importing into an existing Terrain actor?
If so, select the "Heightmap only" and "Into Current" checkboxes and set the Class to "G16BMPT3D".

If you have adjusted the Terrain's NumPatches beforehand, then make sure you set them to -1 for the heightmap size you are importing. A 512x512 heightmap results in a 511x511 NumPatches terrain.

Also be aware that if you are using any of the MaxTesselationLevel optimizations you must use a heightmap size divisible by this value +1. So a 256x256 Patch terrain with MaxTesselationLevel of 4 actually has a 257x257 underlying heightmap.
If you import a 256x256 heightmap into this terrain, you will get a row and column along the edges that are stuck at altitude value 0 that will have to be fixed.

I have a complete tutorial on how to do this on UDN for UT3 as soon as that goes public...

Bill_Brooks
02-09-2008, 05:31 PM
Thanks DGunreal

I can't wait for tutorial.

I'm getting closer but still not there yet.

I did export my terrain height map from the editor then opened it in hmcs saved it in tiff format only so I could look at in photoshop cs as I know that program fairly well. I then edited my height map pic in photoshop to the same size and saved it as a 8 bit tiff so I could open it in hmcs. Doing that I then saved the file into unreal g16.bmb format.

I then opened up the saved test level in the editor selected the terrain then opened the terrain editor clicked the height map then import also selected the format then selected my new saved heightmap pic

It imported the height map but not into the terrain.

Here is a pic from the editor

http://www.wemakemaps.com/images/unreal3/terrainwhy.jpg

This height map isn't going to work as I hoped but I still want to know how to get it to import correctly.

DGUnreal
02-09-2008, 08:23 PM
I then edited my height map pic in photoshop to the same size and saved it as a 8 bit tiff

It imported the height map but not into the terrain.


You must keep the heightmap in 16-bit format. HMCS supports 16-bit TIF for both open and save. So you must save the file back out of PhotoShop as 16-bit TIF. Then convert it back through HMCS to G16.
FYI: while in PhotoShop the most you can do is minimal trimming etc., you can't paint or modify the heightmap since PS cannot display the 16-bit grayscale correctly on screen (video cards and monitors are limited to only 8-bits of grayscale). So if you do any serious edits you will usually wreck the heightmap data.

When importing back into UnrealEd you have to option of importing into the current terrain or creating a new terrain.

After the heightmap is imported, then you need to go to the Terrain properties and set them appropriately, including the DrawScale3D.X,Y,Z, etc. so that the terrain looks correct. The defaults are usually not correct for imported heightmaps.

Bill_Brooks
02-10-2008, 01:02 AM
Silly me if I would just take a few minutes and learn how to use hmcs I wouldn't have to open photoshop. I didn't hit include when I imported the height map that is why the terrain was made instead of being inserted existing terrain. My height map may work out as I figured out how to quickly change the high and low values for the height map and average it out to make a new height map all inside Hmcs scale funtions this will come in very handy I think.

Brits__Hit
03-17-2008, 04:38 PM
Sorry to resurrect this topic, but I'm also importing heightmaps into UED. Everything works fine, apart from the fact that any heightmap I import looks like trash.

Here's 2 examples of maps I imported, just to see what they would look like. I also created a few from taking screenies of hilled regions using Google Earth and then converted them to grayscale (as well as tweaked contrast/etc). Needless to say, they didn't look very good:

https://support.secondlife.com/dmfiles/4051/4417/Support%20Downloads/Illustrations/Heightmap_Example.jpg
http://www.jeangeffroy.com/wp-content/uploads/2007/06/heightmap.jpg

Both those maps (and others) created horribly jagged and sharp terrain that hardly resembled what I thought they would from the look of the image. I also tried reducing contrast of the heightmaps but it still looked awful. (seems like Bill_Brooks has a similar issue, by the looks of his terrain with the imported heightmap)

Now DG, I remember your map Meadowland, which had the most realistic, convincing terrain I've seen in a game. I also remember the heightmap for it was pretty complex, but it looked amazing when used with the terrain. I emailed/PMed you about it and you told me you developed a program that specifically made detailed heightmaps or something. Have you been successful in creating the same kind of detailed terrain in UT3 ED using your heightmaps as you did back with UT2004?
Also, is there some package where the heightmap for my level is kept so I can take a look at it? I looked in the upk created with the same name as my map, but there's nothing there.

Any other info you can give me on importing heightmaps would be appreciated as well.

EDIT: Here's a compilation pic of my map in UED, the terrain's properties and the heightmap used for the terrain as seen in photoshop. As you can see, the transitions on slopes are not gradual at all, even when there are a lot of polygons to distribute the transition:

http://i272.photobucket.com/albums/jj193/Brits_Hit/Heightmap_Example.jpg

D-Hunter
03-17-2008, 05:18 PM
You might like G16ed much better, it doesn't give me as many problems as HMCS. Don't use 8-bit grayscale, you will notice a stair-step effect on the terrain. That wall at the edge of the terrain can be removed by lowering the NPatches on the sides it occurs. You can also change the Z-axis draw-scale if it is too steep/flat since UT3 might use a slightly different scale.

DGUnreal
03-17-2008, 07:21 PM
Sorry to resurrect this topic, but I'm also importing heightmaps into UED. Everything works fine, apart from the fact that any heightmap I import looks like trash.

Here's 2 examples of maps I imported, just to see what they would look like. I also created a few from taking screenies of hilled regions using Google Earth and then converted them to grayscale (as well as tweaked contrast/etc). Needless to say, they didn't look very good:


Heightmaps must be 16-bit or they usually look stair-stepped (and yucky). The only time they don't is when it is a proper 8-bit optimized heightmap, which is rare (HMES supports this).
Unfortunately you can't properly use top-down screenshots from software like Google-Earth, first off that isn't a proper heightmap, second it will be 8-bit.
If you import any of the sample heightmaps with HMCS you will see the difference between 8-bit and 16-bit.

For the most part, you essentially have to rely on GIS or DEM (Digital Elevation Model) files, or use terrain software such as Terragen or Leveller to create the heightmap.
HMCS can then be used to convert the heightmap from those over to the G16 required by UnrealEd.



Both those maps (and others) created horribly jagged and sharp terrain that hardly resembled what I thought they would from the look of the image.


If you do import an 8-bit file, it is best to first Scale it in HMCS so that it fills the altitude area from about 16384 to 49152. Then save it as G16. But in UnrealEd you will have to use the Smooth tool on the terrain to reduce the stair-step look.
I'm adding a feature into HMES that will algorithmically interpolate the data so that an 8-bit grayscale image can be used with better results.



Now DG, I remember your map Meadowland, which had the most realistic, convincing terrain I've seen in a game.


Thanks.
I have even better terrains coming in my UT3 maps.



Have you been successful in creating the same kind of detailed terrain in UT3 ED using your heightmaps as you did back with UT2004?


Yes. My map DM-DG-NecrisIsland (http://forums.epicgames.com/showthread.php?t=606917) is using the same terrain technique I used for UT2004 maps, but it actually has more capabilities and quality now in UT3 since I can use the advanced shaders, normal maps, etc. of UE3 that didn't exist in UT2004. I have a bunch of advanced tutorials regarding terrain on UDN but it is only in the Licensee area.

I am still working on the HMES software, which allows for a lot more powerful heightmap creation and editing. I will be making beta versions available to the public when it is ready. I'm hoping to have something to download soon as I know there are a lot of studios and community mappers who could really use the software.



Also, is there some package where the heightmap for my level is kept so I can take a look at it? I looked in the upk created with the same name as my map, but there's nothing there.


Unlike UT2004, in UT3 the Heightmap and Alphamaps are hidden. The only way you can get the heightmap on an existing terrain is to export it in the Terrain Edit dialog.



Here's a compilation pic of my map in UED, the terrain's properties and the heightmap used for the terrain as seen in photoshop.


In PhotoShop or PhotoPaint you must work with a 16-bit grayscale image format to correctly maintain all of the height data.
This means that other than simple functions like rotating or cropping, you can't do any editing in PS or you may damage the 16-bit data. This is because your monitor can't show all 16-bits of grayscale so you are essentially working blind in PS.
HMES will help alleviate some of this since it supports simulated 16-bit coloring and 3D view.




You might like G16ed much better, it doesn't give me as many problems as HMCS.

That wall at the edge of the terrain can be removed by lowering the NPatches on the sides it occurs. You can also change the Z-axis draw-scale if it is too steep/flat since UT3 might use a slightly different scale.


What issues are you having with HMCS? Sorry, I don't plan on updating the software, but any feature requests might make it into HMES.
Note that HMCS was developed as a quick in-house tool for game studio use and was never designed to be used by the public, so some of its features are incomplete or don't work, and it was designed strictly for file format conversion, so it doesn't have a lot of features (but does offer more than G16Ed).
HMES will be a full function retail quality application.

The edge "wall" occurs because you are using the Terrain LOD Tesselation system, so heightmaps must be multiple-of-tesselation +1. In other words a 256x256 Patch terrain has an underlying 257x257 Heightmap. So if you are using a 256x256 Heightmap from some other software, convert it through HMCS to TIF-16, load it into PS or PP as 16-bit grayscale, resize the paper/document by one pixel X and Y and duplicate the right and bottom edge pixels out by one. This results in a proper +1 (ie. 257x257) heightmap. Then save this, convert back through HMCS to G16 and import it.

Brits__Hit
03-18-2008, 02:36 PM
Hmm, thanks for the extensive input DG, I'll use the info you've given me to try and create a better heightmap. If I have more issues (I no doubt will :P), I'll post them here.


If you do import an 8-bit file, it is best to first Scale it in HMCS so that it fills the altitude area from about 16384 to 49152. Then save it as G16. But in UnrealEd you will have to use the Smooth tool on the terrain to reduce the stair-step look.

I'm not sure what you mean by scaling it to fill the area of '16384 to 49152' in HMCS. Could you maybe explain a bit further?


Yes. My map DM-DG-NecrisIsland (http://forums.epicgames.com/showthread.php?t=606917) is using the same terrain technique I used for UT2004 maps, but it actually has more capabilities and quality now in UT3 since I can use the advanced shaders, normal maps, etc. of UE3 that didn't exist in UT2004.

I've been meaning to check that map out but I've been busy as of late. Looks awesome though.


I am still working on the HMES software, which allows for a lot more powerful heightmap creation and editing. I will be making beta versions available to the public when it is ready. I'm hoping to have something to download soon as I know there are a lot of studios and community mappers who could really use the software.

Glad you're still working on updating the program. I'll be looking forward to the next release.. although I really need to explore the current version's possibilities more.


Unlike UT2004, in UT3 the Heightmap and Alphamaps are hidden. The only way you can get the heightmap on an existing terrain is to export it in the Terrain Edit dialog.

I see.. I'll check it out.


In PhotoShop or PhotoPaint you must work with a 16-bit grayscale image format to correctly maintain all of the height data.
This means that other than simple functions like rotating or cropping, you can't do any editing in PS or you may damage the 16-bit data. This is because your monitor can't show all 16-bits of grayscale so you are essentially working blind in PS.

I converted the heightmap in PS via the image>mode>grayscale option and it's now 8 bit. So I guess I should import it into HMCS and export it to G16?
This is mainly as another test, just too see if the heightmap looks more clear as Terrain in UED.


Again, thanks for the help, I'll have to check out one of those terrain generating programs as opposed to just making heightmaps in PS, but I doubt I'll get the realistic kind of terrain that I'm striving for (ala Meadowlands)/

EDIT: forgot to mention. What is wrong with using a heightmap that's larger (ie. 512x512)? I thought that would make the terrain much more accurate/detailed according to the resolution. It's just too much stress, performance-wise?


Don't use 8-bit grayscale, you will notice a stair-step effect on the terrain.

You mean don't import into UED as 8 bit right? Or do you mean it should never be 8 bit, even if it's converted to 16

D-Hunter
03-18-2008, 02:48 PM
What issues are you having with HMCS? Sorry, I don't plan on updating the software, but any feature requests might make it into HMES.
Note that HMCS was developed as a quick in-house tool for game studio use and was never designed to be used by the public, so some of its features are incomplete or don't work, and it was designed strictly for file format conversion, so it doesn't have a lot of features (but does offer more than G16Ed).
HMES will be a full function retail quality application.

The edge "wall" occurs because you are using the Terrain LOD Tesselation system, so heightmaps must be multiple-of-tesselation +1. In other words a 256x256 Patch terrain has an underlying 257x257 Heightmap. So if you are using a 256x256 Heightmap from some other software, convert it through HMCS to TIF-16, load it into PS or PP as 16-bit grayscale, resize the paper/document by one pixel X and Y and duplicate the right and bottom edge pixels out by one. This results in a proper +1 (ie. 257x257) heightmap. Then save this, convert back through HMCS to G16 and import it.

It's not really problems, it's just that HMCS seems slightly more complicated and is unable to open files of certain resolutions. Also, it creates a diagonal line when importing MicroDEM 24-bit heightmaps (which I use often).


You mean don't import into UED as 8 bit right? Or do you mean it should never be 8 bit, even if it's converted to 16

I mean, if I convert an 8-bit grayscale (since that's the only format I am able to get me heightmaps in initially) to a 16-bit heightmap, it will still act like an 8-bit heightmap (stair-step effect). If I manage to convert a 24-bit heightmap (through multiple conversions and steps) to a 16-bit heightmap, it looks smooth.

DGUnreal
03-18-2008, 03:23 PM
If I have more issues (I no doubt will :P), I'll post them here.


You know where to find me... ;)



I'm not sure what you mean by scaling it to fill the area of '16384 to 49152' in HMCS. Could you maybe explain a bit further?


An 8-bit heightmap only supports altitude values of 0 to 255. A 16-bit heightmap supports altitude values of 0 to 65535 (256 times as much as an 8-bit).
If you import an 8-bit heightmap into UnrealEd, and set the DrawScale3D.Z really high to get some range to it, then you can't smooth it any as there are no intermediate vertex Z values.
So, open the 8-bit heightmap in HMCS, choose the Scale function, and enter in the range that you want it to scale the heightmap to. In this case, if you scale it to 16k through 48k, you will then have a bunch of intermediate Z values available so that you can smooth the terrain in the editor.



Glad you're still working on updating the program. I'll be looking forward to the next release.. although I really need to explore the current version's possibilities more.


As mentioned, HMCS was an in-house developed tool for use in a game studio, it was not meant to be shared with the public, so it essentially was never "finished" and is too old for its "code" to bother updating it. So it is being totally replaced with HMES that is written to be used by the public.



I converted the heightmap in PS via the image>mode>grayscale option and it's now 8 bit. So I guess I should import it into HMCS and export it to G16?
This is mainly as another test, just too see if the heightmap looks more clear as Terrain in UED.


You want to work with a 16-bit grayscale if at all possible. The only way that PS can manage them is through formats such as TIF-16. HMCS can convert RAW-16, Terragen, etc. to TIF-16. Then once you have done any editing/cropping in PS, save it as TIF-16, then convert that through HMCS to G16.



Again, thanks for the help, I'll have to check out one of those terrain generating programs as opposed to just making heightmaps in PS, but I doubt I'll get the realistic kind of terrain that I'm striving for (ala Meadowlands)/


Creating heightmaps in PS is essentially impossible. The reason is that even if you start off with a new 16-bit grayscale document, you can't properly paint anything onto it since your video card and monitor can't display any more than 8-bit of gray. So this essentially means that for every individual color of gray that the monitor can show you, there are 256 actual levels of heightmap altitude, so you can see where it would be difficult to accurately edit in PS.
It would be like trying to edit a 24-bit color photograph from a camera with a computer that can only display 256 colors.

HMES adds a bunch of other features that make working with 16-bit heightmaps easier, and essentially makes PS obsolete.



EDIT: forgot to mention. What is wrong with using a heightmap that's larger (ie. 512x512)? I thought that would make the terrain much more accurate/detailed according to the resolution. It's just too much stress, performance-wise?


You can use up to a 512x512 heightmap, UE3 can handle that (it can handle 1024x1024 if you really want). A 512x512 heightmap is 524,288 total triangles. You will find though that it will impact the framerate for lower hardware, so you usually only want to use 128x128 or 256x256 patch terrains.
Since game design is essentially using tricks to simulate an environment, you are better off using Materials with NormalMaps in them to simulate additional terrain detail than using a high-resolution heightmap.



You mean don't import into UED as 8 bit right? Or do you mean it should never be 8 bit, even if it's converted to 16


Yeah, you should not import an 8-bit heightmap into UEd. If you are stuck with an 8-bit source file, you should Scale it first before saving it as a G16 so that you can properly Smooth it in the editor.
Preferably you always want to use 16-bit heightmaps though.




It's not really problems, it's just that HMCS seems slightly more complicated and is unable to open files of certain resolutions. Also, it creates a diagonal line when importing MicroDEM 24-bit heightmaps (which I use often).


As mentioned, HMCS was designed for specific game studio use, so it has limited features and wasn't designed for general public use.
You should have no problem opening any resolution heightmap between 1x1 and 513x513. HMES supports up to 8192x8192.
Many of HMCS's file open/save functions were not tested on every possible heightmap format available, so there are some glitches on some. HMES supports more Heightmap, 3D, Bitmap, and DEM/GIS formats than any other software available. When it is available for early beta, give it a try.

Brits__Hit
03-28-2008, 02:38 PM
I've been messing around with importing different maps and I've been smoothing the terrain after it's imported. It looks pretty good in some instances, but it depends on the heightmap I import.

Thanks for all the help you gave me DG, I may need more regarding this topic in the future :P

Also, I'm having some issues with an imported mesh into UED, if you could take a look at the thread and give any input you can. Would be greatly appreciated.

http://utforums.epicgames.com/showthread.php?t=608074

DGUnreal
03-28-2008, 03:35 PM
I've been messing around with importing different maps and I've been smoothing the terrain after it's imported. It looks pretty good in some instances, but it depends on the heightmap I import.


I'm still working on HMES, which will have built-in tools for converting 8-bit to 16-bit formats and dealing with optimized 8-bit files.

brunomartelli
01-26-2009, 04:38 PM
What issues are you having with HMCS? Sorry, I don't plan on updating the software, but any feature requests might make it into HMES.
Note that HMCS was developed as a quick in-house tool for game studio use and was never designed to be used by the public, so some of its features are incomplete or don't work, and it was designed strictly for file format conversion, so it doesn't have a lot of features (but does offer more than G16Ed).
HMES will be a full function retail quality application.



Hi where can i get HMES from

thanks in advance

Bruno

DGUnreal
02-01-2009, 01:39 PM
HMCS can still be downloaded and used for free from www.lilchips.com.
Follow the links to the products. The updated site isn't completed yet.

HMES is only available for licensing by UE3 Licensees since it now integrates right into the unreal engine. It is also changing companies soon.

r00t4rd3d
03-01-2009, 03:09 AM
I got a question , I got this height map from a UE2 game that does not support exporting. I had to take a screenshot of it and save it as a bmp. Is there any way I can make this work in UE3 ?


http://img220.imageshack.us/img220/6493/46859211.png

musilowski
03-01-2009, 07:31 AM
I got a question , I got this height map from a UE2 game that does not support exporting. I had to take a screenshot of it and save it as a bmp. Is there any way I can make this work in UE3 ?


<img>

If you can convert it to the proper format (16- or 8-bit grayscale .bmp), I see no problems importing it to UE3. :)

r00t4rd3d
03-01-2009, 01:23 PM
Well I got the original heightmap out with UTPT but when I import it into UE3 its all messed up. Is there a setting I need to change ?

Here is the original heightmap :

http://members.cmwclan.com/r00t4rd3d/HMapBridge.bmp

musilowski
03-01-2009, 02:30 PM
Are you sure that is a 16-bit and not a 8-bit image you're trying to import (the one with loads of colors and bands)? I think DGUnreal's program (HMCS) might be able to work out that image to a workable format. Try using that. :)

DGUnreal
03-01-2009, 04:09 PM
The .bmp file is fine. It is a correct G16 file and will import into UT3 UnrealEd fine.
You could use HMCS to test loading any files to make sure they are compatible with UnrealEd.

However, your issue with it not looking correct will simply be UT3's different Terrain DrawScale3D settings. You will have to adjust the DrawScale3D.X, .Y, and .Z appropriately to get the Terrain looking correct. The .Z will probably have to be somewhere down around 8 to 16.

r00t4rd3d
03-01-2009, 08:43 PM
hmm its like its upside down lol , how I flip it over ?


EDIT :

nvm I got it working and looking good , it was inverted lol.