Curved Roads

Tutorial collection, comprehensive listings on main site.

Curved Roads

Postby Tutorial on Sat Dec 12, 2009 12:01 am

category
General Half-Life 2/Architecture

description
Using displacements to create curved road effects.

keywords
roads, terrain, curved roads, displacements, ramps, ground, curves, advanced, arch, ramp, vertex.

First, I'll clarify on what this tutorial is to be used for. Curved roads, in most cases, should be made of displacements. But when the curve must move up or down vertically while curving, this is the best way to do it.

Image

Ok, I made a tutorial to show the right way to do roads like the ones in the above picture. The problem with using displacements for this is that the two end points can't lie on the same plane as the roads attached to the ramp, meaning no sewing. It is possible to do this with displacements, but you'll end up with cracks and seams and messiness somewhere along the line. So here is how to do it cleanly with brushes:

Image

Make an arch, roads are 512 units wide usually but I made this road 256. I used 1024x1024, any power of 2 will be ok. My arch is made up of 32 brushes.

Image

Clip the arch in half.

Image

Clip every rectangular brush into triangles like so.

Image

Get out the vertex tool and select the first 2 points of the arch using the TOP view. You HAVE to drag and drop to make a box around each square, then hit enter to select it. Hold control to do this multiple times. If you don't do this, you will miss some points because more than 1 brush will have a corner lying on that point.

Image

Move the TOP 2 selected vertices down to where you want the ramp to start.

Image

Now find out how long the distance is between the top of the ramp and the bottom of the ramp is. Mine is 512. Divide that number by the the number of brushes your arch was made up of, in my case 32. 512/32=8. The number you get, in my case 8, is the distance between each level of brushes. Select the next 2 points and move them so they are 8 units above the first set (in my case, of course). The next pair of points will be 8 units above the previous as well, so they'll be 16 units above the start of the ramp. In the screen shot above, I've got 3 pairs of points done. Do all of them so you end up with this:

Image

Here's the finished ramp. You may want to clip the bottom off where the curve starts. To texture it, you'll have to do the rotations by hand for each face and then select them all and align them to the left. STOP CRYING AND POUNDING YOUR FISTS ON THE KEYBOARD, IT'S NOT THAT BAD. I textured and completed this little scene while I was uploading the pictures for the tutorial:

Image

Image

As you can see, lots o' potential for mountainous winding roads.Whatever you do, just MAKE SURE YOU TURN YOUR RAMPS INTO FUNC_DETAILS.

Now, as for adding the cliffs. In the screen shot above, they are brushes and they are ugly. For seamless displacement cliffs, you'll need to:

Image

Start with your ramp. Put a cylinder in the middle that meets all the inside sides of your ramp.

Image

Clip the cylinder in half, then clip from the center of the cylinder to every point on the outside of the cylinder. I also moved the cylinder up a bit.

Image

Using the vertex tool in the top view port, select the outside points of the cylinder one by one and drag them down to match the ramp. When you're done, move the point in the center of the cylinder to half way between the first and last point on the ramp.

Image

Finished! Now clip off the bottom of that mess and TURN IT INTO A FUNC_DETAIL. You now have ground by the road that will prevent seams from forming while you make displacements. Without them, you'd have to push all the displacements into the road to avoid seams. As an alternative, you could just use a displacement and fine tune it to about where the cylinder is now. You won't be able to sew it though, so this won't work in all situations.

Image

Block out your displacements. If you don't know how to do this, take a look at some displacement tutorials on the website. In particular:

http://www.interlopers.net/tutorials/30687
http://www.interlopers.net/tutorials/16891
Image

Subdivide.
Image
Shape your displacements until they look nice and swell.

NOW, this is all well and good for cliffs on the inside of the curve but what if we needed them on the other side of the road? Basically you would do the exact same thing, but instead of using a spiraling cone to cover the seams, you would use another ramp that fits around the outside of your road. Here's how that would look:
Image

Image

The alternative to using brushes, like I mentioned earlier, would be to use displacements under the road and aligning them by hand. Both methods will work in certain situations. Displacements are the better choice when you need to have terrain on the side of the road. Here's how to use displacements for ground under a curved ramp:

Image

Block out the displacements. The six faces on top are the only ones you need, I added the rest for cliffs.

Image

Subdivide. The ground won't be level with the road.

Image

