We have a bit of a tendency to use too many NPCs though incase you find that number appalling (Our system actually goes faster the more NPCs we have, which is why we have excessive amounts).
Like, if an agent goes farming, then sells his product to a concession stand, there are 5 AIs at work here.
- The agent doing the farming
- The agent maintaining the Entity’s inference abilities, so it knows how much money it’ll end up getting, how it’ll spend that, how it’ll store some. Etc
- The agent that takes the food from the farmer
- The agent that then takes the food from the merchant and decides how to distribute it among storefronts for later reselling
- The agent that manages #4’s inference abilities, which in turn allows the AI to decide how that food is distributed among the citizens, when the peaks of demand will most likely be, and to adjust the price accordingly
Obviously if you start breaking it down even more, there are more entities than that (ie: The consumer, perhaps the agent’s employer, perhaps his family that he has a “goal” to protect). Realizing how a chain of events can be represented as a series of agents instead of perhaps just two or three is one the most enabling features of our solution. It allows us to exponentially increase our simulation complexity while actually having a performance increase
We max out at 150,000 agents Queue updates per second. Since a queue can take an entity 5 - 10 minutes to complete (and are done entirely A-synchronously) in a best case scenario, our system could potentially (if we had unlimited HDD space or RAM) manage close to 90 million agents. Of course, we don’t have unlimited RAM or HDD. The most we’ve ever simulated just to see if it’d work was close to 700k. And it was a lag fest, simply due to the fact that we were running out of RAM on a 32GB system. By the end of a 60 minute benchmark, the system had written over 80GB to the HDD. But the CPU was never being fully utilized. We still had tons of room left for other features of a game.
Gah, Fourier transforms work wonders
Edit: Although it did work quite well on a 256GB distributed rack server. I don’t imagine everyone has one of those in their garages haha (**** that’d be nice)
Second Edit: To my knowledge though, Everquest Next has a similar system. The only thing we do better (Once again to my knowledge) is our LOD system seeing how I can confidently say that they need to do all their AI server side. I’m not ranting against them, I love all those dudes over there. Some of the coolest guys ever!