MapMagic World Generator

About MapMagic World Generator – Unity Editor Tool & Plugin

MapMagic World Generator Unity Asset Overview

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.

Data Pipeline & Thread Safety

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:

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.

Inspector Configuration & Workflow

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.

Core Node Graph Types

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.

Quick-Start Unity Integration Guide

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.

Basic Setup Sequence

  1. Create an empty GameObject in your hierarchy and attach the MapMagicObject script component.
  2. Right-click in your Project view and select Create > MapMagic > Graph to generate a MapMagicGraph asset.
  3. Assign the newly created graph asset into the Graph slot of the MapMagicObject Inspector.
  4. Open the MapMagic Graph Window via Window > MapMagic > Editor, and construct your input-to-output graph nodes.
  5. Assign your target player/camera object to the Main Transform field in the MapMagicObject component to control terrain streaming around the player position.

Scripting Setup: Runtime Generation Callbacks

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
            }
        }
    }
}

Performance Profile & Memory Optimization

Generating procedural terrain dynamically at runtime introduces explicit performance tradeoffs that must be managed across targeted platform architectures.

Technical Performance Characteristics

Pros and Cons

Asset Details & Specifications

CategoryTools / Terrain
Latest Versionv1.9.1 (2 tracked releases)
File Size99.40 MB
Added to PlatformFebruary 5, 2026
Views15 views
Downloads1 downloads
Favourites0 favourites
Official StoreBuy Original License on Unity Asset Store →
Issue with Package?Report Broken Link →

Developers Who Downloaded This Also Downloaded

Related Unity Tools Assets