Jump to content
Official BF Editor Forums
Templargfx

Color,Detail,Undergrowth,Overgrowth all with Terragen!

Recommended Posts

you read correctly!

Using Terragen and TPAINT together with your fav image editor (Photoshop, PSP) its not at all hard to create your Colormap, Detailmap, Undergrowth placement map, and overgrowth placement map.

FOR TPAINT INFO and DOWNLOAD, FOLLOW THIS LINK

http://www.bf2modding.net/phpBB2/viewtopic.php?t=27

Rendering the Colormap, and Detailmap in terragen requires you to be a registered user if terragen. well, it doesnt really need registration, but the unregistered version of terragen has an image size limit which will cause your colormaps and detailmaps to be less detailed. you will also not be able to create large hieghtmaps in the unregistered version

NOTE : if you are using the unregistered version, remember to resize the images to the correct size in your image editor before saving them to your level!!

First we start in BF2EDITOR :

Create a new level. for this test, I used a size : 512 scale 2 map. if your giving this a go, I'd suggest starting there!

whatever size you decide to use, REMEMBER, the size you choose here dictates the size of all the other images we are going to create!

once the level is created, jump into the Terrain editor, and switch to undergrowth mode.

setup 1 material using the dark grey color (15) as the materials color.

you can add some undergrowth types now if you want, or leave it till later, it doesnt matter (I leave it till later)

left-click on the terrain to paint a bit of undergrowth (this is so the undergrowth files are generated)

now switch to the Overgrowth mode, and do exactly the same as above, create a new material, choose the dark grey color (15) and paint a bit on the terrain.

save your level, and quit out of BF2EDITOR, its time for spending a little time in terragen!

Open up terragen

Time to generate ourselves some terrain.

first up is to make the heightmap the right size

in the landscape window, click Size...

lndscapesetting.jpg

on this window, in the top right you can choose the size, I chose 513 (my level size + 1)

just say yes to all the little boxes that pop up, we have no terrain atm, so these arent going to effect anything!

ok, click generate terrain... in the Landscape window and make your terrain!

tergen.jpg

these are the options I used for this test

once you are happy with the way the hieghtmap looks, close this window, and click on the Modify... button in the Landscape window

termod.jpg

set the units to Terrain Units, then set the Heightrange from 0 to 164 and click Set Height Range.

close the window

the next step is to set up or surface map (the colors on the terrain)

if you havent done this before, it may take a bit of practice to get used to the different options!

surfacemap.jpg

Some things to consider. when we generate the detailmap, only 3 types of detail can be used. this does not mean that you can only have 3 types of surfaces, just remember this when choosing your surface. I have a very basic way of working this out. I use Grass, Rock, Dirt. this covers almost all terrain types and is easy to remember

when creating a surface map in terragen, you start with one material, SURFACE MAP. the main material. this material covers the entire map, and can be tricky to decide what catagory to put it in. I start off by setting this to black. and change it last to suit the other surface materials, but thats up to you.

add as many child materials to SUFACE MAP as you like, using Advanced Distribution settings to decide how the materials is placed on the terrain.

use the preview render option in the Rendering Control window to have a look what your materials look like.

Once your happy with the colors and placement of the materials, now is a good time to save your surface map (this is NOT the colormap, a surface map file is used by terrain generators to define materials for terrains)

in the Landscape window, under the Surface Map heading, there is a save button. click it and give your surfacemap a name (such as greenmountain).

Its about time to save our heightmap, click the EXPORT button in the Landscape window and choose these settings

savehieght2.jpg

and then save your hieghtmap into mods/bf2/levels/*MYLEVEL*/ overwriting the HeightmapPrimary.RAW file.

ok, now we need to setup the camera, the sun, and the atmosphere so we can render our colormap.

Under Rendering Control you will find a Camera Settings button, click that and you will get this window

camsetting.jpg

set your settings up so they look the same as this window!

under the heading Zoom Magnification, after you have ticked Orthographic click on the AutoSetup button, and say yes to the popups. this will ensure the camera is corectly positioned!

close down the camera settings window, and goto the View... menu and choose Lighting

