SlideShare une entreprise Scribd logo
1  sur  280
Game AI 101
NPCs and Agents and
Algorithms... Oh My!

                Luke Dicken
Strathclyde AI and Games Research Group
         University of Strathclyde
Who Am I




2
Who Am I

    • PhD Student at University of Strathclyde




2
Who Am I

    • PhD Student at University of Strathclyde
      ‣ BSc(Hons), MSc, MRes(Dist) in AI-related fields




2
Who Am I

    • PhD Student at University of Strathclyde
      ‣ BSc(Hons), MSc, MRes(Dist) in AI-related fields
    • Founding member of SAIG




2
Who Am I

    • PhD Student at University of Strathclyde
      ‣ BSc(Hons), MSc, MRes(Dist) in AI-related fields
    • Founding member of SAIG
    • AltDevBlogADay author




2
Who Am I

    • PhD Student at University of Strathclyde
      ‣ BSc(Hons), MSc, MRes(Dist) in AI-related fields
    • Founding member of SAIG
    • AltDevBlogADay author
    • AltDevConf organiser




2
Who Am I

    • PhD Student at University of Strathclyde
      ‣ BSc(Hons), MSc, MRes(Dist) in AI-related fields
    • Founding member of SAIG
    • AltDevBlogADay author
    • AltDevConf organiser
    • Board of Directors for IGDA Scotland



2
Who Am I

    • PhD Student at University of Strathclyde
      ‣ BSc(Hons), MSc, MRes(Dist) in AI-related fields
    • Founding member of SAIG
    • AltDevBlogADay author
    • AltDevConf organiser
    • Board of Directors for IGDA Scotland
    • Recipient of the 2012 Eric Dybsand Memorial AI
     Scholarship to attend GDC
2
Game AI 101




3
Game AI 101

    • Today going to look at techniques to populate game
     worlds with characters




3
Game AI 101

    • Today going to look at techniques to populate game
     worlds with characters
    • This is not state of the art stuff, this is entry level




3
Game AI 101

    • Today going to look at techniques to populate game
     worlds with characters
    • This is not state of the art stuff, this is entry level
    • We will be dealing with a mix of




3
Game AI 101

    • Today going to look at techniques to populate game
     worlds with characters
    • This is not state of the art stuff, this is entry level
    • We will be dealing with a mix of
       ‣ Concepts




3
Game AI 101

    • Today going to look at techniques to populate game
     worlds with characters
    • This is not state of the art stuff, this is entry level
    • We will be dealing with a mix of
       ‣ Concepts
       ‣ Examples



3
Game AI 101

    • Today going to look at techniques to populate game
     worlds with characters
    • This is not state of the art stuff, this is entry level
    • We will be dealing with a mix of
       ‣ Concepts
       ‣ Examples
       ‣ Code


3
Game AI 101

    • Today going to look at techniques to populate game
     worlds with characters
    • This is not state of the art stuff, this is entry level
    • We will be dealing with a mix of
       ‣ Concepts
       ‣ Examples
       ‣ Code
    • Assumes familiarity with Unity
3
Pure AI vs Game AI




4
Pure AI vs Game AI


    • “Pure” AI is a scientific discipline




4
Pure AI vs Game AI


    • “Pure” AI is a scientific discipline
       ‣ Interested in creating systems as smart as possible




4
Pure AI vs Game AI


    • “Pure” AI is a scientific discipline
       ‣ Interested in creating systems as smart as possible
       ‣ Optimal solutions to real-world problems




4
Pure AI vs Game AI


    • “Pure” AI is a scientific discipline
       ‣ Interested in creating systems as smart as possible
       ‣ Optimal solutions to real-world problems
    • Game AI is a whole other thing




4
Pure AI vs Game AI


    • “Pure” AI is a scientific discipline
       ‣ Interested in creating systems as smart as possible
       ‣ Optimal solutions to real-world problems
    • Game AI is a whole other thing
       ‣ Create “realistic simulations” of intelligence




4
Pure AI vs Game AI


    • “Pure” AI is a scientific discipline
       ‣ Interested in creating systems as smart as possible
       ‣ Optimal solutions to real-world problems
    • Game AI is a whole other thing
       ‣ Create “realistic simulations” of intelligence
          - E.g. Believable characters




4
Pure AI vs Game AI


    • “Pure” AI is a scientific discipline
       ‣ Interested in creating systems as smart as possible
       ‣ Optimal solutions to real-world problems
    • Game AI is a whole other thing
       ‣ Create “realistic simulations” of intelligence
          - E.g. Believable characters
       ‣ Enhance the players experience

4
Pure AI vs Game AI




5
Pure AI vs Game AI




6
Pure AI vs Game AI


    • Pure AI for an NPC would be to make it fight as
     effectively as possible.




6
Pure AI vs Game AI


    • Pure AI for an NPC would be to make it fight as
     effectively as possible.
    • Is that what we actually want to achieve?




6
Pure AI vs Game AI


    • Pure AI for an NPC would be to make it fight as
     effectively as possible.
    • Is that what we actually want to achieve?
    • Game AI aims to make an immersive experience




6
Pure AI vs Game AI


    • Pure AI for an NPC would be to make it fight as
     effectively as possible.
    • Is that what we actually want to achieve?
    • Game AI aims to make an immersive experience
       ‣ Represent a thug character accurately




6
Pure AI vs Game AI


    • Pure AI for an NPC would be to make it fight as
     effectively as possible.
    • Is that what we actually want to achieve?
    • Game AI aims to make an immersive experience
       ‣ Represent a thug character accurately
       ‣ Allow the player to “become” Batman



6
Pure AI vs Game AI


    • Pure AI for an NPC would be to make it fight as
     effectively as possible.
    • Is that what we actually want to achieve?
    • Game AI aims to make an immersive experience
       ‣ Represent a thug character accurately
       ‣ Allow the player to “become” Batman
    • Entertainment, not problem solving
6
Automated Opponents




7
Automated Opponents

    • Centuries of trying to play games with few players




7
Automated Opponents

    • Centuries of trying to play games with few players
      ‣ Mechanical Turk claimed to be a chess player circa 1770




7
Automated Opponents

    • Centuries of trying to play games with few players
      ‣ Mechanical Turk claimed to be a chess player circa 1770
      ‣ First video game example - Pong 1972




7
Automated Opponents

    • Centuries of trying to play games with few players
      ‣ Mechanical Turk claimed to be a chess player circa 1770
      ‣ First video game example - Pong 1972
      ‣ Ongoing commercial interest - FPS “Bots” RTS “Skirmish”




7
Automated Opponents

    • Centuries of trying to play games with few players
      ‣ Mechanical Turk claimed to be a chess player circa 1770
      ‣ First video game example - Pong 1972
      ‣ Ongoing commercial interest - FPS “Bots” RTS “Skirmish”




7
Automated Opponents

    • Centuries of trying to play games with few players
      ‣ Mechanical Turk claimed to be a chess player circa 1770
      ‣ First video game example - Pong 1972
      ‣ Ongoing commercial interest - FPS “Bots” RTS “Skirmish”
    • Emphasis now on delivering a good player
     experience.



7
Automated Opponents

    • Centuries of trying to play games with few players
      ‣ Mechanical Turk claimed to be a chess player circa 1770
      ‣ First video game example - Pong 1972
      ‣ Ongoing commercial interest - FPS “Bots” RTS “Skirmish”
    • Emphasis now on delivering a good player
     experience.
      ‣ Human-like rather than “good” AI


7
Automated Opponents

    • Centuries of trying to play games with few players
      ‣ Mechanical Turk claimed to be a chess player circa 1770
      ‣ First video game example - Pong 1972
      ‣ Ongoing commercial interest - FPS “Bots” RTS “Skirmish”
    • Emphasis now on delivering a good player
     experience.
      ‣ Human-like rather than “good” AI
      ‣ Sub-human in order to be beatable
7
Looking and Being Smart




8
Looking and Being Smart

    • Two components to Game AI




8
Looking and Being Smart

    • Two components to Game AI
      ‣ Looking Smart




8
Looking and Being Smart

    • Two components to Game AI
      ‣ Looking Smart
      ‣ Being Smart




8
Looking and Being Smart

    • Two components to Game AI
      ‣ Looking Smart
      ‣ Being Smart
    • Focus in this session on “Being Smart”




8
Looking and Being Smart

    • Two components to Game AI
      ‣ Looking Smart
      ‣ Being Smart
    • Focus in this session on “Being Smart”
    • Looking Smart is more of an animation / art issue




8
Looking and Being Smart

    • Two components to Game AI
      ‣ Looking Smart
      ‣ Being Smart
    • Focus in this session on “Being Smart”
    • Looking Smart is more of an animation / art issue
      ‣ Does the character “feel” intelligent




8
Looking and Being Smart

    • Two components to Game AI
       ‣ Looking Smart
       ‣ Being Smart
    • Focus in this session on “Being Smart”
    • Looking Smart is more of an animation / art issue
       ‣ Does the character “feel” intelligent
    • Good decision making still required to drive this

8
Looking and Being Smart

    • Two components to Game AI
       ‣ Looking Smart
       ‣ Being Smart
    • Focus in this session on “Being Smart”
    • Looking Smart is more of an animation / art issue
       ‣ Does the character “feel” intelligent
    • Good decision making still required to drive this
       ‣ Be smart, then trigger equivalent “look smart”
8
Some AI Basics
What is
     Artificial Intelligence?




10
What is
                Artificial Intelligence?
     • Any time a computer has to pick between two or
      more choices it can be said it is acting “intelligently”




10
What is
                 Artificial Intelligence?
     • Any time a computer has to pick between two or
      more choices it can be said it is acting “intelligently”
     • That isn’t to say that it is inherently making good
      choices.




10
What is
                 Artificial Intelligence?
     • Any time a computer has to pick between two or
      more choices it can be said it is acting “intelligently”
     • That isn’t to say that it is inherently making good
      choices.
        ‣ Tho neither do people...




10
What is
                 Artificial Intelligence?
     • Any time a computer has to pick between two or
      more choices it can be said it is acting “intelligently”
     • That isn’t to say that it is inherently making good
      choices.
        ‣ Tho neither do people...
     • Typically, looking for better-than-random levels of
      sophistication
10
Decision Making




11
Decision Making


     • Not going to get too bogged down today in
      decision making process.




11
Decision Making


     • Not going to get too bogged down today in
      decision making process.
     • Science of decisions can fill multiple degree-level
      courses




11
Decision Making


     • Not going to get too bogged down today in
      decision making process.
     • Science of decisions can fill multiple degree-level
      courses
     • Game Theory is a good starting point to learn more



11
Decision Making


     • Not going to get too bogged down today in
      decision making process.
     • Science of decisions can fill multiple degree-level
      courses
     • Game Theory is a good starting point to learn more
        ‣ “Behavioral Mathematics for Game AI” Dave Mark


11
Smart or Dumb?




12
Smart or Dumb?

     • Partly ignoring decision making because for Game
      AI, it isn’t so important for intro level.




12
Smart or Dumb?

     • Partly ignoring decision making because for Game
      AI, it isn’t so important for intro level.
       ‣ Making a decision is a good start




12
Smart or Dumb?

     • Partly ignoring decision making because for Game
      AI, it isn’t so important for intro level.
       ‣ Making a decision is a good start
     • Partly because of the entertainment issue




12
Smart or Dumb?

     • Partly ignoring decision making because for Game
      AI, it isn’t so important for intro level.
       ‣ Making a decision is a good start
     • Partly because of the entertainment issue
       ‣ Making good decisions is irrelevant




12
Smart or Dumb?

     • Partly ignoring decision making because for Game
      AI, it isn’t so important for intro level.
       ‣ Making a decision is a good start
     • Partly because of the entertainment issue
       ‣ Making good decisions is irrelevant
       ‣ We don’t want tactical genius soldiers




12
Smart or Dumb?

     • Partly ignoring decision making because for Game
      AI, it isn’t so important for intro level.
        ‣ Making a decision is a good start
     • Partly because of the entertainment issue
        ‣ Making good decisions is irrelevant
        ‣ We don’t want tactical genius soldiers
     • Partly for rapid iteration

12
Smart or Dumb?

     • Partly ignoring decision making because for Game
      AI, it isn’t so important for intro level.
        ‣ Making a decision is a good start
     • Partly because of the entertainment issue
        ‣ Making good decisions is irrelevant
        ‣ We don’t want tactical genius soldiers
     • Partly for rapid iteration
        ‣ Make any decision, figure out how to make it better later
12
Agent-Based Systems




13
Agent-Based Systems




13
Agent-Based Systems

     • Intelligent Agents are things within our problem that
      are going to be trying to act intelligently.




13
Agent-Based Systems

     • Intelligent Agents are things within our problem that
      are going to be trying to act intelligently.
     • Could be a Roomba, a warehouse robot, an
      automated trip booking system or a predator drone




13
Agent-Based Systems

     • Intelligent Agents are things within our problem that
      are going to be trying to act intelligently.
     • Could be a Roomba, a warehouse robot, an
      automated trip booking system or a predator drone
     • Agents have three important characteristics




13
Agent-Based Systems

     • Intelligent Agents are things within our problem that
      are going to be trying to act intelligently.
     • Could be a Roomba, a warehouse robot, an
      automated trip booking system or a predator drone
     • Agents have three important characteristics
        ‣ Sense the environment



13
Agent-Based Systems

     • Intelligent Agents are things within our problem that
      are going to be trying to act intelligently.
     • Could be a Roomba, a warehouse robot, an
      automated trip booking system or a predator drone
     • Agents have three important characteristics
        ‣ Sense the environment
        ‣ “Think” about what to do


