basic RTS heightmap design in Unity + Photoshop

One of the things I quickly learned when I wanted to start making maps in RTSengine for Unity was there was a common theme in the RTS games that I yearned for.

In Various Command & Conquers and Age of Empires. they had hills. but more importantly they had plateaus and since it was from a orthographic point of view they needed to be at consistent heights across the board.

So much like my previous RTS Unit icon tutorial I came up with a design workflow that helped recreate this feel. We’ll only be using 2 tools for this. Photoshop and Unity’s Terrain Tools.

1st thing was I needed to decide was minimum height and maximum height on my maps.

To keep things simple this is what u decided to work with:

0 = Bottom Level; .5 = Beach Height; 1= Basic Land; 2= Second Tier; 3= Third Tier

Now this might seem fairly obvious but you can quickly get off the recoverable track if you don’t follow a plan and stick to it.

Step 1.

Unity Likes squares so open Photoshop and make a new canvas of 1024×1024. This is just for the map design you can make it whatever size you want on the actually terrain itself later. You can name it whatever you want.

Step 2.

Since we have 5 height level that’s how many layers we want.

Image 1

Now we also need to set our Color System. Edit -> Color Settings (or if you like Keyboard Shortcuts -> Shift + Ctrl + K)

Set it to Web Graphics Defaults

Image 2

The reason we do this is we want to limit the amount of color possibilities that there actually are available. This is A) Limit our accidental Error and more importantly B) Help use select the correct Grey scale colors.

Image 3

Now we have 6 colors related to the Greyscale that we can use.

Step 3.

Make your Bottom Layer (in my example it was called Layer 1 Bottom) completely Black.

Now you have Set up your Bottom Layer as far and the game engine is concerned.

Now Choose your beach layer and go to Grey just above the black. Select your Layer 2 Beach and draw something. Make sure you draw it on Layer 2 for ease of correcting it later.

Here is what I came up with very quickly while thinking of a 3 person map with visibility constraints while sheltering the base.

 

 

Don’t worry if its not perfect. You can either fix it in the layers or just correct it manually in Unity. Realistically this is good enough for now.

Now File -> Save As

I’m going to call mine Crescent_Field

Change the format to Photoshop Raw   <- This is critical!

Image 8

I also recommend these settings:

Image 9

Ignore any warnings. They don’t matter. Only thing that matters is the .raw was created.

Ok, Open Unity for the next step!

Step 4.

Now I’m going to assume you already imported RTS Engine if not, thats fine this will work in general to. Just skip the related SDK aspect.

File -> New Scene

RTS Engine -> Create New Map

Ok, this next step is important because of how Unity treats Terrains.

Expand the Terrain Object in the Hierarchy.

Image 10

Now grab those 3 object and Un-parent them from the Terrain.

Image 11

Now delete that Terrain Object entirely. You need to make a new one.

Game Object -> 3D Object -> Terrain

You can drag those object back under your new Terrain now.

Now we want to import our Raw…

Click on your terrain Then the COG icon on the far right side. Go alllll the way down tot the bottom and Under Heightmap Press the Import Raw Button.

Image 12

Pay careful attention to this part. The Important bits are The Depth if you manually set it. It MUST match. The Width and Height must also match the Raw we saved. Since we set 1024  that is what we are using.

Image 13

You can set the Terrain Size to what ever you want here, except for the Y since we set that to 5 layer we should exercise some restraint here or it will look out of proportion.

I will set my X and Z to 500 and my Y to 30.

 

Image 14

It came out fairly nice I think!

Step 5.

I recommend you run a smoothing brush over the entire thing at maximum power. Then in moderation try to smooth out the beach to slant into the normal ground level smoothly. I find a 30 degree angle is really good. To test it out simply generate a new navmesh and set the Agent Angle to 30

Image 15

Like so:

Image 16

Step 6.

Just give it some make up now!Image 17

paint it some then add Aquas, a CTS profile an viola!

This only took about 30 minutes. If i wasnt juggling a 1 month old baby, it would have been even faster. Given the proper time and tools these things are pretty easy to make. Everyone like to dis the Unity engine but the terrains turn out just fine. I haven’t even used any camera effects yet.

Advertisements

3. Todays Task: Icons

Today was all about making icons that match a predetermined aesthetic.

Here’s How I went about making the icons you see below.

Capture

1.  With in Unity I simply dragged one of my prefabs into the editor. And used Snippet to take a sectioned screenshot.

2. Copied it into a Photoshop page, cropped it to match what I wanted to see.

3. Used Image -> Image Size to make it 64×64 pixels. Popped a text saying what it was 3 pixels from the bottom.

Simply saved into my Unity Project as is, Set them all to 2D GUI Sprites voila.

3 Minutes a piece. You dont need a Script to get quality work for Icons. Some simple but time consuming effort and you get better results on your own.

Each one takes anywhere from 30 seconds to 5 minutes depending on how complicated cleaning up the screen you takes. I made about 50 icons today over the gradual course of the day with breaks in between.

