Jump to content
Sign in to follow this  
Guest Pfunk

Terrain Editor is Seriously Irritating Me...

Recommended Posts

Guest Pfunk

OK, I know it's possible to edit bitmaps and make them height maps. I need someone to tell HOW it's done. Otherwise, I'm running into the same scaling issues I had before and I am no closer to solving them.

 

I know the .bmp needs to be saved as an 8-bit image for the TE to see it. The TE sees it, all right. It'll even let me tile it, but once I stick the .hfd and .tfd files into the terrain to test it out, all hell breaks loose.

 

Also, in the TE, when I use an edited .bmp to create a height map, the Y-axis is flipped backwards, making creating targeting areas completely impossible.

Share this post


Link to post
Share on other sites

What is "all hell breaks loose" mean? Is it terrain elevations not correct, or some arbitrary max altitude plateau is being created?

 

I know you have to have the right colour palette set up, which gave me pains before I figured out how to do it.

 

As for Y axis, make sure image size in pixels equals terrain size in kilometers, or weird things happen, or the hfd doesn't even get created. I dunno. Now that may not be a requirement, but its a rule I learned to follow: 1pxl = 1km

Share this post


Link to post
Share on other sites
Guest Pfunk

The game doesn't even reach for the .hfd or the .tfd file the TE created. It reaches for a stock one, so the world doesn't even look like the one you tried to make. It looks like GermanyCE or IsraelME, not your terrain.

 

Yes, the map elevations do some funky things. It doesn't flatten mountains (which I was warned it would do if you weren't careful), it flattens the low ground, like valleys. I'll do some research on making a color palette to see if that's what I'm doing wrong.

Share this post


Link to post
Share on other sites

Where do you get your bmps to start with?

 

I went through this when I used 3dem to create my polar map sections, and TK gave a suggestion that I work with the colour palette. It worked. Exactly what I did...lol I can't recall the steps I took. Once I solve a problem, I forget the solution. That's me!!

Share this post


Link to post
Share on other sites
Guest Pfunk

OK, I import the DEMs to give me something to start with. I export the heightmap as a bitmap.

 

I crop the bitmap to the borders I like and save it as an 8-bit .bmp file. I import it back into the TE. It'll let me see it, tile it. But when I want to save it as an .hfd file, the game doesn't want to use it. I'll try looking into the palette thing.

Share this post


Link to post
Share on other sites

Okay, that imported DEM, can you make a test map out of that, and see if it works? If so, then you may be fluffing the re-importing of the bmp.

 

When you crop, do you change bmp size? I think TE(banghead.gif) works best if map size in km equals image size in pixels. At least that's how I do it.

 

Man where is Wrench the TEbanghead.gif-Buster lol

Share this post


Link to post
Share on other sites

1st question is, WHY are you exporting the height map, and then reimporting it?? Why would cropping be necessary? Let the games world settings place The Wall

 

let the DEM build the HFD, don't even mess with the *terrainname*.bmp unless you have to (to edit river valleys, or mountains or shorelines)...and only then after tiling.

 

tile it and build up. mess with things after the tiling is done, and them modify the tiles to fit.

Edited by Wrench
  • Dislike 1

Share this post


Link to post
Share on other sites

I don't understand your need to export/crop/mess with and them import back, right at the start of a terrain project...

%99 tiling should be done in TE, because it's easier.

Share this post


Link to post
Share on other sites

Depends what you want to do, and how TE handles the initial DEM data, which depends on how near the poles your chosen bit of terrain is.

 

For Moroccoo terrain in the WoA mod, I imported the DEM data for the region and used the .HFD file as created by TE, albeit I had bumped up the height setting in TE to 120%, cos I like big jaggy peaks in mountainous regions, at the expense of sacrificing accurate peak heights. All tiling work was done in TE. Also, the region is close to the equator, so there is very limited north/south compression in the DEM data. But, for that terrain, I was happy for 66% of RL scale which TE creates, as it was a job to be done in a limited timescale. The straits of Gibraltar are a bit narrow, but, hey. . .

 

OTOH, for Iceland terrain, I had to edit the .HFD right off the bat because Iceland is so far north the DEM data is compressed in the North/South axis. So, my editable bitmap had to be stretched in the North/South Axis, and the whole thing had to be scaled up to close to 100%. I also wanted to have an editable bitmap to hand-flatten a lot of airbases as the TE airfield flatten tool is too unwieldy for those narrow fjords.

 

You need to select as large an area for the core terrain as will cover everything you want on your final map. Simply enter a big enough map and pick your Lat/long co-ords in TE. Plenty of room round the edges is good at this stage.

 

Then, from the TE dropdown, use File/Export Heightmap as bitmap. Save it somewhere safe, call it what you want, eg ICELAND_HM_BASE.bmp

 

NB this procedure will chop off mountain peaks unless you have set the import/export heightmap setting properly in the TerrainEditor.ini file. To set it, create your map in TE using the DEM data. Float the cursor over the hightest peak on your map to get the max peak height in meters. Add a hundred meters or so for safety, then divide that peak height by 256. This number is the number you should set in the TerrainEditor.ini file, here:-

 

