130 likes | 285 Views
Artificial Intelligence in Game Design. Probabilistic Finite State Machines. Randomness in Games. Adds to playability Characters less predictable, more “realistic” World itself is less predictable Greater replayability Goal: Randomness should not appear random
E N D
Artificial Intelligence in Game Design Probabilistic Finite State Machines
Randomness in Games • Adds to playability • Characters less predictable, more “realistic” • World itself is less predictable • Greater replayability • Goal:Randomness should not appear random • Part of character “personality” • Part of unpredictable world
Randomness Inside State • Randomness in actions taken by NPC • Randomness inside update method • Can depend on current state
Randomness Inside State • Randomness in Initial Setup • Randomness in enter method • Example: choice of weapon in Fight state 60% 35% 5%
Randomness in Transitions • Same current state + same stimuli = one of several possible next states • Possibly including current state • Performing different tasks at random Guard Door andShout for Help Player visible 60% Patrol in front of Door 40% Player visible Chase Player
Random Behavior Timeouts • Continue strong emotional behavior for random number of steps Predator seen Predator seen Wander Flee Predator not seen 10% Predator not seen 90%
Unpredictability of World • Small chance of “unexpected” occurrence • Adds “newness” to game even after multiple plays • Adds to “realism” of world Target in sights98% Reload Aim Fire Normal case Finished reloading Target in sights2% Gun Jam Gun cleared Unexpected case
Randomness in Emotional States • Emotional transitions less predictable • Effect of “delayed reaction” Small hit by player75% Player HP < 1040% Player HP < 1060% Confident Angry Small hit by player25% Heavy hit by player70% My HP < 1050% Heavy hit by player30% My HP < 1050% Heavy hit by me30% Frightened Heavy hit by me70%
Probabilities and Personality • NPCs with probabilities can give illusion of personalities • Differences must be large enough for player to notice in behavior Small hit by player10% Player HP < 1080% Player HP < 1020% Confident Angry Small hit by player90% Heavy hit by player70% My HP < 1080% Heavy hit by player30% Orc with anger management issues Heavy hit by me30% My HP < 1020% Frightened Heavy hit by me70%
Dynamic Probabilities • Likelihood of transition depends on something else • More realistic (but not completely predictable) • Can give player clues about state of NPC % of bullets left Firing Reload Player not firing 1- % of bullets left Guard Door andShout for Help 1- Energy % Player visible Patrol in front of Door Energy % Chase Player
Emergent Group Behavior • Each NPC in group can choose random behavior • Can appear to “cooperate” • Half of group fires immediately giving “cover” to rest • If player shoots firing players, rest will have time to reach cover Fire 50 % Player visible Patrol Cover reached 50 % Take Cover
Emergent Group Behavior • Potential problem:Possibility all in group can choose same action • All either shoot or take cover • No longer looks intelligent • Can base probabilities on actions others take Fire 1 - % of other players firing Player visible Patrol Cover reached Take Cover % of other players firing
Potential Problems • Possibly many parameters to tweak • How do we know these are the best probabilities to use? • Difficult to thoroughly test • Combinations of probabilities may create a bad case (i.e. easy win) which is possible but very unlikely • That case will be found by some customer