Docstoc

Artificial Intelligence in Game Design Artificial Intelligence in Game Design Goal

Document Sample
Artificial Intelligence in Game Design Artificial Intelligence in Game Design Goal Powered By Docstoc
					Artificial Intelligence in
     Game Design

  Goal-Oriented Behavior
                                 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
                  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
                  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?
    Hunger Eat snack
           Cook dinner
    Energy Nap in chair
           Sleep in bed
    Fun      Go to concert
             Paint
             Read
                 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

   Need            Insistence
   Hunger          5
   Energy          0
   Fun             3
                  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

       Hunger    Eat snack: Hunger – 1
                 Cook dinner: Hunger – 5
       Energy    Nap in chair: Energy – 1
                 Sleep in bed: Energy – 5
       Fun       Go to concert: Fun – 4
                 Paint: Fun – 2
                 Read: Fun – 1
                  Choosing Actions
• Simple approach:
   – Choose goal with highest insistence
   – Choose action that gives largest decrease
   Need          Insistence
   Hunger        6
                                        Greatest need
   Energy        0
   Fun           3
                                                  Best action
   Eat      Eat snack: Hunger – 1
            Cook dinner: Hunger – 5
   Energy Nap in chair: Energy – 1
          Sleep in bed: Energy – 5
   Fun      Go to concert: Fun – 4
            Paint: Fun – 2
                       Side Effects
• Actions can effect multiple goals
  Drink Coffee    Hunger – 1
                  Energy – 1
  Eat at          Hunger – 4
  Restaurant      Fun – 3
  Gook Gourmet    Hunger – 5
  Meal            Fun – 1
                  Energy + 1



  Side effect
  Fulfilling one goal increases other needs
                          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

Need           Current      After Cook   After           After      After
               level        Gourmet      Drink           Eat at     Sleep in
                            Meal         Coffee          Restaurant Bed
Hunger              3            0             2             0           3
Energy              2            3             1             2           0
Fun                 4            3             4             1           4
Total effect                     6             7             3           7


                                         Best action
                       Overall Utility
• Problem: This can ignore very severe needs
   – Behavior does not appear rational!

      Need           Current After Eat at   After Sleep
                     level   Restaurant     in Bed
      Hunger            3          0               3
      Energy           10         10               5
      Fun               3          0               3
      Total effect                10              11



                               Will be chosen, even though
                               Sim is very tired!
              Overall Squared Utility
• Common solution:
  Total discontentment = sum of square of needs

   Need           Current After Eat at   After Sleep
                  level   Restaurant     in Bed
   Hunger            3         02             32
   Energy           10         102            52
   Fun               3         02             32
   Total effect                100            43
         Planning and Preconditions
• Actions may have preconditions before they can be taken

             Preconditions    Action   Postconditions


• Multiple actions required to meet needs

 Preconditions which     Action   Postconditions
 character meets
                                          meets


                                  Preconditions    Action   Postconditions
                                                            meet need
        Planning and Preconditions
  • Example: Microwaving food
     Uncooked food    Get food      Have uncooked
     in fridge                      food

                             meets
Have uncooked food   Cook food in     Have cooked
Have microwave        microwave       food

                             meets
     Have cooked       Eat food       Hunger - 5
     food
                Planning Methods
• Scripted action sequences
   – Actually single action with what appears to be multiple steps
   – Long animated sequence
                                  Get food
     Have uncooked food                              Hungry - 5
                           Cook food in microwave
     Have microwave
                                  Eat food



• 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

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:0
posted:5/18/2012
language:
pages:14