94
COPYRIGHT 2016 @ UNITY TECHNOLOGIES PRACTICAL AI IN GAMES Renaldas Zioma Unity Technologies (INTRO LEVEL)

Practical AI in Games

Embed Size (px)

Citation preview

Page 1: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

PRACTICAL AI IN GAMES

Renaldas Zioma Unity Technologies

(INTRO LEVEL)

Page 2: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

INTRO• Why graphics programmer is talking about AI?

Page 3: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

NO AI IN GAMES!• No “intelligence”

Page 4: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

NO AI IN GAMES!• No “intelligence”

• This statement is 99% true

Page 5: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

NO AI IN GAMES!• No “intelligence”

• This statement is 99% true • Behaviors are predefined - game does not learn!

Page 6: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

NO AI IN GAMES!• No “intelligence”

• This statement is 99% true • Behaviors are predefined - game does not learn!

• … but going to change soon-ish

Page 7: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

WHY?

• Hard!

 

Chess• Average branching factor = 35• Average depth = 80• Search space = 1080.

Go• Branching factor = 250• Average depth = 150

• Search space = 10360

• Branching factor = 3050 to 30200 !!!• Average Depth = ???• Search space =

Starcraft

💣 💣 💣

Page 8: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

AND NOT REALLY THE POINT!• AI is not to “solve” your game

• Entertain player

Page 9: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

DESIGN PRINCIPLES• Fun - instead of “just hard”

• Competence

• Autonomy

• Relatedness

• Immersion

• Presence

Page 10: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

• Responsive - because slow feels “stupid”

DESIGN PRINCIPLES

Page 11: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

DESIGN PRINCIPLES

• Relatable - if player does not understand that NPC is “smart”, you just wasted your time

Page 12: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

DESIGN PRINCIPLES• Fun - instead of “just hard”

• Responsive - slow feels “stupid”

• Relatable - if player does not understand that NPC is “smart”, you just wasted your time

• Player should feel “smart” - not AI or you!

Page 13: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

DESIGN PRINCIPLES• Fun, Responsive, Relatable

• Player should feel “smart”

• AI is a tool for game designer!

Page 14: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

PERFORMANCE

• You have 3 ms for AI !!!

• Graphics, physics, audio - first, because crucial for immersion • GPU does NOT do all graphics work!

• AI usually is time sliced - executed over several frames

1 second = 1000 ms

30 FPS = 1000 / 30 = ~33 ms

60 FPS = 1000 / 60 = ~16 ms

Page 15: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

AI “STACK”• Example from Robotics • Autonomous Car Architecture

Navigation

Behavior Planner

Driver

Motion Planner

Trajectory Planner

2Hz

60Hz

10Hz

5Hz

1Hz

Fine

r sca

leC

oars

er s

cale

Nicolas MeuleauUnity Technologies

exApple, exNASADirector of AI Research

Page 16: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

AI “STACK”• Games

Navigation

Animation controller

Trajectory, Steering

Behavior

2Hz

60Hz

10Hz

Page 17: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

NAVIGATION = PATHFINDING• Grid • Navigation Mesh (“NavMesh”) • Waypoint Graph

Navigation

Animation controller

Trajectory

Behavior

2Hz

60Hz

10Hz

Page 18: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

GRID

Page 19: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

NAVMESH

Page 20: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

WAYPOINT GRAPH

Page 21: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

GRID• Pros

• easy • strategy games

• Cons • flat • dense, takes memory

Page 22: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

NAVMESH• Pros

• 3D • average memory footprint • many genres

• Cons • hard to construct

Page 23: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

WAYPOINT GRAPH• Pros

• designer control • low memory footprint

• Cons • manual work

Page 24: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

COMMON PROBLEMS• Static world

• dynamic obstacles are easier to support with grid

• Actor size is predefined

• Fast moving actors with steering constraints • wheeled vehicles

Page 25: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

COMMON SOLUTIONS• Delegate solution to lower-level systems

• steering for dynamic obstacle avoidance

• Several data structures • different data structures can co-exist • several copies with different parameters

Page 26: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

STEERING

Navigation

Animation controller

Trajectory, Steering

Behavior

2Hz

60Hz

10Hz

Page 27: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

STEERING• Path simplification

Page 28: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

STEERING• Path simplification

Page 29: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

• Path simplification • Dynamic object avoidance

STEERING

Page 30: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

STEERING

Page 31: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

BEHAVIOR

Navigation

Animation controller

Trajectory

Behavior

2Hz

60Hz

10Hz

• State Machine • Behavior Tree • Utility AI

Page 32: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

FINITE STATE MACHINE = FSM

Page 33: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

FINITE STATE MACHINE

Page 34: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

FINITE STATE MACHINE

