VisibilityMask records light_walls/algorithm even when they had no effect #404
Labels
No labels
Alpha Release Requirement
Bugfix
Demo Target
Documentation
Major Feature
Minor Feature
priority:tier1-active
priority:tier2-foundation
priority:tier3-future
priority:tier4-deferred
Refactoring & Cleanup
system:animation
system:documentation
system:grid
system:input
system:performance
system:procgen
system:python-binding
system:rendering
system:ui-hierarchy
Tiny Feature
workflow:blocked
workflow:needs-benchmark
workflow:needs-documentation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
john/McRogueFace#404
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while implementing
GridData.observe()/mcrfpy.VisibilityMaskfor the simulation-harness observation seam (seesrc/PyGridDataMethods.cpp:PyGridData::py_observe,src/PyVisibilityMask.{h,cpp}).For an unbounded mask —
observe()called with noorigin— no FOV computation runs at all (py_observejust fills the visibility plane with 1s; see thehas_originbranch aroundPyGridDataMethods.cpp:240-250, and the MCRF_NOTE "observe() with no origin touches no FOV state at all"). But thelight_wallsandalgorithmparameters are still parsed, defaulted (light_walls=True,algorithm=FOV.BASIC), and passed through toPyVisibilityMask::create(), which stores them unconditionally on the resulting object (PyVisibilityMaskObject::light_walls,::algorithm; seesrc/PyVisibilityMask.h:32-33). Somask.light_wallsandmask.algorithmread back asTrue/FOV.BASICon an unbounded mask even though neither parameter participated in producing it.VisibilityMaskis meant to be "an immutable, storable record of which cells were visible, from where, at which frame" — a record read back later, possibly much later (fog-of-war persistence, replay). Recording FOV parameters that were silently ignored makes that record misleading: a caller inspecting a stored mask has no way to tell "these values reflect how this mask was computed" from "these are just the defaults from an unrelated code path."Two options to consider (pick one):
Nonefor bothlight_wallsandalgorithmwhen the mask has noorigin(mirrors howfov_radiusis alreadyNonefor unbounded masks).light_walls/algorithmas errors if passed explicitly whileoriginisNone, since they'd be meaningless arguments.Filed as tier3/Tiny since it's a correctness-of-metadata issue, not a functional bug — the cell set itself is correct either way.