Spielerando

Balance Your Game With AI: A Worked Example

To balance your game with AI, decide what a fair result looks like, keep all the numbers in one place and have your AI work out what they really lead to. Then play it, because numbers can tell you a fight is winnable but not that it is fun.

What does this look like with real numbers?

Say you are making Copper Moors, an invented turn-based game. The boss is the Bog Warden, and every number here is made up.

Health Damage per turn
Hero 40, plus three potions that heal 20 each 8 on average
Bog Warden 120 9

Before touching anything, write down your target in one sentence: a player who uses all three potions should just about win. Without it, your AI has nothing to aim for.

Now do the sum. The hero needs 15 hits to deal 120 damage. Drinking three potions costs three turns, so the fight lasts 18 turns. The hero goes first and the last hit ends the fight, so the Warden attacks 17 times.

Warden's damage Total damage taken Hero has 100 health in all Result
9 153 53 short Hopeless
6 102 2 short Loses, narrowly
5 85 15 left Wins with a little to spare

So one point of damage decides the fight. Damage 5 hits your target.

Now look at the trap. If you forget that a potion uses a turn, the Warden attacks only 14 times, and damage 6 seems to leave you 16 health. A quick answer can sound completely sure and still be wrong. This is why you ask to see the sum.

Why is the sum not enough?

The sum uses averages, and players do not get average luck. If hits range from 6 to 10, some fights go badly, and on damage 5 a player with bad luck may still lose. This is where your AI can do something you cannot do by hand: work out the exact odds, or run the fight thousands of times with a plain strategy and count the wins.

It also cannot tell you how the fight feels. Seventeen turns of drinking and hitting may be fair and still dull.

Which number should you change?

  • Change the enemy, not the hero. The hero's numbers affect every fight in the game, while a boss's numbers affect one.
  • Change one number at a time. With two changes, you do not know which one did it.
  • Keep the numbers together, so that you can change them without asking.

Balance gets harder once things are random, such as a loot table, or stack up, as in a skill tree. Spielerando can give your AI blueprints like these, ready-made code and a wiki through an MCP connection. You need a free account with Google or e-mail, and it never sees your game or code.

Paste this to your AI

Help me balance this part of my game: [fight, level or shop].
My target, in one sentence: [what a fair result looks like].

1. Find every number that affects this and list them in one place, each with a plain name. Quote where you found it.
2. Draw how it plays out as a Mermaid state diagram, with turns, actions and every way it can end. Check that it includes things that use up a turn, and that every path ends.
3. Show me the sum step by step, so I can follow it. Then work out the real result, with exact odds or by running it many times. Tell me which you did and how many runs. If you did not run anything, say so, and do not call a guess a result.
4. Tell me which single number to change to hit my target, and what it would do to the rest of the game.

Change nothing until I agree. Afterwards, show the result again with the new number. Whether it is fun is for me to judge.

Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP

How to check it worked

  • Do the sum yourself once. Follow the steps with a calculator. Does your AI's total match?
  • Count the turns in a real fight. Play it and compare with the drawing. If the fight lasts 12 turns and not 18, the sum is wrong.
  • Play it three times the way your target says. Do you win narrowly?
  • Hand it to someone else. Do not tell them how to win. Your own skill hides a lot.

Last updated: 2026-11-02