lightcon.jpg

change the lightsettings to match the above image.

next is atmosphere, click the View... menu and choose atmosphere

atmos.jpg

move the density sliders so they are like above.

the last thing to do is set the image size. theres an easy way to work out how big it should be. take the size of your map (512) and multiply it by 4 (2048). see I told you to remember that size setting!

imagesize.jpg

ok, make sure you slide the detail slider in the Render Control window all the way to the right. you can click preview render if you like, to a quick look at whats going to come out.

click the render button, and wait (can take up to 20 minutes depending on your heightmap size)

once its done save the file into your level folder

savecolormap.jpg

now we need to change the surface map and lighting to generate our detailmap.

detailmaps use colors to designate what material layer in BF2editor goes where, so we need to change the surface colors to match.

The reason we use only 3 types of detail is to make things nice and easy!

change the areas you want grass detail to pure blue, the areas for rock to pure red, and the areas for gravel to pure green. make sure you slide the bumpiness and mimick terrain sliders all the way to the left

settingupsurfacefordetail.jpg

open up the lightsettings again, and change the sun intesity to 255%

lightfordetailmap.jpg

this ensures that the colors are infact there pure versions.

once this is done, render the image again for some funky pyskodelic action!

once its done, save the file into your levels folder

savedetail.jpg

alrighty! were starting to get there now. next up is undergrowth and overgrowth, these are by far the most involved of this process, not in terragen, but in your image editor which we will get to in a minute.

for now, you need to again change your surface map colors. this time, set the areas you dont want undergrowth to be on (say gravel and rock) to black, and areas you do to white.

if you want, you can of course create a new surface map with different options to create your undergrowth and overgrowth maps. this gives you much better control, but for this exercise we will just use the surface map we have already.

underoversurface.jpg

for this, we need to change the rendered image size to youmapsize(512) + 1 (513)

underoversize.jpg

click render, and when its done, save this to your levels folder aswel

saveundergrowth.jpg

now depending on how your terrain is setup, and how you want your overgrowth to look, you may need to create a new surface map, or change some of the Advanced Distribution settings so that the overgrowth does not cover the same space as the undergrowth.

(I simply changed the coverage, and the minimum and maximum angle settings on my surface map to create "patches" of overgrowth)

after you have set this up, we need to render the image again, and yes, save it to your levels folder

saveovergrowth.jpg

OK, well that was a bit confusing no doubt. well we are now finished with Terragen, you can close it down now.

now its time to jump into our image editor and do some editing. for this part of this tutorial (I guess you could call it that) the details of how to do each step wont be explained. I used Paint Shop Pro to do all this, but those of you who use your image editor regularily will no doubt know how to do the things I talk about.

First up is the heightmap. for some unknown strange and freaky reason, when you load the level in BF2EDITOR the hieghtmap is the wrong way around. in order for your colormap, detailmap undergrowth and overgrowth to line up, you need to flip the heightmap VERTICALLY and then re-save it.

now would be a good time to run a smooth or blur effect onto the terrain, this is not necassery, but a low-level blur or smooth will help to make moving over your terrain easier. whether or not you should do this is mainly decided by your hightmap, and how grainy it looks.

alright, next is the colormap and detailmap.

both of these files simply need converting to TGA (24bit) and saved into the BF2_TPAINT directory under your levels main directory.

for the colormap, save it as COLOURBIG.TGA and your detailmap should be saved as DETAILBIG.TGA.

when you have the detailmap open, you may wish do run an average or blur filter on it. remember that in the BF2EDITOR, the detail textures can fade into each other. I use an average filter before saving my detailmap. but this is not a necassery step

now jump into Windows Explorer, and navigate yourself to these two files.

both of these files need to be set to read-only (I will explain why later), so do this now so we dont forget!

settoreadonly.jpg

OK, Undergrowth and overgrowth. this is probably the most confusing part, I could not work out how to do this in Photoshop, but I am only new to photoshop, but have had Paint Shop Pro for several years. so Im sure you will know how to do these steps.

NOTE : these are the steps used in paint shop pro. you may not need to do all of these in other programs.