public class AttackBehaviour : StateMachineBehaviour{

public float power = 1.0f;public GameObject particle;private GameObject newParticle;override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex){

newParticle = Instantiate(particle, …Rigidbody particlePhysicalBody = newParticle.GetComponent<Rigidbody>();particlePhysicalBody.AddExplosionForce(power, animator.rootPosition, …

}override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex){

Destroy(newParticle);}override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex){

Debug.Log(“Attacking every frame!!!");}

// . . .

Page 35: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

Page 36: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

FINITE STATE MACHINE

• Pros • easy • visual

• Cons • complex behavior gets messy!

• Hierarchical FSM helps • hardcoded decisions

Page 37: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

PACMAN

Page 38: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

PACMAN

Page 39: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

PACMAN

Navigation

Animation

Steering

Behavior

Page 40: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

PACMAN• I felt it would be too stressful for a human […] to be continually surrounded and

hunted down. So I created the monsters’ invasions to come in waves. They’d attack and then they’d retreat. As time went by they would regroup, attack, and disperse again. It seemed more natural than having constant attack.

- Toru Iwatani, Pac-Man creator

• Just before ghosts turn a corner, their eyes move to point in the new direction of movement

- Ghost Pshychology, www.webpacman.com

Page 41: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

PACMAN

Page 42: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

•追いかけ, oikake - “chaser” •待ち伏せ, machibuse -“ambusher” •気紛れ, kimagure - “moody” •お惚け, otoboke - “feigning ignorance”

PACMAN

Page 43: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

GHOST STATEMACHINE

Page 44: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

PACMAN

Page 45: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

BEHAVIOR TREE = BT

Page 46: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

BEHAVIOR TREE• Selector • Sequence • Action

Page 47: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

BEHAVIOR TREE

Page 48: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

BEHAVIOR TREE• Pros

• better at complexity than FSM • used in many games: Halo, Bioshock, Crysis, Spore

• Cons • large BT can get slow • hardcoded decisions

Page 49: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

UTILITY AI

Page 50: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

UTILITY AI

Page 51: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

UTILITY AI

Page 52: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

UTILITY AI

Page 53: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

UTILITY AI• Pros

• can achieve “smarter” behavior than BT • Killzone, Sims, Civilization

• Cons • can be hard to design scorers and debug • some loss of designer control • still pretty hardcoded logic

Page 54: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

FSM / BT / UTILITY HOW TO CHOOSE?• Pick approach you are most comfortable with

• Pick the simplest tool that will make job done

Page 55: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

PLAN AHEAD

• FSM, BT, Utility AI - reactive • only reacts to current situation • no planning

• Deliberate AI • plans ahead

Page 56: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

INFLUENCE MAPS• Add Behavior related

information to path planning

• Simple way to plan for actions ahead • piggy-back pathfinding code

• Better decisions

Page 57: Practical AI in Games
Page 58: Practical AI in Games
Page 59: Practical AI in Games
Page 60: Practical AI in Games
Page 61: Practical AI in Games
Page 62: Practical AI in Games
Page 63: Practical AI in Games
Page 64: Practical AI in Games
Page 65: Practical AI in Games
Page 66: Practical AI in Games
Page 67: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

INFLUENCE MAPS• Types of data:

• covers • distance to enemies • distance to power-ups • heatmaps • etc…

Page 68: Practical AI in Games

COPYRIGHT 2014 @ UNITY TECHNOLOGIESCOPYRIGHT 2016 @ UNITY TECHNOLOGIES

FUTURE

Page 69: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

FUTURE• Intelligence in AI • Bluffing • Learning

Page 70: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

FUTURE• More Planning ahead • Machine Learning

Page 71: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

PLANNING IN GAME AI• Goal Oriented Action Planning

Page 72: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

GOAP• Games: F.E.A.R, S.T.A.L.K.E.R, Fallout 3, Just Cause 2

Page 73: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

GOAP• Pros

• better decisions • emergent gameplay

• Cons • performance! worse than NP-hard! • loss of designer control • so far didn’t became common approach

• maybe needs better tools

Page 74: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

BIOLOGICAL BRAIN• Consists of Neurons

• Ultra low power consumption

• Both DIGITAL and ANALOG!

Page 75: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

NEURON• Can compute • Can learn • Can generate patterns

• Form networks - highly interconnected • Very parallel - but single one is relatively slow

Page 76: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

Page 77: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

Page 78: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

NEURON• Both digital and analog! • Working principle includes 3 things at once:

• Electrical • Bio-mechanical • Chemical

• IMHO in the 21st century you must study some neuroscience! DO IT!

Page 79: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

NEURON, APPROXIMATELY• Sums up weighted inputs • Makes binary decision • Sends to connected neurons

Page 80: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

HARDWARE

Page 81: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

TPU• Tensor Processing Unit • Google

Page 82: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

TPU• Server running AlphaGO • Won against Lee Sedol

Page 83: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

FPGA• Field Programmable Gate Array

Page 84: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

DATA FLOW PROCESSORS• Some prototypes - neuFlow

• Used for Convolutional Networks for vision

Page 85: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

NEUROMORPHIC CHIPS• IBM TrueNorth

Page 86: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

NEUROMORPHIC CHIPS

Page 87: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

TRUE NORTH

Page 88: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

CEREBRAL ORGANOIDS• Madeline Lancaster, Cambridge MRC Lab

• since 2014 • Small artificially grown biological brains!

• ~4 million neurons

Page 89: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

Page 90: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

Page 91: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

Page 92: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

CEREBRAL ORGANOIDS• Easier way to study and learn from real “intelligence”

• Eventually will be connected to computers • biological AI co-processor

Page 93: Practical AI in Games

The Summer of Deep Learning

Page 94: Practical AI in Games

COPYRIGHT 2016 @ UNITY TECHNOLOGIES

Text Styles

between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

again, use SHIFT + TAB

Alternatively,

BACK TO GAME AI• Machine Learning is more like Intuition

• Planning is more like Reason

• Need both