SlideShare a Scribd company logo
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 ?elds




2
Who Am I

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




2
Who Am I

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




2
Who Am I

    ? PhD Student at University of Strathclyde
      ? BSc(Hons), MSc, MRes(Dist) in AI-related ?elds
    ? 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 ?elds
    ? 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 ?elds
    ? 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 scienti?c discipline




4
Pure AI vs Game AI


    ? “Pure” AI is a scienti?c discipline
       ? Interested in creating systems as smart as possible




4
Pure AI vs Game AI


    ? “Pure” AI is a scienti?c 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 scienti?c 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 scienti?c 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 scienti?c 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 scienti?c 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 ?ght as
     effectively as possible.




6
Pure AI vs Game AI


    ? Pure AI for an NPC would be to make it ?ght 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 ?ght 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 ?ght 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 ?ght 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 ?ght 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
     Arti?cial Intelligence?




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




10
What is
                 Arti?cial 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
                 Arti?cial 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
                 Arti?cial 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 ?ll multiple degree-level
      courses




11
Decision Making


     ? Not going to get too bogged down today in
      decision making process.
     ? Science of decisions can ?ll 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 ?ll 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, ?gure 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 ?ne.



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 ?ne.
     ? 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
      speci?c 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
     ? Con?guration parameters




36
Hierarchical Concurrent
                  State Machines


     ? Building block of an HCSM is itself an HCSM
       ? Recursive by nature
     ? Analogue input wire
     ? Con?guration 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 Kna?a
                                       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
Path?nding in Unity




67
Path?nding in Unity


     ? Unity 3.5 now includes path?nding natively




67
Path?nding in Unity


     ? Unity 3.5 now includes path?nding natively
       ? Pro only apparently




67
Path?nding in Unity


     ? Unity 3.5 now includes path?nding natively
       ? Pro only apparently
     ? Not entirely sure how this is implemented




67
Path?nding in Unity


     ? Unity 3.5 now includes path?nding natively
       ? Pro only apparently
     ? Not entirely sure how this is implemented
       ? I still haven’t bought Pro...




67
Path?nding in Unity


     ? Unity 3.5 now includes path?nding 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 path?nding and decision making




69
Runtime Woes


     ? We’ve talked about path?nding and decision making
     ? These can be computationally hard problems




69
Runtime Woes


     ? We’ve talked about path?nding 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 path?nding 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 path?nding 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 path?nding 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 path?nding 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 Path?nding



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 Path?nding
       ? 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

More Related Content

What's hot

[IGC2018] ?? ??? ?? - ????? ??? ?? ??? ?? ???
[IGC2018] ?? ??? ?? - ????? ??? ?? ??? ?? ???[IGC2018] ?? ??? ?? - ????? ??? ?? ??? ?? ???
[IGC2018] ?? ??? ?? - ????? ??? ?? ??? ?? ???
? ??
?
[????/141206 ???] ??? ??? ??? ???
[????/141206 ???] ??? ??? ??? ???[????/141206 ???] ??? ??? ??? ???
[????/141206 ???] ??? ??? ??? ???
MinGeun Park
?
素集合データ构造
素集合データ构造素集合データ构造
素集合データ构造
京大 マイコンクラブ
?
GS-4106 The AMD GCN Architecture - A Crash Course, by Layla Mah
GS-4106 The AMD GCN Architecture - A Crash Course, by Layla MahGS-4106 The AMD GCN Architecture - A Crash Course, by Layla Mah
GS-4106 The AMD GCN Architecture - A Crash Course, by Layla Mah
AMD Developer Central
?
Chrome Hounds におけるチームAI
Chrome Hounds におけるチームAIChrome Hounds におけるチームAI
Chrome Hounds におけるチームAI
Youichiro Miyake
?
???? ?? ?????? ??
????   ?? ?????? ??????   ?? ?????? ??
???? ?? ?????? ??Jubok Kim
?
[IGC 2017] ????? ??? - ?? ?? ??? ??
[IGC 2017] ????? ??? - ?? ?? ??? ??[IGC 2017] ????? ??? - ?? ?? ??? ??
[IGC 2017] ????? ??? - ?? ?? ??? ??
? ??
?
Ndc2012 ??? ??? ?? ?? ??
Ndc2012 ??? ??? ?? ?? ??Ndc2012 ??? ??? ?? ?? ??
Ndc2012 ??? ??? ?? ?? ??Jiho Choi
?
サムライスピリッツキャラクター制作事例 アニメーション编
サムライスピリッツキャラクター制作事例 アニメーション编サムライスピリッツキャラクター制作事例 アニメーション编
サムライスピリッツキャラクター制作事例 アニメーション编
SNK
?
???? ??? ??? ??
???? ??? ??? ?????? ??? ??? ??
???? ??? ??? ??
SeungYeon Jeong
?
Dissecting the Rendering of The Surge
Dissecting the Rendering of The SurgeDissecting the Rendering of The Surge
Dissecting the Rendering of The Surge
Philip Hammer
?
HistoryOfCNN
HistoryOfCNNHistoryOfCNN
HistoryOfCNN
Tae Young Lee
?
GPU Programming with Java
GPU Programming with JavaGPU Programming with Java
GPU Programming with Java
Kelum Senanayake
?
Cerny method
Cerny methodCerny method
Cerny method
Tim Holt
?
???, ?? ??? ???? ?? ???? tip, NDC2010
???, ?? ??? ???? ?? ???? tip, NDC2010???, ?? ??? ???? ?? ???? tip, NDC2010
???, ?? ??? ???? ?? ???? tip, NDC2010devCAT Studio, NEXON
?
Unity ml agent quick guide
Unity ml agent quick guideUnity ml agent quick guide
Unity ml agent quick guide
Kyoungman Lee
?
[????] Recurrent Neural Network (RNN) ??
[????] Recurrent Neural Network (RNN) ??[????] Recurrent Neural Network (RNN) ??
[????] Recurrent Neural Network (RNN) ??
Donghyeon Kim
?
ゲーム向けな美味しい乱数を生成する(再アップ版)
ゲーム向けな美味しい乱数を生成する(再アップ版)ゲーム向けな美味しい乱数を生成する(再アップ版)
ゲーム向けな美味しい乱数を生成する(再アップ版)
ai BlogOnly
?