[bitmapExport]

HeightScale=16

 

[bitmapImport]

HeightScale=16

 

This is from Kamchatka terrain, 16x256=4096m max peak height. Again, I have bumped up the peak heights from RL to give agood craggy, mountain effect. Sure looks good in game, IMHO. If the import/export numbers are different, TE will adjust the scale of heights in your map each time you import/export the heightfield bmp, which will wreck your map. You will lose low-level detail at higher numbers, as TE can only handle 256 height "steps."

 

My preference is for big jaggy mountains at the expense of RL peak heights, and I don't mind losing a bit of low-level detail. Also, I never, ever use the TE "smooth terrain" function as it rounds everything out and makes it bland, smooth and crops off a good bit of height. I edit heights manually, like this:-

 

My imaging software of choice is gimp, for reasons which will become clear.

 

Using gimp, open up your _HM.bmp. You will see the standard blue/green/orange TE heightmap pallette.

 

In gimp, select Colour/Map/Set Colourmap. The script-fu "Set Colourmap" box will come up. In that box, click on the Pallette: button (it shows default, click where it says default). That will bring up the script-fu "pallette selection" box, which showes a list of installed pallettes. Scroll down that list until you come to "topographic."

 

Click on topographic. Close the pallette box, then click on "OK" in the script-fu "Set colormap" box. You will see that the green/blue/orange image has changed to something which is black for sea, with varying shades of blue for land, right up through pale blue, green, then greenish-yellow to white for high peaks. This is a much more visible colourmap for editing heights which shows a clear variation between height steps, unlike the TE standard pallette.

 

Next, check along the top of the gimp box showing your map. This should have the name of your _HM.bmp, and show the colour mode it is in. This should read "indexed, 1 layer." TE cannot read bmps which are in RGB mode, so if your image is not in the right mode, use the Image/Mode/Indexed dropdown to fix this.

 

Save your re-coloured _HM.bmp using "save as" In the dialog, make sure "run length-encoded" is unticked.

 

The acid test comes when you re-import the re-coloured image to TE. TE can only read bmps which are in the correct colour mode, and which are the same size as the map currently set in TE. This last point is really important.

 

If you change the overall size of your HM.bmp by cutting or stretching, then saving it, you have to make sure that TE is set up to accept a map of the new size.

 

So, say I start with a terrain map of 500x500km in TE. When I export the HM bitmap, I get an image which is 1000x1000 pixels. If I stretch my bmp to 2000x2000 pixels, I need to start a new map in TE which is 1000x1000km, and import my 2000x2000 pixel image into that.

 

For Iceland, I stretched the exported bmp more in the north-south axis than east west, to get a proper projection of iceland, compensating for the error in the DEM data at that latitude. Then I cut a piece out of my stretched .bmp file which had everything I wanted on the map, making an allowance for "the wall" at the edge, and saved that as ICELAND_HM_EDITED.bmp. Them I created a new map in TE which was the correct size for the edited file, and imported the HM_EDITED.bmp into the new TE map.

 

That sounds more complicated than it is. Bear in mind that your edited .bmp has to be square, has to be in the right colour mode, and that TE will only read a .bmp when you have set the km size of your map in TE to match the new bmp first. NB 1km in TE = 2 pixels in bmp.

 

You cannot create a 1000x1000km map in TE, export the height bmp, double the size of the bmp, then re-import it to the same session of TE. You have to open a new TE window, set the km size of the new map to match your edited bmp, then import the bmp into the new iteration of TE.

 

You can then edit your topographic image to your heart's content. Bear in mind that if you use the "level airfield" function in TE, you will need to export the heightfield.bmp from TE to save those changes, over-writing your working bmp file.

 

Obviously, I keep a stack of backup heightfield bmps at every stage in case something goes wrong.

 

 

Sorry, I don't use Photoshop for this, you're on your own there. Likewise, I have done all my hand-tiling in TE, so I can't help with the "export .TFD as bitmap" function.

 

Hope that helps.

 

Cheers,

 

baltika

Edited by Baltika

Share this post


Link to post
Share on other sites

W,P::

WHY are you exporting the height map, and then reimporting it??

I don't understand your need to export/crop/mess with and them import back, right at the start of a terrain project...

CAUZ ya'll know why :drinks: same reason, different reason

 

Baltik that's some nice tips there. If you ever want a 3DEM sinusoidal projection of Iceland, lemme know. Its real easy especially for a small area like that, and 3dem allows max altitude of terrain to be set, allowing more elevation detail in TE(banghead.gif). I needed the Mt. Everest so I had to go from 0 to 8000m+. I was afraid to read your poast, knowing I would pickup a Free Tip that would force me to start over from scratch with my map. :rofl: I swear I've started that over for the last time LOLOLOLZZ

Share this post


Link to post
Share on other sites
Guest Pfunk

OK, here's why I'm trying like mad to get this to work.

 