Open up undergrowth.BMP (or whatever you saved it as)

reduce the colors on the image to 2, using the nearest color option.

right, now the image is just plant old black and white, just what we need.

next, convert the image to greyscale.

using the COLOR REPLACER tool, we want to replace all the WHITE with almost black. Red : 15, Blue : 15, Green : 15 to be exact.

(now I dont know if its pure coincidence that the RGB values are the same as the material color number from BF2EDITOR. but I think its like that on purpose!)

now replace all the white with the R:15 G:15 B:15 color.

you should have a hard time seeing this color, thats a good thing!

alright. thats it for undergrowth, not that confusing hey (ok it was) now we save the image.

In your levels main directory there is a file called Undergrowth.RAW this is the file we want to replace. make sure when saving you have 0 header information and IBM byte order.

now, for overgrowth we do EXACTLY the same process above. so load up the overgrowth.BMP (or whatever you called it) and do the steps above, using the same R:15 G:15 B:15 color to replace the white.

this time, save this file as Overgrowth.RAW in the Overgrowth folder of your level.

THE FINAL PHASE

ok, now we are ready to use TPAINT to create our devided color and detail maps.

if you do not know how to use the TPAINT program, I would suggest having a read through the tutorial from the link above. for installation and use information.

jump into the BF2_TPAINT forder, and run BF2_TPAINT.EXE untick these options

tpaint.jpg

click go, and wait for it to finish.

now I told you I would explain why we need to set those files to read-only.

Well, when you run TPAINT, it generates the two files COLOURBIG.TGA and DETAILBIG.TGA which it then uses BF2_TSPLIT to break them up into the DDS files BF2 uses. if they are not read only, TPAINT will overwrite them with its own generated colormap and detailmap, which is a bad thing for us!.

ok, now as the instructions for TPAINT state, you now need to copy the Colormaps and Detailmaps folders to *yourlevel*/editor folder replacing the two folders that are already there.

EXCELLENT. now its finally time to jump back into BF2EDITOR and finish this off!

load your level back up, watch the debug window for any "could not load" etc. if this happens, one of several things could be wrong. you have saved a raw file in the wrong format, or one of the raw files is not the right size. if you were paying attention, you will have seen which file it was loading, and which file to redo.

ok, so your level loaded up without a hitch, I knew it would!

ok, first thing you might need to do is change the overall height of your map, under the tweaker bar, there is a tab with your levels name on it. click there.

under level settings you will find a Terrain Height settings (currently at 163.4 or something like that) lower (or raise) this number to your liking!

switch to the terrain editor mode one more time, and go into paint terrain mode.

now we need to setup the detailtextures (much the same as the instructions state for TPAINT)

Layer1 should be grass

Layer2 should be gravel

Layer3 should be Rock

(dont kill me if I got mixed up, im sure this is write)

make sure to set the material type and low_detail_type under the tweakbar.

