Bevy Procedural Tilemaps
This repository is a streamlined fork of Guillaume Henaux’s ghx_proc_gen, trimmed to focus on lightweight 2D tilemap generation with Wave Function Collapse / Model Synthesis for Bevy. The work powers the procedural-generation chapters of my upcoming Bevy game-development book—The Impatient Programmer's Guide to Bevy and Rust (Chapter 1 is already available here).
Highlights:
- Updated for Bevy 0.17.
- Small API surface: cartesian grid helpers, rule/model builders, and a simple Bevy runner.
- Designed for layered 2D tile maps (Z layers handled by a 3D grid).
- MIT/Apache dual-licensed, preserving full credit to the original authors.
Quickstart
use *;
use *;
The core building blocks come from procedural_tilemaps_core::prelude (re-exported through the Bevy prelude):
RulesBuilder,SocketCollection,ModelCollectionto describe adjacency rules.GeneratorBuilder/Generatorto run Model Synthesis / WFC.CartesianGrid,GridDelta,Directionfor cartesian grids.NodesSpawnerand bundle inserters to spawn tiles in Bevy worlds.
Example (tile layers)
The workspace ships with a single Bevy example demonstrating layered tile generation:
cargo run -p bevy_examples --example tile-layers
It stacks multiple Z layers to render a top-down map while using Bevy’s 2D camera. Assets come from the “16x16 Game Assets” pack by George Bailey (OpenGameArt, CC-BY 4.0).
Feature flags
[dependencies]
bevy_procedural_tilemaps = "0.1.2"
simple-plugin– registers the minimal generator runner used by the example. Enabled by default; opt out withdefault-features = falseif you want to wire systems manually.default-bundle-inserters– provides defaultBundleInserterimpls for common Bevy asset handles. Enabled by default; disable alongside the default features if you supply your own inserters.- Enabling the
bevyfeature on the core crate (automatically applied by this crate) derivesComponentfor relevant types and is required when targeting Bevy.
Credits
- Original project design & implementation: Guillaume Henaux (
Henauxg) and contributors. - Lean tiles edition & book integration maintained by AIBodh.
License
Code is dual-licensed under either:
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
at your option. Contributions are accepted under the same terms.
Assets
bevy_examples/assets/tile_layers: “16x16 Game Assets” by George Bailey, CC-BY 4.0.