Game Development Reference
In-Depth Information
There's more
This recipe only has two different states, where one is the deciding one. What do we do if
we have, let's say five equally important resources or tasks to consider? The principles are
very much the same:
• Begin by normalizing the need for each task between 0.0 and 1.0. This makes it
easier to balance things.
• Next, add all the values together, and divide each value by the sum. Now, each
value is balanced with each other, and the total of all values is 1.0.
In this recipe, the evaluation is done continuously, but it might just as well be applied when
an AI has finished a task, to see what it should do next. In that case, the task could be
picked at random among the distributed values to make it more dynamic.
Search WWH ::




Custom Search