• entries
    16
  • comments
    60
  • views
    3,460

Encounter Balance part 1

freakytapir

200 views

The impossibility of perfect encounter balance.

 

Or maybe just my failure at it.

 

Now that I've finished bare bones mapping for most of my act 1 dungeons, I was thinking to myself : Why don't you make some nice 
encounters so you actually can get some playstesting done?

I open up the database, create some basic enemy types (Skirmisher, Artillery, Soldier, Brute,...), give my characters some basic skills (fire, ice, darkness), and try them out.

Now, I have been pretty anal about getting my stats right ( see my previous blogs), with HP's and so forth being determined by the amount of hits 
I want the enemies to take before dying, and the amount of hits a player will take before dying.

 

It all seemed so perfectly balanced on the spreadsheet, until I started playtesting my encounters.
Which shows again , numbers are no substitute for raw playtest data.

 

All went well until I tried basically anything beyond a basic damage spell or attack. Then the balance shifted into weird directions.

 

After giving it some thought, I think I have found the 4 biggest disruptors for encounter balance, in rising order of complexity :

  1.  Multi-Target/Hit skills
  2. Status effects
  3. Randomness
  4. Interactions

Today, I'll be tackling the first 2, the other 2 are for another time. Maybe next week. Because for these first 2 , I have found a simple tool to balance these out.

 

1. Multitarget spells

For a starter, Multi Target/Hit skills, abilities that hit 2 or more targets, cause problems because they are damage multipliers.
Unless the damage is nearly neglectible, or the cost is excessive, any multitarget spell is just an order of magnitude better than any single target spell.
Any small boost or debuff is felt way harder than with single target skills.

 

An example : At level 20 the player is supposed to do 400 Damage per attack. 
Now, as I am working on a one enemy per player character system, there should be about 4 targets.
So easy, you say, just let the multi-target spell deal 25 % damage, so 100 per target.

 

That's nice, but that means it is now useless in any stituation with less than 4 targets. Now, most enemies will have 4 players fighting them, so this solution works nicely for enemies.

Obviously that does not work for Players, so in comes my good old friend : limited resources. 

 

Any multitarget attack should just cost a certain amount of MP/TP, even if the single target version does not. How much MP/TP ?

The easiest solution I could find was to just give each MP point an amount of damage it could deal. After long debate, I came to 50 % damage (or healing) per MP point spent.
So assuming I use a multitarget spell when I have 3 or 4 , so 3.5, opponents, I deal 350%-100%= 250% more damage, so a multitarget spell costs 5 MP.

 

What about high levels, you say ? Seeing as I don't believe in straight upgrades ( no Fire 1,2,3), I have an additional solution: Monster HP escalates way faster than player damage, 
so by the time he can spam fireball, enemies dont take 2 hits, but 4 hits to take down, and he will need all the fireballs he can get. 
It allows the player to grow without needing to replace his basic skills, as I combine it with a small MP pool, topping out at 110 MP for mages at lvl 100, and rising MP generation, topping out at 10 MP per turn at lvl 100. 

 

Instead of casting fire (0MP) and saving his MP for the fireball (5MP), he can alternate between the 2 the moment he regenerates enough MP, maybe even casting regular fire a couple of turns, to save up for the big guns (25 MP/shot).

Now, in the case of TP using skills, how do we balance this ? That is something for another chapter.

 

2. Status effects, buffs and Debuffs.

 

The core of combat: Action economy.

 

In combat, in the rawest sence, players and enemies trade actions for damage. Given the way I balanced my game, equally levelled players and enemies recieve an equal amount of damage per spent action , it is just the HP's that differ.

 

So in the strictest sence, the opponent has to spend a certain number of actions to win , and the player has to spend a different amount of actions to win.
In a basic combat, the 2 cavemen beating eachother with clubs until one falls down kind, aka the attack spam battle, the players will allways win or the enemy will always win, with, outside of criticals, no variance inbetween.

 

But that is not how real combats work. In a combat with multiple characters on both sides, both sides generate actions each turn , and spend them to kill the other side. Once one side has spent enough actions , that side wins.

 

An Example:

A 4 heroes against 3 rats scenario at level 5. The rats deal about 20 % of the players hp in damage each action they takeand can take 2 hits.
So the rats generate 3 actions per turn, and need to spend 20 actions to win, the players generate 4 actions a turn and need to spend 6 actions to win.

So however you slice it, the rats always lose in 1.5 turns, having dealth at most 4.5 actions worth of damage, but if the player focus fire having dealt only 1-2 actions worth of damage. 
The worst case scenario is that all the rats hit the same guy, and he dies.
This is a nice and safe encounter even if the player just divvies up his attacks evenly instead of focus-firing (which is pretty dumb for the player).

 

