The Mantle Core: An Introduction

POINT.  CLICK.  GENERATE.

If you have started using Mantle, welcome to exciting and endless possibilities in creating and iterating unique environments.  To give you a better understanding of how Mantle's components work together, we want to start you off by introducing the most important Mantle elements that you'll be working with and in this post we're covering the first one you need to know about, the Mantle Core object, what it is and what it does in a scene.

Other related posts in this series cover:

The Mantle Core object is the main element that holds together everything needed to generate an environment.  It assembles a Datasource and a Theme in order to create and render content.  The Datasource links mapping data sources and preferences, which are then broken down into different layer categories for flexible editing in a Theme.  Without the Datasource Mantle cannot generate an environment.  Without a Theme defined there is no detailed generation, however by default Mantle is designed to render out an unstyled white environment in order to preview environments and provide a blank canvas for starting new Themes.

Let's take a closer look at the UI.

Mantle is designed with an interface that is easy to use for all Unity user experience levels. With the push of a button Mantle will generate a world for you with no editing required.

It's worth noting that we'll be making significant updates to the Mantle UI over the next few releases and we'll update these posts once they've gone live.

The interface arrangement in this setting may be different from your own because Unity allows you to dock tabs anywhere on screen.  However for demonstration purposes we have docked the hierarchy, project and inspector panes close together in order for you to understand the Mantle capabilities and UI better.

Once it is dropped into the scene, the Mantle game object appears in the Hierarchy pane. Clicking on it focusses the Inspector pane which shows the Mantle UI.

In the Inspector, the interface is broken down into six parts.

Project Area

Name allows you to set a descriptive location name for your environment and set the world co-ordinates using the Latitude and longitude or Lat Lng field which determines the part of the world you wish to render.  These co-ordinates can be obtained from any popular online map service though we commonly use Openstreetmap.org or Google maps.  Lastly the size of the generation area can be adjusted using the Meters North to South and Meters East to West sliders up to 5km by 5km.

Theme & Data

These two work hand in hand to combine the data about your chosen location and how you want to treat that data visually.  A Theme links Styles together with the different data layers as defined by the Datasource in order to construct your environment.

This is incredibly powerful as it means that by simply swapping out a Theme, you can change an area's appearance in an instant. You can also change the detail of Theme layers that appear in your location simply by swapping Datasources. 

Rendering (Design-time generation)

The Mantle Core gives you the option to either run your scene as a live-preview or to generate the content into your project for you to continue editing.  Using the Create design-time content button places the different layers of the theme directly into the scene.  Simply using the Unity Play button with a Mantle Core object in your scene allows live previewing of your given settings. This is highly beneficial in the iteration process and gives you endless previews of your scene before generating the content you intend to work with for you project.
If you need to remove the content that has just been generated more easily than hand deleting each item from your scene, simply use the Clear design-time content button to remove all content generated by Mantle. As this process simply looks for the key layer names used by Mantle, if you would like to keep a particular generated layer and clear the rest all you need to do is to rename the layer you'd like to keep so that it remains uncleared.

Render Options

Several settings here provide additional options for generation.
No render until completion turns off the 'game' camera in preview mode while content is being generated. This is a minor speed boost if you're likely to be doing many preview renders. Include camera drone sets an orbiting camera in the scene to spin around the scene allowing hands-free viewing during preview renders.
Make buildings static sets all generated buildings to static meaning they are then eligible for occlusion cull baking. Most useful when Creating design-time content that you'll then edit for inclusion in any project builds that make use of Mantle content.
Mesh combine static prefabs groups all static prefabs together in order to further reduce the number of draw calls. Effectively a frame rate optimisation technique.
Show scene geofence reveals the various borders for map tiles requested using the datasource.

Help & About Mantle

Tap the button to reveal the information panel that covers information about Mantle, the team and quick links to all the tutorial and social content you need to have right at your fingertips.

Trans Sim Manager (Preview mode transport sim)

This script add-on to the Mantle Core allows you to add simulated vehicles to the transport networks in your scene during Preview mode. It allows you to choose prefabs you've created, or the ones we've provided with Prototype and Eltnam Themes, to simulate traffic, pedestrians or, for the more creative, even hot air balloons!
Do Simulate vehicles sets whether traffic is generated during preview mode or not.
Random Seed changes how and where traffic is randomly generated during preview mode.
Ground vehicles to place is a list of vehicle groups. To add groups simply increase the size value.
Vehicles is a list of vehicle prefabs. To add or remove vehicle slots simply change the size value.
Traversable road Types refers to which parts of the transport network these vehicles are going to appear on and be allowed to use. Simply set the number of traversable slots by changing the size value and then use the element drop down to determine what transport type to set each element to.

That covers Mantle Core! Thanks for reading and as always if you have any questions or comments please let us know on the forum, twitter, facebook or email us!

The Mantle Core icon

The Mantle Core icon

An environment generated unstyled without a Theme set

Location of Mantle UI in Inspector with Mantle Core highlighted in Hierarchy

Mantle Core - UI accessed via Unity Inspector pane

 

The Trans Sim Manager script expanded