DFHack / dfhack

Memory hacking library for Dwarf Fortress and a set of tools that use it
Other
1.84k stars 462 forks source link

Reverse-engineer surface water feature detection #4636

Closed Bumber64 closed 1 month ago

Bumber64 commented 1 month ago

Plants are categorized into the shrub_wet or tree_wet vectors if they're within 2 tiles of a surface water feature. Need to figure out this logic for creating plants (plant plugin's plant create.)

quietust commented 1 month ago

The wet/dry distinction is fairly straightforward: it checks a 5x5 region minus the corners around the tile directly beneath the plant, and if at least one of those tiles is a River [Ramp], a Murky Pool [Ramp], a Brook, or a River Source (or a "waterfall from nowhere"), then the tile is considered Wet, otherwise it is Dry.

Bumber64 commented 1 month ago

So that's:

MurkyPool
MurkyPoolRamp
Waterfall
RiverSource
BrookN - BrookSE
RiverN - RiverSE
RiverRampN - RiverRampSE

But not:

BrookTop1 - BrookTop4

?

Or (for us) tiletype_shape::BROOK_BED, tiletype_material::POOL, and tiletype_material::RIVER.