Game Development Community

How to create highways (not trail) on the terrain

by Mahmudul Hasan Sohag · in Torque Game Engine Advanced · 10/16/2007 (3:03 pm) · 9 replies

Hi,

can anybody say what is the most effective way of drawing roads (highways) on a terrain? There are 2 options I think ..one is to blend a road texture on the terrain and another is to make the roads .dif and then loading it.

what do you think?

thanks
shaon

#1
10/16/2007 (3:08 pm)
We are planning to use .dif and load them. You could use a blended terrain and define the roads using one of the alpha layers with an appropriate texture. The problem with the latter, in my opinion, is that with only four layers you loose 25% of your detail to make roads. A final option is to use a unique texture that already has the roads drawn on it. However it is very difficult to get a really sharp, high resolution unique texture so your roads will probably look blurry.
#2
10/16/2007 (3:25 pm)
(Not exactly about texturing, more about the terrain height modifications under the road)

There was a previous thread about "burning" roads into a terrain height image via application of alpha masks. An associate of mine noticed a nifty tool to automate this. It has code to help you lay out the routes, raise the terrain or lower the terrain to control the smoothness (e.g.: places "fill" to keep the road level as you cross a valley), input of the size of road borders, handles crossroads, etc.

http://www.shapemagic.com/roadmaker/

Even if you want to use object pieces for the road eventually, this might help set up the grade and borders into the terrain, or to burn a ledge for the road into a mountainside, etc.
#3
10/16/2007 (3:31 pm)
@Dennis:I agree with you. I lose the details of blended terrain if one is wasted in creating roads and I dont want to use a unique terrain as the terrain I am working on is huge about 4km X 4km.so the unique texture must have to be large.

@Mathew:Thanks for the tool.I will give it a try.

thanks
shaon
#4
10/17/2007 (10:49 am)
I would actually use a DTS rather than a DIF for the roads. Was there a reason you were using one over the other? DTS has less complex collision detection so would be a lighter "load" on your game when many of them are implemented. We had a lot of success using a flat DTS model with Transparency and Normal Mapping for a fairly good-looking "stone path."
#5
10/25/2007 (6:37 am)
Blended terrain can only use 4 texture? you can use as many as you want ( or untill you have no Ram left)
#6
10/25/2007 (6:56 am)
Already at 8 the performance will suffer seriously.

It would be simpler to take the DecalProjector, create a new class based on it (detailProjector potentially) and use that one after you give it a usefull editor integration.
#7
10/25/2007 (2:27 pm)
@David : As far as I know pixel shader 3 will allow you max 16 sampler so its not actually unlimited.. ;) and the more texture you use the performance degrades.So I need something that wont lower my fps.anyway thnks for ur time.

@Marc : Your idea seems nice.can you provide some details about it?

thanks
shaon
#8
10/26/2007 (5:02 am)
What we right now use is still the default decal projector class.
But we added use the possibility to make them stay alive forever.

This allows our designer to just place the path decals on the terrain.

This sadly is only a temporal solution.
The terrain detail decals would need to have subdivision to wrap around the ground, at the moment they are only a plane. That or alternative quite small decals and place more of them.

If the editor would by default support a continous decal draw, this would be extremely simpel to do.

This should work for roads if the terrain is done accordingly.
otherwise, using "lego like" road parts (DIF or DTS) which you place and align to each other, might be the better solution if you want really "flat roads"
#9
10/26/2007 (11:23 am)
Hmm I think the dif would be the best soln for the current engine.

anyway thanks
shaon