dynamic node driven room based AI

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 rooms that are proceduraly placed (a levelManager will be controlling this). I know that there is a path-node system in Unity, but as far as I can tell it requires baking*, and also contradicts some of my desired functionality (see below). So I have placed Nodes into my prefabs at desired points (currently Empty GameObjects).

Problem space: I want to have my agents be able to move around the room that they are created in using the nodes (wandering), and not be aware of the nodes in the adjacent rooms unless told to take a calculated node path to a target (hunting). then if need be return to their starting room (traveling) via reverse path.

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 nodes will need to be a node layer, and that each have a given script. I think that I can have each agent locate local nodes with radius raycasts, but that will not be limited to the given subset unless I am missing something. I thought that I could get around some of this by having the rooms be their own data structure (this thought comes from a C++ OOP mindset), but I don’t think that Unity will allow this the same way that I would like as it seems to me that all Objects are aware of everything unless the layers say otherwise, and I don’t want to have to have a different layer for each room (mainly because it might not be a fixed number of rooms)

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.