enis
enis

Reputation: 31

The Sims 3 AI: utility to probability

Richard Evans gave a presentation about the Sims 3 AI at GDC 2010. He describes the algorithm in some detail on his presentation slides:

http://www.gdcvault.com/play/1012450/Modeling-Individual-Personalities-in-The

On slide 36 he describes how they convert utility scores to a probability distribution that the AI uses to randomly choose which action to take.

Can someone explain how exactly is the probability distribution calculated? I've tried to calculate the probabilities shown on slide 36 by using the simplified Boltzmann equation and estimating the utility scores from the chart on the left and "temperatures" from slide 38, but I can not get results that would be similar to the chart shown on the right side of slide 36.

Upvotes: 1

Views: 1028

Answers (2)

HelloGoodbye
HelloGoodbye

Reputation: 3922

The equation used in the slides doesn't seem to be a simplified version of the Boltzmann distribution, but a modified version of it.

For this to be a valid probability, though, it needs to be modified further, since all probabilities should be in the range [0, 1], while the probability formula given in the slideshow can evaluate to something that can be < 0 and > 1, which doesn't make any sense. The correct formula should be:

pi = max(esi/T - 1, 0)/Z

where Z is defined as

Z = max(es1/T-1, 0) + max(es2/T-1, 0) + ... + max(esN/T-1, 0)

and si and pi are the score (utility?) and the probability of the i:th action, respectively. N is the number of possible actions.

Upvotes: 2

Philip
Philip

Reputation: 1551

A probability distribution of a bunch of utility metrics just calculates the percentage that any utility has over the whole.

Ex: Eat = 10, Sleep = 100, Hunt = 20

The probability you'd eat would be 10/130. or 0.0769. Or 7.7%.
Sleep is 76.9%. Hunt is 15.4%.

You have the agent make a decision about what to do by rolling the dice and the choice falling into one of those three buckets. Probably sleep. That's how you would satisfy:

"Choose randomly using the score distribution as the probability distribution"

As for his slides and his "simplified Boltzmann equation". He's throwing in another variable and step that isn't really described. Apparently it has something to do with stress. But you're not going to convert that chart from the left into the chart on the right because you don't have all the information needed. Because it's all kinda bullshit. It's the Sims dude, how deep did you think it was?

Upvotes: 1

Related Questions