Now, let's replace the rats by snakes. Suppose they have a poison attack, that deals no initial damage, but poisons with 20 % HP per turn damage , and a regular attack.
How much more dangerous is this than the rats ?
Assuming the same encounter, 3 snakes vs 4 players, equal level.
The players still generate 4 actions per turn , and need to spend 6 actions to win. The snakes also need to spend 20 actions and generate 3 actions per turn.

Supposing the snakes have basic AI and do not attack already poisoned players, is this encounter more dangerous than the rats one?
Looking at it hrough an actions generated/spent lens might give us an answer.
Nothing has changed on the player side, so were ignoring that for now, but the way the snakes behave is totally different than te rat behaviour.

After poisoning the players, suddenly the snakes are generating damage on the opponents turns, in effect generating actions.

 

A little turn by turn :
Snakes spend 3 actions , to poison 3 players. The players take 3 actions worth of damage because of the poison. The players spend 4 actions and kill 2 snakes.
The final snake attacks one player, the party then mobs him, but still takes poison damage twice. 

So grand total : The players take about 6 actions worth of damage before winning, therefore this encounter is about 2-3 times as difficult as the rats one, but still nowhere near a danger for the player.

 

Now interesting things happen when the number of snakes or rats changes.

Suppose we have 3/6 rats, and the player focus fires to kill rats as fast as possible, and tries to kill a rat before it takes a turn, and the rats attack randomly:

Round 1: Players spend 4 actions and kill 2 rats, rats get 4/1 actions.

Round 2: Players mow down 2 rats, rats get 2/0 actions

Round 3 : All rats die.

 

Suddenly the 6 rats get off 6 actions, in opposition to the 1-2 actions if there where 3 of them. So the encounter with twice as many rats is not twice as hard, but up to 4 times as hard. Notice also how the 3 rat encounter is actually 3x easier if the players focus fire.

From this we can conclude that encounters do not scale in a  linear fashion, and even adding one enemy does nasty things to an encounter.


As a bonus the same situation with 6 snakes :
Players focus fire on the 6 snakes, and the snakes spread poison as fast as possible, to a player that still has to take its turn.
Round 1 : 2 Snakes killed, 4 players poisoned. 4 actions worth of damage.
Round 2: 2 Snakes attack, 2 snakes killed. Snakes deal 6 actions worth of damage.
Round 3: 0-1 snakes attack, 2 snakes killed. Snakes deal 2-3 actions worth of damage.

 

So the snakes deal 12-13 actions worth of damage. So the 6 snake encounter is still twice as dangerous as the 6 rat one, and might actually heavily damage a party, seeing that 20 actions by the enemy kills the player.

 

If the player spread his damage instead of focus firing, he would take :

Round 1: 4 Players poisoned, 2 regular attacks, no snakes killed: 6 actions for the snakes.
Round 2 : 4 regular attacks, 4 poison damage actions. 8 actions by the snakes.
Round 3 : Kill 4 snakes.1 attack by the snakes. 4 actions worth of poison damage, and 1 regular action.

 

For a grand total of 19 actions worth of damage by the snakes. The players might actually lose this encounter if they are really dumb and just attack spam to random targets. 

Now why this whole explanation about rats and snakes ?

Because they demonstrate that nearly all things can be calculated in an actions worth of damage, and to show that he who generates the most actions wins.

 

This is an important factor in encounter balance. It shows that the more enemies you add, the more turns each enemy gets, so you have a near quadratic effect on encounter difficulty.
It also show the importance of debuffs and buffs and status effects, once you start to see it as trading your turn for theirs, and why status efects are annoying if used by the enemy and useless if used by the player.

