Book Image

Unity 4.x Game AI Programming

By : Aung Sithu Kyaw, Clifford Peters, Thet Naing Swe
Book Image

Unity 4.x Game AI Programming

By: Aung Sithu Kyaw, Clifford Peters, Thet Naing Swe

Overview of this book

<p>This book fills the gap between artificial intelligence (AI) books designed to learn underlying AI algorithms and general Unity3D books written to cover basic scene setup and scripting in Unity3D. Game AI Scripting in Unity3D covers implementing AI techniques such as flocking, pathfinding, path following, and behavior trees in Unity3D with example projects.<br /><br />Game AI Scripting in Unity3D will show you how to apply AI techniques to your Unity3D projects using C# as the scripting language. Unlike other AI books and Unity3D books, this book tries to focus more on the application of AI techniques in the Unity3D engine, with sample projects that demonstrate finite state machines (FSMs), pathfinding, steering, navigation graphs, and behavior trees techniques. <br /><br />This book shows how to implement various AI techniques in Unity3D by implementing the algorithm from scratch using C#, applying Unity3D built-in features, or using available scripts and plugins from the Unity Asset Store. For example, we’ll be implementing our own A* algorithm to do pathfinding but will also explore the Unity3D navigation graphs feature. Then we’ll use the Behave plugin to construct behavior trees for intelligent AI character behaviors.<br /><br />Game AI Scripting in Unity3d&nbsp; covers other AI techniques such as flocking behavior, building a sensory system for taking inputs from the environment and other AI agents, and so on. In the final chapter this book will show you how to build a racing game AI project using Unity3D and applying the techniques described in earlier chapters.</p>
Table of Contents (17 chapters)
Unity 4.x Game AI Programming
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
Index

Index

A

  • A* algorithm
    • about /
    • testing /
  • A* pathfinding
    • about /
  • action
    • about /
  • AdvancedFSM class / Patrol state
  • AdvancedFSM framework / AI Car Controller
  • AdvanceFSM class
    • about /
    /
  • Agent /
  • AgentAI class / The Robots versus Aliens project
  • AgentController.cs file /
  • AI
    • about /
    • research areas /
    • in games /
    • techniques /
    • sensory systems /
  • AI car controller
  • AICars entity / Scene setup
  • AI character
    • about /
    • sense class /
    • perspective sense /
    • touch sense /
    • testing /
  • AIUpdate method /
  • Aliens project
  • alignment rule
    • about /
  • ArrayList type /
  • Aspect.cs class /
  • Aspect.cs file /
  • aspectName /
  • AssignNeighbour method /
  • AStar.FindPath method /
  • AStar class /
    • about /
  • attack state / Attack state
  • avoidanceForce property /
  • avoidanceRadius property /
  • AvoidObstacles method /

B

  • Behave.Runtime namespace /
  • behave plugin
    • about /
    • installing, steps for /
    • downloading, steps for /
    • debugger /
    • results, exploring /
  • behavior trees
    • about /
  • betResult guiText object /
  • BLAgentBehaveLib.TreeType variable /
  • bullet class
    • about /
  • Bullet object / Bullet

C

  • CalculateNextMovementPoint() method /
  • CalculateObstacles method /
  • CalculatePath method /
  • chase state / Chase state
  • checkBet() method /
  • cohesion rule
    • about /
  • CompareTo method /
  • Component completion variable /
  • conditional probability
    • about /
    • loaded dice /
  • controller class
    • about /
  • coroutine method / Gun
  • Cube game object /

D

  • dead state /
  • DebugDrawGrid method /
  • decorator
    • about /
  • Defense of the Ancient (DotA) /
  • DetectAspect method /
  • Dijkstra algorithm
    • about /
  • direction property /
  • Dynamic AI
    • about /

E

  • Enemy detected message /
  • enemy tank AI
    • about /
    • patrol state /
    • chase state /
    • attack state /
    • dead state /
  • events component /
  • Explosion property /

F

  • FadeIn action /
  • FadeOut action /
  • FindNextPoint method /
  • FindPath method /
  • FixedUpdate() method /
  • FlockController
    • about /
    • code /
  • flocking
    • from Unity Island Demo /
    • implementing /
  • followRadius /
  • followVelocity /
  • FSM
    • about /
    • components /
    • random /
    • abstract FSM class /
    • enemy tank AI /
    • with probability /
  • FSM, components
    • state component /
    • transitions component /
    • rules component /
    • events component /
  • FSMs
  • FSMState class
    • about /

G

  • Game Developers Conference (GDC)
    • about /
  • GameObject.FindWithTag() method / Tags and layers
  • GetColumn method /
  • GetGridIndex method /
  • GetNeighbours method /
  • GetPoint method /
  • GetRow method /
  • GridManager class
    • about /
  • GridManager object /
  • guiText element /
  • guiText object /