the rock layer (which is generally your steep mountin edges should be set to a low_detail_type of 2 (verticle) and the other two should be set to 1 (horizontal)

once you've youve chosen your textures for the 3 layers, you need to click SET LOW DETAIL TEXTURE (on the right side of the window) and choose that DefaultLowDetail.DDS file. then click GENERATE LOW DETAIL TEXTURE.

this will improve the look of your map alot!

ok, now switch to undergrowth mode, and under the render menu, switch it to undergrowth mode also (turn on the rendering of undergrowth in there too!). if you did not set up any undergrowth types, now would be a good time! once your happy with the undergrowth settings you have, switch to overgrowth mode (switch to overgrowth in the render menu, and turn overgrowth on, and undergrowth off)

again, if you did not setup any overgrowth types do that now.

change the density settings so that the overgrowth is to your taste!

ok, now Im sure you wanna jump right in to BF2 and take a look at your level but theres a few things we must do first (some obvious, some not)

the most obvious is we need to add some control and spawn points (perhaps a helicopter or two?)

whenever I create a new level, I always add a combat zone, this seems to help prevent the dreaded "terrain-of-death" where you take damage till you die. just create a simple square combatzone that surrounds the entire map.

ok, before we go any running off into the wilderness, we need to compile a few things so battlefield doesnt have a hissyfit!

start by compiling a lightmap for the terrain, the settings dont matter too much, as long as the ENTIRE primary terrain is done.

next compile a particle atlas, then a decal atlas. finally generate a ground hemi... using the default settings.

OK, now all we need to do is save.

take my advice here seriously, choose the SAVE ALL... option and make sure that EVERY SINGLE option is selected, even though you dont have roads etc. this is for a very good reason!

doing this makes the BF2EDITOR to recreate prettymuch everyfile for your level from its loaded resources. this fixes alot of those wierdo problems you can get loading a level!

alrighty, its party time, P... A... R... T... Y? because I gotta!

sorry LOL

jump into Battlefield 2, and marvel at your god like ability to create mini worlds!

screen006.jpg

screen005.jpg

screen000.jpg

ok, there you go, complete terrain for building your level in, without actually painting anything in the editor at all!

now I would like to stress, that after trial and error for over 8 hours, the level you see in the images, and the hieghtmap I used for this tutorial were not exactly cool! I mean it still looks cool, but its not very practicle

Share this post


Link to post
Share on other sites

This is superb!!!!! :!: :!: :!: :!: :!: Very nice and clear tutorial. I'll try this at once!

Edit: you should post this in the user tutorial section. This way it won't be lost very quick. :)

Share this post


Link to post
Share on other sites

I've been doing this for a couple months, so I thought i'd give you a tip. With under and overgrowth, each 1+ in rgb (as in color property how much red, green and blue it has) value from 0 indicates another type of under or overgrowth going up to 15.

When I do it I generally use only 5 different types of under and overgrowth as you generally have to desaturate the file in photoshop as terragen despite only having gray will render colours with higher red or green or blue than you put down making it not perfectly gray. When you have 5 different types (with each being 3 rgb values apart from eachother) you are able to space the under and overgrowth enough so that you don't have the right under or overgrowth in a particular place.

So, I have one gray with a value of 3 for red, green and blue and then I will have another with a value of 6 for red, green and blue, and so on. Hopefully you can understand that.

Share this post


Link to post
Share on other sites

I cant get teragen to render a flat color image. Im a relative newbie to terragen, so Im probably missing something.

I was thinking of doing what I have stated above, but doing it several times for each undergrowth/overgrowth areas and then compositing the images into one image.

your way sounds easier, but I dont understand how to get terragen to create an image in flat color mode.

Share this post


Link to post
Share on other sites

Nice tutorial Templargfx!

Instead of calling TPaint to split the detail and colour maps you can call tsplit directly:

bf2_tsplit [detailmap] [colormap]

eg.

bf2_tsplit detailbig.tga colourbig.tga

but you have to make sure that the folders: "colormaps" and "detailmaps" exist first.

Share this post


Link to post
Share on other sites

I tried doing this several times, but for some reason, it would not use the entire image, I dont know why it wouldnt work for me, which is why I use the tpaint program instead. perhaps I was doing something stupid LOL

Share this post


Link to post
Share on other sites

Very nice tutorial. I'm moving it to the user tutorials section.

As soon as I have time, I'll look it over and may contact you to turn it into an "Official" tutorial. You of course would be given the credit;)

Share this post


Link to post
Share on other sites

That would be awesome.

should you decide to make it "official" I would of course spent a little more time making it a bit more easy to read, and more concise!

thats cool! LOL

Share this post


Link to post
Share on other sites

Very nice Tut, I have been practicing a lot in terragen, this program is worth every cent. Rise of Kobol will have every level done in terragen.

Also, here is my tutorial to get material ID's to work after creating custom color/detail maps. This will work post this tutorial. Custom Color/Detail maps and Material ID’s Tutorial

Share this post


Link to post
Share on other sites

Dude, ur making me go :shock: ! I didnt know Terragen could do this, ur making the map quality rise 500% if everyone starts to use Terragen! If we knew this for Bf42, we could have a lot more nicer maps ;) Ought to try this myself too!