I’m sure you can go even faster given practice, however I was also learning photoshop as I went.

Tomorrow I’ll detail a tip on how I make my Levels as well. 😉

2. Building Designs

The single most defining feature of playing an RTS is in fact base building.

Your game can have Turtling or Expansion Play over the course of a game. or like myself you can decide to have both.

In Command and Conquer you have harvesters that need go out and retrieve the Tiberium / Gold. This material deplete over time as you farm it forcing you to hunt down more or defend your supply on smaller maps. This is how games like CnC or SC control the player flow.
CnC allows Turtling by having fairly cheap units but expensive buildings and the Tiberium if managed properly Grows back. This can allow the Players to control the battle flow at their own rate.

SC is much more strict in this resource management. Everything is expensive and if you wanna expand your Max Army size you need to build more supply deploys or Pylons or Whatever the Zerg use. And you will quickly use up you available resources forcing base expansion and preventing Turtling. The theory is the player flow is faster.

For My own I decided I wanted to use both these Mecanics. I have designed 3 different resource types.

Currency – Generated by the Construction Center – Master Building

ConYard

Metal- Generated by a constructed Drill

Drill

Electricity- Generated by a constructed Power Plant

PowerPlant

However these will auto generate slowly. So the player will have the option to increase the rate of resource generation by having the Engineer Units retrieve the resources and carry them back to the the StoreRooms.

The Basic Flow will be Construction Center -> Metal Drill -> Power Plant

Barracks – Create Infantry

Barracks

Factory – Create Land based Vehicles

Factory

Airports – Generate Air Vehicles:

AirPorts

Construction Center (Primary Structure):

ConYard

Defensive Structures — What would a base be without Defensive structures:

Defense

You also need Multiple types of Units and Building Variations that separate these factions. Or they would simply be carbon copies of each other. This could simply be aesthetic or stat even unit/building  cost. I have chosen to go with all 3 to manamge balancing.

I have 3 factions.

EU, Mercenary, and Cybernetic.

I will detail the variations in a later post. Once they are actually finalized.

1. An initial statement on RTS definition

What originally started a a throw away project to recreate WestWood Studio’s Command and Conquer has become something more. I had wanted to resurrect the CnC games from a time before the taint that is EA touched it.

I had spent a paltry sum of 45 dollars on this: SoumiDelRio’s RTS Engine

It’s the best still being developed RTS sdk that I have found on the store.

Let me be crystal clear on my definition of RTS so there is zero confusion.

Command And Conquers [all of em except for 4 that’s a without question a hybrid MOBA]= RTS

HALO Wars =  RTS

Age of Empire’s [all of em]= RTS

StarCraft I and II = Core game and Core Multiplayer RTS. However there are several mods on Battlenet that are actually MOBA’s

Civilization= NOT RTS. This falls under Turn based Strategy

League of Legends = NOT and RTS. this falls into a separate category of its own. MOBA as it is a hero type battle arena.

Any kind of Tower Defense = NOT RTS this falls into a separate category of its own. Somewhat obviously called….Tower Defense.

A strong distinction is vital when classifying games. You do not want to deceive your players or buyers into thinking your game is in fact something it is not. This is how you alienate your audience. Real Time Strategy is a classic genre and the title for that type of game should be preserved to represent a pure concept. Its fine to add a mecanic here and there of course. However dive too far and you missed the forest for a tree.

I was getting sick and tired of Games that are actually MOBA’s or Tower defense or TBS game get slapped under the RTS classification. Let those game stand on thier own in the proper Genre. That is where they belong. Stop try to drown the actual RTS games under your trifle. To do so is dishonest and makes you a bad developer.

Having seen so much of this happening I decided to set out and try to make my own. I was thinking how hard could it possibly actually be to make one of these if EA could do it. Lets be honest they are not exactly a ‘AAA’ company like they claim to be, outside of the sports genre crap they spew. They are opportunists at best.

This is part of why the Command and Conquer franchise died a sudden death. They observed a market trend and tried to convert a game that was strong enough to stand on its own to follow that trend. and it failed. The CEO at the time decided this was a failure in the genre instead of taking responsibility for betraying fans of the series, and gave it the chopping block. Incase you are unaware of what Im talking about — There was a title called ‘Command and Conquer 4: Tiberian Twilight

The basic failure in this…and it was easily fixable…Was the decision to remove the core staple of the series out. The removed the base building aspect from the game. Instead replacing it with a Mobile support platform that was only capable of creating a single type of unit. This was a departure from ALL the previous games – presumably in an attempt to reinvent the IP and merge it with the MOBA market. Needless to say the fans did not like it. Reviews were not nice.

That game marked the fall of the entire franchise and was directly responsible for no fewer than 3 different games being canceled. And ultimately left Starcraft I and II uncontested.

Now you know where I stand and my thoughts. With that defined and vented lets begin!