1
IMGD 1001: Programming Practices; Artificial Intelligence
by Mark Claypool (claypool@cs.wpi.edu) Robert W. Lindeman (gogo@wpi.edu)
Claypool and Lindeman, WPI, CS and IMGD 2
IMGD 1001: Programming Practices; Artificial Intelligence by Mark - - PDF document
IMGD 1001: Programming Practices; Artificial Intelligence by Mark Claypool (claypool@cs.wpi.edu) Robert W. Lindeman (gogo@wpi.edu) Outline Common Practices Artificial Intelligence Claypool and Lindeman, WPI, CS and IMGD 2 1 Common
Claypool and Lindeman, WPI, CS and IMGD 2
Claypool and Lindeman, WPI, CS and IMGD 3
Based on Chapter 3.1, Introduction to Game Development
Claypool and Lindeman, WPI, CS and IMGD 4
Based on Chapter 3.1, Introduction to Game Development
Claypool and Lindeman, WPI, CS and IMGD 5
Low level test of part of game
See if physics computations correct
Tough to wait until very end and see if there's a bug Often automated, computer runs through combinations Verify before assembling
Verify high-level functionality working correctly
See if levels load correctly
Still turned over to testers that track bugs, do gameplay
Based on Chapter 3.1, Introduction to Game Development
Claypool and Lindeman, WPI, CS and IMGD 6
Based on Chapter 3.1, Introduction to Game Development
Claypool and Lindeman, WPI, CS and IMGD 7
http://en.wikipedia.org/wiki/Pair_programming
Claypool and Lindeman, WPI, CS and IMGD 8
Claypool and Lindeman, WPI, CS and IMGD 9
Claypool and Lindeman, WPI, CS and IMGD 10
Based on Chapter 5.3, Introduction to Game Development
Claypool and Lindeman, WPI, CS and IMGD 11
Based on Chapter 5.3, Introduction to Game Development
Claypool and Lindeman, WPI, CS and IMGD 12
Claypool and Lindeman, WPI, CS and IMGD 13
Based on Chapter 5.3, Introduction to Game Development
Claypool and Lindeman, WPI, CS and IMGD 14
Claypool and Lindeman, WPI, CS and IMGD 15
Based on Chapter 5.3, Introduction to Game Development
Claypool and Lindeman, WPI, CS and IMGD 16
Based on Chapter 5.3, Introduction to Game Development
Claypool and Lindeman, WPI, CS and IMGD 17
Based on Chapter 5.3, Introduction to Game Development
Claypool and Lindeman, WPI, CS and IMGD 18
Based on Chapter 5.3, Introduction to Game Development
Claypool and Lindeman, WPI, CS and IMGD 19
Claypool and Lindeman, WPI, CS and IMGD 20
Wander Attack Flee See Enemy Low Health No Enem y No Enemy Based on Chapter 5.3, Introduction to Game Development
Claypool and Lindeman, WPI, CS and IMGD 21
Based on Chapter 5.3, Introduction to Game Development
Claypool and Lindeman, WPI, CS and IMGD 22
Based on Chapter 5.3, Introduction to Game Development
Claypool and Lindeman, WPI, CS and IMGD 23
void RunLogic( int * state ) { switch( state ) { case 0: //Wander Wander(); if( SeeEnemy() ) { *state = 1; } break; case 1: //Attack Attack(); if( LowOnHealth() ) { *state = 2; } if( NoEnemy() ) { *state = 0; } break; case 2: //Flee Flee(); if( NoEnemy() ) { *state = 0; } break; } }
Based on Chapter 5.3, Introduction to Game Development
Claypool and Lindeman, WPI, CS and IMGD 24
Based on Chapter 5.3, Introduction to Game Development
Claypool and Lindeman, WPI, CS and IMGD 25
AgentFSM { State( STATE_Wander ) OnUpdate Execute( Wander ) if( SeeEnemy ) SetState( STATE_Attack ) OnEvent( AttackedByEnemy ) SetState( Attack ) State( STATE_Attack ) OnEnter Execute( PrepareWeapon ) OnUpdate Execute( Attack ) if( LowOnHealth ) SetState( STATE_Flee ) if( NoEnemy ) SetState( STATE_Wander ) OnExit Execute( StoreWeapon ) State( STATE_Flee ) OnUpdate Execute( Flee ) if( NoEnemy ) SetState( STATE_Wander ) } Based on Chapter 5.3, Introduction to Game Development Claypool and Lindeman, WPI, CS and IMGD 26
Claypool and Lindeman, WPI, CS and IMGD 27
Based on Chapter 5.3, Introduction to Game Development
Claypool and Lindeman, WPI, CS and IMGD 28
OnEnter, OnExit Timers Handle events Consistent regulated structure Ability to log history Modular, flexible, stack-based Multiple FSMs, Concurrent FSMs
Based on Chapter 5.3, Introduction to Game Development