Expand description
Ready-made tilesets and grid builders so a client (agent or GUI) can lay out floors, paths, dungeons and caves with one call.
preset_tileset registers a small kit of primitive-built tiles (floor,
path, wall, corner, ramp, …) with matching materials; the generator
functions paint those tiles onto a crate::tileset::TileMap:
paint_line for paths, gen_dungeon (rooms + corridors + walls) and
gen_cave (cellular automata). Tile convention: every kit mesh is built
around XZ-center with its bottom at y = 0; ops::add_tile_mesh places
it with an offset of half a cell.
Structs§
- Build
Report - Cave
Opts - Cave parameters: cellular automata.
fill~ initial wall density,smoothiteration passes; open cells become floor, border walls becomewall; rareaccenttiles (crystals) dot the floor. - Dungeon
Opts - Dungeon parameters:
w×hcells (from cell 0,0),roomsrandom chambers connected by corridors; every border cell of open space gets the wall tile. - KitTile
- One kit entry returned by
preset_tileset. - Rng
- Deterministic tiny LCG — no
randdependency.
Functions§
- gen_
cave - Organic cave system painted onto
map. - gen_
dungeon - Rooms + corridors + wall ring painted onto
map(cells overwritten). - kit_
motion - Motion the kits apply to their tiles by name (living-world wiring).
- merge_
meshes - Union of box parts into one mesh (no skin/UVs; normals recomputed).
- paint_
line - Bresenham line of
tilefrom cell(x0,z0)to(x1,z1); returns count. - preset_
tileset - Register a primitive-built kit as a new tileset.
kind:dungeon(Verlies: Boden/Weg/Wand/Ecke/Rampe/Tor),cave(Höhle: dunkler Boden, Wand, Felsbrocken, Kristall, Wasser) oroutdoor(Gras/Weg/Fels/Baum/ Hecke/Wasser). Returns the tileset id and its named tiles.