A data-oriented 2D grid engine for games, optimized for performance with pathfinding and observer systems.
Tile is a high-performance 2D tile map engine written in Go, designed for handling large-scale grids in games and simulations. It uses a data-oriented, cache-friendly memory layout with each tile occupying 4 bytes and pages fitting into 64-byte cache lines to optimize CPU performance. The library provides essential utilities like thread-safe operations, pathfinding, and observer systems for reactive updates.
Game developers and simulation engineers working on projects that require efficient management of large 2D grids, such as real-time strategy games, roguelikes, or large-scale agent-based simulations. It is particularly suited for Go developers who need a performant, concurrent-safe grid system.
Developers choose Tile for its emphasis on performance through compact, cache-optimized memory layouts and zero-allocation traversal, which minimizes garbage collection overhead. Its built-in thread safety with per-page spinlocks, integrated A* pathfinding, and observer system for reactive updates provide a comprehensive solution out of the box, reducing the need for additional libraries.
Tile is a 2D grid engine, built with data and cache friendly ways, includes pathfinding and observers.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Each tile uses only 4 bytes, and pages fit into 64-byte cache lines, minimizing memory overhead and improving CPU performance for large grids like 3000x3000 using around 64MB.
Supports concurrent reads and writes with per-page spinlocks and atomic updates, enabling multiple goroutines to operate on the grid without data races.
Allows creating views that notify observers of tile changes in real-time, facilitating reactive game mechanics like fog of war or dynamic environment updates.
Includes A* pathfinding and BFS-based scanning with customizable cost functions, reducing the need for external libraries in game development.
The README explicitly states the API is not final and likely to change, and it's a side project with infrequent maintenance, making it unreliable for production-critical applications.
The A* algorithm can scan the entire map when no path exists, leading to significant performance degradation in games with frequent impassable areas or large grids.
Each tile is restricted to a 4-byte uint32 value for pathfinding, which may be insufficient for complex simulations requiring more granular or diverse state data per tile.