keep your game in the fun zone - designing an ai director
DESCRIPTION
Das Balancing eines Spiels ist eine große Herausforderung, insbesondere wenn es gilt, Spieler auf unterschiedlichen Niveaus gleichermaßen abzuholen und im Flow-Kanal zu halten. Dabei spielt die automatische Anpassung des Schwierigkeitsgrades eine zentrale Rolle. An dieser Stelle kommt das Konzept des AI-Directors ins Spiel, welcher erlaubt die Balance zentral zu steuern und dynamisch an das Spielerverhalten anzupassen. Wie dieses Konzept konkret umgesetzt wird und sich auf das eigene Spiel übertragen lässt, erklärt Sascha in diesem Talk.TRANSCRIPT
@swagentrotz Blazing Badger
Who is talking?
Sascha Wagentrotz
CEO, Co-Founder and Game Designer
Blazing Badger GmbH
Founded in April 2014
Based in Frankfurt, Germany
@swagentrotz Blazing Badger
Why would your game not be fun?
The challenge structure is unstable.
The challenge parts don’t combine the way they are supposed to.
@swagentrotz Blazing Badger
@swagentrotz Blazing Badger
Specific Problems
Spawn camping
Getting one-shot
Button-mashing to victory
Out of ammo/Stuck on low health
Farmed up to invincibility
Difficulty affects enemy damage/health only
@swagentrotz Blazing Badger
Why does this happen?
Challenge flow is static
Spawn timings are pre-determined in most cases
Enemy distribution is pre-defined
Each enemy is allowed to make its own decisions
Enemies don’t take the actions of other enemies into account
@swagentrotz Blazing Badger
Solution: AI / Combat Director
DOES:
Controls all elements of the challenge with perfect knowledge
Enforces specific dynamic
Adjusts on the fly within seconds
Offers many parameters to affect difficulty
DOES NOT:
Make the game easier if you play badly! (if done right)
@swagentrotz Blazing Badger
WTF is an AI Director?
Superordinate Entity that takes control of the “big picture” of your game and features a dynamic system for game dramatics, pacing and difficulty.
Has been around for decades in simple forms
Was adapted for more genres over the last years
@swagentrotz Blazing Badger
Process: MDA Framework
Mechanics Dynamics Aesthetics
The experience (Aesthetics) that arises, when the player interacts (Dynamics) with the game rules (Mechanics).
Therefore:
What Dynamics do we want to see?
What Mechanics do we employ to facilitate them?
@swagentrotz Blazing Badger
DYNAMICS
What we want:
Smooth challenge flow
Mix of initiative and reaction
Some degree of forgiveness
Achieved with:
Spawn Rate
Attack Behavior
Recovery Rate
@swagentrotz Blazing Badger
STRUCTURE
Intention
Definition of the goal
Dynamic
What happens
Mechanic
How to get there
Parameters
Our “balancing knobs”
@swagentrotz Blazing Badger
Spawn Rate - Intentions
Good players are unable to ever beat the spawn counter (spawn camping)
May even need to put heavy pressure onto enemy numbers to survive incoming damage on higher modes at all
Bad players can never be swamped more than as intended by a tightly designed worst case
@swagentrotz Blazing Badger
Spawn Rate - Dynamic
Spawn rate depends on number of enemies present, desired maximum number and time to max number
The less enemies present, the faster they spawn
Enem
y A
mount
Time
Enemy amount over time
Most fights will
happen here
@swagentrotz Blazing Badger
Spawn Rate - Mechanic
The n-th enemy spawns after F(n) seconds after encounter start
F(n)=((n/MaxAmount)^Exp)*MaxTime
The n-th enemy spawns once a certain amount time has elapsed since spawning the previous one:
SpawnTimer=F(n)-F(n-1)
Restart the counter every time an enemy spawns
Tim
e
Enemy #
Time elapsed when nth enemy spawns
t unti
l nex
t en
emy
@swagentrotz Blazing Badger
Spawn Rate - Parameters
MaxAmount, MaxTime and Exponent
Depend on enemy strength and encounter intensity
Manage multiple pools for different challenge categories
Larger desired max number of small enemies
Lower desired max number of strong ones
Lower time to max for “deal with it” like spawn behaviour
Larger time to max for “you cannot ignore this for long” behaviour
@swagentrotz Blazing Badger
Attack Behavior - Intentions
Groups of two should not be boring
Groups of six+ should be tough but beatable
The player should have the initiative most of the time (ratio ~ 2:1 to 3:1) The player should be frequently forced to react
Very high intensity situations like bosses may change the initiative/reaction ratio (~1:1 or even 1:2)
The amount of players present shouldn’t influence the challenge much for an individual player
@swagentrotz Blazing Badger
Attack Behavior - Dynamic
The enemy attack frequency depends somewhat, but not much, on actual enemy numbers
The player has enough time to dispose of 2-3 foes before reacting to something
The time between attacks depends a lot on enemy type and the attack’s strength
On lower difficulties, there is less need to react in time than on higher ones
If multiple players are present, each player is pressured more or less evenly (enemy proximity and attacks)
@swagentrotz Blazing Badger
Attack Behavior - Mechanic
All challenging enemy actions have a cost associated
Enemies who are in position to act register all their currently possible with the Director very frequently (simultaneously)
The CD selects an action to be executed from what was registered, and incurs its cost in “debt”
The debt degenerates back to zero over time
Actions can only be ordered at zero debt Makes sure attack cost has no unwanted impact on how often has a chance to be
bought
Manage likeliness by other means (e.g. chances, or multiple debt counters)
@swagentrotz Blazing Badger
Attack Behavior - Parameters
Per actor:
Action Cost
Combat Director
One to several debt pools
Initial debt for each pool
Degeneration rate for each pool (does not have to be constant)
Degen
erati
on
Enemy #
Enemy amount over time
@swagentrotz Blazing Badger
Recovery Rate - Intentions
The player shouldn’t be able to hoard beneficial items (as this would trivialize bigger challenges that come along later)
The player shouldn’t ever be so starved for items that he cannot afford to use one every battle or two
There should be no extreme spikes in the drop rate
@swagentrotz Blazing Badger
Recovery Rate - Dynamic
The drop rate of beneficial items should depend on the amount of items already in the player’s possession
The more items the player has, the less likely it is another one will drop
It should not happen that items keep dropping even though there are already plenty waiting to be picked up
@swagentrotz Blazing Badger
Recovery Rate - Mechanic
Items waiting to be picked up count as well
Chance(Possesion)=base^(Posession)
0 < base < 1
Possession=Carried+x*OnGround
X = factor for value of items on the ground e.g. 0.5 = 50% worth
Dro
p C
hance
# in Possession
Time elapsed per enemy
@swagentrotz Blazing Badger
Recovery Rate - Parameters
Base
OnGround Modifier (x)
Example:
Possesion = Carried+x*OnGround = 0+0.5*0 = 0
Chance(Possesion)=0.5^(0) = 1 = 100% drop chance
Possesion = Carried+x*OnGround = 1+0.5*1= 1.5
Chance(Possesion)=0.5^(1.5) = 0.353 ~ 35% drop chance
Chance(Possesion)=0.7^(1.5) = 0.585 ~ 59% drop chance
@swagentrotz Blazing Badger
Variants
Want player to wait for opening
Have enemies buy whole sequence
Or regular low/freeze combat point generation
Want moments of frenzy
Occassionally lower costs by large factor
Want hard limits on some attacks/spawns
Add cooldown
Other Genres: e.g. Hint-Director in a Puzzle Game