Building a new map
Author: danger726,
published 2 years ago,
Hi everyone, it's been a while, so time for a dev update I think.
Over the past couple of months I've been working on making a new map for the full game. Currently in the demo there's a procedurally generated "desert" map that's a bit boring as it doesn't have much variation. So I decided to hand craft another map that would be more fun for testing wheeled vehicles, with various road and race track layouts.
At some point I'd like to have other maps tailored towards different kinds of creations, but those will have to wait until some time in the future.
[b]The race track layout[/b]
The map sizes in the game are 12x12km, with an 8x8km playable area, which is a huge area to create a map for, especially by hand. So for now I've been focusing on one 2x2km region to try and get that up to a decent quality level.
The first step was to design a race track layout, which I did by piecing together corners inspired by some of my favourite real world tracks. I wanted to have a good mix of corner types, elevation change, and a nice flow. The track also has multiple routes, for more variety.
The next stage was to build the race track in Unity, for this I used [b]EasyRoads3D[/b] (http://www.easyroads3d.com/). This is a node based tool for creating road layouts that generates the road meshes, matches the terrain height to the road, and can generate other associated objects such as tunnels, bridges, kerbs, and walls. This tool isn't without its problems, it has quite a few bugs that I struggled with initially, especially when using the flex connectors to create road intersections. However once I got used to working around these issues, I found this tool to be quite powerful and flexible, and it can produce some great results.
Here's the initial race track layout, you can see where I've used intersections to create alternate routes and a pit lane, and where the flat terrain has been automatically raised up to match the elevation changes in the track:-
[img]https://clan.cloudflare.steamstatic.com/images//37970304/5dc195a6bbef001a528feeae4285cad204496482.jpg[/img]
[img]https://clan.cloudflare.steamstatic.com/images//37970304/4d923f5d0457c07cbfac5aea604583701527e1ea.jpg[/img]
Following on from this I sculpted the terrain around the track to match it, and added a tunnel for the bit where it crosses over:-
[img]https://clan.cloudflare.steamstatic.com/images//37970304/1d4fdbcba93e973fbd75738ed4f13daa69c2bc6f.jpg[/img]
[img]https://clan.cloudflare.steamstatic.com/images//37970304/106b5b93afb635eb10a925bcb62e0731fdc7cf9f.jpg[/img]
[b]Terrain texturing[/b]
Before painting textures onto the race track terrain, I first wanted to make some improvements over the terrain texturing that has been in the game so far. The textures themselves didn't really fit the visual style of the game, they weren't varied enough, and I'm not a huge fan of "cross fade" blending between the textures either.
So I created a set of new terrain textures with a more stylised look (a mix of adapting some pre-made textures and making my own).
I implemented height-based blending into my terrain shaders (also with gloss, occlusion, and metallic maps), this was based on the mask map support in Unity's URP (I'm using the built-in RP). I'll skip the details here for brevity, but here's a comparison between conventional and height-based blending:-
[img]https://clan.cloudflare.steamstatic.com/images//37970304/1863d31e0bbeb69866f171820d167f0296b573b1.jpg[/img]
[img]https://clan.cloudflare.steamstatic.com/images//37970304/b2ef42032383270ec951f8a901b4f4934159d46b.jpg[/img]
And now here's the terrain with the textures painted onto it (and also with some tweaks to the pit lane):-
[img]https://clan.cloudflare.steamstatic.com/images//37970304/b20bc8450ea338c3c740cdebee43a6785acff9d9.jpg[/img]
[img]https://clan.cloudflare.steamstatic.com/images//37970304/c8a82faeb21a3899b16bfd8ed1015afbb38c7456.jpg[/img]
[b]Terrain details and trees[/b]
The next job was to add some terrain details (grass & rocks) and trees. I implemented custom shaders for all these, in order to have deferred lighting support, and translucency on the tree leaves. I created tree models using Unity's old tree editor, which is somewhat flawed (I think it might be abandoned nowadays?), but it did the job, and besides I couldn't justify spending money on a third party tree creator tool!
I implemented a simple tool in Unity to procedurally place the grass and rocks based on the underlying terrain textures (e.g. so I could quickly place the grass details on top of wherever the grass terrain texture is painted). The trees I just placed by hand.
Here are some images of the final result:-
[img]https://clan.cloudflare.steamstatic.com/images//37970304/64d405d618842e1b94281e24ac4dfdfce320e75c.jpg[/img]
[img]https://clan.cloudflare.steamstatic.com/images//37970304/535217cead14edc20049901e3647c2811fd885f5.jpg[/img]
[img]https://clan.cloudflare.steamstatic.com/images//37970304/c1aca0dade6578a261d684f48f2b7a159dd519b7.jpg[/img]
[img]https://clan.cloudflare.steamstatic.com/images//37970304/a5770ff7ddd5460711e3b322f917a3f868b39ac5.jpg[/img]
[img]https://clan.cloudflare.steamstatic.com/images//37970304/cc07315b2ffd51f4f1745d9c23411b86b1efe836.jpg[/img]
[b]Desert map[/b]
I also worked on the old desert map to bring it in line with the new one, by switching over to the new stylised textures, adding grass & rock details, and adding trees. The desert map was created procedurally using [b]TerrainComposer[/b] (http://www.terraincomposer.com/terraincomposer-2-2/), so it was fairly simple to set up and automatically place the details and trees. They definitely add a bit more life to the old map:-
[img]https://clan.cloudflare.steamstatic.com/images//37970304/b7282e08e4e81f83116cbf8483d7a6f9caa9ac68.jpg[/img]
[img]https://clan.cloudflare.steamstatic.com/images//37970304/f00c8eb65e7ec4ce00cf4cde144934bfba4e50c3.jpg[/img]
[img]https://clan.cloudflare.steamstatic.com/images//37970304/064e1b5289e1214a35a445a6a7f9a4e78543259b.jpg[/img]
[b]Next steps[/b]
Overall I'm reasonably happy with how the race track map turned out so far, the track itself is a lot of fun to drive on, although visually I feel the map is still lacking something in some places. I'd like to tweak the terrain and tree textures some more, improve the pit / paddock area, and maybe place more objects (such as large rocks) around the map. Hopefully that'll help.
More importantly, I need to finish laying out the rest of the map, by adding an oval track (I've made a start on this already), a go kart track, and an off-road track. Beyond that, I'll probably fill out the remaining outer regions of the map with more generic elements (hills, mountains, etc.) which should be less time consuming to make.