Grid - Entity - GridPointState updates via TCOD #64

Closed
opened 2024-03-09 21:09:27 +00:00 by john · 1 comment
Owner

50 feat: grid / entity updates [depends on RAII, UIGrid fixes, UIEntity becoming UIDrawable, TCOD module]

Update the visible/discovered map of each entity based on the whole grid. While #16 is about connecting the Grid datatypes together correctly, and #30 is about moving entities on and off grids reliably, this issue is for setting discovered / visible flags on each GridPointState for each Entity, in accordance with TCOD algorithms for sight (using the GridPoints' transparent flag)

Dependencies:

  • #4 (RAII)
  • #30 (Add/Remove Entities reliably)
  • #16 (Entity Knowledge)
  • #35 (TCOD module) - or will this be in C++?
50 feat: grid / entity updates \[depends on RAII, UIGrid fixes, UIEntity becoming UIDrawable, TCOD module] Update the visible/discovered map of each entity based on the whole grid. While #16 is about connecting the Grid datatypes together correctly, and #30 is about moving entities on and off grids reliably, this issue is for setting discovered / visible flags on each GridPointState for each Entity, in accordance with TCOD algorithms for sight (using the GridPoints' transparent flag) Dependencies: * #4 (RAII) * #30 (Add/Remove Entities reliably) * #16 (Entity Knowledge) * #35 (TCOD module) - or will this be in C++?
Author
Owner

The core functionality described in #64 is fully implemented:

Feature Status Implementation
Setting visible/discovered flags Done entity.update_visibility()
TCOD FOV algorithms Done FOV_BASIC, SHADOW, DIAMOND, PERMISSIVE_0-8
Uses transparent flag Done grid->computeFOV() syncs with tcod_map
Per-entity gridstate Done entity.gridstate vector, lazy-initialized
Query cell state Done entity.at((x,y)) returns GridPointState
Access underlying point Done state.point (None if not discovered)
ColorLayer integration Done fov_layer.apply_perspective(entity)

The only major shortcoming related to this system is caching previously viewed tile state in discovered but not visible tiles. This is being left as an "exercise for the reader", as game devs can certainly populate a tile/color layer with the contents they wish to display in the perspective and make that layer empty/transparent in the visible area.

The core functionality described in #64 is **fully implemented**: | Feature | Status | Implementation | |----------------------------------|---------|--------------------------------------------| | Setting visible/discovered flags | ✅ Done | entity.update_visibility() | | TCOD FOV algorithms | ✅ Done | FOV_BASIC, SHADOW, DIAMOND, PERMISSIVE_0-8 | | Uses transparent flag | ✅ Done | grid->computeFOV() syncs with tcod_map | | Per-entity gridstate | ✅ Done | entity.gridstate vector, lazy-initialized | | Query cell state | ✅ Done | entity.at((x,y)) returns GridPointState | | Access underlying point | ✅ Done | state.point (None if not discovered) | | ColorLayer integration | ✅ Done | fov_layer.apply_perspective(entity) | The only major shortcoming related to this system is caching previously viewed tile state in discovered but not visible tiles. This is being left as an "exercise for the reader", as game devs can certainly populate a tile/color layer with the contents they wish to display in the perspective and make that layer empty/transparent in the visible area.
john closed this issue 2025-12-28 16:09:19 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
john/McRogueFace#64
No description provided.