1. Home
  2. Docs
  3. GO Map – Documentation
  4. Demo Scenes
  5. Environment (GO Terrain)

Environment (GO Terrain)

If you already have tried GO Terrain you may recognize it’s low poly style in this demo scene. That’s why this map style is almost exactly the same of the GO Terrain’s Vector map demo scene, made with the new GO Map 3.0.

This demo scene will show you a nice example of a map with elevation and the brand new environment generator!

Elevation settings

First thing first: GO Map needs a unity layer named “GOTerrain” to be set up in order to work correctly. You’ll find an error in the debugger if you run the map without setting it, so please do it as the first step.

To Add a Unity Layer click on the layer dropdown menu of whatever GameObject and select “Add Layer…

Then simply write in an empty box the string “GOTerrain” and while you’re at it add also a layer for the “Roads” and “Buildings” it will help you later.

Ok now let’s see the elevation settings of this demo scene in the GOMap inspector component

Use elevation: when set to on will make GO Map to download and use the elevation data to produce a 3D terrain. Keep in mind that elevation doesn’t work nice on every map style, so maybe a map that works really well in “2D” like the Marauder’s Map isn’t that nice with elevation set to on. Also consider that a map with elevation consumes a request per tile more than a normal map so it would double your API usage.

Elevation multiplier: That value allows you to fake a bit the terrain true elevation in order to make a more (or less) pronounced effect. In this map style I’ve preferred to increase it a bit than normal making every 1 meter equal to 1.5 units. In the image below I’ve compared two version of the same map with a value of 1 and 3:

Terrain resolution: That value means that each terrain tile is a grid of 50*50. Increasing that value will smooth the terrain by giving more triangles to the final mesh, vice versa, decreasing that value will make the terrain looks more “low poly”.

A higher value means slower mesh generation and a lower value means faster mesh generation. I’ve found that 50 is a perfect compromise.
An important consideration has to be made: Elevation data comes in DEM format that is a 256*256 png image. That means the maximum resolution value would be 256, but that is impossible because of the Unity 65535 vertices limit.

GOEnvironmentPro.cs

Go Environment is an easy interface to spawn decorative models randomly on the map. It’s really useful to add clouds, trees, something in the water, and every other thing that may embellish your map style.

I suggest you not to use this for spawning monsters, coins or other stuff that your game’s character may have to find or catch because it’s really made too randomly. Move that kind of logic server side.

The script have to be linked to GOMap, then there are two lists to fill up:

Floating environment

That kind of model gets spawned above each tile created, regardless if the location is above water, landuse or buildings. Use this list to spawn objects like clouds or balloons.
Ignore the “Kind” value that will be useful for the feature environment only.

Feature environment

That kind of model gets spawned on some specific kinds of features that you decide. In this demo trees are spawned above parks and forests, tombstones above cemeteries and graveyards, and ice rocks on glaciers.

Was this article helpful to you? Yes 2 No 2

How can we help?