Integrating Vector Data - Roads

Published May 25, 2010
Advertisement
You may remember an earlier blog about roads where the approach and algorithms for creating spline based roads were outlined. At that time it was just a concept of how it may work, with many unresolved issues.

In the past weeks I occupied myself with integrating the road system into the engine, making it more robust and powerful on the way. The road way points now contain additional information such as road type, width, marking style and more that will allow to make a variety of road types, also including forest roads with ruts, for example.

As you can see on the following screenshots, the roads are completely integrated into the terrain - no terrain poking through the road surface ever. The integration also modifies the surrounding terrain to make the embedment natural. Side of the road is initially smooth up to a specified border width (can be specified per road spline node), and after that the fractal roughness gradually takes on.




Depressions are filled and an embankment is created.



Routing road through a rock or hill makes rocky slopes with defined steepness on the side(s).



Some screenshots showing the creation process and the results, from various level of detail.




Trees are automatically removed from the road surface and its border area, although sometimes you can see branches hanging over the road.



Splines allow for some mad but still fitting roads too :)





Terrain under the road is initially roughly prepared - gaps are filled and excess volume is cut out. This is being done at tile with resolution ~10m, so that fractal algorithm can refine it down naturally. Previously, when the road cut into a hill, the cut was unnaturally smooth. Now only the road border is smooth, gradually transitioning into a rougher fractal structure.

In the following screenshots you can see the process documented:


I. Placing the waypoints - this is currently being done as you move over the terrain pressing a build-road key, later a built-in editor will allow for better editing modes and options.




II. Rough terrain treatment - note this is actually hidden within the process, I've visualized it here just to show what effect it has on the terrain.




III. Finalizing the road





The engine has no problems with terrain resolution (as is apparently the case with many planetary engines), to the extent that asphalt can have actual thickness - I think it's 3cm now (~1.2inch).




Other notable features are

  • vector data are automatically cut and indexed to quad-tree managing the terrain

  • overlay dirt textures per road type

  • roads can connect, additional helper code will be needed to adjust the spline points and their attributes so that the connection is smooth

  • the same system is also used for terrain leveling, with or without pavement placing or with gravel surface etc.



Finally the process can be seen on the YouTube video. Original uploaded video was 500MB with good quality, but the recompression step on YouTube reduced it considerably.

">


The same system is used also for runways, here's a teaser screenshot for upcoming video where Angrypig tries to properly land at .. you can guess where this is from :-)




The corresponding discussion topic on Outerra Forums can be found here
0 likes 7 comments

Comments

LogicalError
Awesome work!
Looks great :)
May 25, 2010 07:01 AM
MickeWi
Holy crap, this is amazing!

When comparing the screenshots with/without roads it's clear that the roads really add alot.
May 26, 2010 05:29 AM
NineYearCycle
Wow congratulations those are some very nice results! Much better than anything I've achieved with roads on terrain.

You mention an editor, but will you be able to import (suitably pre-processed) road maps of some form? There are large existing datasets or road and terrain and I assume your editor will to load and save it too.

Also, will you add support for automatic/optional bridge creation eventually.

Excellent work so far though, this journal is a lot like Ysaneya's in that every time there's a post I'm blown away by it! :)

Andy
May 26, 2010 07:08 AM
cameni
Thanks guys.

Yes the import is possible, the way points can be defined in various ways (3D pos, lat/lon). So it will be simple to take a database where the roads are defined as series of points on a spline, throw it at the engine and it creates the road, generating the internal representation in the same way it does it now when the point coordinates come from the current world position.

Another approach would be to edit the road in the embedded browser using Google maps, with &#106avascript on the web page calling the engine functions for inserting lat/lon way points. In fact the only thing that keeps us from that is finding the time to write that small piece of &#106avascript [smile] <br> <br>The bridges should not be a problem, but I'm thinking how to generate them in a similar way the roads are being done, by generating bridge segments. That would allow for curved bridges too, but could be mainly useful for highway ramps.
May 26, 2010 08:23 AM
dgreen02
Wow ... absolutly amazing ...
May 26, 2010 07:57 PM
kudi
just one question about the 3cm... this elevation, is it in the heighmap? or are these seperate vectors representing the street?
June 30, 2011 03:26 PM
cameni
Separate vectors that define the roads, height is generated from them with the 3cm asphalt layer
July 07, 2011 10:40 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement