BeamNG.drive

BeamNG.drive

View Stats:
Aeva May 4, 2018 @ 2:19am
Align terrain with mesh road?
So I'm working on a map currently and I'm having trouble figuring out the best was to align the terrain with the edge of the road. As you can see in the image, the road and terrain are at different heights, which apart from being aesthetically unpleasing, also bursts tyres if the track is left and re-entered.

I'm aware of the "align with mesh" tools in the terrain editor, but all of them have a tendecy to create jagged egdes that are difficult to work with.

https://i.imgur.com/LrwASQ1.jpg

Any help is greatly appreciated
< >
Showing 1-5 of 5 comments
Apolepth May 4, 2018 @ 2:24am 
If you want to align the terrain with road then you need to raise the terrain to the road edge level ans smooth it if you don't want to use align with mesh tool or use terrain height
Last edited by Apolepth; May 4, 2018 @ 2:26am
Aeva May 4, 2018 @ 2:34am 
That's the issue. That's what I've been doing and it just isn't precise enough. It's a nightmare to do on a track with a 100m height difference range
Nadeox1 May 4, 2018 @ 5:42am 
We don't have a proper road tool yet.
What you can do is use the smoothing tool, after the allign one.

If you want much more control over your roads, you can use Blender (which is what we use for our levels). More complicated, but the results are very good: https://www.beamng.com/threads/tutorial-adding-heightmap-roads-with-blender-v2.39903/
The way I do it is this. You'll want your decal road drawn out where you want it to go. Then go into the MESH road tool. We're only going to use this mesh temporarily but the decal road will stay when we're done.

The average road is 8 units wide for typical 2 lane country road with striping on it (lines showing lanes, white and yellow/orange).
Make a mesh road (use toolbar at top to set size) that's 0.5 meters deep but 20~24 meters wide (to give you lots of room later), and lay it over the terrain by creating a new road and using LOTS of nodes to make it easy to bend around. IT won't bend as tightly if you have a wider area so you may want it narrower, or in the case of a large multi-lane road or highway, even wider yet. If you have a two lane road, make the mesh road 3x the width of the road.

Get it set up the way you want it, by looking from the side to see your grade of the hill (you try to keep it even for a realistic main route, or more varying hills for a back farm route). Highways shouldn't have more than a 5~8% grade, anything over 7% is actually grandfathered in from the 50's~60's. So do take care to make it realistic.
Now's a good time to bank your corners, get close to road level to see what looks right, or look at some pictures on the internet (google street view can be useful here), of a similar road for ideas (I can't stress this enough, it helps a LOT to have a source scene from a real place to model after).

It's optional to have the decal road drawn on the terrain already at this point, it can be helpful, but you can put it in after if that's what you like.

You can use the 1st tool in terrain editor (where you pull or push the terrain up or down with the mouse), to make some rough adjustments so your road grade isn't so radically different then the terrain, if needed.

Once you get everything where you want it, go ahead and set the break angle on the mesh road's properties and set the width divisions too so it doesn't kink up as bad before and after corner banking areas. If you have a good processor (recent i5 or i7 of 4xxx series or newer), set the break angle for 0.02~0.1, and set width divisions so they're 15~64 of them depending on if you go with a recommended size of 20~24 or much larger (a highway could be easily as wide as 70+ meters due to median and multiple lanes and shoulder room, and set-backs on each side). The smaller your break angle, and the longer/wider the road, and the larger your cursor size, the more CPU power it will take to smooth the road. It might go 2FPS so make the tool smaller or raise your break angle to maintain a responsive editor interface.
If you have the break angle 0.02 and use over half a mile of mesh road at once for carving purposes, the max amount of surfaces on a mesh may be reached and you will end up with odd rendering. Use more than one mesh road if needed just pay special attention to where they intersect so there's not a nasty bump when you're done.
Keeping the mesh road nodes fairly equal in distance apart helps keep them from bending wrong and kinking up. If they kink up they will not respond or level as well, and also the 'add node' feature in the mesh road tool won't add the nodes in the right place. If that happens, work out the kinks, loosen your corners a bit and even out your node spacing, and try again.

Use the RAISE and LOWER terrain TO MESH tools to raise or lower the terrain to the road surface of the road in the terrain tools. These will carve the terrain to where you put the mesh road. This way we can get rid of the mesh road, leaving the decal road when we're all done.

At this point, you'll want to have your (decal) road in by now if you haven't so that you can go ahead and see if your carving looks up to par or where it doesn't look so good when you think you're far enough along with carving.
If it all looks good, get your road surface smooth so that it's nice to drive upon. You will have a harder time touching up your road surface later than you will now. Since we've leveled more terrain than just the width of the road, make a smoother tool the size of the road, and go over the beginning and end of your corners with it, where the banking begins and ends. Get down close to the road surface (like bumper height) with the camera to see any imperfections and humps in the road. You'll want to test with a smaller or rough-riding car to find bumps later.
You can go into the f1 object editor and click your mesh road and move/hide it under the terrain temporarily to see if it looks nice, if it does, leave it hidden for now below the terrain. If it doesn't look good, tap CTRL+Z on your keyboard to undo once, and it should return to being at road-level. You can now switch back to the terrain tools and keep carving if needed.


Now once you have the decal road exactly where you want it, and the mesh hidden, now you can smooth the sides of the road edge nicely. This is why we make the road extra wide. There needs to be a little 'breathing room' on each edge so that we have something to level to (from the road surface to the original terrain height), without marring the road surface. If while smoothing you get too close and bite your road, CTRL+Z to undo is your friend. Just try to be careful. Once it's all done you can make sure it's asphalt textured underneath the road (F3 terrain painter tools, for traction), and try driving on it. You can leave your mesh road hidden until it's time that you feel you won't have to mess with the road anymore, or just remove it before you release the map. They do take time to render, so it's best you get rid of them all (if you've done a few) before you go ahead and upload it to the server for the mod repository on beamng website.

I hope you folks appreciated this tutorial. I think you may wish to look up the 'something about roads' thread on the website. I was involved with it and it says the same thing.

Check out my Roane County TN USA featured as 'TENNESSEE' on Beamng.drive website. Feel free to use my ROAD textures from my map. There's sets for several types of road networks in there and almost any texture you could ever want for almost any configuration. Take a look around my (huge) map to see what works and how it goes together. Don't forget about invisible AI guide roads for the AI if you make complicated intersections like I do that make the AI look like a dummy.

--Cheers
Last edited by Los.Injurus.Bob.Blunderton; May 4, 2018 @ 6:13pm
Aeva May 5, 2018 @ 6:39am 
Thanks guys! I'll be sure to try out all methods mentioned.
< >
Showing 1-5 of 5 comments
Per page: 1530 50

Date Posted: May 4, 2018 @ 2:19am
Posts: 5