So this is a bit of a follow up to a previous question I had. I have a fairly large areas that my game takes place in. These large areas contain buildings which the AI needs to be able to find its way through. Here is an example of a building compared to the characters:
I have found that I need a pretty detailed graph in order for them to make it through those doors. Which wouldn’t be a big deal…except here is where the building lies within the largest possible play space:
This space will eventually also be filled with more buildings. How do I set up pathfinding for a space like this? At first I thought I could just use a LayeredGridGraph, as that was able to fill the 1000x1000 space and calculate pretty quickly, but it ate up way too much memory as there can be up to 15 areas of this size. I also tried a RecastGraph, but these areas are procedurally generated, so Recast was way too slow for that.
So what are my options here?
Well… It’s not an easy situation.
You want a huge world, but you cannot precalculate anything and it cannot use a very large amount of memory, I also assume multiple agents may need to request a path to any point on these spaces at all times. I’m afraid it will be hard to do this. I would have recommended recast graphs were they not too slow.
Yeah, I’m kinda at a loss. Been fiddling around with it for around 20 hours now and still haven’t really found a solution.
EDIT: Is there a way to have one part of the graph more detailed than the others? The exterior areas don’t need to be that detailed. While the buildings are being placed I will have the size of them and their location, so can I use that somehow?
Sorry, that is not possible at the moment.
I have been thinking about adding such a feature to the recast graph, but currently it is just in the idea stage.
How many AIs are you going to have in these regions? How complex are the environments? Is there a possibility to have e.g a huge mountain range or a wall which requires AIs to take very large detours from a straight path or are the detours always relatively small?
Anywhere from 10-30 AIs will be in a region at a time. And I think the problem has been solved here.