Entity.gridstate as DiscreteMap reference #294
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.
Depends on
#293 DiscreteMap serialization via bytes
john/McRogueFace
Reference
john/McRogueFace#294
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?
Summary
Replace the current entity gridstate implementation (flat arrays with
ensureGridstate()resize logic) with aDiscreteMapreference. Entity perspective knowledge becomes a first-class, swappable, serializable object rather than an implicit internal array.Current problems
ensureGridstate()silently destroys exploration data — moving between grids of different sizes wipes all discovery with no callback or save mechanismentity.gridstatereturns detached copies (SimpleNamespace snapshots), forcing O(w×h) Python iteration for save/restore — violates the principle that grid-shaped iteration stays on the C++ sideProposed API
Engine behavior on grid transitions
When an entity is removed from a grid (or the grid's perspective entity changes):
Game-side multi-grid memory pattern
The engine provides correct primitives; game code composes them for its specific needs.
Dependencies
Scope
Could be implemented incrementally on the current Entity/Grid, or as part of #252. The DiscreteMap serialization issue is a prerequisite.
Roadmap context
This issue is part of the Grid & Entity Overhaul Roadmap (
docs/GRID_ENTITY_OVERHAUL_ROADMAP.md), placed in Phase 4 (after #252 Grid/GridView split).The behavior system's seek/flee behaviors (#300) will initially use the current
DijkstraMaptype, then migrate toDiscreteMapwhen this issue lands. TheDiscreteMapwill also serve as the entity's perspective map for FOV-based TARGET triggers in the behavior system.