What's hot (20)

[IGC2018] ?? ??? ?? - ????? ??? ?? ??? ?? ???
[IGC2018] ?? ??? ?? - ????? ??? ?? ??? ?? ???[IGC2018] ?? ??? ?? - ????? ??? ?? ??? ?? ???
[IGC2018] ?? ??? ?? - ????? ??? ?? ??? ?? ???
?
[????/141206 ???] ??? ??? ??? ???
[????/141206 ???] ??? ??? ??? ???[????/141206 ???] ??? ??? ??? ???
[????/141206 ???] ??? ??? ??? ???
?
素集合データ构造
素集合データ构造素集合データ构造
素集合データ构造
?
GS-4106 The AMD GCN Architecture - A Crash Course, by Layla Mah
GS-4106 The AMD GCN Architecture - A Crash Course, by Layla MahGS-4106 The AMD GCN Architecture - A Crash Course, by Layla Mah
GS-4106 The AMD GCN Architecture - A Crash Course, by Layla Mah
?
Chrome Hounds におけるチームAI
Chrome Hounds におけるチームAIChrome Hounds におけるチームAI
Chrome Hounds におけるチームAI
?
???? ?? ?????? ??
????   ?? ?????? ??????   ?? ?????? ??
???? ?? ?????? ??
?
[IGC 2017] ????? ??? - ?? ?? ??? ??
[IGC 2017] ????? ??? - ?? ?? ??? ??[IGC 2017] ????? ??? - ?? ?? ??? ??
[IGC 2017] ????? ??? - ?? ?? ??? ??
?
Ndc2012 ??? ??? ?? ?? ??
Ndc2012 ??? ??? ?? ?? ??Ndc2012 ??? ??? ?? ?? ??
Ndc2012 ??? ??? ?? ?? ??
?
Za atsu-20170328
Za atsu-20170328Za atsu-20170328
Za atsu-20170328
?
サムライスピリッツキャラクター制作事例 アニメーション编
サムライスピリッツキャラクター制作事例 アニメーション编サムライスピリッツキャラクター制作事例 アニメーション编
サムライスピリッツキャラクター制作事例 アニメーション编
?
???? ??? ??? ??
???? ??? ??? ?????? ??? ??? ??
???? ??? ??? ??
?
Dissecting the Rendering of The Surge
Dissecting the Rendering of The SurgeDissecting the Rendering of The Surge
Dissecting the Rendering of The Surge
?
???, ?? ?????? ?? ??? ??, NDC2012
???, ?? ?????? ?? ??? ??, NDC2012???, ?? ?????? ?? ??? ??, NDC2012
???, ?? ?????? ?? ??? ??, NDC2012
?
HistoryOfCNN
HistoryOfCNNHistoryOfCNN
HistoryOfCNN
?
GPU Programming with Java
GPU Programming with JavaGPU Programming with Java
GPU Programming with Java
?
Cerny method
Cerny methodCerny method
Cerny method
?
???, ?? ??? ???? ?? ???? tip, NDC2010
???, ?? ??? ???? ?? ???? tip, NDC2010???, ?? ??? ???? ?? ???? tip, NDC2010
???, ?? ??? ???? ?? ???? tip, NDC2010
?
Unity ml agent quick guide
Unity ml agent quick guideUnity ml agent quick guide
Unity ml agent quick guide
?
[????] Recurrent Neural Network (RNN) ??
[????] Recurrent Neural Network (RNN) ??[????] Recurrent Neural Network (RNN) ??
[????] Recurrent Neural Network (RNN) ??
?
ゲーム向けな美味しい乱数を生成する(再アップ版)
ゲーム向けな美味しい乱数を生成する(再アップ版)ゲーム向けな美味しい乱数を生成する(再アップ版)
ゲーム向けな美味しい乱数を生成する(再アップ版)
?

