questions about Utility AI

Started by
5 comments, last by IADaveMark 5 years, 5 months ago

hi.

im reading about utility AI and seems its best new approach for programming NPCs.

there is not much resource about it. how it really works?

defining some actions, some scoring parameters. give score to those actions in any defined interval and choose best scorer as chosen action. that's all? is there any best approach for coding that in c# or Unity?

Advertisement

Using that name is about 10 years old, but the model is much older.

The Sims is a good example of a game that uses it.  Every actor has a bunch of motives. You can see about 6 of them like hunger, bladder, energy, and social.  When the AI runs, it scans for a list of all the potential interactions. They range from things like "go to work", "play chess", "watch TV", "go to bed", "eat", "call a friend", and similar.  Each one looks at the motives and sees how well they can satisfy it, generating a score. When you're not hungry, eating won't satisfy any motives so it gets a very low score. When you are hungry, eating gets a much higher score. When you are dying of starvation food gets an incredibly high score.  Taking a shower is normally a very low score, unless your hygine is bad.  But taking a shower also has a tremendously high score when you catch fire, since it will put the fire out.  All the motives can have their utility score tabulated very rapidly, and the top items are considered by the AI for the next action.

More complex utilities can be developed in different games.  In city building games, the utility of each building can have many different scores.  It may have a score because of the direct effect, and it may have more score because of side effects.  Sum them all together than that's the total utility.  The choices with the highest utility should then be considered using additional criteria, such as the availability of resources.

As an approach, there are basically two: ask the object for a score, or ask how they change motives. In the first you can query the object giving it the list of your needs and than asking a score as a result. It can be a single function that takes a collection and returns a float. Or you can reverse it, asking every object what satisfaction it provides and it returns a collection, then use the resulting collection of motives to compute the score yourself.  Which is better depends on your game's plans, if and how you intent do expand your game in the future, the design of your game, what you use for utility functions, and much more.

 

Start here:

http://intrinsicalgorithm.com/IAonAI/2013/02/both-my-gdc-lectures-on-utility-theory-free-on-gdc-vault/

Then an entire architecture built on utility:

http://intrinsicalgorithm.com/IAonAI/2015/10/building-a-better-centaur-ai-at-massive-scale-gdc-ai-summit-lecture/ 

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

On 11/10/2018 at 8:39 PM, frob said:

Using that name is about 10 years old

Sorry... my fault.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

29 minutes ago, IADaveMark said:

Sorry... my fault.

Wait. I thought you were responsible for the name "utility-based salad". :)

3 minutes ago, alvaro said:

Wait. I thought you were responsible for the name "utility-based salad". :)

Specifically "taco salad".

http://intrinsicalgorithm.com/IAonAI/2012/11/ai-architectures-a-culinary-guide-gdmag-article/

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

This topic is closed to new replies.

Advertisement