When you’re creating AI to control a population of thousands of visualized entities, and it’s all supposed to run on one machine, your options can often be limited. Now, I know I said population up there, and a lot of you read that as crowd and you would be wrong wrong wrong. So here comes a brief but informative aside. The problems of creating realistic crowd behavior and population behavior are two completely separate things:
- Crowds: Smaller in scope, both in time (duration of gathering) and in size (i.e. hours or days, 10s, 100s, 1000s of people). Actions do not have lasting consequences (see below). An example of this is a bunch of people assembled around a car accident, or in a stadium to witness a rock concert.
- Populations: Large in scope, both in time and size (days, months, years, forever, population size on the order of 10^3, 10^4, or 10^5). In a population, one agent’s life is totally independent of another agent’s life: i.e. two agents in a the same place at the same time are most probably not there for the same reason, whereas the opposite is true for crowds. The most significant differences between a population and a crowd, however, is that a population itself has a personality, and actions have lasting consequences.
By this I mean the following. When modeling a population, now you have to think about modeling time-of-day events, such as rush hour in the morning and evening, and making food vendors more busy during the lunch hour.
In addition, if a traumatic event, such as an explosion, occurs at location L, then now you have to model the effect this had on the population. When people pass by L, now they’re creeped out by it a bit, or perhaps they completely steer clear of it. Now the city has a history, which the population itself makes and reacts to.
Now that that’s out of the way, we can talk about modeling populations. Actually, I wanted to talk about just one model in particular, that is pretty popular + successful: The resource control model, and some of the implications of using it for population control. Used in such places as The Sims, and Shao and Terzopolous, the resource model essentially creates agents that look for things when they run out of them.
In the resource control model, agents maintain a list of resources, including things such as hunger or satisfaction, often represented simply as a number. The resource value can be thought of as “urge for/to” something. Due to whatever reason, eventually the resource value will increase beyond a threshold, and the agent has to do something about it. For example, eventually the hunger resource will increase beyond a threshold. At this point, the agent examines the world for things satisfying hunger, i.e. places providing food.
Of course, the success of this framework hinges up on the agents being able to find what they’re looking for the environment. There are two things spanning the space of options:
- Directory Lookup: An agent can query the system for the nearest food stand. The system returns the location of the food stand.
- Wandering: There is no directory facility. To find out where things are, agents have to wander around the city, noting whenever it finds something interesting.
Any population control scheme using resource control will most probably use a combination of these two. If the agents start out with all wandering, and there’s no directory service, then as they note things, eventually the information will be put into a sort of directory. Agents that use only directory lookup become excessively mechanical. If the population only cares about things they already know about, then new information is difficult to propagate.
So, any combination of the above two axes has wandering as a component.
The question is: How do you do good wandering behavior?
Let me roll that one over a little.