Keep up the nice discoveries and let us know if you discover any more ;)

Share this post


Link to post
Share on other sites
...

now we need to change the surface map and lighting to generate our detailmap.

detailmaps use colors to designate what material layer in BF2editor goes where, so we need to change the surface colors to match.

The reason we use only 3 types of detail is to make things nice and easy!

change the areas you want grass detail to pure blue, the areas for rock to pure red, and the areas for gravel to pure green. make sure you slide the bumpiness and mimick terrain sliders all the way to the left

settingupsurfacefordetail.jpg

open up the lightsettings again, and change the sun intesity to 255%

lightfordetailmap.jpg

this ensures that the colors are infact there pure versions.

once this is done, render the image again for some funky pyskodelic action!

once its done, save the file into your levels folder

savedetail.jpg

Awesome tut! This is actually very close to how we made the official maps at dice. Apart from the under-/overgrowth and that we used Blue=Rock, Red=Gravel, Green=Grass :D. Though you missed one important step.

50174695_06f2dff40f.jpg

Each pixel of the detailmap must have a sum for RGB of 255. The easiest way to do this is to convert it to a indexed palette that looks like this:

50167229_9ed8dab23d.jpg

Convert it back to RGB.

If the total RGB value for a pixel is higher than 255 it will be overbrighted. If its less, it will make your terrain darker.

50173571_7b04a45e11.jpg

Also try to make the colors as clean as possible. Its better for the performance.

Otherwise great job!

Oscar

Share this post


Link to post
Share on other sites

templar awesome tut man! i was supposed to write one on how i did my colormaps, but this is much more exact and frankly alot more info. gonna have to try out the overgrowth and undergrowth thingie you got there. good work man thanks!

Share this post


Link to post
Share on other sites

:idea: might also add to the realistic distribution of under- and overgrowth:

by increasing or decreasing a (color-)selection of black or white (befor colorchange for exactly picking the color) to extend the area grass or small rocks cover and to prevent small spots from getting trees placed there (you may want to smooth out the selection for tree-distribution as well).

great tutorial !! :D

Share this post


Link to post
Share on other sites
savehieght2.jpg

Its about time to save our heightmap, click the EXPORT button in the Landscape window and choose these settings

and then save your hieghtmap into mods/bf2/levels/*MYLEVEL*/ overwriting the HeightmapPrimary.RAW file.

Yea i have a question here...

Are we saving the hirghtmap into the level's folder here... or is there supposed to be a hieghtmap file to select in my terragen folders?

Because you cut off the pick a litt short so can't see what directory you are selevting the Primary Hieght Map from...