Now the dirty work. Paint your geometry so the displacement sit a little below the road all the way up the ramp.

Image

By request, I'm adding this section on banking roads. It seems like something that would be fairly easy to do with the information above, but there are a few problems you'll come across unless you know what you're doing.

Start out with a triangulated arch, just like everything else we've looked at.

Image

Using ctrl + drag and drop select all the vertices around the outer edge of your road and raise them to make however steep of a bank you want (but PLEASE keep it on a power of 2 or things will get very messy later on)

Image

The banking road is done, but unless you're making a banking circle you will need to make a transition from a flat road to the banking road. This is where it gets tricky.
Make a UNIFORM 4x4 grid of brushes in the shape you want your transition piece to be. Using the vertex tool, move the outermost points into a slope like this going from the flat road to the top of the banking road:

Image

Now we have one column of the points finished, but we will now be working in rows. The first row that is touching the flat road will be flat. The second row from the flat road needs to be raised into a slope that goes from the first point (on the right in my screenshot) to the far left point which is already raised. To do this, you need to adjust your grid using the bracket keys so that each unit on the grid is one fourth of the height of the far right point on the row. This means if the far right point is raised 32 units up, you will work on a grid of 8. Select the point 2nd from the left and move it up 8 units (in this case) and then select the point 3rd from right and move it up 16 units and so on. You should now have a slope going up the far left column and another slope intersecting the first like this:

Image

On to the third row. This one is a bit trickier, because you need to move each point up an amount that is a multiple of three. All you need to do is adjust the grid so there are 12 grid units between the first and last point on the row's slope. Now you'll move the second point from the left up 3 grid units and the third from the left up 6 grid units, then move the fourth up 9 grid units.

Image

Finish off the fourth row and you are done.
Image

Image

-Corey Androski
- Don't send PM's to this user -
Tutorial
Not A Real User
 
Joined: Sun Mar 06, 2005 11:00 pm

Re: Curved Roads

Postby Major Banter on Sun Dec 13, 2009 1:45 pm

Astonishing detail and excellent examples. A bloody good tutorial.
ImageImageImage
Major Banter
Veteran
Veteran
 
Joined: Tue Apr 01, 2008 10:52 pm
Location: UK

Re: Curved Roads

Postby GenghisTron on Tue Dec 15, 2009 3:28 pm

Great tutorial, this will definitely come in handy.
GenghisTron
Dumpling
Dumpling
 
Joined: Mon Nov 23, 2009 4:06 pm

Re: Curved Roads

Postby LuaPineapple on Fri Dec 25, 2009 9:02 pm

Just would like to point out that 512/32 = 16, not 8. :P Very nice tutorial none the less.
LuaPineapple
Member
Member
 
Joined: Sun Jan 14, 2007 9:05 pm

Re: Curved Roads

Postby BaRRaKID on Mon Jan 18, 2010 12:26 pm

Sarry to bump this, but it will probably save some time to change the "step" value of the arch tool. That way the different blocks of the arch will already be at the correct height and you just have to join the corners.
I've no sign
BaRRaKID
Veteran
Veteran
 
Joined: Sun Oct 10, 2004 1:46 pm
Location: PORTUGAL!!!

Re: Curved Roads

Postby Increazon on Sun Mar 07, 2010 7:10 pm

I will read this tutuorial. I trying to make road as a model, but stack on collision model (it must be concave). So it is what i need to!
Increazon
Dumpling
Dumpling
 
Joined: Sun Mar 07, 2010 4:41 pm

Re: Curved Roads

Postby ThorSummoner on Fri Apr 02, 2010 1:11 am

I'm sorry to point this out but it is in fact very possible to still have sewn displacements in 3-space. This tutorial is very handy for lots of architectural needs a mapper may need, but i still have to say, displacements are the way to go.
I can't go into to terribly much detail here, but using vertex manipulation to make the roadway placement then making it all displacement maps still works. If you care to look at the roadway in HL-ep2 that is taken to the launching silo you will see switch back displacement maps of roads almost (if not the entire) way there. Again, thanks for the insightful tutorial.
ThorSummoner
Dumpling
Dumpling
 
Joined: Mon Aug 10, 2009 8:48 pm

Re: Curved Roads

Postby nub on Fri Apr 02, 2010 2:53 am

I never thought of such a thing. It's like you took a brush and manually made it in to a displacement by cutting it in to triangles, very smart idea!