When I load the DEM files to create a terrain, it gives me a HUGE amount of ground to play with, and none of it is scaled correctly. If I were to use what the TE generates, it creates a world in about 50% scale.

 

I want only part of it. I want to crop out the areas I don't need and keep the areas I do. I then want to resize the bitmap to a 2000x2000 pxl image and then use that image to create a 1000x1000km terrain with more accurate distance scaling.

 

How do I take the areas I need, carve the stuff out I don't and still have something that the game can use?

 

I DID look up the color pallette thing. I generated a palette in PS-CS3 using an exported .bmp file from the TE, saved the palette, and was able to load and save the palette into the .bmp image and now the height map thing is perfectly solved. BUT, the Y-axis is STILL flipped backwards in the TE, so making target areas is still impossible, so I am still doing something wrong.

Share this post


Link to post
Share on other sites

 

When I load the DEM files to create a terrain, it gives me a HUGE amount of ground to play with, and none of it is scaled correctly. If I were to use what the TE generates, it creates a world in about 50% scale.

 

I want only part of it. I want to crop out the areas I don't need and keep the areas I do. I then want to resize the bitmap to a 2000x2000 pxl image and then use that image to create a 1000x1000km terrain with more accurate distance scaling.

 

How do I take the areas I need, carve the stuff out I don't and still have something that the game can use?

 

 

 

Hmmm. . .

 

what I did was use the huge areas generated by TE as my core HM_bmp. Then, I used the scale function in gimp to stretch that bmp so that the piece I wanted was as close as possible to an accurate projection. This is more of an art form than anything else - using easily recognisable, usually coastal features on the terrain bmp to estimate an accurate distance, bearing in mind 2 pixels = 1km in TE, but that TE creates terrains which are 66% of full scale. I tended to use GE to roll the globe to find an accurate projection of what I wanted to map, and work from there, by eye.

 

So, scale up your initial bmp by 4/3 (or 133%) to get a roughly full-scale map. The stretch it out a bit in the x or y axis so that your distances are as close as you can make them, to make allowances for squahing in the north-south axis the nearer you are to the poles. You will get huge bmp files in this process. Once you are happy, with your basic edited projection, use the box selection tool to select an area of pixels on your edited map which is 2000x2000 pixels, or whatever size you want. Then cut and paste that selection as a new bmp image, and save it as whatever you want. Then, using that example, open up TE and create a new terrain, size 1000x1000km, and simply import your new bmp into it to create the HFD, bearing in mind you need tpo set the import and export heightmap numbers in Terraineditor.ini for your edited bmp, so that peak heights are imported correctly to the new map.

 

I've never seen the y-flip thing, I'm not sure what's going on there :blink: In TE, there is an Edit/Rotate Map/Flip vertical or flip horizontal setting, maybe you have that checked by mistake?

Edited by Baltika

Share this post


Link to post
Share on other sites
Guest Pfunk

No, Baltika, but I think I know where I may have messed up.

 

I have a heightmap EXACTLY the way I want it. I mean, it is dead-ass-on in terms of calculated distance.

 

Lemme play around with these instructions Baltika has outlined for me.

Share this post


Link to post
Share on other sites

You know TE comes with a 45cal :suicide::grin:

Share this post


Link to post
Share on other sites

lol ... 45

 

---

 

P::

Yes, the map elevations do some funky things.

^^ this

 

Like, terrain slides around (that's very disturbing) and elevation pops or goes flat at varying distances? If so...

 

P...okay, TE(banghead.gif) is funny about Texture Tile Resolution (TTR) and Height Field Resolution (HFR) -- you know those two variables you setup when you go New Terrain. The ratio of these two variables is very important to TE(banghead.gif).

 

Look at your TerrainEditor.ini config file for TileToHeightGridRatio = ... this variable MUST equal the TTR/HFR ratio you use when setting up New Terrain. TE ports this grid ratio over to your terrain's DATA file, and if its wrong, then map elevations do some funky things.

 

If grid ratio is not equal to TTR/HFR, then to test if this is the problem, you can manually change the grid ratio in the Terrain_DATA file, then run the game. If that fixes things, just make sure to change the grid ratio in TerrainEditor.ini for this terrain.

 

Every time you make New Terrain with a different TTR/HFR ratio, and you forget to tell TE.ini, then you get the funky terrain.

 

--

 

On the other hand, the closest I've seen to P's y-flip is when I import a wrong size bmp *or* import with wrong tile size (don't know which), and the y scale goes negative. I've never seen a consisten y axis reversal if I recall.

Share this post


Link to post
Share on other sites

In other words....

 

P, poast your New Terrain Dialogs...

 

Terrain Map Size |___| (km)

Texture Tile Resolution |___| (m)

Height Field Resolution |___| (m)

 

and...

 

TileToHeightGridRatio=___ in either Terrain_DATA.ini or TerrainEditor.ini

 

TTHGR = TTR / HFR or elevation is not just funky, but Pfunky.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use, Privacy Policy, and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..