((P.S. And you need registered version to render the map image... can I just use photoshop to enlarge a smaller render to the right size or.... :( I don't have $99 to register with))

~NeVaR~

Share this post


Link to post
Share on other sites

not sure how that helps me...

Ok after reading and re-reading the damn tut over and over (which is awsome and I love you for writing it) I got my terrain into BFEditor, textures seem to show up ingame but all the stuff is one filled in texture... I think this is because of me main material in terragen.

I have to toy with it more.

But the main issue i ran into was at under and overgrowth... I got the map files done wasily enough, but I the Editor won't render any under or overgrowth... maybe I just don't know how to propperly set up growth?

Anyways ignoring growth I aded the spawn points and stuff to my rugged desolate rocky canyon, and saved ALL

made sure all things were checked, and had the lightmaps and such compiled, though it failed to compile the TV Station's lightmap... but I ignored this.

Got the atlas' created, but it wouldn't load or read, or create a Overgrowth Atlas...

So I saved again and attemted to test it anyways...

The map crashes when loading objects... about.... 1/10 of the way loaded.

:(

~NeVaR~

((P.S. awsome tools and the terrain imported well... really cool tut even if I wasn't perfectly successful on my first try...))

Share this post


Link to post
Share on other sites
Sgt.Wedge]using the Firmament plugin you can import your 16bit HeightmapPrimary.raw into terragen

http://www.mclusky.co.uk/firmament/

I wouldn't recommend Firmament, but that is just my personal opinion. I find it's capabilities too limited, and the importation quality, well, to put it blatant, sucks. However, I can highly recommend TerraConv. The reliability and quality of the imports simply stomp Firmament into the ground.

By the way, great tutorial. One thing though: you can achieve a lot better quality color textures by using SOPack and using the texture overlay feature. Perhaps I will write a mini-tutorial on it later.

mschoeldgen:removed my virus warning

Edited by mschoeldgen[Xww2]

Share this post


Link to post
Share on other sites
I wouldn't recommend Firmament, but that is just my personal opinion. I find it's capabilities too limited, and the importation quality, well, to put it blatant, sucks. However, I can highly recommend TerraConv. The reliability and quality of the imports simply stomp Firmament into the ground.

thx!, I'll try this one :D

Share this post


Link to post
Share on other sites

When I load my level back into Terragen, I simply open it into photoshop first, and change it to 8 bit, then save it again.

lets face it, the terrain your creating cant be super detailed simply because you need to be able to drive and whatnot on it. I dont find that I lose anything from the terrain when doing this. but thats just me.

If EA decides to go ahead and make this "Official" I will re-write the whole thing making it alot more thorough and easier to understand. So those having trouble, never fear!

NeVaR:

All files are saved into your levels folder eg :

*BF2INSTALLDIR*/mods/bf2/levels/*yourlevel*/

hope that helps

with your undergrowth/overgrowth problem. did you follow the steps so that you undergrowth and overgrowth images both only have the 2 colors : Black, and nearly black (R15,G15,B15)? if so, then make sure than you have chosen material color 15 (really dark grey) in the BF2EDITOR.

under the render menu, switch to overgrowth mode and see if your map has sections of the dark grey on it. if it does, but your still not seeing any overgrowth. check how your overgrowth material is setup.

make sure that you have added at least 1 type of overgrowth. and in the tweaker bar, chosen a mesh for the overgrowth type, and also changed the density so that you get some on the map.

also do this for your undergrowth.

with the crash to desktop problem, run battlefield 2 in a window (edit the shortcut, and change the +fullscreen 1, to +fullscreeen 0.

when it crashes to the desktop it will give you an error window first.

if you cant work out what the error means, post it here, and let us take a look!

Share this post


Link to post
Share on other sites

Alrighty, thanks to a tut on over and undergrowth I got that working... now I am attempting the tut again and noticed in Terragen you can make water areas... will this method work with water?

Share this post


Link to post
Share on other sites
When I load my level back into Terragen, I simply open it into photoshop first, and change it to 8 bit, then save it again.

lets face it, the terrain your creating cant be super detailed simply because you need to be able to drive and whatnot on it. I dont find that I lose anything from the terrain when doing this. but thats just me.

I would not suggest saving the heightmap in 8-bits. You loose alot of detail in your terrain. 8-bit grayscale contains only 256 shades of grey, while 16-bit holds 65536 shades! Lets say the mountains in your level are 256m high, then you will get terracing every meter. :cry:

Oscar

Share this post


Link to post
Share on other sites
:D Hi i quickly scanned through this tutorial, but i have one question... maybe you did already show us but i missed it.... in BF2 when ur running on the ground... you notice that the grass just appears like maybe 20 feet in front of you... and when you think your hidden in grass someone far away can see you as plain as day.... is there a way to increase the LOD distance for the grass? so that you still stay hidden even if your like 50 meters away???

Share this post


Link to post
Share on other sites

You can do that by changing the viewdistance of the undergrowth (same with overgrowth). It's one of the options. But be carefull, I experienced some lag when increasing it tooooo much. It also doesn't seem very natural if you see the grass waving from a distance of 2000 m, lol. When I increased the viewdistance, I also experienced a CTD, but only once. So you have to be carefull with it apparantly (could have been my own fault off course).

Share this post


Link to post
Share on other sites

Now you may kill me for this stupid question but I can't figure out how to reduce the colors of the image to two (you know, for the under and overgrowth map). Also replacing white with that very dark grey doesn't seem to work after changing to greyscale. I end up with a sort of purple in the editor and I'm pretty sure it's not ment to be that way :?

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

×