H

  • HeuristicEstimateCost method /

I

  • Initialise method /
  • InstantiateTree method /
  • InstantiateTree static method /
  • intervalTime property /
  • Is Looping flag /

L

M

  • Manhattan length /
  • map
    • setting up /
  • Max Slope property /
  • messaging system
    • about /
  • minimumDistToAvoid variable /
  • missile launcher weapon / Launcher
  • mousePosition object /

N

  • Natural language processing (NLP)
    • about /
  • navigation mesh
    • about /
    • baking /
  • Navigation Static
    • about /
  • Nav Mesh Agent
    • about /
    • URL /
    • destination, updating /
    • Target.cs class /
  • NavMeshAgent array /
  • NavMeshLayers
    • about /
    • creating /
    • new layer, adding /
  • near miss
    • about /
  • Node class /
  • Node object /
  • non-player characters (NPCs) /
  • NPCTankController class
    • about /

O

  • obstacleList property /
  • obstacles
    • about /
    • avoiding /
    • custom layer, adding /
  • Off Mesh Links
    • about /
    • generation /
    • manual off /
    • URL /
  • OnDrawGizmos method /
  • OnGUI() function /
  • OnGUI() method /
  • OnGUI method /
  • OnTriggerEnter event /
  • OnTriggerEnter method /

P

  • parallel node
    • about /
  • PARS /
  • ParticleExplosion /
  • path
    • about /
    • adding /
    • script /
    • follower /
  • Path.cs script /
  • pathArray property /
  • patrol state / Patrol state
  • PatrolState class
    • about /
  • PerformTransition method / Patrol state
  • Perspective.cs file /
  • perspective sense /
  • Physics.Raycast method /
  • player car controller
  • player tank
    • about /
  • PlayerTank.cs file /
  • PlayerTankController.cs file
    • code /
  • PlayerTankController class
    • about /
    • properties /
    • bullet, shooting /
    • tank, controlling /
    • bullet class /
  • PlayerTank game object /
  • PlayerTank script /
  • playerTransform variable / AI Car Controller
  • polling
    • about /
  • PriorityQueue.cs class /
  • PriorityQueue class /
    • about /
  • PRNG
    • about /
  • probability
    • about /
    • defining /
    • conditional probability /
    • with FSM /
    • weighted probability /
  • Pull Lever button /

R

  • radius property /
  • RAIN
    • URL /
  • random
    • about /
    • class /
    • dice game /
  • Random.value property /
  • randomFreq /
  • randomPush value /
  • range method /
  • Raycast method / Launcher
  • real-time strategy (RTS) game /
  • recticle / Player car controller
  • recticle Player game object / Scene setup
  • reference
    • about /
  • Reset method /
  • Rigidbody component /
  • RNG
    • about /
  • Robots project
  • RTP /
  • rules component /

S

  • scene
  • script
    • interfacing with /
  • seed property /
  • selectors
    • about /
    • priority selector /
  • SelectTopPriority method /
  • Sense.cs file /
  • sense class /
  • sensor system
    • about /
  • sensory systems
    • about /
  • separation rule
    • about /
  • sequence
    • about /
  • SetTransition method /
  • Shoot method / Gun
  • ShouldDoMyAction decorator /
  • slope
    • scene, building with /
  • slot machine
    • demo /
    • random slot machine /
  • Sort method /
  • SpawnBullet method / Gun
  • SpawnMissile method / Launcher
  • Start() method /
  • StartCoroutine method / Gun
  • Start function /
  • Start method /
  • state class
    • about /
  • state component /
  • statesPoll array /
  • steer() method /
  • steering
    • about /
    • layers /
  • Steer method /
  • StopCoroutine method / Gun
  • s_Instance static variable /

T

  • tags
  • tank
    • controlling /
  • Target.cs class /
  • TargetMovement
    • about /
    • file /
  • Target object /
  • targetTransform variable /
  • target variable /
  • TestCode class
    • about /
  • throwLoadedDice() method /
  • Tick method /
  • toOriginForce /
  • toOriginRange /
  • Touch.cs file /
  • touch sense /
  • transitions component /
  • Translate() method /

U

  • Unity3D reference documentation
    • URL /
  • UnityFlock.cs file /
  • UnityFlockController entity /
  • UnityFlock script /
  • Unity reference documentation
    • URL /
  • Unitys Island Demo
    • flocking from /
  • Update() method /
  • Update method / Player car controller, Missile
  • UpdateRandom() method /
  • UpdateSense method /
  • UpdateSens method /

V

  • Vector3.RotateTowards method /
  • vehicles

W