| Crates.io | bevy_map_autotile |
| lib.rs | bevy_map_autotile |
| version | 0.3.1 |
| created_at | 2025-12-22 10:34:23.764852+00 |
| updated_at | 2026-01-20 11:17:50.967164+00 |
| description | Tiled-compatible terrain autotile system |
| homepage | |
| repository | https://github.com/jbuehler23/bevy_map_editor |
| max_upload_size | |
| id | 1999493 |
| size | 221,426 |
Tiled-like terrain autotiling using Wang tiles.
Part of bevy_map_editor.
| Type | Tiles | Use Case |
|---|---|---|
| Corner | 16 | Ground transitions (grass/dirt) |
| Edge | 16 | Linear features (walls, rivers) |
| Mixed | 48 | Full terrain with corners and edges |
use bevy_map::autotile::{TerrainSet, TerrainSetType, Terrain, WangFiller};
// Create a terrain set
let mut terrain_set = TerrainSet::new(
"Ground Transitions",
tileset_id,
TerrainSetType::Corner,
);
// Add terrains (each terrain maps to tiles in the tileset)
terrain_set.add_terrain(Terrain::new("Grass", 0));
terrain_set.add_terrain(Terrain::new("Dirt", 1));
// Fill tiles automatically based on neighbors
let filler = WangFiller::new(&terrain_set);
filler.fill_area(&mut level, layer_index, terrain_index, x, y, width, height);
The autotile system examines neighboring tiles to determine which tile variant to place:
Corner Mode (16 tiles):
┌───┬───┬───┐ Each corner can be terrain A or B
│ A │ A │ B │ giving 2^4 = 16 combinations
├───┼───┼───┤
│ A │ ? │ B │
├───┼───┼───┤
│ A │ B │ B │
└───┴───┴───┘
The editor provides a terrain palette for painting with autotile support. Terrains are configured per-tileset and stored in the project file.
MIT OR Apache-2.0