Optionalchance0-100, the chance the passage is walked at all; defaults to 100
the chamber id this passage runs to
Optionalwidthcells wide; defaults to 1
Optionalwindiness0-100, the chance a walk step wanders instead of closing in; defaults to 0
Caves: chambers grown as blobs, joined by winding passages.
The counterpart to
generateDungeon's rooms-and-corridors: where a dungeon reads as built architecture, a cave reads as carved rock. Chambers grow from a centre by absorbing frontier cells until they holdsizecells (jaggedis the chance a step picks any frontier cell instead of the one nearest the centre, so 0 gives a round room and 100 a splatter); passages are biased random walks between chamber centres (windinessthe chance of a random step instead of the one closing in on the target,widthhow many cells wide);chancerolls whether a passage exists at all. Every chamber centre and everymustBeClearcoordinate is force-joined to the first chamber, so a generated cave is always fully connected whatever the rolls did.Seeded through the framework
Randomstack: the same seed produces the same cave on every machine, the same contractgenerateDungeonalready carries. A game that owns its stream (aSimulationRuntime's, say) passes it asrandominstead and the cave draws from that, advancing it, with no seed involved.shape: 'hex'carves the same cave on a hex grid (odd-q offset coordinates, theLevelconvention): six neighbours instead of four, chambers growing and passages closing in by hex distance, so a chamber is round on screen rather than a skewed diamond. The result'slevelcarries the shape, soPathfinderandFieldOfViewwalk it as hexes.Example