Advertisement

Ai frameworks for task assignment and execution in simulation games

Started by May 18, 2024 06:47 PM
3 comments, last by Alberth 6 months, 4 weeks ago

Hi,

I'm looking for information about commonly used AI frameworks in simulation games such as Rimworld, Prison Architect, Oxygen Not Included, etc - for deciding what each character does.

On the one hand, there are the different characters that have various priorities of which tasks they want done, and on the other hand there are the different tasks/goals and what's best for them (someone that is nearby, someone that is good at that specific job). This is complicated a bit more by having tasks that require some preparation (like carrying items).

A simple utility AI can help a specific character choose the best task for them, but when there are multiple characters that want to do the same task, it gets more complicated since some may be closer, have higher skill, etc. It won't make sense if a character from the other side of the map will start walking to chop a tree that another idle character is standing right next to.

I've implemented a similar system in the past, but it had a hard time handling a large amount of tasks & characters, especially with large maps (despite pathfinding optimizations). I was wondering if anyone knew what kind of system was used in other games like those I mentioned, and if there is any literature or modern methods for dealing with these things.

Thanks!

Don't know those games, but I don't think much optimization of tasks happens. As you want more optimal behavior, cpu time explodes. That time cannot be spend on eg better graphics or more fluent game play.

In the area of strategy games optimal play is even deadly for the game. It's relatively easy to play optimal there, but the AI becomes so good in it that it's unwinnable for a player.

The goal of a game is to have fun for the player. Optimizing what you do is usually not part of that. Even if it is, an AI has way more information than a player, and can compute an optimal result much faster. No way a human can compete with that.

As for literature, you can probably fill a room or two with books about optimizing. Literally almost every business in the world is doing that.

Advertisement

It doesn't need to be 100% optimal, but it does need to make sense for the player. If a character has to walk across the map to toggle a switch that another character is just next to and doing nothing, that would look bad and players will definitely complain.

I'm looking for specific information on how these games do this, since they do feel more or less reasonable (definitely not perfect).

What about computing for a number of NPCs when they could finish the new task given the work they already have?

You could use heuristics like distance, or amount of work they already have, or expertise or … to reduce computation time,

This topic is closed to new replies.

Advertisement