• Register

You are an interplanetary mining contractor on a mission to discover natural resources on alien planets and send them back to earth. TerraTech features procedurally generated worlds and unique on-the-fly vehicle construction.

Report RSS TerraTech Dev Diary: Surfacing harvestable resources

Terratech Lead Artist, Jolyon Webb, explains the design of TerraTech's intergalactic natural resources.

Posted by on

Terratech Lead Artist, Jolyon Webb, explains the design of the game’s intergalactic natural resources.

Why would we care about surfaces? Simply because they strongly affect the way we feel about objects and environments.

In a game the surfaces added to objects are really important. They bring the world alive and make it cool and atmospheric. They have gameplay significance too as they give concrete information about things like the value and purpose of objects in the world. Finally, they are motivating by making objects in the world desirable. Anyone who gets a kick out of levelling up from dull leather to shiny metal armour will understand this.

Test resource geometry and surfacing
Test resource geometry and surfacing

This combination of giving information and making things desirable is going to be very important in the TerraTech world. The TerraTech world features a number of very different corporations all with different strengths, weaknesses and styles. It needs to be easy for the player to visually separate the corporations and read visual cues about their strengths and personality. Some of this information will be driven by silhouette and size of component parts. However this is not enough, as the TerraTech world is completely dynamic and fluid with vehicles that can radically change shape and composition all the time. As a result we plan to use the surface type of each corporation as a unique, recognisable identifier that works for a corporation regardless of the specific component type, or what vehicle it is built into. For example, all the components of extreme sports corporation Venture will have a racing car high gloss. Those of the bio-mechanical Legion will be iridescent, slightly oily looking and hopefully a bit unsettling.

We will show and talk more about the corporation surfacing later. For now a key focus for surfacing is the resource chunks. TerraTech has a strong harvesting mechanic. For this to play well and be fun, the resources gathered need to be visually distinctive for identification and state, give visual clues to their purpose and should look desirable enough to give a pay off to harvesting.

So let's have a look at the resource surfaces. First, I'll explain a little of the terminology used to talk about surfaces and what making surfaces in games can involve.

Rendering is the computer graphics term describing the way objects are calculated and drawn on to the screen in a computer game or animated movie. Shading is the term for how the surface properties of an object are controlled. Shading allows the same calculated shape in a game, such as a sphere, to noticeably change appearance. For example, shading could change the same sphere to make it look like it is a hard, shiny chrome ball bearing, or a soft, fuzzy tennis ball.

The same render geometry with different surface shading
The same render geometry with different surface shading

Shading and materials are just a fascinating mix. They really are a mad combination of art and science, code and imaginative map painting. One of the things I've always loved about making games is how it truly is a team sport that forces you to think across boundaries. Rendering and shading really force you to do this cross-disciplinary thinking and it’s a lot of fun.

The harvestable resources in the world are really good examples of surfaces that are a combination of shader code doing some of the work and map painting doing the rest.

Here is an image of a series of surfaces prototypes I have made to upgrade the resource objects in the world to add the distinctiveness and desirability I have talked about.

A variety of resource elements all using the same shader but looking very different
A variety of resource elements all using the same shader but looking very different

So hopefully here we have surfaces that look interesting and appealing, are noticeably different from one another and which bring enjoyment and depth to the game world.

What is interesting is that all these resources are actually using identical shader code. The different look for the different resources is controlled by two things. Firstly by number values set in the shader parameters that control things like how reflective a surface is. Secondly by the maps that affect things like the colour and shape of reflected pattern and lighting.

Combining both types of these controls allows the surface of a resource chunk to, for example, look like a bright pure steel, or a dull unrefined ore. These kind of state changes are going to be key to the harvesting/refining/manufacturing process and getting these clear visual cues should aid gameplay.

Refined and unrefined steel resources
Refined and unrefined steel resources

The resource shader uses something called a 'spherical map' (sometimes called 'spherical lighting' or 'lit sphere' lighting) to make the surface interesting. It is a very 'old school' approach to creating lighting on a surface where a simple map is projected directly on to an object from the direction of the screen to provide faked lighting and sometimes reflection. This means it does not behave in a completely realistic way when the view moves around. However it has two main advantages over a potentially more complex shader. First, it is cheap to run, something that can be very important if there will be a lot of objects on screen using the shader. Secondly, and this is the most important in my eyes, it is extremely easy and intuitive for an artist to edit the shader settings and maps used to give a surface major changes.

Have a look at these examples to see how changing the shader parameters and the spherical map used can radically alter the way a surface looks. Here are some example resource chunks using the same shader in Unity.

These settings give us a bright, chrome-like surface. Obviously we are faking a high level of reflectivity so we will have to match the sphere map closely to the environment.

A bright, sharp spherical map and bright tint with no highlight colour
A bright, sharp spherical map and bright tint with no highlight colour

By contrast this is a much duller, satin finish surface. The sphere map is doing lighting information but no colour change at all. Contrasting the highlight and tint colours helps give and interest and surface shimmer to the surface.

A smooth, blurred spherical map with contrasting hightlight & tint colours
A smooth, blurred spherical map with contrasting hightlight & tint colours

This example is mid-way between the two previous ones. The sphere map contains both soft and sharp areas with some noticeably sharp faked specular hits. Also the sphere map gives a greenish ‘bounce light’ on the downward facing parts of the object. The contrasting highlight and tint colours liven up the surface. We end up with something that is glossy but not mirror finished.

A spherical map with sharp & blurred parts and contrasting highlight & tint colours
A spherical map with sharp & blurred parts and contrasting highlight & tint colours

As you can see, changing a map and two parameters can give very different looking surfaces. Most of the control sits with the map and this is a very easy and intuitive map to edit. We can produce variety without a complex system and using assets so it doesn’t require specialist knowledge to handle. That is a really good thing for production efficiency and good for the game!

The good news is with this test work done and the shaders and resources prepared we should be moving this work into a build of TerraTech very soon as we push to expand and deepen the harvesting and crafting mechanics. Let us know what you think!

Before I sign off here are a few links for those of you interested enough in Spherical Mapping to learn more. The guys below have posted some great explanations and walkthroughs on using and producing maps. Check them out, they’ve helped me a lot.

dralex789 talks about using spherical maps in UDK on the Polycount forums. Polycount.com

peppi also has a great thread on sphere maps and using them in 3ds Max on Polycount forums.

Prior Oberson posted a great tutorial video on painting and editing sphere maps in Mudbox (very similar work can be done in Z-brush too) on Vimeo.

UndergroundEducation has posted a good tutorial on painting a sphere map in Photoshop. It is focused on using the results in Z-brush but the basics could apply to any shader.

Finally, I’ve found the Unity Shaders and Effects Cookbook by Kenny Lammers really useful. Look at the section on Lit Sphere lighting model.

Thanks for checking out the latest TerraTech Dev Diary. Please support us on Kickstarter and don't forget to try our latest free downloadable demo!

Local Multiplayer Pre-Alpha Demo

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.

Follow Report Profile
Windows, Mac, Linux
Developer & Publisher
Payload Studios
Send Message
Release date
Game watch
Dev Diary
Related Games
TerraTech Adventure
Related Engines
Unity Commercial
Related Groups
Indie Devs
Indie Devs Hobbies & Interests with 1,652 members
Indie Gamers
Indie Gamers Hobbies & Interests with 1,507 members
Kickstarter Web & Community with 37 members
Payload Studios
Payload Studios Developer & Publisher with 2 members
The Indie Game Mag
The Indie Game Mag Hobbies & Interests with 117 members
Unity Games
Unity Games Hobbies & Interests with 1,808 members