The first thing you need to do is create a MapMagic object, which contains the MapMagic script, the initial terrain, and allows the editor interface to be opened. To create a MapMagic object, click the GameObject menu -> 3D Object -> MapMagic.
A new game object named “MapMagic” will appear in the hierarchy menu. It already has the initial pinned terrain and three example generators, so the terrain is not flat. Clicking this object will show basic settings in the Inspector.
The “Pin Terrain” button allows pinned terrains to be selected in the Scene view. Left-clicking on an empty area will pin a terrain, and it will appear in a moment, after it’s been generated. Left-clicking on an already pinned terrain will unpin it. To exit pinning mode click on the “Pin Terrain” button once more.
Within the MapMagic object you created, the “Show Editor” button will open up the MapMagic Editor Window. Here you can see three initial nodes (called generators): Noise, Curve and Height (output generator), all connected together. It's recommended to dock this window somewhere so it will not overlap the scene view.
Part 2: Editor Window
To pan (scroll) the editor window click and drag middle mouse button anywhere on the graph. It does not matter if you are middle-clicking empty space, generator, field or connection wire:
You can use Alt + left click combination if you are using 2-button mouse.
To zoom the graph rotate the mouse wheel up or down:
Alternatively you can use keyboard keys "+" and "-" for zoom.
To move the generator left-click anywhere on generator and drag it:
Try changing the generator values by left-click and drag on the right side of the property field:
You can click on the field and type the new value the standard way too.
You can see that the resulting terrain is changing too - after a short delay. During this delay the new terrain is calculated and applied. You can see the "Generate" mark in
the top left corner of the window meaning that the new terrain is currently calculated.
The generator could be removed by right-clicking anywhere on it and selecting "Remove" from the context menu. Remove all the 3 generators so we could start from scratch.
A new generator could be created by right-clicking on background (empty space) and selecting a proper section and generator type in context menu.
Create two generators - similar to those we have removed:
Noise: Create -> Maps -> Noise. This generator creates a fractal noise pattern.
Height: Create -> Output -> Height. This node converts the input map to terrain heightmap and applies it.
Move created generators to make the graph look this way:
The Noise Generator creates a fractal noise pattern (like this). Consider it's a 2D map. After the Noise Generator has been generated it stores this map in it's output. Now we have to make this output pass to the Height Generator to apply it to terrain.
To do so we have to connect Noise Generator's output to the Height Generator's input by clicking in the blue circle and dragging the mouse:
You can see that the noise effect applied to terrain.
You can also click at the Height's input circle and drag the line to the Noise's output with the same effect.
You can see that the generators are now linked with a blue line. Blue line connects only blue inputs/outputs, blue color symbolize a "map" input/output type: . In contrast to blue connections you may see the green lines that connect green inputs/outputs: . Green means an "object list" connection. You cannot connect green and blue inputs together since their types are incompatible - to convert an objects list to a map (or vice versa) a special generators should be used.
Technically, "maps" are not actually textures - they use a special Matrix class that use an array of floats internally. Neither "Object lists" are lists, but spatial hashes.
To unlink the generator you should connect it to void. Click at it's input and drag it to the empty space:
Clicking and dragging an output to an empty space will have no effect. This is caused by MM's concept: any output can have any number of connections, but any input can be connected only to one output. So, connecting an input to void just unlinks it.
Part 3: Textures
All of the generators are grouped together under the Create Menu using this logic:
Map: these nodes work only with 2D maps.
Object: generators that receive or output object lists. The easy way to find out if generator is in Maps or Objects category is to question yourself if it deal with objects in any way. If id does - then it will be in Objects list, otherwise look for it under the Maps.
Outputs: a special generators that apply all of the terrain. Unless any of the output generators is not connected MapMagic will not even start to work. These are the main generators that trigger the linked nodes. Their number is quite limited:
Height: used to generate height. Receives a map, perceives it like a heightmap, converts it to float[,] format and assigns to terrain.
Textures: used to paint terrain with textures. Receives several maps (supposed to be control texture masks) blends them together and applies along with the assigned prototypes (i.e. terrain textures and normalmaps).
Grass: to apply grass.
Objects: places game objects (transforms) on terrain according to the "object list" input.
Trees: same as Objects, but uses the Unity terrain trees engine instead of individual transforms.
Custom Shader: same as Texture, but works with MegaSplat, RTP, CTS or other custom terrain shader.
Voxeland Outputs: work only when MapMagic is used as a Voxeland generator.
**Voxeland is a voxel-based 3D terrain, and it requires a different approach to terrain creation rather than 2.5D Unity terrains. Do not try to make a standard map with expectation to convert it to Voxeland - this will require a lot of changes to the graph and in some cases will not even be possible.
Add a Textures output: Create -> Output -> Textures:
Assign a texture in a slot shown on the image - this will fill all the terrain with it.
Textures output has a layered structure. The one we've just added has only one layer called "Background". Each layer corresponds to the texture layer when editing the standard terrain. Each layer has two texture slots - one for the diffuse (albedo) texture, and one for the normal map, and some parameters like texture size, offset, specular color, gloss, etc.
To add a new layer click the plus button next to the "Layers" label. Assign the other texture to the diffuse slot:
Now try connecting the layer's input to the Noise generator. You can see that the terrain was painted according to the noise map, the same map used for the height: the higher the values, the more visible the layer is:
Try creating some absolutely different map like voronoi (Create -> Map -> Voronoi) and connect it to the layer's input. Just raise voronoi's intensity value to 15 to make the effect visible:
Note that Background layer does not have input. It just fill all the other layers' values so that their sum is always 1.