05 Jul Building Levels in Unity – Part 1 of 3
September 6, 2016: We are looking for a Unity C# Developer and Node.js/Back-end Developer to join our team. You can find the vacancies here!
Hi! I’m Matthias Zarzecki, and I’m making the levels Looking For Group – The Fork Of Truth (among other things).
In this series we’re going to use Unity to create a game environment. The first part will deal with the basic landscape – the terrain on which the rest of the environment is built. You can find the other two post over here:
- Part 2 – The logistics of managing a vast library of environmental objects
- Part 3 – smaller and ancillary tricks that make the entire level come together.
If you’ve seen our rockin’ trailer…
…or our Kickstarter video, you can see the environment the characters fight in.
To make these videos, we set out to actually built a playable level. It serves as a prototyping area, to test the combat system and overall look-and-feel of the game. We wanted to use actual footage for the Kickstarter videos, so people would know what to expect. Ultimately this resulted in a fully functional game (albeit a rather short one).
Level overview
The gang starts in the lower right:
They break into a village and get in the way of a goblin attack:
Then they get a quest from a farmer (actually a goblin in disguise), and track down the goblin menace. They are lured into a trap, resulting in the final battle in the goblin camp:
The level takes about 10-20 minutes to play through, and is quite fun. So let’s talk about how we made this!
Terrain
The entire level uses the Unity Terrain. It is a great way to create natural landscapes.
To get started with Unity Terrain, select “Terrain” -> “Create Terrain” in the menu bar. You start with a flat plane:
Unity Terrain lets you “paint” on this surface, using different brushes and sizes:
Using the Height painting tool (the first mode), you can paint height differences. Simply select the right mode, and paint your terrain on the plane in the Unity viewport:
Using the texture painting tool, it is possible to apply textures to the terrain:
Start with a base texture like grass or dirt, and take it from there:
Add extra textures to create rocks, sand, any type of ground you need:
Roads are easy to create. Simply paint a specific height, and assign a road texture to the terrain:
These are the textures we used for The Fork of Truth:
With these simple tools, you can create complex terrains that are convincing and interesting to look at. You can see the road texture painted on the right, and the height differences in the pool:
Unity Terrain is an awesome feature, and offers a wide array of options and ways to create a world. You can sculpt almost any kind of landscape with it. Create streets, rivers, canyons – all with a swipe of the mouse.
Verticality
But you have to be careful not to overdo it. Things may look great, but a hilly terrain could give you all kinds of level design headaches.
Height differences make placing things a chore. You might end up spending hours adjusting the vertical position of the objects in the scene, so that they don’t float in the air or are stuck in the ground.
The basis for the LFG-game is a flat plane. There are still hills and depressions, but these are purely visual. You can’t actually reach them. You can see some of these non-flat areas highlighted in the picture below. They are inaccessible due to obstacles and invisible walls:
Another benefit of keeping your level flat is simpler attacks. Attacks and abilities become much more complicated when there is an uneven terrain. Does a summoned tornado move horizontally, or does it move along with the floor? If so, could it move up a cliff? If you are standing on a hill, does your fireball hit the enemies below or do they fly over? What about if there is a hill between you and the enemy?
Keeping the level “flat” gently sidesteps these problems. Games like Diablo, Torchlight and Magicka use a mostly planar environment as well. And with good reason.
Note that even though we kept the walkable areas flat, we did add uneven ground in some places to give the impression of depth. For the extended game we plan on using height in the levels. Height-differences and cliffs make for interesting level design, so we don’t want to leave it out for the real thing.
Water
The characters can’t interact with water in The Fork Of Truth (yet). Should anything fall into the water anyway, like a goblin thrown by an attack, it is killed immediately.
The river in the level is a depression in the terrain, moving down to 30 units below the “floor-level”. Here you can see the river “canyon”, with some decorative objects placed within. All it needs is a bit of water:
There are different options for the water surface. The simplest version is a simple flat square with a blue color and transparency:
Unity comes with several water shaders. This is the basic one. It has animated waves and simple reflection, but no transparency:
This one is a more advanced version (the coloring is a bit off at the moment). It is transparent, and has all of the wave-animations of the previous one:
The next one is just about perfect (it is called “Water4” in Unity Pro). It is transparent, reflects the environment, has animated waves, and nicely fits the cartoony visuals of the game. It also has an interesting “fizzle” area at the borders. Even though it has all of this great stuff, it doesn’t kill the framerate like some of the other advanced water types.
Conclusion
The level building process in Unity starts with the general terrain layout. Here is a summary of the tips:
- Use the Unity Terrain for fast landscape sculpting and texturing
- Keep the walkable paths flat for easier level design
- Unity has several great water shaders, we used the Pro shader “Water4”
Running around in an essentially empty level with just the ground and water beneath your feet can still be satisfying. If that is indeed the case, you have built a solid foundation for the rest of the level.
Next time: We’ll have a look at placing the objects in the level, and fill up the environment with trees, bushes, fences, and other doodads.
Curious about the The Fork of Truth? We are running a crowdfunding campaign on Kickstarter. Check it out, and if you like what you see, be sure to back the project and spread the word!
Thanks,
–Matthias
Rik
Posted at 18:40h, 05 Julycant wait for part 2 🙂
jorisvanleeuwen
Posted at 20:51h, 05 JulyA good read! Glad you guys are doing this, keep it up! : D
frede
Posted at 22:19h, 05 JulyInteresting read 🙂 waiting for part 2
Casper
Posted at 15:34h, 06 JulyThanks for a great insight into the game building process. As someone learning Unity this is truly amazing. I hope for more to follow and wish you the best of luck with the Kickstarter project. Considering making my first Kickstarter support for this project, partly due to your open process.
Building Levels in Unity – Part 2 of 3 » Paladin Studios
Posted at 08:15h, 13 July[…] environment setup in Unity, using Unity Terrain. If you haven’t read it yet, you can find it here. In this segment I’ll go into the environmental objects, and how they are set […]
Building Levels in Unity – Part 3 of 3 » Paladin Studios
Posted at 16:56h, 15 July[…] Part 1 – A look at how the terrain in Unity works […]
Mark
Posted at 11:28h, 08 SeptemberBest resource I have found so far regarding 3D isometric terrain design, thank you for writing this stuff down
pasban110
Posted at 14:06h, 07 JanuaryGreat!
Thanks for sharing the stuffs with us 🙂
“Building Levels in Unity”- a three-part tutorial by Paladin Studio’s Matthias Zarzecki | Skillpoint School
Posted at 06:21h, 04 February[…] An image from Paladin Studio’s “Looking for Group: Fork of Truth” […]
Suggested Reading – Building Levels in Unity | Lich Queen
Posted at 12:06h, 18 October[…] http://paladinstudios.com/2013/07/05/building-levels-in-unity-part-1-of-3/ […]
erikh2000
Posted at 01:31h, 08 DecemberThanks for the article. I took a few tips about water for my own work.
Gloomshroud
Posted at 02:34h, 10 MarchThis is still useful in Unity 5, way down the line! Thank you for sharing! I am trying to implement roads (which you say are easy) but I’m having some difficulty. You say to paint a specific height and then add a texture to the terrain. Is this done programmatically or directly in the editor?
"The Road Goes Ever On" and other "Old Walking Songs" | Ceiba3D Studio
Posted at 05:45h, 10 March[…] to create it myself.).The best result I found that was pretty much what I was looking for was right HERE. (As an aside, they’re a neat studio and their games are pretty […]
Building Games With Unity
Posted at 16:35h, 18 December[…] Building Levels in Unity – Part 1 of 3 – Paladin Studios – In this series we’re going to use Unity for building levels. The first part will deal with basic landscapes on which the rest of the environment is built. […]
Building Game Environments | Playacuare
Posted at 10:01h, 26 April[…] Building Levels in Unity – Part 1 of 3 – Paladin Studios – Video embedded · In this series we’re going to use Unity for building levels. The first part will deal with basic landscapes on which the rest of the environment is built. […]
Building Game In Unity | Clarksville Chess Club
Posted at 09:24h, 27 April[…] Building Levels in Unity – Part 1 of 3 – Paladin Studios – In this series we’re going to use Unity for building levels. The first part will deal with basic landscapes on which the rest of the environment is built. […]
jt
Posted at 03:45h, 31 Octoberfix your images
Stein Damen
Posted at 14:20h, 31 OctoberThanks Jason. Should be fixed now,
Building Levels in Unity – Part 3 of 3 | Matthias Zarzecki
Posted at 10:04h, 02 February[…] Part 1 – A look at how the terrain in Unity works […]