Similar to 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 Games
Luke 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 Up
Luke 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 designer
Ethan Levy
?
DWS17 - Game Summit - Emmanuel CORNO - Freelance
DWS17 - Game Summit - Emmanuel CORNO - FreelanceDWS17 - Game Summit - Emmanuel CORNO - Freelance
DWS17 - Game Summit - Emmanuel CORNO - Freelance
IDATE DigiWorld
?
Diversity in NPC AI
Diversity in NPC AIDiversity in NPC AI
Diversity in NPC AI
Luke 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 Reich
Jessica 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 Models
Luke Dicken
?
Presentation sanlab workshops
Presentation sanlab workshopsPresentation sanlab workshops
Presentation sanlab workshops
Artur Roszczyk
?
iPhone game development - Joash Chee
iPhone game development - Joash CheeiPhone game development - Joash Chee
iPhone game development - Joash Chee
jasonong
?
Making a Game: Start with Constraints
Making a Game: Start with ConstraintsMaking a Game: Start with Constraints
Making a Game: Start with Constraints
hacknjill
?
Game AI For the Masses
Game AI For the MassesGame AI For the Masses
Game AI For the Masses
Luke 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 Cloning
Greg 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 Testing
Bica Studios
?
2.revision
2.revision2.revision
2.revision
mrsloan
?
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
mochimedia
?
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
?
Idle Chatter - GDC 2016
Idle Chatter - GDC 2016Idle Chatter - GDC 2016
Idle Chatter - GDC 2016
Anthony Pecorella
?
Gaming and Robotics
Gaming and RoboticsGaming and Robotics
Gaming and Robotics
Mohammad Shaker
?
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
Luke Dicken
?
Video game plan
Video game planVideo game plan
Video game plan
Jesse Lapworth
?

Similar to 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
?

More from Luke Dicken

Advances in Game AI
Advances in Game AIAdvances in Game AI
Advances in Game AI
Luke 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 I
Luke 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 Planners
Luke Dicken
?
Game Development 2
Game Development 2Game Development 2
Game Development 2
Luke 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 Association
Luke Dicken
?
Lecture 7 - Experience Management
Lecture 7 - Experience ManagementLecture 7 - Experience Management
Lecture 7 - Experience Management
Luke Dicken
?
Lecture 5 - Procedural Content Generation
Lecture 5 - Procedural Content GenerationLecture 5 - Procedural Content Generation
Lecture 5 - Procedural Content Generation
Luke Dicken
?
Lecture 3 - Decision Making
Lecture 3 - Decision MakingLecture 3 - Decision Making
Lecture 3 - Decision Making
Luke Dicken
?
Lecture 2 - Probability
Lecture 2 - ProbabilityLecture 2 - Probability
Lecture 2 - Probability
Luke Dicken
?
Lecture 1 - Game Theory
Lecture 1 - Game TheoryLecture 1 - Game Theory
Lecture 1 - Game Theory
Luke Dicken
?
Lecture 4 - Opponent Modelling
Lecture 4 - Opponent ModellingLecture 4 - Opponent Modelling
Lecture 4 - Opponent Modelling
Luke Dicken
?
What I Done on my Holidays
What I Done on my HolidaysWhat I Done on my Holidays
What I Done on my Holidays
Luke 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 Representations
Luke Dicken
?
The Strathclyde Poker Research Environment
The Strathclyde Poker Research EnvironmentThe Strathclyde Poker Research Environment
The Strathclyde Poker Research Environment
Luke Dicken
?
SAIG Overview March 2011
SAIG Overview March 2011SAIG Overview March 2011
SAIG Overview March 2011
Luke 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 Planning
Luke 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 AI
Luke Dicken
?
Robust Agent Execution
Robust Agent ExecutionRobust Agent Execution
Robust Agent Execution
Luke Dicken
?