"Wait what ?" You might say, but it is true. As we see in the 6 rats scenario, the players have to spend 12 actions to win, but the rats have to spend 20. 
So each action for the players is 1.66 times more valuable than one from the enemies. Even if the player had a 100 % accurate stun it is only worth it if the rat would have lived 2 additional turns. And this is the best case scenario. 
And forget the classical blindness spell with a 70 % succes chance and a 70 % accuracy reduction. That would only generate on average 0.7*0.7=0.49 actions per turn. Meaning, in our rat case, the rat would have to live 3-4 more turns before it becomes worth it.
I easily solve this by having the player cast blindness spell also deal damage, but cost 1 MP. As I established earlier, 1 MP gets you 50 % of an actions worth of damage/effect/healing. 
So with the same reasoning, the ice spell that deals regular damage and freezes for 2 turns with a 50 % chance costs 1 MP, as it negates a full enemy action (that's about 1/1.6= 62 % of a player action).

Now when used by the enemies, it suddenly does become worth it. If an enemy action costs a player an action , he has traded up, seeing as the player actions are worth 1.6 times as much as the rat ones.

 

It also poses a floor for healing spells. If a healing spell does not heal at least, in our example, 1.6 x as much as the enemy would deal, that healing spell would have better been an attack to end the encounter faster except when that character would otherwise die, then you're trading an action for an action.

 

Buff spells suffer the same fate. A single target buff spell that raises another characters attack by 50 % is only worth it if the combat lasts 2 more turns to break even, and 3 turns to be better than a standard attack. 

Meaning that I find that a single target buff should cost 0-1 MP (probably 0 to encourage buff use), but a partywide buff should cost 1 MP if it lasts 1 turn ,because you spent an action to generate 1.5 actions (3*50% more damage), gaining you half an action. 
Any turn after that should cost 4 MP, so a 3 turn party wide buff should cost 9 MP. Now, to encourage buff use, because 90 % off players will still always go for the straight damage spells, I might just reduce this to 6-7 MP.

 

Now comes the difficult part : The exchange rate between player and enemy actions shifts at higer levels. This is because at higher levels, the balance is different.
At level 5, enemies deal 20 % of the players HP in damage and take 2 hits to kill, while at level 100 they deal 60 % of the players HP and take 7 hits to kill.
So the players need to spend 28 actions to kill the enemy, and the enemy needs to spend 8 actions to kill the player. Suddenly the enemies turn is worth at least 3.5 times as much as a player one.
This means that a player is spending at least 5 MP a turn (+250% Damage) to make his actions on par with the enemies actions, and should probable be spending about 10 MP per turn if he wants to win(By coincidence, that is what he regenerates in MP each turn). It also means that status effects become really important for the players to use, as each stunned/silenced/frozen enemy is worth 2-3 player turns. And I am ok with that. It just means that abilities that unlock later should be balanced for use at that level, and that some low level abilities become better as the levels advance, thereby keeping them relevant.

 

So what I'm saying is to not stare yourself blind at the numbers in this article but maybe to try and see combat in terms of an action economy, with both players and enemies generating and spending actions, with a certain exchange rate between these 2 actions, and an MP cost to generate what amounts to extra actions.

 

It simplifies the numbers to simple actions spent, and allows you to quickly mentally simulate important battles, and balance skills.

 

This is most valuable in boss encounters, where you can actually start to see it on a timeline, and thus balance the boss way easier.


  Report Entry


3 Comments


Hello, my friend. Welcome to Hell :D I didn't bother using a spreadsheet when I tried figuring all the above stuff out. My theory was I could drive myself nuts trying to figure out all that stuff above, but it would fail magnificently, and I'd spend a ton of time tinkering with everything anyway. So I saved myself the time and headache and just eyeballed everything, tested, and adjusted. Looots of adjusting, but I eventually found a balance with player stats, armor, skills, and enemies that had the difficulty curve I wanted. It's not perfect, but it's pretty good for the completed areas. I just added a bunch of higher level player skills that need to be tested, and I'm sure there will be more tinkering. 

freakytapir likes this

Share this comment


Link to comment

I actually considered wrtiting a script in some programming langauage to simulate combats, before I reralised how daft that sounded.

 

Some part of my mind really wants everything to make sense, but as an engineer, I learned that sometimes you just accept the test results, no matter how much they contradict any underlying math or theory. As the saying goes : in theory practice should equal theory, in practice it doesn't.

lonequeso likes this

Share this comment


Link to comment

If you ask me, for the most part any kind of gameplay 'balance' is something you usually end up needing to test and adjust until you get it right. A theory or plan can help, but it often break down in the end. This is because you are always dealing with the butterfly effect, any tiny change can ripple out and make huge differences. There is a reason why lots of games go through lots of patches to find the right balance and have to always nerf or buff little things that you wouldn't think make a big difference. Because they do make a big difference.

 

If you ask me though, 'balance' isn't quite the thing that should be the most important. Instead, it should be 'consequence'. A perfectly balanced game after all could be very boring as a result of nothing really standing out or being meaningful. If every encounter is handled like a zero-sum game where nothing really stands out or is interesting then they just become tedious busy work. Having weaker or stronger encounters, having better matchups or worse ones, having the choice of different playstyles witch may work better or worse for some things, all of these things are important. Meaningful choice requires more then a bit of balance to make the choice not have an obvious 'right answer', but at the same time the choices have to not amount to the same thing. It can get chaotic very quickly, but a chaotic system where a few balance issues sneak in might be better then a boring one where everything is perfectly balanced at the cost of anything having any consequence to it.

 

Of course, it's ideal to have both balance and consequence coexist together, but it's a lot more tricky then it seems.

Share this comment


Link to comment