13
Agent-Based Systems

     • Intelligent Agents are things within our problem that
      are going to be trying to act intelligently.
     • Could be a Roomba, a warehouse robot, an
      automated trip booking system or a predator drone
     • Agents have three important characteristics
        ‣ Sense the environment
        ‣ “Think” about what to do
        ‣ Turn “thinking” into actions within the environment
13
Agent-Based Systems




13
NPCs as Agents




14
NPCs as Agents

     • One of the core places we can apply “agent-based
      systems” is when thinking about NPCs




14
NPCs as Agents

     • One of the core places we can apply “agent-based
      systems” is when thinking about NPCs
     • Each NPC is an agent.




14
NPCs as Agents

     • One of the core places we can apply “agent-based
      systems” is when thinking about NPCs
     • Each NPC is an agent.
       ‣ In some situations we may have a “General” as the agent




14
NPCs as Agents

     • One of the core places we can apply “agent-based
      systems” is when thinking about NPCs
     • Each NPC is an agent.
       ‣ In some situations we may have a “General” as the agent
          - Directing NPCs around as its way of affecting the world.




14
NPCs as Agents

     • One of the core places we can apply “agent-based
      systems” is when thinking about NPCs
     • Each NPC is an agent.
        ‣ In some situations we may have a “General” as the agent
           - Directing NPCs around as its way of affecting the world.

     • In this model



14
NPCs as Agents

     • One of the core places we can apply “agent-based
      systems” is when thinking about NPCs
     • Each NPC is an agent.
        ‣ In some situations we may have a “General” as the agent
           - Directing NPCs around as its way of affecting the world.

     • In this model
        ‣ NPCs sense the world


14
NPCs as Agents

     • One of the core places we can apply “agent-based
      systems” is when thinking about NPCs
     • Each NPC is an agent.
        ‣ In some situations we may have a “General” as the agent
           - Directing NPCs around as its way of affecting the world.

     • In this model
        ‣ NPCs sense the world
        ‣ Decide what to do, then do it
14
Representations




15
Representations

     • Software Engineering buzzwords!




15
Representations

     • Software Engineering buzzwords!
     • Representation internal to one NPC or shared?




15
Representations

     • Software Engineering buzzwords!
     • Representation internal to one NPC or shared?
       ‣ Alien Hivemind - All units know what one unit knows




15
Representations

     • Software Engineering buzzwords!
     • Representation internal to one NPC or shared?
       ‣ Alien Hivemind - All units know what one unit knows
          - Communal blackboard!




15
Representations

     • Software Engineering buzzwords!
     • Representation internal to one NPC or shared?
       ‣ Alien Hivemind - All units know what one unit knows
          - Communal blackboard!
       ‣ Modern Squad - Communication between certain units




15
Representations

     • Software Engineering buzzwords!
     • Representation internal to one NPC or shared?
       ‣ Alien Hivemind - All units know what one unit knows
          - Communal blackboard!
       ‣ Modern Squad - Communication between certain units
          - This was made explicit in “Enslaved Odyssey to the West”




15
Representations

     • Software Engineering buzzwords!
     • Representation internal to one NPC or shared?
       ‣ Alien Hivemind - All units know what one unit knows
          - Communal blackboard!
       ‣ Modern Squad - Communication between certain units
          - This was made explicit in “Enslaved Odyssey to the West”
          - Message passing between units




15
Representations

     • Software Engineering buzzwords!
     • Representation internal to one NPC or shared?
       ‣ Alien Hivemind - All units know what one unit knows
          - Communal blackboard!
       ‣ Modern Squad - Communication between certain units
          - This was made explicit in “Enslaved Odyssey to the West”
          - Message passing between units
       ‣ Medieval Guards - No widespread communication

15
Representations

     • Software Engineering buzzwords!
     • Representation internal to one NPC or shared?
       ‣ Alien Hivemind - All units know what one unit knows
          - Communal blackboard!
       ‣ Modern Squad - Communication between certain units
          - This was made explicit in “Enslaved Odyssey to the West”
          - Message passing between units
       ‣ Medieval Guards - No widespread communication
          - Pure-internal representation
15
AI in Game Worlds
Taking Our First Steps




17
Taking Our First Steps

     • For this session let’s assume we have




17
Taking Our First Steps

     • For this session let’s assume we have
        ‣ A 3D world




17
Taking Our First Steps

     • For this session let’s assume we have
        ‣ A 3D world
        ‣ A pre-fab for an NPC




17
Taking Our First Steps

     • For this session let’s assume we have
        ‣ A 3D world
        ‣ A pre-fab for an NPC
           - Surprise! We’ll be using the Unity soldier today




17
Taking Our First Steps

     • For this session let’s assume we have
        ‣ A 3D world
        ‣ A pre-fab for an NPC
           - Surprise! We’ll be using the Unity soldier today

     • We’re going to work today with FPS, but the
      techniques generalise fine.



