MapMagic World Generator is built on a modular node-based visual scripting interface designed to proceduralize terrain generation through continuous mathematical function graphs. Rather than relying on static heightmap textures or monolithic compute passes on the GPU, MapMagic organizes generation pipelines into a node network saved as ScriptableObject graph assets (MapMagicGraph). This decoupled structure separates generator evaluation logic from spatial game state management.
At the architectural core lies a multi-threaded execution pipeline. MapMagic offloads compute-heavy procedural calculations—such as Perlin/Simplex noise generation, hydraulic erosion iteration, terracing matrices, and heightmap blend operations—away from Unity’s main thread into background worker threads using native standard C# System.Threading tasks or array processing queues. This ensures frame rates remain stable during dynamic landscape updates in runtime infinity modes.
Because background threads in Unity cannot access engine objects like UnityEngine.Object, TerrainData, or transform hierarchies directly, MapMagic uses intermediate managed matrix structures (such as Matrix2D arrays holding float height profiles and byte mask arrays). Execution flows through three strict stages:
TerrainData buffers, splatmap layers, and mesh vertices are populated.To prevent continuous Garbage Collection (GC) frame spikes caused by generating large 2D arrays across dynamic terrain chunks, MapMagic implements heavy dynamic array pooling. Matrix allocations are cached and reused once a terrain chunk shifts beyond the rendering perimeter, keeping heap allocation minimal during continuous player movement.
The visual editor in MapMagic is built using custom Unity Editor GUI extensions and dynamic Property Drawers. Opening the graph editor canvas provides a node graph where inputs, modifiers, visual previews, and final dynamic outputs connect through directional data pins.
Generators in the visual editor fall into four functional execution buckets:
The runtime manager component (MapMagicObject) handles terrain streaming around a target Transform (typically the Player or Camera). Within the Inspector, developers configure tile resolution (e.g., 512x512 matrix precision), terrain square dimensions in world units, maximum background thread limits, and render distance radii. Multi-tile infinity streaming dynamically generates, updates, and unloads TerrainTile instances according to spatial distance vectors.
Setting up MapMagic requires creating a centralized generator manager and wiring graph outputs to terrain instances. The following workflow outlines standard initialization and custom runtime event handling.
MapMagicObject script component.MapMagicGraph asset.MapMagicObject Inspector.MapMagicObject component to control terrain streaming around the player position.When extending MapMagic via C# code, developers frequently need to attach post-processing scripts, assign dynamic NavMesh components, or bind trigger listeners when a specific dynamic TerrainTile finishes building. The script below demonstrates how to bind event delegates securely on the main thread:
using UnityEngine;
using MapMagic.Nodes;
using MapMagic.Terrains;
public class MapMagicChunkListener : MonoBehaviour
{
[SerializeField] private MapMagicObject mapMagic;
[SerializeField] private LayerMask terrainLayer;
private void OnEnable()
{
if (mapMagic != null)
{
// Subscribe to chunk application completion
mapMagic.OnTileApplied += HandleTileApplied;
}
}
private void OnDisable()
{
if (mapMagic != null)
{
mapMagic.OnTileApplied -= HandleTileApplied;
}
}
private void HandleTileApplied(TerrainTile tile)
{
// Verified main thread execution after threaded matrix processing completes
if (tile != null && tile.main != null)
{
GameObject tileGO = tile.main.gameObject;
tileGO.layer = Mathf.RoundToInt(Mathf.Log(terrainLayer.value, 2));
// Custom dynamic logic: Dynamic NavMesh baking or trigger zone creation
Terrain terrain = tileGO.GetComponent<Terrain>();
if (terrain != null)
{
terrain.allowAutoConnect = true;
terrain.drawInstanced = true; // Optimize draw calls via GPU Instancing
}
}
}
}
Generating procedural terrain dynamically at runtime introduces explicit performance tradeoffs that must be managed across targeted platform architectures.
TerrainCollider physics meshes on newly loaded tiles can cause occasional main-thread CPU spikes. Utilizing low-resolution physics collision settings or offloading physics mesh creation across frame steps reduces micro-stutters.| Category | Tools / Terrain |
|---|---|
| Latest Version | v1.9.1 (2 tracked releases) |
| File Size | 99.40 MB |
| Added to Platform | February 5, 2026 |
| Views | 15 views |
| Downloads | 1 downloads |
| Favourites | 0 favourites |
| Official Store | Buy Original License on Unity Asset Store → |
| Issue with Package? | Report Broken Link → |