Hello everyone, I’m really stumped as to what to do to achieve my current needs. Below I’ve posted what I’m trying to do, and what I have thought of so far. Any ideas are really appreciated, thank you for reading.
The Goal:
Platform: iOS
Amount of Agents active in scene: usually 2, possible many more (perhaps up to 10 or more).
Required Update Frequency: mostly likely 5-10 seconds between updates, agents are not fast.
I’ve got a mix of agent sizes (compared against other agents), some are fairly small, some are quite large. The problem arises when these agents need to computer courses where they may pass each other at close ranges, where clearance becomes an issue (similar to the ‘large agent through a small door’ issue). In A*, this can be dealt with by using Tags on nodes to make sure a path for an agent is not calculated though a certain area. The issue that the agents are dynamic, so the tagged area keep moving, and I’m looking for the combination of best performance vs. ease of implementation to address this situation.
What I’ve tried so far:
-
GraphUpdateScene only: Each agent has a small/medium/large “safe area / buffer area” defined by setting tag values in the “Points area”, agent turns off own GUS scripts before starting path.
-> Since Nav Mesh triangles are “on or off” only, changing tags could end up invalidating large areas of the Nav Mesh. Also concerned about performance on iOS (since GUS scripts update the entire graph, unlike nav mesh cutting correct?).
-Nav mesh resolution could of course be increased, but at some point is just becomes a grid graph right? In that the whole point of a nav mesh is that it doesn’t require as many nodes? -
Nav Mesh Cutting only: Each agent has a small/medium/large “cut area / buffer area” defined, agent turns off own Nav Mesh Cutting scripts before starting path.
-> Larger cuts override smaller cuts, so only the largest cut is applied / recognized.- Could potentially be overcome by having all cutting scripts on agents disabled by default, when an agent needs to calculate a path, it goes through a list of other ships, enabling the agent’s cutting script with the appropriate parameters (so a small agent activates the “small cutting area” on other agents, medium agents activate the “medium cutting area”, etc).
-> I am afraid of trying to manage the timings between updates (when the cut script is enabled vs. when the Nav Mesh update actually happens vs. when the path is calculated). There is also the issue of what happens if / when 2 or more agents try to calculate a path ‘at the same time’ and how that fits into the timing issue. This would require a lot of management.
- Could potentially be overcome by having all cutting scripts on agents disabled by default, when an agent needs to calculate a path, it goes through a list of other ships, enabling the agent’s cutting script with the appropriate parameters (so a small agent activates the “small cutting area” on other agents, medium agents activate the “medium cutting area”, etc).
-
Nav Mesh Cutting (without removing nodes [isDual]) + GraphUpdateScene tags: Each agent has a small/medium/large “cut area / buffer area” defined, and since the nav mesh is does not have any nodes removed, use GUS with area that is the same as the Nav Mesh Cut area with appropriate tags. Agent turns off GUS scripts when calculating path.
-> As noted in example “Door 2”, using cutting wipes out any tags on the affected nodes, so I don’t know when tags are / are not applied.
Thanks again for reading all of that, I’m just stuck on what to do.