More from 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
?

Recently uploaded

9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
saastr
?
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
?
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
Enterprise Knowledge
?
Must Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during MigrationMust Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during Migration
Mydbops
?
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
?
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance PanelsNorthern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving
?
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
?
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
?
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
ScyllaDB
?
Christine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptxChristine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptx
christinelarrosa
?
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
Ajin Abraham
?
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
Fwdays
?
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
?
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
?
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
?
High performance Serverless Java on AWS- GoTo Amsterdam 2024
High performance Serverless Java on AWS- GoTo Amsterdam 2024High performance Serverless Java on AWS- GoTo Amsterdam 2024
High performance Serverless Java on AWS- GoTo Amsterdam 2024
Vadym Kazulkin
?
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin..."$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
Fwdays
?
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
DanBrown980551
?
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
Safe Software
?
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
Jason Yip
?

Recently uploaded (20)

9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
?
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
?
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
?
Must Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during MigrationMust Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during Migration
?
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
?
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance PanelsNorthern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
?
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
?
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
?
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
?
Christine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptxChristine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptx
?
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
?
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
?
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
?
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
?
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
?
High performance Serverless Java on AWS- GoTo Amsterdam 2024
High performance Serverless Java on AWS- GoTo Amsterdam 2024High performance Serverless Java on AWS- GoTo Amsterdam 2024
High performance Serverless Java on AWS- GoTo Amsterdam 2024
?
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin..."$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
?
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
?
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
?
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
?

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 ?elds 2
  • 5. Who Am I ? PhD Student at University of Strathclyde ? BSc(Hons), MSc, MRes(Dist) in AI-related ?elds ? Founding member of SAIG 2
  • 6. Who Am I ? PhD Student at University of Strathclyde ? BSc(Hons), MSc, MRes(Dist) in AI-related ?elds ? 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 ?elds ? 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 ?elds ? 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 ?elds ? 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 scienti?c discipline 4
  • 20. Pure AI vs Game AI ? “Pure” AI is a scienti?c discipline ? Interested in creating systems as smart as possible 4
  • 21. Pure AI vs Game AI ? “Pure” AI is a scienti?c 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 scienti?c 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 scienti?c 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 scienti?c 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 scienti?c 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 ?ght as effectively as possible. 6
  • 29. Pure AI vs Game AI ? Pure AI for an NPC would be to make it ?ght 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 ?ght 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 ?ght 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 ?ght 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 ?ght 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 Arti?cial Intelligence? 10
  • 54. What is Arti?cial 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 Arti?cial 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 Arti?cial 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 Arti?cial 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 ?ll multiple degree-level courses 11
  • 61. Decision Making ? Not going to get too bogged down today in decision making process. ? Science of decisions can ?ll 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 ?ll 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, ?gure 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 ?ne. 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 ?ne. ? 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 speci?c 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 ? Con?guration parameters 36
  • 186. Hierarchical Concurrent State Machines ? Building block of an HCSM is itself an HCSM ? Recursive by nature ? Analogue input wire ? Con?guration 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 Kna?a 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. Path?nding in Unity ? Unity 3.5 now includes path?nding natively 67
  • 228. Path?nding in Unity ? Unity 3.5 now includes path?nding natively ? Pro only apparently 67
  • 229. Path?nding in Unity ? Unity 3.5 now includes path?nding natively ? Pro only apparently ? Not entirely sure how this is implemented 67
  • 230. Path?nding in Unity ? Unity 3.5 now includes path?nding natively ? Pro only apparently ? Not entirely sure how this is implemented ? I still haven’t bought Pro... 67
  • 231. Path?nding in Unity ? Unity 3.5 now includes path?nding 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 path?nding and decision making 69
  • 236. Runtime Woes ? We’ve talked about path?nding and decision making ? These can be computationally hard problems 69
  • 237. Runtime Woes ? We’ve talked about path?nding 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 path?nding 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 path?nding 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 path?nding 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 path?nding 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
  • 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 Path?nding 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 Path?nding ? 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

Editor's Notes

  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
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news
news