17
Taking Our First Steps

     • For this session let’s assume we have
        ‣ A 3D world
        ‣ A pre-fab for an NPC
           - Surprise! We’ll be using the Unity soldier today

     • We’re going to work today with FPS, but the
      techniques generalise fine.
     • Examples today come primarily from Steve
      Gargolinski ( http://stevegargolinski.com )
17
Moving at Random




18
Moving at Random


     • OK, let’s do something basic




18
Moving at Random


     • OK, let’s do something basic
       ‣ Take our NPC, pick a location and go there.




18
Moving at Random


     • OK, let’s do something basic
       ‣ Take our NPC, pick a location and go there.
       ‣ When he gets there, pick another location etc.




18
Moving at Random


     • OK, let’s do something basic
       ‣ Take our NPC, pick a location and go there.
       ‣ When he gets there, pick another location etc.
     • We need to




18
Moving at Random


     • OK, let’s do something basic
       ‣ Take our NPC, pick a location and go there.
       ‣ When he gets there, pick another location etc.
     • We need to
       ‣ Pick a location randomly




18
Moving at Random


     • OK, let’s do something basic
       ‣ Take our NPC, pick a location and go there.
       ‣ When he gets there, pick another location etc.
     • We need to
       ‣ Pick a location randomly
       ‣ Be able to move the NPC about



18
Moving at Random


     • OK, let’s do something basic
       ‣ Take our NPC, pick a location and go there.
       ‣ When he gets there, pick another location etc.
     • We need to
       ‣ Pick a location randomly
       ‣ Be able to move the NPC about
       ‣ Be able to detect when we get to the location

18
Moving at Random




19
Moving at Random




     • Demo 1




19
Following the Player




20
Following the Player


     • Let’s do something a bit more sophisticated




20
Following the Player


     • Let’s do something a bit more sophisticated
       ‣ Follow the player around the map




20
Following the Player


     • Let’s do something a bit more sophisticated
       ‣ Follow the player around the map
     • This time we need to




20
Following the Player


     • Let’s do something a bit more sophisticated
       ‣ Follow the player around the map
     • This time we need to
       ‣ Determine position of the target




20
Following the Player


     • Let’s do something a bit more sophisticated
       ‣ Follow the player around the map
     • This time we need to
       ‣ Determine position of the target
       ‣ Move towards the target




20
Following the Player


     • Let’s do something a bit more sophisticated
        ‣ Follow the player around the map
     • This time we need to
        ‣ Determine position of the target
        ‣ Move towards the target
     • Very similar to the last example, this time we have a
      non-random target

20
Following the Player




21
Following the Player




     • Demo 2




21
On Patrol




22
On Patrol


     • Typically, we want soldiers guarding things, patrolling




22
On Patrol


     • Typically, we want soldiers guarding things, patrolling
        ‣ Go to the next waypoint




22
On Patrol


     • Typically, we want soldiers guarding things, patrolling
        ‣ Go to the next waypoint
        ‣ When you get there, go to the next in the series etc




22
On Patrol


     • Typically, we want soldiers guarding things, patrolling
        ‣ Go to the next waypoint
        ‣ When you get there, go to the next in the series etc
     • Still just an iterative improvement on previous




22
On Patrol


     • Typically, we want soldiers guarding things, patrolling
        ‣ Go to the next waypoint
        ‣ When you get there, go to the next in the series etc
     • Still just an iterative improvement on previous
        ‣ We need to track where the waypoints are




22
On Patrol


     • Typically, we want soldiers guarding things, patrolling
        ‣ Go to the next waypoint
        ‣ When you get there, go to the next in the series etc
     • Still just an iterative improvement on previous
        ‣ We need to track where the waypoints are
        ‣ Which one we are near



22
On Patrol


     • Typically, we want soldiers guarding things, patrolling
        ‣ Go to the next waypoint
        ‣ When you get there, go to the next in the series etc
     • Still just an iterative improvement on previous
        ‣ We need to track where the waypoints are
        ‣ Which one we are near
        ‣ Which comes next in a sequence

22
On Patrol




23
On Patrol




     • Demo 3




23
Looking (Kinda) Smart




24
Looking (Kinda) Smart



     • An NPC that does just one thing is not smart




24
Looking (Kinda) Smart



     • An NPC that does just one thing is not smart
     • Raging gun battle, it doesn’t make sense to carry on
      patrolling.




24
Looking (Kinda) Smart



     • An NPC that does just one thing is not smart
     • Raging gun battle, it doesn’t make sense to carry on
      patrolling.
     • We’ve got now three different sets of code for
      specific jobs, no way to swap between them.


24
Different Situations,
     Different Behaviours




25
Different Situations,
                 Different Behaviours

     • So we know that different situations are going to
      call for different behaviours




25
Different Situations,
                  Different Behaviours

     • So we know that different situations are going to
      call for different behaviours
     • We need to be able to swap from one to another
      realistically




25
Different Situations,
                  Different Behaviours

     • So we know that different situations are going to
      call for different behaviours
     • We need to be able to swap from one to another
      realistically
     • This is where we’re going to really be using AI
      techniques

25
Finite State Machines




26
Finite State Machines



     • FSMs are fundamental building blocks in Computer
      Science




26
Finite State Machines



     • FSMs are fundamental building blocks in Computer
      Science
     • A machine that can be in one of a number of states




26
Finite State Machines



     • FSMs are fundamental building blocks in Computer
      Science
     • A machine that can be in one of a number of states
     • It transitions from one state to another when
      certain conditions are met


26
Finite State Machine




27
NPCs as an FSM




28
NPCs as an FSM



     • We can represent what behaviour is currently active
      as a state in an FSM




28
NPCs as an FSM



     • We can represent what behaviour is currently active
      as a state in an FSM
     • When certain things happen we can transition to a
      different state




28
NPCs as an FSM



     • We can represent what behaviour is currently active
      as a state in an FSM
     • When certain things happen we can transition to a
      different state
     • We can move around states as required


28
A Simple Guard




29
A Simple Guard



     • Let’s combine what we’ve seen already




29
A Simple Guard



     • Let’s combine what we’ve seen already
       ‣ A guard stands idle




29
A Simple Guard



     • Let’s combine what we’ve seen already
       ‣ A guard stands idle
       ‣ When he sees the player he begins approaching




29
A Simple Guard



     • Let’s combine what we’ve seen already
       ‣ A guard stands idle
       ‣ When he sees the player he begins approaching
       ‣ If the player breaks line of sight, he returns to his start
         position



29
A Simple Guard




30
A Simple Guard




     • Demo 4




30
Non-Boolean Transitions




31
Non-Boolean Transitions




     • We can track non-boolean values and use these as
      triggers for state transitions




31
Non-Boolean Transitions




     • We can track non-boolean values and use these as
      triggers for state transitions
     • Just need to meet a boolean criteria e.g. X > 100



31
Suspicious Guard




32
Suspicious Guard


     • This time, the guard will grow suspicious the longer
      the player stays in view.




32
Suspicious Guard


     • This time, the guard will grow suspicious the longer
      the player stays in view.
        ‣ When suspicion hits a threshold, the guard will
         investigate




32
Suspicious Guard


     • This time, the guard will grow suspicious the longer
      the player stays in view.
        ‣ When suspicion hits a threshold, the guard will
         investigate
        ‣ If the player breaks line of sight, guards suspicion begins
         to lower, continues to investigate



32
Suspicious Guard


     • This time, the guard will grow suspicious the longer
      the player stays in view.
        ‣ When suspicion hits a threshold, the guard will
         investigate
        ‣ If the player breaks line of sight, guards suspicion begins
         to lower, continues to investigate
        ‣ When suspicion drops below a threshold, returns to start

32
Suspicious Guard




33
Suspicious Guard




     • Demo 5




33
Beyond FSMs




34
Beyond FSMs


     • Finite State Machines are easy to understand




34
Beyond FSMs


     • Finite State Machines are easy to understand
     • But they get complicated quickly




34
Beyond FSMs


     • Finite State Machines are easy to understand
     • But they get complicated quickly
       ‣ Particularly for behaviours that need to have multiple
         components chained to them, and be interruptible




34
Beyond FSMs


     • Finite State Machines are easy to understand
     • But they get complicated quickly
        ‣ Particularly for behaviours that need to have multiple
         components chained to them, and be interruptible
     • They aren’t state of the art, but good to introduce
      concepts


34
Beyond FSMs


     • Finite State Machines are easy to understand
     • But they get complicated quickly
        ‣ Particularly for behaviours that need to have multiple
         components chained to them, and be interruptible
     • They aren’t state of the art, but good to introduce
      concepts
     • Not widely used in industry now.
34
Hierarchical Concurrent
         State Machines




35
Hierarchical Concurrent
                  State Machines

     • Recent addition to the AI developers arsenal




35
Hierarchical Concurrent
                  State Machines

     • Recent addition to the AI developers arsenal
     • Popular after successful use in Left 4 Dead




35
Hierarchical Concurrent
                  State Machines

     • Recent addition to the AI developers arsenal
     • Popular after successful use in Left 4 Dead
        ‣ Drove NPCs




35
Hierarchical Concurrent
                   State Machines

     • Recent addition to the AI developers arsenal
     • Popular after successful use in Left 4 Dead
        ‣ Drove NPCs
        ‣ Also drove the AI Director system




35
Hierarchical Concurrent
                   State Machines

     • Recent addition to the AI developers arsenal
     • Popular after successful use in Left 4 Dead
        ‣ Drove NPCs
        ‣ Also drove the AI Director system
     • A real-time parallel redesign of the Finite State
      Machine (sort of)

35
Hierarchical Concurrent
         State Machines




36
Hierarchical Concurrent
                 State Machines


     • Building block of an HCSM is itself an HCSM




36
Hierarchical Concurrent
                  State Machines


     • Building block of an HCSM is itself an HCSM
       ‣ Recursive by nature




36
Hierarchical Concurrent
                  State Machines


     • Building block of an HCSM is itself an HCSM
       ‣ Recursive by nature
     • Analogue input wire




36
Hierarchical Concurrent
                  State Machines


     • Building block of an HCSM is itself an HCSM
       ‣ Recursive by nature
     • Analogue input wire
     • Configuration parameters




36
Hierarchical Concurrent
                  State Machines


     • Building block of an HCSM is itself an HCSM
       ‣ Recursive by nature
     • Analogue input wire
     • Configuration parameters
     • Output wire


36
Hierarchical Concurrent
         State Machines




37
Behaviour Trees




38
Behaviour Trees

     • Behaviour Trees are another great way of deciding
      which of a bunch of behaviours should be activated
      at a given time.




38
Behaviour Trees

     • Behaviour Trees are another great way of deciding
      which of a bunch of behaviours should be activated
      at a given time.
     • Lets you craft intricate behaviours, and combine
      them relatively intelligently.




38
Behaviour Trees

     • Behaviour Trees are another great way of deciding
      which of a bunch of behaviours should be activated
      at a given time.
     • Lets you craft intricate behaviours, and combine
      them relatively intelligently.
     • Kind of similar conceptually to a Decision Tree with
      an internal knowledge of what triggered last time
38
Example Behaviour Tree




            “Introduction to Behaviour Trees”, Bjoern Knafla
                                       AltDevBlogADay.com
39
Path Finding




40
Path Finding

     • Being able to automatically work out how to move
      around a world is a common AI problem




40
Path Finding

     • Being able to automatically work out how to move
      around a world is a common AI problem
     • Several good algorithms for doing this, today going
      to show A*




40
Path Finding

     • Being able to automatically work out how to move
      around a world is a common AI problem
     • Several good algorithms for doing this, today going
      to show A*
     • Works by assessing




40
Path Finding

     • Being able to automatically work out how to move
      around a world is a common AI problem
     • Several good algorithms for doing this, today going
      to show A*
     • Works by assessing
        ‣ Work done



40
Path Finding

     • Being able to automatically work out how to move
      around a world is a common AI problem
     • Several good algorithms for doing this, today going
      to show A*
     • Works by assessing
        ‣ Work done
        ‣ Estimating work remaining (a heuristic)


40
Path Finding

     • Being able to automatically work out how to move
      around a world is a common AI problem
     • Several good algorithms for doing this, today going
      to show A*
     • Works by assessing
        ‣ Work done
        ‣ Estimating work remaining (a heuristic)
     • Always selects most promising node
40
Heuristic Example - A*




41
Heuristic Example - A*

                     B




         A



42
Heuristic Example - A*

                     B




         A



43
Heuristic Example - A*

                     B




     1+7    A

           1 +7

44
Heuristic Example - A*

                     B




     1+7    A

           1 +7

45
Heuristic Example - A*

                      B




     2+6

     1+7    A

     2 + 8 1 +7

46
Heuristic Example - A*

                      B




     2+6

     1+7    A

     2 + 8 1 +7

47
Heuristic Example - A*

                      B

     3+5

     2+6

     1+7    A

     2 + 8 1 +7

48
Heuristic Example - A*

                      B

     3+5

     2+6

     1+7    A

     2 + 8 1 +7

49
Heuristic Example - A*

     4+4              B

     3+5 4+4

     2+6

     1+7    A

     2 + 8 1 +7

50
Heuristic Example - A*

     4+4 5+3          B

     3+5 4+4 5+3

     2+6

     1+7    A

     2 + 8 1 +7

51
Heuristic Example - A*

     4+4 5+3 6+2        B

     3+5 4+4 5+3

     2+6          6+4

     1+7    A

     2 + 8 1 +7

52
Heuristic Example - A*

     4+4 5+3 6+2        B

     3+5 4+4 5+3

     2+6          6+4

     1+7    A

     2 + 8 1 +7

53
Heuristic Example - A*

     4+4 5+3 6+2        B

     3+5 4+4 5+3

     2+6        6+4

     1+7    A

     2 + 8 1 +7 2 + 6

54
Heuristic Example - A*

     4+4 5+3 6+2        B

     3+5 4+4 5+3

     2+6        6+4

     1+7    A

     2 + 8 1 +7 2 + 6

55
Heuristic Example - A*

     4+4 5+3 6+2              B

     3+5 4+4 5+3

     2+6        6+4

     1+7    A

     2 + 8 1 +7 2 + 6 3 + 5

56
Heuristic Example - A*

     4+4 5+3 6+2             B

     3+5 4+4 5+3

     2+6        6+4

     1+7    A         4+4

     2 + 8 1 +7 2 + 6 3 + 5 4 + 4

57
Heuristic Example - A*

     4+4 5+3 6+2             B

     3+5 4+4 5+3

     2+6        6+4

     1+7    A         4+4

     2 + 8 1 +7 2 + 6 3 + 5 4 + 4

58
Heuristic Example - A*

     4+4 5+3 6+2             B

     3+5 4+4 5+3

     2+6        6+4 5+3

     1+7    A         4+4 5+3

     2 + 8 1 +7 2 + 6 3 + 5 4 + 4

59
Heuristic Example - A*

     4+4 5+3 6+2             B

     3+5 4+4 5+3

     2+6        6+4 5+3

     1+7    A         4+4 5+3

     2 + 8 1 +7 2 + 6 3 + 5 4 + 4

60
Heuristic Example - A*

     4+4 5+3 6+2             B

     3+5 4+4 5+3

     2+6        6+4 5+3 6+2

     1+7    A         4+4 5+3

     2 + 8 1 +7 2 + 6 3 + 5 4 + 4

61
Heuristic Example - A*

     4+4 5+3 6+2             B

     3+5 4+4 5+3

     2+6        6+4 5+3 6+2

     1+7    A         4+4 5+3

     2 + 8 1 +7 2 + 6 3 + 5 4 + 4

62
Heuristic Example - A*

     4+4 5+3 6+2             B

     3+5 4+4 5+3            7+1

     2+6        6+4 5+3 6+2

     1+7    A         4+4 5+3

     2 + 8 1 +7 2 + 6 3 + 5 4 + 4

63
Heuristic Example - A*

     4+4 5+3 6+2             B

     3+5 4+4 5+3            7+1

     2+6        6+4 5+3 6+2

     1+7    A         4+4 5+3

     2 + 8 1 +7 2 + 6 3 + 5 4 + 4

64
Heuristic Example - A*

     4+4 5+3 6+2             B

     3+5 4+4 5+3            7+1

     2+6        6+4 5+3 6+2

     1+7    A         4+4 5+3

     2 + 8 1 +7 2 + 6 3 + 5 4 + 4

65
Heuristic Example - A*

     4+4 5+3 6+2             B

     3+5 4+4 5+3            7+1

     2+6        6+4 5+3 6+2

     1+7    A         4+4 5+3

     2 + 8 1 +7 2 + 6 3 + 5 4 + 4

66
Pathfinding in Unity




67
Pathfinding in Unity


     • Unity 3.5 now includes pathfinding natively




67
Pathfinding in Unity


     • Unity 3.5 now includes pathfinding natively
       ‣ Pro only apparently




67
Pathfinding in Unity


     • Unity 3.5 now includes pathfinding natively
       ‣ Pro only apparently
     • Not entirely sure how this is implemented




67
Pathfinding in Unity


     • Unity 3.5 now includes pathfinding natively
       ‣ Pro only apparently
     • Not entirely sure how this is implemented
       ‣ I still haven’t bought Pro...




67
Pathfinding in Unity


     • Unity 3.5 now includes pathfinding natively
        ‣ Pro only apparently
     • Not entirely sure how this is implemented
        ‣ I still haven’t bought Pro...
     • Possibly similar to the Path package (creator of that
      works at Unity)

67
Path




68
Path




     • Demo 6




68
Runtime Woes




69
Runtime Woes


     • We’ve talked about pathfinding and decision making




69
Runtime Woes


     • We’ve talked about pathfinding and decision making
     • These can be computationally hard problems




69
Runtime Woes


     • We’ve talked about pathfinding and decision making
     • These can be computationally hard problems
       ‣ In general we want to shoot for around 60fps




69
Runtime Woes


     • We’ve talked about pathfinding and decision making
     • These can be computationally hard problems
       ‣ In general we want to shoot for around 60fps
       ‣ 16.67ms of computation per frame




69
Runtime Woes


     • We’ve talked about pathfinding and decision making
     • These can be computationally hard problems
       ‣ In general we want to shoot for around 60fps
       ‣ 16.67ms of computation per frame
       ‣ Most of that will go on non-AI aspects




69
Runtime Woes


     • We’ve talked about pathfinding and decision making
     • These can be computationally hard problems
        ‣ In general we want to shoot for around 60fps
        ‣ 16.67ms of computation per frame
        ‣ Most of that will go on non-AI aspects
     • Realistically looking at 1 or 2ms per frame for all AI


69
Runtime Woes


     • We’ve talked about pathfinding and decision making
     • These can be computationally hard problems
        ‣ In general we want to shoot for around 60fps
        ‣ 16.67ms of computation per frame
        ‣ Most of that will go on non-AI aspects
     • Realistically looking at 1 or 2ms per frame for all AI
     • Lots of computation, not a lot of time

69
Breaking Problems Up




70
Breaking Problems Up


     • So we know that we might want to do things take
      longer than we have.




70
Breaking Problems Up


     • So we know that we might want to do things take
      longer than we have.
     • How can we break it up into manageable chunks so
      that we aren’t delaying the game thread?




70
Breaking Problems Up


     • So we know that we might want to do things take
      longer than we have.
     • How can we break it up into manageable chunks so
      that we aren’t delaying the game thread?
     • In Unity, we have a very powerful system at our
      disposal called


70
Breaking Problems Up


     • So we know that we might want to do things take
      longer than we have.
     • How can we break it up into manageable chunks so
      that we aren’t delaying the game thread?
     • In Unity, we have a very powerful system at our
      disposal called
       ‣ Coroutines

70
Coroutines




71
Coroutines


     • Coroutines are blocks of code that can return a
      value partway through execution.




71
Coroutines


     • Coroutines are blocks of code that can return a
      value partway through execution.
     • Next time that routine is called, it will pick up
      where it left off




71
Coroutines


     • Coroutines are blocks of code that can return a
      value partway through execution.
     • Next time that routine is called, it will pick up
      where it left off
     • Allows you to chop a block of code up into roughly
      frame-computable chunks.


71
Coroutines


     • Coroutines are blocks of code that can return a
      value partway through execution.
     • Next time that routine is called, it will pick up
      where it left off
     • Allows you to chop a block of code up into roughly
      frame-computable chunks.
        ‣ Delays overall result, doesn’t delay code execution

71
Juggling Timings




72
Juggling Timings

     • Another great use of Coroutines is to get timing of
      things right.




72
Juggling Timings

     • Another great use of Coroutines is to get timing of
      things right.
          - Lots of things in Unity are “delayed calls”




72
Juggling Timings

     • Another great use of Coroutines is to get timing of
      things right.
          - Lots of things in Unity are “delayed calls”

     • They don’t actually happen til the end of the frame




72
Juggling Timings

     • Another great use of Coroutines is to get timing of
      things right.
          - Lots of things in Unity are “delayed calls”

     • They don’t actually happen til the end of the frame
          - Destroy(), Debug.Log()




72
Juggling Timings

     • Another great use of Coroutines is to get timing of
      things right.
          - Lots of things in Unity are “delayed calls”

     • They don’t actually happen til the end of the frame
          - Destroy(), Debug.Log()
     • We can do things like



72
Juggling Timings

     • Another great use of Coroutines is to get timing of
      things right.
          - Lots of things in Unity are “delayed calls”

     • They don’t actually happen til the end of the frame
          - Destroy(), Debug.Log()
     • We can do things like
                    yield return new WaitForEndOfFrame();


72
Juggling Timings

     • Another great use of Coroutines is to get timing of
      things right.
          - Lots of things in Unity are “delayed calls”

     • They don’t actually happen til the end of the frame
          - Destroy(), Debug.Log()
     • We can do things like
                    yield return new WaitForEndOfFrame();
     • What we are waiting for happens, code resumes
72
Coroutines in practice




73
Coroutines in practice




     • Demo




73
Summary




74
Summary


     • Today we covered basics/fundamentals




74
Summary


     • Today we covered basics/fundamentals
       ‣ What we’re trying to achieve with Game AI




74
Summary


     • Today we covered basics/fundamentals
       ‣ What we’re trying to achieve with Game AI
       ‣ Some very simple implementations of behaviours




74
Summary


     • Today we covered basics/fundamentals
       ‣ What we’re trying to achieve with Game AI
       ‣ Some very simple implementations of behaviours
       ‣ Simple methods for selecting which is active




74
Summary


     • Today we covered basics/fundamentals
       ‣ What we’re trying to achieve with Game AI
       ‣ Some very simple implementations of behaviours
       ‣ Simple methods for selecting which is active
       ‣ Discussion of some more advanced methods




74
Summary


     • Today we covered basics/fundamentals
       ‣ What we’re trying to achieve with Game AI
       ‣ Some very simple implementations of behaviours
       ‣ Simple methods for selecting which is active
       ‣ Discussion of some more advanced methods
       ‣ Intro to Pathfinding



74
Summary


     • Today we covered basics/fundamentals
       ‣ What we’re trying to achieve with Game AI
       ‣ Some very simple implementations of behaviours
       ‣ Simple methods for selecting which is active
       ‣ Discussion of some more advanced methods
       ‣ Intro to Pathfinding
       ‣ Coroutines for AI

74
Takeaways




75
Takeaways




     1. AI is awesome




75
Takeaways




     1. AI is awesome
     2. AI is complicated




75
Takeaways




     1. AI is awesome
     2. AI is complicated
     3. AI doesn’t need to be scary




75
But Wait There’s More!




76
But Wait There’s More!


     • We haven’t scratched the surface of what we can do
      with AI.




76
But Wait There’s More!


     • We haven’t scratched the surface of what we can do
      with AI.
       ‣ AI for companions




76
But Wait There’s More!


     • We haven’t scratched the surface of what we can do
      with AI.
       ‣ AI for companions
       ‣ AI for squad behaviours & coordination of multiple NPCs




76
But Wait There’s More!


     • We haven’t scratched the surface of what we can do
      with AI.
       ‣ AI for companions
       ‣ AI for squad behaviours & coordination of multiple NPCs
       ‣ AI for scenario control (e.g. Left 4 Dead)




76
But Wait There’s More!


     • We haven’t scratched the surface of what we can do
      with AI.
       ‣ AI for companions
       ‣ AI for squad behaviours & coordination of multiple NPCs
       ‣ AI for scenario control (e.g. Left 4 Dead)
       ‣ AI for content generation


76
Contact

     • luke@cis.strath.ac.uk
     • @LukeD


     • http://saig.cis.strath.ac.uk - Research Group
     • http://lukedicken.com - Personal Site


                            Questions?
77

Contenu connexe

Tendances

Killzone's AI: Dynamic Procedural Tactics
Killzone's AI: Dynamic Procedural TacticsKillzone's AI: Dynamic Procedural Tactics
Killzone's AI: Dynamic Procedural TacticsGuerrilla
 
게임 개발 파이프라인과 시스템 기획(공개용)
게임 개발 파이프라인과 시스템 기획(공개용)게임 개발 파이프라인과 시스템 기획(공개용)
게임 개발 파이프라인과 시스템 기획(공개용)ChangHyun Won
 
Artificial intelligence in gaming.
Artificial intelligence in gaming.Artificial intelligence in gaming.
Artificial intelligence in gaming.Rishikese MR
 
Initial Architectural Design (Game Architecture)
Initial Architectural Design (Game Architecture)Initial Architectural Design (Game Architecture)
Initial Architectural Design (Game Architecture)Rajkumar Pawar
 
Personalisation as the key to optimising your game's revenue & LTV.
Personalisation as the key to optimising your game's revenue & LTV.Personalisation as the key to optimising your game's revenue & LTV.
Personalisation as the key to optimising your game's revenue & LTV.GameCamp
 
Endless runner game in unreal engine 4
Endless runner game in unreal engine 4Endless runner game in unreal engine 4
Endless runner game in unreal engine 4Vasilis Kamakaris
 
Game Architecture and Programming
Game Architecture and ProgrammingGame Architecture and Programming
Game Architecture and ProgrammingSumit Jain
 
Introduction to Game Development
Introduction to Game DevelopmentIntroduction to Game Development
Introduction to Game DevelopmentShaan Alam
 
[AI10] ゲームキャラクターのための人工知能と社会への応用 ~ FINAL FANTASY XV を事例として ~
[AI10] ゲームキャラクターのための人工知能と社会への応用 ~ FINAL FANTASY XV を事例として ~[AI10] ゲームキャラクターのための人工知能と社会への応用 ~ FINAL FANTASY XV を事例として ~
[AI10] ゲームキャラクターのための人工知能と社会への応用 ~ FINAL FANTASY XV を事例として ~de:code 2017
 
Game Development Step by Step
Game Development Step by StepGame Development Step by Step
Game Development Step by StepBayu Sembada
 
ゲームAIから見るAIの歴史
ゲームAIから見るAIの歴史ゲームAIから見るAIの歴史
ゲームAIから見るAIの歴史Youichiro Miyake
 
Game Design Fundamentals: The Formal Elements
Game Design Fundamentals: The  Formal ElementsGame Design Fundamentals: The  Formal Elements
Game Design Fundamentals: The Formal ElementsChristina Wodtke
 
쩌는 게임 기획서, 이렇게 쓴다(How to write great design documents) from GDC 2008 (Korean)
쩌는 게임 기획서, 이렇게 쓴다(How to write great design documents) from GDC 2008 (Korean)쩌는 게임 기획서, 이렇게 쓴다(How to write great design documents) from GDC 2008 (Korean)
쩌는 게임 기획서, 이렇게 쓴다(How to write great design documents) from GDC 2008 (Korean)Kay Kim
 
Creating a Game Design Document
Creating a Game Design DocumentCreating a Game Design Document
Creating a Game Design DocumentKarl Kapp
 
GAME 3400 Level Design - Moment Based Design
GAME 3400 Level Design - Moment Based DesignGAME 3400 Level Design - Moment Based Design
GAME 3400 Level Design - Moment Based DesignSeth Sivak
 
KillzoneにおけるNPCの動的な制御
KillzoneにおけるNPCの動的な制御KillzoneにおけるNPCの動的な制御
KillzoneにおけるNPCの動的な制御Youichiro Miyake
 
ゲームデザインを改善/批評するための時間構造モデル「ワンダールクス」
ゲームデザインを改善/批評するための時間構造モデル「ワンダールクス」ゲームデザインを改善/批評するための時間構造モデル「ワンダールクス」
ゲームデザインを改善/批評するための時間構造モデル「ワンダールクス」Sho Iwamoto
 
The rise of Hyper-casual & takeaways from Tap Tap Games
The rise of Hyper-casual & takeaways from Tap Tap GamesThe rise of Hyper-casual & takeaways from Tap Tap Games
The rise of Hyper-casual & takeaways from Tap Tap GamesGameCamp
 
Intro to Game Design
Intro to Game DesignIntro to Game Design
Intro to Game DesignGraeme Smith
 
모바일 게임기획 따라하며 배우기
모바일 게임기획 따라하며 배우기모바일 게임기획 따라하며 배우기
모바일 게임기획 따라하며 배우기Sunnyrider
 

Tendances (20)

Killzone's AI: Dynamic Procedural Tactics
Killzone's AI: Dynamic Procedural TacticsKillzone's AI: Dynamic Procedural Tactics
Killzone's AI: Dynamic Procedural Tactics
 
게임 개발 파이프라인과 시스템 기획(공개용)
게임 개발 파이프라인과 시스템 기획(공개용)게임 개발 파이프라인과 시스템 기획(공개용)
게임 개발 파이프라인과 시스템 기획(공개용)
 
Artificial intelligence in gaming.
Artificial intelligence in gaming.Artificial intelligence in gaming.
Artificial intelligence in gaming.
 
Initial Architectural Design (Game Architecture)
Initial Architectural Design (Game Architecture)Initial Architectural Design (Game Architecture)
Initial Architectural Design (Game Architecture)
 
Personalisation as the key to optimising your game's revenue & LTV.
Personalisation as the key to optimising your game's revenue & LTV.Personalisation as the key to optimising your game's revenue & LTV.
Personalisation as the key to optimising your game's revenue & LTV.
 
Endless runner game in unreal engine 4
Endless runner game in unreal engine 4Endless runner game in unreal engine 4
Endless runner game in unreal engine 4
 
Game Architecture and Programming
Game Architecture and ProgrammingGame Architecture and Programming
Game Architecture and Programming
 
Introduction to Game Development
Introduction to Game DevelopmentIntroduction to Game Development
Introduction to Game Development
 
[AI10] ゲームキャラクターのための人工知能と社会への応用 ~ FINAL FANTASY XV を事例として ~
[AI10] ゲームキャラクターのための人工知能と社会への応用 ~ FINAL FANTASY XV を事例として ~[AI10] ゲームキャラクターのための人工知能と社会への応用 ~ FINAL FANTASY XV を事例として ~
[AI10] ゲームキャラクターのための人工知能と社会への応用 ~ FINAL FANTASY XV を事例として ~
 
Game Development Step by Step
Game Development Step by StepGame Development Step by Step
Game Development Step by Step
 
ゲームAIから見るAIの歴史
ゲームAIから見るAIの歴史ゲームAIから見るAIの歴史
ゲームAIから見るAIの歴史
 
Game Design Fundamentals: The Formal Elements
Game Design Fundamentals: The  Formal ElementsGame Design Fundamentals: The  Formal Elements
Game Design Fundamentals: The Formal Elements
 
쩌는 게임 기획서, 이렇게 쓴다(How to write great design documents) from GDC 2008 (Korean)
쩌는 게임 기획서, 이렇게 쓴다(How to write great design documents) from GDC 2008 (Korean)쩌는 게임 기획서, 이렇게 쓴다(How to write great design documents) from GDC 2008 (Korean)
쩌는 게임 기획서, 이렇게 쓴다(How to write great design documents) from GDC 2008 (Korean)
 
Creating a Game Design Document
Creating a Game Design DocumentCreating a Game Design Document
Creating a Game Design Document
 
GAME 3400 Level Design - Moment Based Design
GAME 3400 Level Design - Moment Based DesignGAME 3400 Level Design - Moment Based Design
GAME 3400 Level Design - Moment Based Design
 
KillzoneにおけるNPCの動的な制御
KillzoneにおけるNPCの動的な制御KillzoneにおけるNPCの動的な制御
KillzoneにおけるNPCの動的な制御
 
ゲームデザインを改善/批評するための時間構造モデル「ワンダールクス」
ゲームデザインを改善/批評するための時間構造モデル「ワンダールクス」ゲームデザインを改善/批評するための時間構造モデル「ワンダールクス」
ゲームデザインを改善/批評するための時間構造モデル「ワンダールクス」
 
The rise of Hyper-casual & takeaways from Tap Tap Games
The rise of Hyper-casual & takeaways from Tap Tap GamesThe rise of Hyper-casual & takeaways from Tap Tap Games
The rise of Hyper-casual & takeaways from Tap Tap Games
 
Intro to Game Design
Intro to Game DesignIntro to Game Design
Intro to Game Design
 
모바일 게임기획 따라하며 배우기
모바일 게임기획 따라하며 배우기모바일 게임기획 따라하며 배우기
모바일 게임기획 따라하며 배우기
 

Similaire à Game AI 101 - NPCs and Agents and Algorithms... Oh My!

Artificial Intelligence in Computer and Video Games
Artificial Intelligence in Computer and Video GamesArtificial Intelligence in Computer and Video Games
Artificial Intelligence in Computer and Video GamesLuke Dicken
 
Knowing When to Hold 'Em, When to Fold 'Em and When to Blow 'Em Up
Knowing When to Hold 'Em, When to Fold 'Em and When to Blow 'Em UpKnowing When to Hold 'Em, When to Fold 'Em and When to Blow 'Em Up
Knowing When to Hold 'Em, When to Fold 'Em and When to Blow 'Em UpLuke Dicken
 
Unlock your creative potential: 7 steps to becoming a game designer
Unlock your creative potential: 7 steps to becoming a game designerUnlock your creative potential: 7 steps to becoming a game designer
Unlock your creative potential: 7 steps to becoming a game designerEthan Levy
 
DWS17 - Game Summit - Emmanuel CORNO - Freelance
DWS17 - Game Summit - Emmanuel CORNO - FreelanceDWS17 - Game Summit - Emmanuel CORNO - Freelance
DWS17 - Game Summit - Emmanuel CORNO - FreelanceIDATE DigiWorld
 
Diversity in NPC AI
Diversity in NPC AIDiversity in NPC AI
Diversity in NPC AILuke Dicken
 
Why VR Needs - Much! - Better AI | Wendelin Reich
Why VR Needs - Much! - Better AI | Wendelin ReichWhy VR Needs - Much! - Better AI | Wendelin Reich
Why VR Needs - Much! - Better AI | Wendelin ReichJessica Tams
 
Lecture 6 - Procedural Content and Player Models
Lecture 6 - Procedural Content and Player ModelsLecture 6 - Procedural Content and Player Models
Lecture 6 - Procedural Content and Player ModelsLuke Dicken
 
Presentation sanlab workshops
Presentation sanlab workshopsPresentation sanlab workshops
Presentation sanlab workshopsArtur Roszczyk
 
iPhone game development - Joash Chee
iPhone game development - Joash CheeiPhone game development - Joash Chee
iPhone game development - Joash Cheejasonong
 
Making a Game: Start with Constraints
Making a Game: Start with ConstraintsMaking a Game: Start with Constraints
Making a Game: Start with Constraintshacknjill
 
Game AI For the Masses
Game AI For the MassesGame AI For the Masses
Game AI For the MassesLuke Dicken
 
Natural Game Design: How to Birth Games Without Cloning
Natural Game Design: How to Birth Games Without CloningNatural Game Design: How to Birth Games Without Cloning
Natural Game Design: How to Birth Games Without CloningGreg Costikyan
 
Bica Studios Game Design Document and the Importance of Testing
Bica Studios Game Design Document and the Importance of TestingBica Studios Game Design Document and the Importance of Testing
Bica Studios Game Design Document and the Importance of TestingBica Studios
 
2.revision
2.revision2.revision
2.revisionmrsloan
 
Super Gun Kids: The Making Of by Iain Lobb
Super Gun Kids: The Making Of by Iain LobbSuper Gun Kids: The Making Of by Iain Lobb
Super Gun Kids: The Making Of by Iain Lobbmochimedia
 
FGS 2011: Keeping Yourself Honest in Game Design (SteamBirds)
FGS 2011: Keeping Yourself Honest in Game Design (SteamBirds)FGS 2011: Keeping Yourself Honest in Game Design (SteamBirds)
FGS 2011: Keeping Yourself Honest in Game Design (SteamBirds)mochimedia
 
Lecture 8 - What is Game AI? Final Thoughts
Lecture 8 - What is Game AI? Final ThoughtsLecture 8 - What is Game AI? Final Thoughts
Lecture 8 - What is Game AI? Final ThoughtsLuke Dicken
 

Similaire à Game AI 101 - NPCs and Agents and Algorithms... Oh My! (20)

Artificial Intelligence in Computer and Video Games
Artificial Intelligence in Computer and Video GamesArtificial Intelligence in Computer and Video Games
Artificial Intelligence in Computer and Video Games
 
Knowing When to Hold 'Em, When to Fold 'Em and When to Blow 'Em Up
Knowing When to Hold 'Em, When to Fold 'Em and When to Blow 'Em UpKnowing When to Hold 'Em, When to Fold 'Em and When to Blow 'Em Up
Knowing When to Hold 'Em, When to Fold 'Em and When to Blow 'Em Up
 
Unlock your creative potential: 7 steps to becoming a game designer
Unlock your creative potential: 7 steps to becoming a game designerUnlock your creative potential: 7 steps to becoming a game designer
Unlock your creative potential: 7 steps to becoming a game designer
 
DWS17 - Game Summit - Emmanuel CORNO - Freelance
DWS17 - Game Summit - Emmanuel CORNO - FreelanceDWS17 - Game Summit - Emmanuel CORNO - Freelance
DWS17 - Game Summit - Emmanuel CORNO - Freelance
 
Diversity in NPC AI
Diversity in NPC AIDiversity in NPC AI
Diversity in NPC AI
 
Why VR Needs - Much! - Better AI | Wendelin Reich
Why VR Needs - Much! - Better AI | Wendelin ReichWhy VR Needs - Much! - Better AI | Wendelin Reich
Why VR Needs - Much! - Better AI | Wendelin Reich
 
Lecture 6 - Procedural Content and Player Models
Lecture 6 - Procedural Content and Player ModelsLecture 6 - Procedural Content and Player Models
Lecture 6 - Procedural Content and Player Models
 
Presentation sanlab workshops
Presentation sanlab workshopsPresentation sanlab workshops
Presentation sanlab workshops
 
iPhone game development - Joash Chee
iPhone game development - Joash CheeiPhone game development - Joash Chee
iPhone game development - Joash Chee
 
Making a Game: Start with Constraints
Making a Game: Start with ConstraintsMaking a Game: Start with Constraints
Making a Game: Start with Constraints
 
Game AI For the Masses
Game AI For the MassesGame AI For the Masses
Game AI For the Masses
 
Natural Game Design: How to Birth Games Without Cloning
Natural Game Design: How to Birth Games Without CloningNatural Game Design: How to Birth Games Without Cloning
Natural Game Design: How to Birth Games Without Cloning
 
Bica Studios Game Design Document and the Importance of Testing
Bica Studios Game Design Document and the Importance of TestingBica Studios Game Design Document and the Importance of Testing
Bica Studios Game Design Document and the Importance of Testing
 
2.revision
2.revision2.revision
2.revision
 
Super Gun Kids: The Making Of by Iain Lobb
Super Gun Kids: The Making Of by Iain LobbSuper Gun Kids: The Making Of by Iain Lobb
Super Gun Kids: The Making Of by Iain Lobb
 
FGS 2011: Keeping Yourself Honest in Game Design (SteamBirds)
FGS 2011: Keeping Yourself Honest in Game Design (SteamBirds)FGS 2011: Keeping Yourself Honest in Game Design (SteamBirds)
FGS 2011: Keeping Yourself Honest in Game Design (SteamBirds)
 
Idle Chatter - GDC 2016
Idle Chatter - GDC 2016Idle Chatter - GDC 2016
Idle Chatter - GDC 2016
 
Gaming and Robotics
Gaming and RoboticsGaming and Robotics
Gaming and Robotics
 
Lecture 8 - What is Game AI? Final Thoughts
Lecture 8 - What is Game AI? Final ThoughtsLecture 8 - What is Game AI? Final Thoughts
Lecture 8 - What is Game AI? Final Thoughts
 
Video game plan
Video game planVideo game plan
Video game plan
 

Plus de Luke Dicken

Advances in Game AI
Advances in Game AIAdvances in Game AI
Advances in Game AILuke Dicken
 
You're Not Special, Neither am I
You're Not Special, Neither am IYou're Not Special, Neither am I
You're Not Special, Neither am ILuke Dicken
 
Procedural Processes - Lessons Learnt from Automated Content Generation in "E...
Procedural Processes - Lessons Learnt from Automated Content Generation in "E...Procedural Processes - Lessons Learnt from Automated Content Generation in "E...
Procedural Processes - Lessons Learnt from Automated Content Generation in "E...Luke Dicken
 
The Next Generation of Game Planners
The Next Generation of Game PlannersThe Next Generation of Game Planners
The Next Generation of Game PlannersLuke Dicken
 
Game Development 2
Game Development 2Game Development 2
Game Development 2Luke Dicken
 
Game Development 1 - What is a Game?
Game Development 1 - What is a Game?Game Development 1 - What is a Game?
Game Development 1 - What is a Game?Luke Dicken
 
The International Game Developers Association
The International Game Developers AssociationThe International Game Developers Association
The International Game Developers AssociationLuke Dicken
 
Lecture 7 - Experience Management
Lecture 7 - Experience ManagementLecture 7 - Experience Management
Lecture 7 - Experience ManagementLuke Dicken
 
Lecture 5 - Procedural Content Generation
Lecture 5 - Procedural Content GenerationLecture 5 - Procedural Content Generation
Lecture 5 - Procedural Content GenerationLuke Dicken
 
Lecture 3 - Decision Making
Lecture 3 - Decision MakingLecture 3 - Decision Making
Lecture 3 - Decision MakingLuke Dicken
 
Lecture 2 - Probability
Lecture 2 - ProbabilityLecture 2 - Probability
Lecture 2 - ProbabilityLuke Dicken
 
Lecture 1 - Game Theory
Lecture 1 - Game TheoryLecture 1 - Game Theory
Lecture 1 - Game TheoryLuke Dicken
 
Lecture 4 - Opponent Modelling
Lecture 4 - Opponent ModellingLecture 4 - Opponent Modelling
Lecture 4 - Opponent ModellingLuke Dicken
 
What I Done on my Holidays
What I Done on my HolidaysWhat I Done on my Holidays
What I Done on my HolidaysLuke Dicken
 
Influence Landscapes - From Spatial to Conceptual Representations
Influence Landscapes - From Spatial to Conceptual RepresentationsInfluence Landscapes - From Spatial to Conceptual Representations
Influence Landscapes - From Spatial to Conceptual RepresentationsLuke Dicken
 
The Strathclyde Poker Research Environment
The Strathclyde Poker Research EnvironmentThe Strathclyde Poker Research Environment
The Strathclyde Poker Research EnvironmentLuke Dicken
 
SAIG Overview March 2011
SAIG Overview March 2011SAIG Overview March 2011
SAIG Overview March 2011Luke Dicken
 
The Ludic Fallacy Applied to Automated Planning
The Ludic Fallacy Applied to Automated PlanningThe Ludic Fallacy Applied to Automated Planning
The Ludic Fallacy Applied to Automated PlanningLuke Dicken
 
Integrated Influence - The Six Million Dollar Man of AI
Integrated Influence - The Six Million Dollar Man of AIIntegrated Influence - The Six Million Dollar Man of AI
Integrated Influence - The Six Million Dollar Man of AILuke Dicken
 
Robust Agent Execution
Robust Agent ExecutionRobust Agent Execution
Robust Agent ExecutionLuke Dicken
 

Plus de Luke Dicken (20)

Advances in Game AI
Advances in Game AIAdvances in Game AI
Advances in Game AI
 
You're Not Special, Neither am I
You're Not Special, Neither am IYou're Not Special, Neither am I
You're Not Special, Neither am I
 
Procedural Processes - Lessons Learnt from Automated Content Generation in "E...
Procedural Processes - Lessons Learnt from Automated Content Generation in "E...Procedural Processes - Lessons Learnt from Automated Content Generation in "E...
Procedural Processes - Lessons Learnt from Automated Content Generation in "E...
 
The Next Generation of Game Planners
The Next Generation of Game PlannersThe Next Generation of Game Planners
The Next Generation of Game Planners
 
Game Development 2
Game Development 2Game Development 2
Game Development 2
 
Game Development 1 - What is a Game?
Game Development 1 - What is a Game?Game Development 1 - What is a Game?
Game Development 1 - What is a Game?
 
The International Game Developers Association
The International Game Developers AssociationThe International Game Developers Association
The International Game Developers Association
 
Lecture 7 - Experience Management
Lecture 7 - Experience ManagementLecture 7 - Experience Management
Lecture 7 - Experience Management
 
Lecture 5 - Procedural Content Generation
Lecture 5 - Procedural Content GenerationLecture 5 - Procedural Content Generation
Lecture 5 - Procedural Content Generation
 
Lecture 3 - Decision Making
Lecture 3 - Decision MakingLecture 3 - Decision Making
Lecture 3 - Decision Making
 
Lecture 2 - Probability
Lecture 2 - ProbabilityLecture 2 - Probability
Lecture 2 - Probability
 
Lecture 1 - Game Theory
Lecture 1 - Game TheoryLecture 1 - Game Theory
Lecture 1 - Game Theory
 
Lecture 4 - Opponent Modelling
Lecture 4 - Opponent ModellingLecture 4 - Opponent Modelling
Lecture 4 - Opponent Modelling
 
What I Done on my Holidays
What I Done on my HolidaysWhat I Done on my Holidays
What I Done on my Holidays
 
Influence Landscapes - From Spatial to Conceptual Representations
Influence Landscapes - From Spatial to Conceptual RepresentationsInfluence Landscapes - From Spatial to Conceptual Representations
Influence Landscapes - From Spatial to Conceptual Representations
 
The Strathclyde Poker Research Environment
The Strathclyde Poker Research EnvironmentThe Strathclyde Poker Research Environment
The Strathclyde Poker Research Environment
 
SAIG Overview March 2011
SAIG Overview March 2011SAIG Overview March 2011
SAIG Overview March 2011
 
The Ludic Fallacy Applied to Automated Planning
The Ludic Fallacy Applied to Automated PlanningThe Ludic Fallacy Applied to Automated Planning
The Ludic Fallacy Applied to Automated Planning
 
Integrated Influence - The Six Million Dollar Man of AI
Integrated Influence - The Six Million Dollar Man of AIIntegrated Influence - The Six Million Dollar Man of AI
Integrated Influence - The Six Million Dollar Man of AI
 
Robust Agent Execution
Robust Agent ExecutionRobust Agent Execution
Robust Agent Execution
 

Dernier

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 

Dernier (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

Game AI 101 - NPCs and Agents and Algorithms... Oh My!

  • 1. Game AI 101 NPCs and Agents and Algorithms... Oh My! Luke Dicken Strathclyde AI and Games Research Group University of Strathclyde
  • 3. Who Am I • PhD Student at University of Strathclyde 2
  • 4. Who Am I • PhD Student at University of Strathclyde ‣ BSc(Hons), MSc, MRes(Dist) in AI-related fields 2
  • 5. Who Am I • PhD Student at University of Strathclyde ‣ BSc(Hons), MSc, MRes(Dist) in AI-related fields • Founding member of SAIG 2
  • 6. Who Am I • PhD Student at University of Strathclyde ‣ BSc(Hons), MSc, MRes(Dist) in AI-related fields • Founding member of SAIG • AltDevBlogADay author 2
  • 7. Who Am I • PhD Student at University of Strathclyde ‣ BSc(Hons), MSc, MRes(Dist) in AI-related fields • Founding member of SAIG • AltDevBlogADay author • AltDevConf organiser 2
  • 8. Who Am I • PhD Student at University of Strathclyde ‣ BSc(Hons), MSc, MRes(Dist) in AI-related fields • Founding member of SAIG • AltDevBlogADay author • AltDevConf organiser • Board of Directors for IGDA Scotland 2
  • 9. Who Am I • PhD Student at University of Strathclyde ‣ BSc(Hons), MSc, MRes(Dist) in AI-related fields • Founding member of SAIG • AltDevBlogADay author • AltDevConf organiser • Board of Directors for IGDA Scotland • Recipient of the 2012 Eric Dybsand Memorial AI Scholarship to attend GDC 2
  • 11. Game AI 101 • Today going to look at techniques to populate game worlds with characters 3
  • 12. Game AI 101 • Today going to look at techniques to populate game worlds with characters • This is not state of the art stuff, this is entry level 3
  • 13. Game AI 101 • Today going to look at techniques to populate game worlds with characters • This is not state of the art stuff, this is entry level • We will be dealing with a mix of 3
  • 14. Game AI 101 • Today going to look at techniques to populate game worlds with characters • This is not state of the art stuff, this is entry level • We will be dealing with a mix of ‣ Concepts 3
  • 15. Game AI 101 • Today going to look at techniques to populate game worlds with characters • This is not state of the art stuff, this is entry level • We will be dealing with a mix of ‣ Concepts ‣ Examples 3
  • 16. Game AI 101 • Today going to look at techniques to populate game worlds with characters • This is not state of the art stuff, this is entry level • We will be dealing with a mix of ‣ Concepts ‣ Examples ‣ Code 3
  • 17. Game AI 101 • Today going to look at techniques to populate game worlds with characters • This is not state of the art stuff, this is entry level • We will be dealing with a mix of ‣ Concepts ‣ Examples ‣ Code • Assumes familiarity with Unity 3
  • 18. Pure AI vs Game AI 4
  • 19. Pure AI vs Game AI • “Pure” AI is a scientific discipline 4
  • 20. Pure AI vs Game AI • “Pure” AI is a scientific discipline ‣ Interested in creating systems as smart as possible 4
  • 21. Pure AI vs Game AI • “Pure” AI is a scientific discipline ‣ Interested in creating systems as smart as possible ‣ Optimal solutions to real-world problems 4
  • 22. Pure AI vs Game AI • “Pure” AI is a scientific discipline ‣ Interested in creating systems as smart as possible ‣ Optimal solutions to real-world problems • Game AI is a whole other thing 4
  • 23. Pure AI vs Game AI • “Pure” AI is a scientific discipline ‣ Interested in creating systems as smart as possible ‣ Optimal solutions to real-world problems • Game AI is a whole other thing ‣ Create “realistic simulations” of intelligence 4
  • 24. Pure AI vs Game AI • “Pure” AI is a scientific discipline ‣ Interested in creating systems as smart as possible ‣ Optimal solutions to real-world problems • Game AI is a whole other thing ‣ Create “realistic simulations” of intelligence - E.g. Believable characters 4
  • 25. Pure AI vs Game AI • “Pure” AI is a scientific discipline ‣ Interested in creating systems as smart as possible ‣ Optimal solutions to real-world problems • Game AI is a whole other thing ‣ Create “realistic simulations” of intelligence - E.g. Believable characters ‣ Enhance the players experience 4
  • 26. Pure AI vs Game AI 5
  • 27. Pure AI vs Game AI 6
  • 28. Pure AI vs Game AI • Pure AI for an NPC would be to make it fight as effectively as possible. 6
  • 29. Pure AI vs Game AI • Pure AI for an NPC would be to make it fight as effectively as possible. • Is that what we actually want to achieve? 6
  • 30. Pure AI vs Game AI • Pure AI for an NPC would be to make it fight as effectively as possible. • Is that what we actually want to achieve? • Game AI aims to make an immersive experience 6
  • 31. Pure AI vs Game AI • Pure AI for an NPC would be to make it fight as effectively as possible. • Is that what we actually want to achieve? • Game AI aims to make an immersive experience ‣ Represent a thug character accurately 6
  • 32. Pure AI vs Game AI • Pure AI for an NPC would be to make it fight as effectively as possible. • Is that what we actually want to achieve? • Game AI aims to make an immersive experience ‣ Represent a thug character accurately ‣ Allow the player to “become” Batman 6
  • 33. Pure AI vs Game AI • Pure AI for an NPC would be to make it fight as effectively as possible. • Is that what we actually want to achieve? • Game AI aims to make an immersive experience ‣ Represent a thug character accurately ‣ Allow the player to “become” Batman • Entertainment, not problem solving 6
  • 35. Automated Opponents • Centuries of trying to play games with few players 7
  • 36. Automated Opponents • Centuries of trying to play games with few players ‣ Mechanical Turk claimed to be a chess player circa 1770 7
  • 37. Automated Opponents • Centuries of trying to play games with few players ‣ Mechanical Turk claimed to be a chess player circa 1770 ‣ First video game example - Pong 1972 7
  • 38. Automated Opponents • Centuries of trying to play games with few players ‣ Mechanical Turk claimed to be a chess player circa 1770 ‣ First video game example - Pong 1972 ‣ Ongoing commercial interest - FPS “Bots” RTS “Skirmish” 7
  • 39. Automated Opponents • Centuries of trying to play games with few players ‣ Mechanical Turk claimed to be a chess player circa 1770 ‣ First video game example - Pong 1972 ‣ Ongoing commercial interest - FPS “Bots” RTS “Skirmish” 7
  • 40. Automated Opponents • Centuries of trying to play games with few players ‣ Mechanical Turk claimed to be a chess player circa 1770 ‣ First video game example - Pong 1972 ‣ Ongoing commercial interest - FPS “Bots” RTS “Skirmish” • Emphasis now on delivering a good player experience. 7
  • 41. Automated Opponents • Centuries of trying to play games with few players ‣ Mechanical Turk claimed to be a chess player circa 1770 ‣ First video game example - Pong 1972 ‣ Ongoing commercial interest - FPS “Bots” RTS “Skirmish” • Emphasis now on delivering a good player experience. ‣ Human-like rather than “good” AI 7
  • 42. Automated Opponents • Centuries of trying to play games with few players ‣ Mechanical Turk claimed to be a chess player circa 1770 ‣ First video game example - Pong 1972 ‣ Ongoing commercial interest - FPS “Bots” RTS “Skirmish” • Emphasis now on delivering a good player experience. ‣ Human-like rather than “good” AI ‣ Sub-human in order to be beatable 7
  • 43. Looking and Being Smart 8
  • 44. Looking and Being Smart • Two components to Game AI 8
  • 45. Looking and Being Smart • Two components to Game AI ‣ Looking Smart 8
  • 46. Looking and Being Smart • Two components to Game AI ‣ Looking Smart ‣ Being Smart 8
  • 47. Looking and Being Smart • Two components to Game AI ‣ Looking Smart ‣ Being Smart • Focus in this session on “Being Smart” 8
  • 48. Looking and Being Smart • Two components to Game AI ‣ Looking Smart ‣ Being Smart • Focus in this session on “Being Smart” • Looking Smart is more of an animation / art issue 8
  • 49. Looking and Being Smart • Two components to Game AI ‣ Looking Smart ‣ Being Smart • Focus in this session on “Being Smart” • Looking Smart is more of an animation / art issue ‣ Does the character “feel” intelligent 8
  • 50. Looking and Being Smart • Two components to Game AI ‣ Looking Smart ‣ Being Smart • Focus in this session on “Being Smart” • Looking Smart is more of an animation / art issue ‣ Does the character “feel” intelligent • Good decision making still required to drive this 8
  • 51. Looking and Being Smart • Two components to Game AI ‣ Looking Smart ‣ Being Smart • Focus in this session on “Being Smart” • Looking Smart is more of an animation / art issue ‣ Does the character “feel” intelligent • Good decision making still required to drive this ‣ Be smart, then trigger equivalent “look smart” 8
  • 53. What is Artificial Intelligence? 10
  • 54. What is Artificial Intelligence? • Any time a computer has to pick between two or more choices it can be said it is acting “intelligently” 10
  • 55. What is Artificial Intelligence? • Any time a computer has to pick between two or more choices it can be said it is acting “intelligently” • That isn’t to say that it is inherently making good choices. 10
  • 56. What is Artificial Intelligence? • Any time a computer has to pick between two or more choices it can be said it is acting “intelligently” • That isn’t to say that it is inherently making good choices. ‣ Tho neither do people... 10
  • 57. What is Artificial Intelligence? • Any time a computer has to pick between two or more choices it can be said it is acting “intelligently” • That isn’t to say that it is inherently making good choices. ‣ Tho neither do people... • Typically, looking for better-than-random levels of sophistication 10
  • 59. Decision Making • Not going to get too bogged down today in decision making process. 11
  • 60. Decision Making • Not going to get too bogged down today in decision making process. • Science of decisions can fill multiple degree-level courses 11
  • 61. Decision Making • Not going to get too bogged down today in decision making process. • Science of decisions can fill multiple degree-level courses • Game Theory is a good starting point to learn more 11
  • 62. Decision Making • Not going to get too bogged down today in decision making process. • Science of decisions can fill multiple degree-level courses • Game Theory is a good starting point to learn more ‣ “Behavioral Mathematics for Game AI” Dave Mark 11
  • 64. Smart or Dumb? • Partly ignoring decision making because for Game AI, it isn’t so important for intro level. 12
  • 65. Smart or Dumb? • Partly ignoring decision making because for Game AI, it isn’t so important for intro level. ‣ Making a decision is a good start 12
  • 66. Smart or Dumb? • Partly ignoring decision making because for Game AI, it isn’t so important for intro level. ‣ Making a decision is a good start • Partly because of the entertainment issue 12
  • 67. Smart or Dumb? • Partly ignoring decision making because for Game AI, it isn’t so important for intro level. ‣ Making a decision is a good start • Partly because of the entertainment issue ‣ Making good decisions is irrelevant 12
  • 68. Smart or Dumb? • Partly ignoring decision making because for Game AI, it isn’t so important for intro level. ‣ Making a decision is a good start • Partly because of the entertainment issue ‣ Making good decisions is irrelevant ‣ We don’t want tactical genius soldiers 12
  • 69. Smart or Dumb? • Partly ignoring decision making because for Game AI, it isn’t so important for intro level. ‣ Making a decision is a good start • Partly because of the entertainment issue ‣ Making good decisions is irrelevant ‣ We don’t want tactical genius soldiers • Partly for rapid iteration 12
  • 70. Smart or Dumb? • Partly ignoring decision making because for Game AI, it isn’t so important for intro level. ‣ Making a decision is a good start • Partly because of the entertainment issue ‣ Making good decisions is irrelevant ‣ We don’t want tactical genius soldiers • Partly for rapid iteration ‣ Make any decision, figure out how to make it better later 12
  • 73. Agent-Based Systems • Intelligent Agents are things within our problem that are going to be trying to act intelligently. 13
  • 74. Agent-Based Systems • Intelligent Agents are things within our problem that are going to be trying to act intelligently. • Could be a Roomba, a warehouse robot, an automated trip booking system or a predator drone 13
  • 75. Agent-Based Systems • Intelligent Agents are things within our problem that are going to be trying to act intelligently. • Could be a Roomba, a warehouse robot, an automated trip booking system or a predator drone • Agents have three important characteristics 13
  • 76. Agent-Based Systems • Intelligent Agents are things within our problem that are going to be trying to act intelligently. • Could be a Roomba, a warehouse robot, an automated trip booking system or a predator drone • Agents have three important characteristics ‣ Sense the environment 13
  • 77. Agent-Based Systems • Intelligent Agents are things within our problem that are going to be trying to act intelligently. • Could be a Roomba, a warehouse robot, an automated trip booking system or a predator drone • Agents have three important characteristics ‣ Sense the environment ‣ “Think” about what to do 13
  • 78. Agent-Based Systems • Intelligent Agents are things within our problem that are going to be trying to act intelligently. • Could be a Roomba, a warehouse robot, an automated trip booking system or a predator drone • Agents have three important characteristics ‣ Sense the environment ‣ “Think” about what to do ‣ Turn “thinking” into actions within the environment 13
  • 81. NPCs as Agents • One of the core places we can apply “agent-based systems” is when thinking about NPCs 14
  • 82. NPCs as Agents • One of the core places we can apply “agent-based systems” is when thinking about NPCs • Each NPC is an agent. 14
  • 83. NPCs as Agents • One of the core places we can apply “agent-based systems” is when thinking about NPCs • Each NPC is an agent. ‣ In some situations we may have a “General” as the agent 14
  • 84. NPCs as Agents • One of the core places we can apply “agent-based systems” is when thinking about NPCs • Each NPC is an agent. ‣ In some situations we may have a “General” as the agent - Directing NPCs around as its way of affecting the world. 14
  • 85. NPCs as Agents • One of the core places we can apply “agent-based systems” is when thinking about NPCs • Each NPC is an agent. ‣ In some situations we may have a “General” as the agent - Directing NPCs around as its way of affecting the world. • In this model 14
  • 86. NPCs as Agents • One of the core places we can apply “agent-based systems” is when thinking about NPCs • Each NPC is an agent. ‣ In some situations we may have a “General” as the agent - Directing NPCs around as its way of affecting the world. • In this model ‣ NPCs sense the world 14
  • 87. NPCs as Agents • One of the core places we can apply “agent-based systems” is when thinking about NPCs • Each NPC is an agent. ‣ In some situations we may have a “General” as the agent - Directing NPCs around as its way of affecting the world. • In this model ‣ NPCs sense the world ‣ Decide what to do, then do it 14
  • 89. Representations • Software Engineering buzzwords! 15
  • 90. Representations • Software Engineering buzzwords! • Representation internal to one NPC or shared? 15
  • 91. Representations • Software Engineering buzzwords! • Representation internal to one NPC or shared? ‣ Alien Hivemind - All units know what one unit knows 15
  • 92. Representations • Software Engineering buzzwords! • Representation internal to one NPC or shared? ‣ Alien Hivemind - All units know what one unit knows - Communal blackboard! 15
  • 93. Representations • Software Engineering buzzwords! • Representation internal to one NPC or shared? ‣ Alien Hivemind - All units know what one unit knows - Communal blackboard! ‣ Modern Squad - Communication between certain units 15
  • 94. Representations • Software Engineering buzzwords! • Representation internal to one NPC or shared? ‣ Alien Hivemind - All units know what one unit knows - Communal blackboard! ‣ Modern Squad - Communication between certain units - This was made explicit in “Enslaved Odyssey to the West” 15
  • 95. Representations • Software Engineering buzzwords! • Representation internal to one NPC or shared? ‣ Alien Hivemind - All units know what one unit knows - Communal blackboard! ‣ Modern Squad - Communication between certain units - This was made explicit in “Enslaved Odyssey to the West” - Message passing between units 15
  • 96. Representations • Software Engineering buzzwords! • Representation internal to one NPC or shared? ‣ Alien Hivemind - All units know what one unit knows - Communal blackboard! ‣ Modern Squad - Communication between certain units - This was made explicit in “Enslaved Odyssey to the West” - Message passing between units ‣ Medieval Guards - No widespread communication 15
  • 97. Representations • Software Engineering buzzwords! • Representation internal to one NPC or shared? ‣ Alien Hivemind - All units know what one unit knows - Communal blackboard! ‣ Modern Squad - Communication between certain units - This was made explicit in “Enslaved Odyssey to the West” - Message passing between units ‣ Medieval Guards - No widespread communication - Pure-internal representation 15
  • 98. AI in Game Worlds
  • 99. Taking Our First Steps 17
  • 100. Taking Our First Steps • For this session let’s assume we have 17
  • 101. Taking Our First Steps • For this session let’s assume we have ‣ A 3D world 17
  • 102. Taking Our First Steps • For this session let’s assume we have ‣ A 3D world ‣ A pre-fab for an NPC 17
  • 103. Taking Our First Steps • For this session let’s assume we have ‣ A 3D world ‣ A pre-fab for an NPC - Surprise! We’ll be using the Unity soldier today 17
  • 104. Taking Our First Steps • For this session let’s assume we have ‣ A 3D world ‣ A pre-fab for an NPC - Surprise! We’ll be using the Unity soldier today • We’re going to work today with FPS, but the techniques generalise fine. 17
  • 105. Taking Our First Steps • For this session let’s assume we have ‣ A 3D world ‣ A pre-fab for an NPC - Surprise! We’ll be using the Unity soldier today • We’re going to work today with FPS, but the techniques generalise fine. • Examples today come primarily from Steve Gargolinski ( http://stevegargolinski.com ) 17
  • 107. Moving at Random • OK, let’s do something basic 18
  • 108. Moving at Random • OK, let’s do something basic ‣ Take our NPC, pick a location and go there. 18
  • 109. Moving at Random • OK, let’s do something basic ‣ Take our NPC, pick a location and go there. ‣ When he gets there, pick another location etc. 18
  • 110. Moving at Random • OK, let’s do something basic ‣ Take our NPC, pick a location and go there. ‣ When he gets there, pick another location etc. • We need to 18
  • 111. Moving at Random • OK, let’s do something basic ‣ Take our NPC, pick a location and go there. ‣ When he gets there, pick another location etc. • We need to ‣ Pick a location randomly 18
  • 112. Moving at Random • OK, let’s do something basic ‣ Take our NPC, pick a location and go there. ‣ When he gets there, pick another location etc. • We need to ‣ Pick a location randomly ‣ Be able to move the NPC about 18
  • 113. Moving at Random • OK, let’s do something basic ‣ Take our NPC, pick a location and go there. ‣ When he gets there, pick another location etc. • We need to ‣ Pick a location randomly ‣ Be able to move the NPC about ‣ Be able to detect when we get to the location 18
  • 115. Moving at Random • Demo 1 19
  • 117. Following the Player • Let’s do something a bit more sophisticated 20
  • 118. Following the Player • Let’s do something a bit more sophisticated ‣ Follow the player around the map 20
  • 119. Following the Player • Let’s do something a bit more sophisticated ‣ Follow the player around the map • This time we need to 20
  • 120. Following the Player • Let’s do something a bit more sophisticated ‣ Follow the player around the map • This time we need to ‣ Determine position of the target 20
  • 121. Following the Player • Let’s do something a bit more sophisticated ‣ Follow the player around the map • This time we need to ‣ Determine position of the target ‣ Move towards the target 20
  • 122. Following the Player • Let’s do something a bit more sophisticated ‣ Follow the player around the map • This time we need to ‣ Determine position of the target ‣ Move towards the target • Very similar to the last example, this time we have a non-random target 20
  • 124. Following the Player • Demo 2 21
  • 126. On Patrol • Typically, we want soldiers guarding things, patrolling 22
  • 127. On Patrol • Typically, we want soldiers guarding things, patrolling ‣ Go to the next waypoint 22
  • 128. On Patrol • Typically, we want soldiers guarding things, patrolling ‣ Go to the next waypoint ‣ When you get there, go to the next in the series etc 22
  • 129. On Patrol • Typically, we want soldiers guarding things, patrolling ‣ Go to the next waypoint ‣ When you get there, go to the next in the series etc • Still just an iterative improvement on previous 22
  • 130. On Patrol • Typically, we want soldiers guarding things, patrolling ‣ Go to the next waypoint ‣ When you get there, go to the next in the series etc • Still just an iterative improvement on previous ‣ We need to track where the waypoints are 22
  • 131. On Patrol • Typically, we want soldiers guarding things, patrolling ‣ Go to the next waypoint ‣ When you get there, go to the next in the series etc • Still just an iterative improvement on previous ‣ We need to track where the waypoints are ‣ Which one we are near 22
  • 132. On Patrol • Typically, we want soldiers guarding things, patrolling ‣ Go to the next waypoint ‣ When you get there, go to the next in the series etc • Still just an iterative improvement on previous ‣ We need to track where the waypoints are ‣ Which one we are near ‣ Which comes next in a sequence 22
  • 134. On Patrol • Demo 3 23
  • 136. Looking (Kinda) Smart • An NPC that does just one thing is not smart 24
  • 137. Looking (Kinda) Smart • An NPC that does just one thing is not smart • Raging gun battle, it doesn’t make sense to carry on patrolling. 24
  • 138. Looking (Kinda) Smart • An NPC that does just one thing is not smart • Raging gun battle, it doesn’t make sense to carry on patrolling. • We’ve got now three different sets of code for specific jobs, no way to swap between them. 24
  • 139. Different Situations, Different Behaviours 25
  • 140. Different Situations, Different Behaviours • So we know that different situations are going to call for different behaviours 25
  • 141. Different Situations, Different Behaviours • So we know that different situations are going to call for different behaviours • We need to be able to swap from one to another realistically 25
  • 142. Different Situations, Different Behaviours • So we know that different situations are going to call for different behaviours • We need to be able to swap from one to another realistically • This is where we’re going to really be using AI techniques 25
  • 144. Finite State Machines • FSMs are fundamental building blocks in Computer Science 26
  • 145. Finite State Machines • FSMs are fundamental building blocks in Computer Science • A machine that can be in one of a number of states 26
  • 146. Finite State Machines • FSMs are fundamental building blocks in Computer Science • A machine that can be in one of a number of states • It transitions from one state to another when certain conditions are met 26
  • 148. NPCs as an FSM 28
  • 149. NPCs as an FSM • We can represent what behaviour is currently active as a state in an FSM 28
  • 150. NPCs as an FSM • We can represent what behaviour is currently active as a state in an FSM • When certain things happen we can transition to a different state 28
  • 151. NPCs as an FSM • We can represent what behaviour is currently active as a state in an FSM • When certain things happen we can transition to a different state • We can move around states as required 28
  • 153. A Simple Guard • Let’s combine what we’ve seen already 29
  • 154. A Simple Guard • Let’s combine what we’ve seen already ‣ A guard stands idle 29
  • 155. A Simple Guard • Let’s combine what we’ve seen already ‣ A guard stands idle ‣ When he sees the player he begins approaching 29
  • 156. A Simple Guard • Let’s combine what we’ve seen already ‣ A guard stands idle ‣ When he sees the player he begins approaching ‣ If the player breaks line of sight, he returns to his start position 29
  • 158. A Simple Guard • Demo 4 30
  • 160. Non-Boolean Transitions • We can track non-boolean values and use these as triggers for state transitions 31
  • 161. Non-Boolean Transitions • We can track non-boolean values and use these as triggers for state transitions • Just need to meet a boolean criteria e.g. X > 100 31
  • 163. Suspicious Guard • This time, the guard will grow suspicious the longer the player stays in view. 32
  • 164. Suspicious Guard • This time, the guard will grow suspicious the longer the player stays in view. ‣ When suspicion hits a threshold, the guard will investigate 32
  • 165. Suspicious Guard • This time, the guard will grow suspicious the longer the player stays in view. ‣ When suspicion hits a threshold, the guard will investigate ‣ If the player breaks line of sight, guards suspicion begins to lower, continues to investigate 32
  • 166. Suspicious Guard • This time, the guard will grow suspicious the longer the player stays in view. ‣ When suspicion hits a threshold, the guard will investigate ‣ If the player breaks line of sight, guards suspicion begins to lower, continues to investigate ‣ When suspicion drops below a threshold, returns to start 32
  • 168. Suspicious Guard • Demo 5 33
  • 170. Beyond FSMs • Finite State Machines are easy to understand 34
  • 171. Beyond FSMs • Finite State Machines are easy to understand • But they get complicated quickly 34
  • 172. Beyond FSMs • Finite State Machines are easy to understand • But they get complicated quickly ‣ Particularly for behaviours that need to have multiple components chained to them, and be interruptible 34
  • 173. Beyond FSMs • Finite State Machines are easy to understand • But they get complicated quickly ‣ Particularly for behaviours that need to have multiple components chained to them, and be interruptible • They aren’t state of the art, but good to introduce concepts 34
  • 174. Beyond FSMs • Finite State Machines are easy to understand • But they get complicated quickly ‣ Particularly for behaviours that need to have multiple components chained to them, and be interruptible • They aren’t state of the art, but good to introduce concepts • Not widely used in industry now. 34
  • 175. Hierarchical Concurrent State Machines 35
  • 176. Hierarchical Concurrent State Machines • Recent addition to the AI developers arsenal 35
  • 177. Hierarchical Concurrent State Machines • Recent addition to the AI developers arsenal • Popular after successful use in Left 4 Dead 35
  • 178. Hierarchical Concurrent State Machines • Recent addition to the AI developers arsenal • Popular after successful use in Left 4 Dead ‣ Drove NPCs 35
  • 179. Hierarchical Concurrent State Machines • Recent addition to the AI developers arsenal • Popular after successful use in Left 4 Dead ‣ Drove NPCs ‣ Also drove the AI Director system 35
  • 180. Hierarchical Concurrent State Machines • Recent addition to the AI developers arsenal • Popular after successful use in Left 4 Dead ‣ Drove NPCs ‣ Also drove the AI Director system • A real-time parallel redesign of the Finite State Machine (sort of) 35
  • 181. Hierarchical Concurrent State Machines 36
  • 182. Hierarchical Concurrent State Machines • Building block of an HCSM is itself an HCSM 36
  • 183. Hierarchical Concurrent State Machines • Building block of an HCSM is itself an HCSM ‣ Recursive by nature 36
  • 184. Hierarchical Concurrent State Machines • Building block of an HCSM is itself an HCSM ‣ Recursive by nature • Analogue input wire 36
  • 185. Hierarchical Concurrent State Machines • Building block of an HCSM is itself an HCSM ‣ Recursive by nature • Analogue input wire • Configuration parameters 36
  • 186. Hierarchical Concurrent State Machines • Building block of an HCSM is itself an HCSM ‣ Recursive by nature • Analogue input wire • Configuration parameters • Output wire 36
  • 187. Hierarchical Concurrent State Machines 37
  • 189. Behaviour Trees • Behaviour Trees are another great way of deciding which of a bunch of behaviours should be activated at a given time. 38
  • 190. Behaviour Trees • Behaviour Trees are another great way of deciding which of a bunch of behaviours should be activated at a given time. • Lets you craft intricate behaviours, and combine them relatively intelligently. 38
  • 191. Behaviour Trees • Behaviour Trees are another great way of deciding which of a bunch of behaviours should be activated at a given time. • Lets you craft intricate behaviours, and combine them relatively intelligently. • Kind of similar conceptually to a Decision Tree with an internal knowledge of what triggered last time 38
  • 192. Example Behaviour Tree “Introduction to Behaviour Trees”, Bjoern Knafla AltDevBlogADay.com 39
  • 194. Path Finding • Being able to automatically work out how to move around a world is a common AI problem 40
  • 195. Path Finding • Being able to automatically work out how to move around a world is a common AI problem • Several good algorithms for doing this, today going to show A* 40
  • 196. Path Finding • Being able to automatically work out how to move around a world is a common AI problem • Several good algorithms for doing this, today going to show A* • Works by assessing 40
  • 197. Path Finding • Being able to automatically work out how to move around a world is a common AI problem • Several good algorithms for doing this, today going to show A* • Works by assessing ‣ Work done 40
  • 198. Path Finding • Being able to automatically work out how to move around a world is a common AI problem • Several good algorithms for doing this, today going to show A* • Works by assessing ‣ Work done ‣ Estimating work remaining (a heuristic) 40
  • 199. Path Finding • Being able to automatically work out how to move around a world is a common AI problem • Several good algorithms for doing this, today going to show A* • Works by assessing ‣ Work done ‣ Estimating work remaining (a heuristic) • Always selects most promising node 40
  • 201. Heuristic Example - A* B A 42
  • 202. Heuristic Example - A* B A 43
  • 203. Heuristic Example - A* B 1+7 A 1 +7 44
  • 204. Heuristic Example - A* B 1+7 A 1 +7 45
  • 205. Heuristic Example - A* B 2+6 1+7 A 2 + 8 1 +7 46
  • 206. Heuristic Example - A* B 2+6 1+7 A 2 + 8 1 +7 47
  • 207. Heuristic Example - A* B 3+5 2+6 1+7 A 2 + 8 1 +7 48
  • 208. Heuristic Example - A* B 3+5 2+6 1+7 A 2 + 8 1 +7 49
  • 209. Heuristic Example - A* 4+4 B 3+5 4+4 2+6 1+7 A 2 + 8 1 +7 50
  • 210. Heuristic Example - A* 4+4 5+3 B 3+5 4+4 5+3 2+6 1+7 A 2 + 8 1 +7 51
  • 211. Heuristic Example - A* 4+4 5+3 6+2 B 3+5 4+4 5+3 2+6 6+4 1+7 A 2 + 8 1 +7 52
  • 212. Heuristic Example - A* 4+4 5+3 6+2 B 3+5 4+4 5+3 2+6 6+4 1+7 A 2 + 8 1 +7 53
  • 213. Heuristic Example - A* 4+4 5+3 6+2 B 3+5 4+4 5+3 2+6 6+4 1+7 A 2 + 8 1 +7 2 + 6 54
  • 214. Heuristic Example - A* 4+4 5+3 6+2 B 3+5 4+4 5+3 2+6 6+4 1+7 A 2 + 8 1 +7 2 + 6 55
  • 215. Heuristic Example - A* 4+4 5+3 6+2 B 3+5 4+4 5+3 2+6 6+4 1+7 A 2 + 8 1 +7 2 + 6 3 + 5 56
  • 216. Heuristic Example - A* 4+4 5+3 6+2 B 3+5 4+4 5+3 2+6 6+4 1+7 A 4+4 2 + 8 1 +7 2 + 6 3 + 5 4 + 4 57
  • 217. Heuristic Example - A* 4+4 5+3 6+2 B 3+5 4+4 5+3 2+6 6+4 1+7 A 4+4 2 + 8 1 +7 2 + 6 3 + 5 4 + 4 58
  • 218. Heuristic Example - A* 4+4 5+3 6+2 B 3+5 4+4 5+3 2+6 6+4 5+3 1+7 A 4+4 5+3 2 + 8 1 +7 2 + 6 3 + 5 4 + 4 59
  • 219. Heuristic Example - A* 4+4 5+3 6+2 B 3+5 4+4 5+3 2+6 6+4 5+3 1+7 A 4+4 5+3 2 + 8 1 +7 2 + 6 3 + 5 4 + 4 60
  • 220. Heuristic Example - A* 4+4 5+3 6+2 B 3+5 4+4 5+3 2+6 6+4 5+3 6+2 1+7 A 4+4 5+3 2 + 8 1 +7 2 + 6 3 + 5 4 + 4 61
  • 221. Heuristic Example - A* 4+4 5+3 6+2 B 3+5 4+4 5+3 2+6 6+4 5+3 6+2 1+7 A 4+4 5+3 2 + 8 1 +7 2 + 6 3 + 5 4 + 4 62
  • 222. Heuristic Example - A* 4+4 5+3 6+2 B 3+5 4+4 5+3 7+1 2+6 6+4 5+3 6+2 1+7 A 4+4 5+3 2 + 8 1 +7 2 + 6 3 + 5 4 + 4 63
  • 223. Heuristic Example - A* 4+4 5+3 6+2 B 3+5 4+4 5+3 7+1 2+6 6+4 5+3 6+2 1+7 A 4+4 5+3 2 + 8 1 +7 2 + 6 3 + 5 4 + 4 64
  • 224. Heuristic Example - A* 4+4 5+3 6+2 B 3+5 4+4 5+3 7+1 2+6 6+4 5+3 6+2 1+7 A 4+4 5+3 2 + 8 1 +7 2 + 6 3 + 5 4 + 4 65
  • 225. Heuristic Example - A* 4+4 5+3 6+2 B 3+5 4+4 5+3 7+1 2+6 6+4 5+3 6+2 1+7 A 4+4 5+3 2 + 8 1 +7 2 + 6 3 + 5 4 + 4 66
  • 227. Pathfinding in Unity • Unity 3.5 now includes pathfinding natively 67
  • 228. Pathfinding in Unity • Unity 3.5 now includes pathfinding natively ‣ Pro only apparently 67
  • 229. Pathfinding in Unity • Unity 3.5 now includes pathfinding natively ‣ Pro only apparently • Not entirely sure how this is implemented 67
  • 230. Pathfinding in Unity • Unity 3.5 now includes pathfinding natively ‣ Pro only apparently • Not entirely sure how this is implemented ‣ I still haven’t bought Pro... 67
  • 231. Pathfinding in Unity • Unity 3.5 now includes pathfinding natively ‣ Pro only apparently • Not entirely sure how this is implemented ‣ I still haven’t bought Pro... • Possibly similar to the Path package (creator of that works at Unity) 67
  • 233. Path • Demo 6 68
  • 235. Runtime Woes • We’ve talked about pathfinding and decision making 69
  • 236. Runtime Woes • We’ve talked about pathfinding and decision making • These can be computationally hard problems 69
  • 237. Runtime Woes • We’ve talked about pathfinding and decision making • These can be computationally hard problems ‣ In general we want to shoot for around 60fps 69
  • 238. Runtime Woes • We’ve talked about pathfinding and decision making • These can be computationally hard problems ‣ In general we want to shoot for around 60fps ‣ 16.67ms of computation per frame 69
  • 239. Runtime Woes • We’ve talked about pathfinding and decision making • These can be computationally hard problems ‣ In general we want to shoot for around 60fps ‣ 16.67ms of computation per frame ‣ Most of that will go on non-AI aspects 69
  • 240. Runtime Woes • We’ve talked about pathfinding and decision making • These can be computationally hard problems ‣ In general we want to shoot for around 60fps ‣ 16.67ms of computation per frame ‣ Most of that will go on non-AI aspects • Realistically looking at 1 or 2ms per frame for all AI 69
  • 241. Runtime Woes • We’ve talked about pathfinding and decision making • These can be computationally hard problems ‣ In general we want to shoot for around 60fps ‣ 16.67ms of computation per frame ‣ Most of that will go on non-AI aspects • Realistically looking at 1 or 2ms per frame for all AI • Lots of computation, not a lot of time 69
  • 243. Breaking Problems Up • So we know that we might want to do things take longer than we have. 70
  • 244. Breaking Problems Up • So we know that we might want to do things take longer than we have. • How can we break it up into manageable chunks so that we aren’t delaying the game thread? 70
  • 245. Breaking Problems Up • So we know that we might want to do things take longer than we have. • How can we break it up into manageable chunks so that we aren’t delaying the game thread? • In Unity, we have a very powerful system at our disposal called 70
  • 246. Breaking Problems Up • So we know that we might want to do things take longer than we have. • How can we break it up into manageable chunks so that we aren’t delaying the game thread? • In Unity, we have a very powerful system at our disposal called ‣ Coroutines 70
  • 248. Coroutines • Coroutines are blocks of code that can return a value partway through execution. 71
  • 249. Coroutines • Coroutines are blocks of code that can return a value partway through execution. • Next time that routine is called, it will pick up where it left off 71
  • 250. Coroutines • Coroutines are blocks of code that can return a value partway through execution. • Next time that routine is called, it will pick up where it left off • Allows you to chop a block of code up into roughly frame-computable chunks. 71
  • 251. Coroutines • Coroutines are blocks of code that can return a value partway through execution. • Next time that routine is called, it will pick up where it left off • Allows you to chop a block of code up into roughly frame-computable chunks. ‣ Delays overall result, doesn’t delay code execution 71
  • 253. Juggling Timings • Another great use of Coroutines is to get timing of things right. 72
  • 254. Juggling Timings • Another great use of Coroutines is to get timing of things right. - Lots of things in Unity are “delayed calls” 72
  • 255. Juggling Timings • Another great use of Coroutines is to get timing of things right. - Lots of things in Unity are “delayed calls” • They don’t actually happen til the end of the frame 72
  • 256. Juggling Timings • Another great use of Coroutines is to get timing of things right. - Lots of things in Unity are “delayed calls” • They don’t actually happen til the end of the frame - Destroy(), Debug.Log() 72
  • 257. Juggling Timings • Another great use of Coroutines is to get timing of things right. - Lots of things in Unity are “delayed calls” • They don’t actually happen til the end of the frame - Destroy(), Debug.Log() • We can do things like 72
  • 258. Juggling Timings • Another great use of Coroutines is to get timing of things right. - Lots of things in Unity are “delayed calls” • They don’t actually happen til the end of the frame - Destroy(), Debug.Log() • We can do things like yield return new WaitForEndOfFrame(); 72
  • 259. Juggling Timings • Another great use of Coroutines is to get timing of things right. - Lots of things in Unity are “delayed calls” • They don’t actually happen til the end of the frame - Destroy(), Debug.Log() • We can do things like yield return new WaitForEndOfFrame(); • What we are waiting for happens, code resumes 72
  • 261. Coroutines in practice • Demo 73
  • 263. Summary • Today we covered basics/fundamentals 74
  • 264. Summary • Today we covered basics/fundamentals ‣ What we’re trying to achieve with Game AI 74
  • 265. Summary • Today we covered basics/fundamentals ‣ What we’re trying to achieve with Game AI ‣ Some very simple implementations of behaviours 74
  • 266. Summary • Today we covered basics/fundamentals ‣ What we’re trying to achieve with Game AI ‣ Some very simple implementations of behaviours ‣ Simple methods for selecting which is active 74
  • 267. Summary • Today we covered basics/fundamentals ‣ What we’re trying to achieve with Game AI ‣ Some very simple implementations of behaviours ‣ Simple methods for selecting which is active ‣ Discussion of some more advanced methods 74
  • 268. Summary • Today we covered basics/fundamentals ‣ What we’re trying to achieve with Game AI ‣ Some very simple implementations of behaviours ‣ Simple methods for selecting which is active ‣ Discussion of some more advanced methods ‣ Intro to Pathfinding 74
  • 269. Summary • Today we covered basics/fundamentals ‣ What we’re trying to achieve with Game AI ‣ Some very simple implementations of behaviours ‣ Simple methods for selecting which is active ‣ Discussion of some more advanced methods ‣ Intro to Pathfinding ‣ Coroutines for AI 74
  • 271. Takeaways 1. AI is awesome 75
  • 272. Takeaways 1. AI is awesome 2. AI is complicated 75
  • 273. Takeaways 1. AI is awesome 2. AI is complicated 3. AI doesn’t need to be scary 75
  • 274. But Wait There’s More! 76
  • 275. But Wait There’s More! • We haven’t scratched the surface of what we can do with AI. 76
  • 276. But Wait There’s More! • We haven’t scratched the surface of what we can do with AI. ‣ AI for companions 76
  • 277. But Wait There’s More! • We haven’t scratched the surface of what we can do with AI. ‣ AI for companions ‣ AI for squad behaviours & coordination of multiple NPCs 76
  • 278. But Wait There’s More! • We haven’t scratched the surface of what we can do with AI. ‣ AI for companions ‣ AI for squad behaviours & coordination of multiple NPCs ‣ AI for scenario control (e.g. Left 4 Dead) 76
  • 279. But Wait There’s More! • We haven’t scratched the surface of what we can do with AI. ‣ AI for companions ‣ AI for squad behaviours & coordination of multiple NPCs ‣ AI for scenario control (e.g. Left 4 Dead) ‣ AI for content generation 76
  • 280. Contact • luke@cis.strath.ac.uk • @LukeD • http://saig.cis.strath.ac.uk - Research Group • http://lukedicken.com - Personal Site Questions? 77

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. \n
  87. \n
  88. \n
  89. \n
  90. \n
  91. \n
  92. \n
  93. \n
  94. \n
  95. \n
  96. \n
  97. \n
  98. \n
  99. \n
  100. \n
  101. \n
  102. \n
  103. \n
  104. \n
  105. \n
  106. \n
  107. \n
  108. \n
  109. \n
  110. \n
  111. \n
  112. \n
  113. \n
  114. \n
  115. \n
  116. \n
  117. \n
  118. \n
  119. \n
  120. \n
  121. \n
  122. \n
  123. \n
  124. \n
  125. \n
  126. \n
  127. \n
  128. \n
  129. \n
  130. \n
  131. \n
  132. \n
  133. \n
  134. \n
  135. \n
  136. \n
  137. \n
  138. \n
  139. \n
  140. \n
  141. \n
  142. \n
  143. \n
  144. \n
  145. \n
  146. \n
  147. \n
  148. \n
  149. \n
  150. \n
  151. \n
  152. \n
  153. \n
  154. \n
  155. \n
  156. \n
  157. \n
  158. \n
  159. \n
  160. \n
  161. \n
  162. \n
  163. \n
  164. \n
  165. \n
  166. \n
  167. \n
  168. \n
  169. \n
  170. \n
  171. \n
  172. \n
  173. \n
  174. \n
  175. \n
  176. \n
  177. \n
  178. \n
  179. \n
  180. \n
  181. \n
  182. \n
  183. \n
  184. \n
  185. \n
  186. \n
  187. \n
  188. \n
  189. \n
  190. \n
  191. \n
  192. \n
  193. \n
  194. \n
  195. \n
  196. \n
  197. \n
  198. \n
  199. \n
  200. \n
  201. \n
  202. \n
  203. \n
  204. \n
  205. \n
  206. \n
  207. \n
  208. \n
  209. \n
  210. \n
  211. \n
  212. \n
  213. \n
  214. \n
  215. \n
  216. \n
  217. \n
  218. \n
  219. \n
  220. \n
  221. \n
  222. \n
  223. \n
  224. \n
  225. \n
  226. \n
  227. \n
  228. \n
  229. \n
  230. \n
  231. \n
  232. \n
  233. \n
  234. \n
  235. \n
  236. \n
  237. \n
  238. \n
  239. \n
  240. \n
  241. \n
  242. \n
  243. \n