Skip to content

liquids: support painting into sky and fix covered tile flags - #5973

Open
ab9rf wants to merge 2 commits into
DFHack:developfrom
ab9rf:liquids-80
Open

ab9rf wants to merge 2 commits into
DFHack:developfrom
ab9rf:liquids-80

Conversation

@ab9rf

@ab9rf ab9rf commented Sep 22, 2026

Copy link
Copy Markdown
Member

Implements the liquids improvements requested in #80: support painting into sky and fix covered tile flags

  • Allocate target map blocks when they don't exist, filling them with open space tiles like natural sky, so liquids and obsidian can be painted into unallocated sky blocks (point, range, block, and column brushes).
  • Update the light/outside flags of tiles covered by newly painted obsidian walls, obsidian floors, and river sources via the new MapCache::propagateVerticalFlags, so stacked obsidian structures no longer leave tiles below reading "outside light".

Tests cover the new behaviors:

  • painting water or obsidian into unallocated sky blocks, including a range brush that spans a map block boundary
  • obsidian walls, obsidian floors, and river sources clearing light/outside on the open tiles they cover

The tests synthesize unallocated blocks by detaching a block's block_index slot (generated forts typically have no unallocated blocks to find), and the cursor test waits for transient screens above the map to go away so cursor_hotkey-guarded commands can run.

Depends on/incorporates #5970.

Closes #80 (we are not going to implement undo).

Propagate light, outside, and subterranean flags to tiles below a tile
that changed between an open and a solid shape, matching how the game
maintains sky exposure. Handles both directions: exposing tiles copies
the changed tile's flags downward, while covering tiles clears the
light/outside flags of the column below.
Implements the liquids improvements requested in DFHack#80:  support painting into sky and fix covered tile flags

- Allocate target map blocks when they don't exist, filling them with   open space tiles like natural sky, so liquids and obsidian can be  painted into unallocated sky blocks (point, range, block, and column brushes).
- Update the light/outside flags of tiles covered by newly painted   obsidian walls, obsidian floors, and river sources via the new ` MapCache::propagateVerticalFlags`, so stacked obsidian structures no  longer leave tiles below reading "outside light".

Tests cover the new behaviors:

- painting water or obsidian into unallocated sky blocks, including a  range brush that spans a map block boundary
- obsidian walls, obsidian floors, and river sources clearing   light/outside on the open tiles they cover

The tests synthesize unallocated blocks by detaching a block's
block_index slot (generated forts typically have no unallocated blocks to find), and the cursor test waits for transient screens above the map to go away so cursor_hotkey-guarded commands can run.

Closes DFHack#80 (we are not going to implement undo).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some pointers on dfliquids, to be considered in future development

1 participant