Valve should add a feature where using vertex manipulation on a displacement lets us manipulate each point, rather than the corners of the original brush. That would allow us to save time from having to cut a brush up in to triangles.

There's a program called DispEd that lets you generate perfect corners with displacements, and the texture fits on it perfectly, but getting it to measure out correctly is a pain in the ass. Additionally, certain issues could arise and you might have to ditch the use of displacements to fix this, thus your tutorial is a great alternative.

A brilliant tutorial. Great work, and thanks for sharing.
User avatar
nub
Veteran
Veteran
 
Joined: Tue Nov 15, 2005 1:11 am
Location: Charlotte, NC, US

Re: Curved Roads

Postby MayheM on Tue Aug 24, 2010 5:16 am

Nub, back in the olden days before displacement brushes in hammer we had to make displacements like this.

I made a map called cs_waterside and it was almost entirely made like this. a ton of triangles and arrows nudging the points. Anyone who mapped back then will agree displacements are a gift for the heavens...
Image
User avatar
MayheM
Veteran
Veteran
 
Joined: Tue Oct 16, 2007 7:46 pm
Location: Lancaster SC

Re: Curved Roads

Postby TorQueMoD on Wed Sep 03, 2014 7:14 am

No disrespect meant at all as this is a fantastic tutorial but you'd probably be better off making roads like this out of your own custom static meshes. Would likely be a lot faster to put together.
-TorQue[MoD]
Environment and Game designer
http://www.torquemod.com
User avatar
TorQueMoD
Been Here A While
Been Here A While
 
Joined: Wed Oct 19, 2005 7:15 am
Location: Vancouver, Canada

Re: Curved Roads

Postby Kosire on Wed Sep 03, 2014 2:50 pm

TorQueMoD wrote:No disrespect meant at all as this is a fantastic tutorial but you'd probably be better off making roads like this out of your own custom static meshes. Would likely be a lot faster to put together.

This tutorial is from 2009...
User avatar
Kosire
1337 p0st3r
1337 p0st3r
 
Joined: Sat Mar 07, 2009 7:25 pm
Location: Denmark

Re: Curved Roads

Postby Gary on Thu Sep 04, 2014 1:03 am

TorQueMoD wrote:No disrespect meant at all as this is a fantastic tutorial but you'd probably be better off making roads like this out of your own custom static meshes. Would likely be a lot faster to put together.


Maybe faster for a modeler. But you'd still run into issues with any Source game before CSGO. Even then it might not. I don't know CSGO too well. But I know that in any other Source game; that static mesh roads, or any large structure the player is close to. Will be poorly lit. The best you can get with static meshes is per-vertex lighting. Only light source that would be usable with it is the flashlight/ env_projectedtexture entity since it can light per pixel.

I do wonder if you subdivided a road mesh enough though. If it would look decent.

Someone want to make me a compiled and textured model of a short road ( maybe like the one in the tutorial?). One subdivided(not more than 75k polygons)
Have a question related to modding or something I posted? Something that needs staff attention? I haven't been active lately, but feel free to PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: Curved Roads

Postby [KIRBY] on Thu Sep 04, 2014 4:43 am

I will give it a go, I dont think you can go much above 30k poly anyway, but I know that source has no problem handling highpoly stuff
to make it more interesting I will model it for ep2 and see what happens
I am pretty sure it will take more time to work on collisions than to work on lighting, especially when someone is going for cracks in the road
User avatar
[KIRBY]
Regular
Regular
 
Joined: Tue Dec 17, 2013 1:59 pm
Location: Manchester

Re: Curved Roads

Postby [KIRBY] on Thu Sep 04, 2014 7:23 am

alright posting some progress, have not checked lighting yet, collisions work, model is driveable, and its made to fit hammer units, road is 384 units wide
Image
User avatar
[KIRBY]
Regular
Regular
 
Joined: Tue Dec 17, 2013 1:59 pm
Location: Manchester

Re: Curved Roads

Postby Gary on Thu Sep 04, 2014 1:10 pm

Very nice. I am curious how it looks with lighting. And I wouldn't mind playing with it myself if you wouldn't mind throwing the model my way. (Via PM or whatever)
Have a question related to modding or something I posted? Something that needs staff attention? I haven't been active lately, but feel free to PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL
Next

Return to Tutorials

Who is online

Users browsing this forum: Bing [Bot]