Docstoc

Artificial Intelligence in Game Design

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

      Smart Terrain
                      Smart Terrain
• Objects in world meet needs of characters

     Hunger     Refrigerator, Microwave,
                Cookie Jar
     Energy     Bed, Sofa,
                Chair
     Fun        Computer, Bookshelf


•   Characters should be influenced to move towards those objects
•   Choice of objects should be influenced by:
    – Type and degree of needs
    – Location of objects
    – Degree to which they meet needs
              Objects and Influences
 • Objects have an area of influence
     – Radius in which they influence character to move towards them




Character with energy
need in influence
radius of bed
Should move towards
bed to meet need
                  Radius of Influence
•   Radius of influence depends on the “strength” of the object
     – Degree to which it meets needs of character
     – Character should move to things that better meet needs


                                Bed       Energy – 10

                                Sofa      Energy – 5

                                Chair     Energy – 1




                                          Only sleep in chair if
                                          actually in chair!
            Influences and Distances
•   Influence of objects lessens with distance
     – Idea: “More effort” required to reach object
     – Usually linear dropoff
       influence = strength - distance




           10    8     6    4     2    0    2     4   6   8   10
              Influences and Distances
•   Basic idea:
    Move towards object with greatest influence
      – Also based on current needs




Note that never                                   Bed has greater
sleep in chair, since                             influence, so move
bed always has                                    towards it
greater influence!
                        Map Flooding
•   Map Flooding used to determine influence at each location
    – Moves around walls, not through them

                            3   4   5   6    7    6   5
                            4   7   6   7    8    7   6
                    1       5   6   7   8    9    8   7
                1   2   1   6   7   8   9    10   9   8
                2   3   4   5   6   7   6    5    4   3
                1   2   3   4   5   6   5    4    3   2
                    1   2   3   4   5   4    3    2   1
                        1   2   3   4   3    2    1
                            1   2   3   2    1
                                1   2   1
     Movement and Smart Terrain
• Sim moves to tile that has largest value for that need
   – No need for any complex path algorithms!

                           3   4   5   6   7    6   5
                           4   7   6   7   8    7   6
                   1       5   6   7   8   9    8   7
               1   2   1   6   7   8   9   10   9   8
               2   3   4   5   6   7   6   5    4   3
               1   2   3   4   5   6   5   4    3   2
                   1   2   3   4   5   4   3    2   1
                       1   2   3   4   3   2    1
                           1   2   3   2   1
                               1   2   1
             Combined Influences
• Influence at tile is maximum of influences from objects
   – Sim moves towards object with strongest influence

                           3   4   5   6   7    6   5
                           4   7   6   7   8    7   6
                   1       5   6   7   8   9    8   7
               1   2   1   6   7   8   9   10   9   8
               2   3   4   5   6   7   6   5    4   3
               2   2   3   4   5   6   5   4    3   2
               3   2   2   3   4   5   4   3    2   1
               4   3   2   2   3   4   3   2    1
               5   4   3   2   2   3   2   1
               4   3   2   3   2   2   1
               Meeting Multiple Needs
•   What if influences from multiple
    needs?
                                                           3   4   5   6   7    6   5
     – Energy = 10, 8 units from bed
     – Hunger = 5, 4 units from refrigerator               4   7   6   7   8    7   6
•   Have separate tile value for                   1       5   6   7   8   9    8   7
    each need                                  1   2   1   6   7   8   9   10   9   8
                                               2   3   4   5   6   7   6   5    41 32
•   Move in direction of greatest              1   2   3   4   5   6   5   41 32 23
    value of greatest need                         1   2   3   4   5   41 32 23 14
     – Not bad idea, since movement
                                                       1   2   3   41 32 23 14      5
       does not require a lot of time
     – Can also use discomfort level                       1   21 32 23 14      6   7
       for actions that take longer                        1   12 23 14    5    7   8
                     Multi-Step Actions
• Each part of plan requires an object
•   Example: Cooking and eating food

    1. Get uncooked food       refrigerator meets need

    2. Cook food                microwave meets need

    3. Eat food                table meets need



    Overall scripted plan to
    meet “hungry” need
           Multi-Step Actions
• “Get uncooked food” need




                                      1   2   3
                                  1   2   3   4
                              1   2   3   4   5
                          1   2   3   4   5   6
                      1   2   3   4   5   6   7
                  1   2   3   4   5   6   7   8
           Multi-Step Actions
• “Cook uncooked food” need




                              1
                          1   2   1
                      1   2   3   4   5   6   7
                  1   2   3   4   5   6   7   8
                      1   2   3   4   5   6   7
                          1   2   3   4   5   6
                              1   2   3   4   5
                                  1   2   3   4
            Multi-Step Actions
• “Eat food” need


                             1
                         1   2    1
                         2   3    2   1
                 1       3   4    3   2   1
             1   2   3   4   5    4   3   2   1
             2   3   4   5   6    5   4   3   2   1
             3   4   5   6   7    6   5   4   3   2
             4   5   6   7   8    7   6   5   4   3
             5   6   7   8   9    8   7   6   5   4
             6   7   8   9   10   9   8   7   6   5
               Multi-Step Actions
• Potential problem:
  Plans may be interrupted if other needs become greater
• Example:
       • Hungry = 5
       • Social = 10
   – No objects meet “social” need, so start plan to meet “hungry”
     need
       • Get food
       • Cook food
   – Friend comes to door
       • Meets “social” need, so move towards friend
       • Abandon plan to eat!

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:1
posted:4/28/2014
language:English
pages:15