Similar to Path Finding, I would like to recommend a Path Making behavior.
Where as Path Finding plots its path to a selected point according to the obstacles between Point A and Point B, Path Making would define a strict, straight, specific path the objects would follow...a patrol route, in essence.
This could be used for enemies in a top-down game to patrol prescribed zones or bosses in side-scrollers to follow a pattern to be discovered (revealing a weak point in the process).
At present, I'm trying to work out my own patrol system/Path Making behavior from the existing C2 engine, and I'm frequently hitting road blocks. What I've worked out so far is to create these "nodes", contain them with variables and/or arrays that define which directions are open for the character to pursue, and then tell it to find the path from that node to the next node. This has worked, with much pain and labor, but it's not perfect.
What I propose then, is that the Path Maker behavior will allow you to set similar nodes which will give you the option to define how the character will behave when it arrives at that node:
- will it randomly choose from all available path?
- will it be able to choose the path it arrived on?
- will it cycle through the paths in a sequential order?
You can further choose the angle the paths are set at as they branch out from each node (and of course, there will be the option to choose how obstacles are set).
The main difficulty I've had in setting up my own system like this is how to place each node in a way that, regardless of how I arrange the nodes, it will have the information it needs on which node to travel to next. But in this case, the character needs only to know to follow the patrol path established by whichever node it originates from. If that path leads to another node, then that path, though perhaps originating from another node, is considered a viable pathway (perhaps an option to make paths one-way regardless of its origins?).
1. Nodes are origin points for paths.
2. Paths can be set at any angle.
3. Per-node options to dictate...
-- How the character will choose a new path.
-- Which paths are available to select from.
-- If paths are one-way or two-way.
-- The length of the path or if it is to end at another node it overlaps.
4. The character will strictly follow the path, similar to Path Finding.
5. Paths that overlap other nodes will be considered viable paths to select from unless the parameters of the originating node dictate otherwise.
(See my crude illustration here: https://www.sugarsync.com/pf/D6025908_4317202_6987563.)
This is probably an idea that would require some refinement if it's applied to updates to C2, but I hope it's a viable one.