Presentation is loading. Please wait.

Presentation is loading. Please wait.

Artificial Intelligence in Game Design Goal-Oriented Behavior.

Similar presentations


Presentation on theme: "Artificial Intelligence in Game Design Goal-Oriented Behavior."— Presentation transcript:

1 Artificial Intelligence in Game Design Goal-Oriented Behavior

2 Goals Complex characters have goals –Add to realism of character Actions appear motivated instead or reflexive Player must be aware of character motivations –Example: Napoleon “boss” NPC Capture other cities Protect own cities Increase gold level Issue: –What if goals conflict? Get gold Avoid player ???

3 Goals and the Sims Overall goals (player meets) –Positive and negative goals Goals based on physical needs –Hunger –Energy –Fun –Etc. Characters automatically choose actions to meet needs

4 Goals and Actions Goals determine actions than fulfill need –Game keeps list of actions for each need –Which actions should NPC take to fulfill goals? HungerEat snack Cook dinner EnergyNap in chair Sleep in bed FunGo to concert Paint Read

5 Insistence of Needs Needs may have “degree of urgency” (insistence) –How critical is need? –How important is this need relative to others? –How much of an action is needed to fulfill need? Represented as number –Higher = greater need –Zero = no need NeedInsistence Hunger5 Energy0 Fun3

6 Actions and Goals Actions can permanently fulfill goals –Replaced with another related goal (Sims) –Ends game (Napoleon captures all cities in world) Actions can temporarily lessen needs –Action: Need – n lessens that need by n HungerEat snack: Hunger – 1 Cook dinner: Hunger – 5 EnergyNap in chair: Energy – 1 Sleep in bed: Energy – 5 FunGo to concert: Fun – 4 Paint: Fun – 2 Read: Fun – 1

7 Choosing Actions Simple approach: –Choose goal with highest insistence –Choose action that gives largest decrease NeedInsistence Hunger6 Energy0 Fun3 EatEat snack: Hunger – 1 Cook dinner: Hunger – 5 EnergyNap in chair: Energy – 1 Sleep in bed: Energy – 5 FunGo to concert: Fun – 4 Paint: Fun – 2 Greatest need Best action

8 Side Effects Actions can effect multiple goals Drink CoffeeHunger – 1 Energy – 1 Eat at Restaurant Hunger – 4 Fun – 3 Gook Gourmet Meal Hunger – 5 Fun – 1 Energy + 1 Side effect Fulfilling one goal increases other needs

9 Overall Utility Utility-based decision making –Determine effect of each action on total needs –Choose action that has best overall effect –One criteria: sum of all needs NeedCurrent level After Cook Gourmet Meal After Drink Coffee After Eat at Restaurant After Sleep in Bed Hunger30203 Energy23120 Fun43414 Total effect6737 Best action

10 Overall Utility Problem: This can ignore very severe needs –Behavior does not appear rational! NeedCurrent level After Eat at Restaurant After Sleep in Bed Hunger303 Energy10 5 Fun303 Total effect1011 Will be chosen, even though Sim is very tired!

11 Overall Squared Utility Common solution: Total discontentment = sum of square of needs NeedCurrent level After Eat at Restaurant After Sleep in Bed Hunger30202 3232 Energy1010 2 5252 Fun30202 3232 Total effect10043

12 Planning and Preconditions Actions may have preconditions before they can be taken Multiple actions required to meet needs Action PreconditionsPostconditions Action Preconditions which character meets Postconditions Action PreconditionsPostconditions meet need meets

13 Planning and Preconditions Example: Microwaving food Get food Uncooked food in fridge Have uncooked food Cook food in microwave Have uncooked food Have microwave Have cooked food meets Eat food Have cooked food Hunger - 5 meets

14 Planning Methods Scripted action sequences –Actually single action with what appears to be multiple steps –Long animated sequence Very simple to implement (no planning needed!) Weaknesses: –Cannot interrupt sequence without starting over entirely Phone rings while cooking –Cannot start plan until all preconditions met Get food Cook food in microwave Eat food Have uncooked food Have microwave Hungry - 5


Download ppt "Artificial Intelligence in Game Design Goal-Oriented Behavior."

Similar presentations


Ads by Google