Chunk-Based Tilemap Architecture
The tilemap system in the game is based on a chunked layout, where the full tilemap is divided into multiple chunks depending on the tilemap dimensions and the configured chunk size.
This architectural choice significantly improves performance and memory efficiency, especially for large maps.

The number of chunks depends on both the overall tilemap size and the chunk dimensions.
For example, a tilemap that is 128 128 tiles in size, with each chunk being 8 8 tiles, results in a grid of 16 16 chunks.
Each chunk is internally represented as a render target texture (RenderTarget2D).
Whenever a tile inside the chunk is modified, the corresponding chunk is marked as dirty and automatically re-rendered to its new texture and disposes the old one.
To optimize rendering performance:
- Empty chunks (chunks that contain no tiles) are skipped entirely and never rendered.
- The tilemap system respects the cameras visible area. Chunks outside the current camera bounds are culled and not drawn at all.
Tile Connections System
Tile connection system that dynamically selects tile variants based on their surrounding neighbors. This helps create seamless terrain transitions without manual work.
There are three connection modes available:
- Individual: Each tile is rendered independently, with no awareness of neighboring tiles. This mode is simple and used for non-terrain elements (items).

- Sides: A tile checks its four direct neighbors (top, bottom, left, right) and selects the appropriate variant to blend with them. Ideal for terrain with simple transitions (paths, walls).

- Sides and Corners: This advanced mode considers all eight surrounding tilesincluding diagonalsallowing for smooth and detailed tile blending. Ideal for terrain with complext transitions (water, grass). It also enables the use of bitmasking for auto-tiling, similar to systems used in Godot and Tiled.
Whats New Compared to the Original Paleon
Paleon Reinvented introduces several visual and optimization improvements:
- Tiles that are located at the edges of the map are no longer visually cut off. They now connect seamlessly with the tilemap borders.
- When a tile is completely surrounded by tiles of the same type, it can randomly use a decorative variation
- In the original Paleon, each season had a separate, dedicated Tilemap. This meant managing multiple full maps for each seasonal state. In Paleon Reinvented, the system is much more elegant and efficient: I keep a single tilemap and simply swap its Tileset at runtime depending on the current season.
Paleon (old):

Paleon Reinvented:

Our Discord server: https://discord.gg/bnGvx8mXyB
Support me on Boosty: https://boosty.to/ricktechnolithic
[ 2025-06-03 17:40:27 CET ] [ Original post ]