I am developing a rts/city building game, my worker Ai are using sphere collision to find resources.
My question is how expensive is EQS because I see many benefits of using it but I don’t know how big of an impact it would be if 500 actors are running EQS to find resources?
So if you were to have them run EQS queries on tick the entire time? Massive slowdown.
However, if you were to have them, say, run an EQS query when they have nothing to do on a 10s timer, that wouldn’t be so bad.
Run a query, find a thing to do, go do the thing (like pick up ore) then run an EQS again to find where to put it. That’s 2 queries in let’s say… 20 seconds. Virtually nothing!
If it were to run on tick that’s 300 vs 3. Now that’s not a big deal… until you have 500 workers and you have 60 queries each second times 500 (30,000) versus .1 queries per second times 500 (50).
They would run the EQS like you said only when the don’t have a task to do, that’s how they do the sphere trace right now.
I like the EQS more because it is more flexible in the code for me and somehow it is easier for me because I have to run huge sphere traces right now for them to find the resources and it would be easier for me to program resource importance with EQS like getting food would be more important then ore but if the distance is 2x to get the food then get the ore first.
In my whole game I have just one thing that runs on thing and that’s a camera trace to landscape to have the same height all the time.