Real world track building!
A few people have asked how Rush Rally 3 is such a small install size considering it has 20 cars, 80+ tracks and delivers a AAA experience on the mobile platform. I'm now working on an update which will deliver a set of new tracks, which are still largely undecided on at the moment. However I will be adding some new tracks based on real life spline data, just like the 12 mile track of U.S.A. in this game. So here is a quick insight into the work behind creating a new track, I'm aiming to get this done in the remainder of the day today so let's see how far I get!
Not all tracks are created with this detail, this is purely showing how you can map some real work tracks into Rush Rally if you want to!
The track we are going to create is based on data from Mount Washington in the U.S.A, i'm not going to be using this name in game, and it will form a new country, but never the less this is where the source data has come from.
The first step is to find the height data somewhere, for this I've used the popular tool VTBuilder, (http://vterrain.org/Doc/VTBuilder/overview.html) You can import height data from real world data into this, I uses the NASA database found here, https://dds.cr.usgs.gov/srtm/version2_1/SRTM3/, Once you have interpreted the data and got what you need, you can extract it from the tool as height map (or whatever format you like.)
To make it a bit easier, go to google maps, find the location you want, right click and select "What's here?", then note down the Latitude and Longitude of the location. This then maps to a file in the above database, so for this I am at Lat 44.27 Long -71.3, This maps to file N44W072.hgt (because 71.3 is rounded up as we are in base 0!),
This shows what you should get (although this is showing height data from a different location!)
Quickly, this is the data I've got for this areas of google maps, I then save the boxed area height map from the tool, and get ready to use that for the track data. To do this I Export the Elevation layer from VTBuilder to a BMP file (which actually gets flipped in the Y axis, so it needs flipping).
Once I have the heightmap, I then combine the heightmap with the google map data to form a heightmap with the road spline on top.
I then use this to trace out the spline in Maya to create the spine data. Once this is done I basically have a road spline and a heightmap ready for building into the game. This step the requires a few iteratons to make sure the scale is all correct and that the spline matches the heightmap nicely to give corners on the correct parts of the map, below is what I have so far.
So basically the data for this track is currently about 4Kb for the spline, and about 150Kb for the compressed height data. This is all we need to generate the track! The height map min and max heights are also specified to get the scale of the mountains, and I've scaled it to the correct distance based on google maps.
Now I simply add this spline to a track list and then decide what "look" I want to give it, snowy, dirty, night, day and we are ready to go!
Here is the final product in game, probably about 2-3 hours work with lunch in there somewhere, of course this is only the basics of it, it will take a lot longer to refine it all, and generate a new visual look etc etc to go with the new track pack.
Now to spend a bit (possibly a lot) of time tweaking it all out!