any place marked with (*) are shaky points, and I would appreciate correction if need be.
Setup: my game is a maze-type game using prefab defined
Problem space: I want to have my agents be able to move around the
reasoning: because the built in path node system needs baking*, and I want to have the agents only know of a subset of all nodes at any given time (unless given a different subset) I think I will need to roll my own node system.
Question how would I create an extensible node system that can run dynamically?
*what I think it will need is that all
asked May 31 '12 at 05:35 PM
When I built a similar solution, I made my Nodes 'intelligent.'
On creation or when moved, a Node compiles and stores a list of adjacent Nodes. If that list has changed since last time, it tells the Path Manager so Paths can update.
When a Room is created, it gets all the Nodes inside itself, then builds a directional Path over those nodes.
Agents request directional Paths (From the Room when wandering, or from the Path Manager when hunting). This way an Agent only knows about its current Path (which translates to only knowing about the room it's in)
The Path Manager does all the heavy lifting of finding paths (and listening for moving nodes and adjusting accordingly); the Agents just happily run along the list of Nodes they're given. Once they reach the end they either loop to the beginning (wander) or do the 'where is Player?!' logic again and either get a new Path or go backwards along the one they have.
answered May 31 '12 at 08:17 PM