Hex Terrains Framework
Hex Terrain Framework – Modular, High-Performance Hex-Based World System for Unity DOTS
Documentation
The Hex Terrain Framework is a fully modular, runtime-editable, high-performance hexagonal terrain system built for Unity’s ECS (DOTS) architecture. Designed from the ground up for large-scale simulation and strategy games, it offers a Photoshop-like editing workflow with full brush-based control, multichannel data layering, and dynamic surface generation — all with performance and flexibility in mind.
Whether you're building a game like Civilization, Factorio, or your own simulation-heavy world, this framework provides everything you need to create, edit, render, and interact with vast hex-based environments.
Core Features
Brush-Based Terrain Editing Edit terrain in real time with brush tools that support size, opacity, stamping, alt-sampling (like a color picker), and auto-painting — just like Photoshop.
Dynamic Terrain Creation Create new terrains at runtime with custom dimensions, cell resolution, and layer configuration. Resize or regenerate terrain without restarting.
Modular Data Layer System Add or remove data layers (heightmap, biomes, countries, items, entities, etc.) on demand. Each layer is self-contained and supports dirty flagging and job-safe dependency tracking.
Surface Layers & Water Support Render complex layered surfaces (e.g., ground, water, snow, oil) using custom or built-in mesh generators. Water is its own elevation map — fully interactive and editable.
Highly Optimized Mesh Generation Meshes are generated using Burst-compiled jobs with support for simplified or detailed topology. You can extend it with your own generators for custom visuals.
Minimap with Viewport Sync Real-time minimap renders any data layer texture. Click-to-center camera control. Camera position indicator with normalized tracking included.
HDRP & URP Ready Sample content provided for both pipelines. Choose your look and customize with Shader Graph.
Custom UI Toolkit-Based Editor In-game terrain editor built with Unity UI Toolkit, featuring fully data-bound property windows, tool panels, and a modular view model system. Easily extend with your own tools.
Save/Load Support Modular binary serialization built-in. Save and load entire terrain states, including all data layers, runtime changes, and surface configuration.
Wraparound Map Support Connect terrain edges horizontally and vertically (e.g., like a globe or Civ-style map). Seamless camera movement across terrain boundaries.
Technical Highlights
- Built entirely on Unity DOTS (ECS 1.0)
- Burst-accelerated hex math with axial/offset and flat/point top options
- Minimal allocations and full job safety — optimized for large terrains
- Data layers store per-chunk dirty flags and read/write job handles
- Render system designed for Graphics.DrawMeshInstanced, not hybrid entities
- Designed for multi-terrain projects (e.g., Earth, Moon, Mars...)
Ideal For
- 4X and Strategy Games
- Simulation and Economy Games
- City Builders
- Custom World Editors
- ECS Learning Projects
- Games that require fully interactive hex terrain with high performance
Included
- Full source code (C# + DOTS)
- Demo project with HDRP and URP samples
- In-game terrain editor with sample tools
- Procedural brushes and auto-painting systems
- Modular, extendable UI framework