Sub topic 12
Validate the Model Against Expected Behavior
Assume you know basic spreadsheet navigation, arithmetic, percentages, and the game system being balanced. Validation means checking whether a spreadsheet model behaves like the game is supposed to behave. A formula can be syntactically correct and still describe impossible or misleading gameplay.
Start with Explicit Expectations
Before checking formulas, write down expected behavior as testable statements. These statements become validation targets.
Examples include:
- A stronger weapon should not reduce damage against the same target.
- Increasing enemy defense should not reduce time to kill.
- A player should earn enough resources to buy the intended upgrade within a target number of encounters.
- The first upgrade should feel affordable, while later upgrades should require increasing commitment.
- Damage should never become negative unless the game explicitly supports healing or damage absorption.
- A difficulty increase should make encounters harder without accidentally increasing player rewards beyond the intended range.
Separate exact expectations from directional expectations. An exact expectation might be “the player reaches level 5 after 20 minutes.” A directional expectation might be “the hard mode takes longer than normal mode.”
Add Validation Columns
Keep validation checks beside the calculated results or on a dedicated Validation sheet. Each check should return a clear result such as PASS or FAIL.
For example, suppose damage uses attack power and defense:
=MAX(1, AttackPower - Defense)You can test its minimum-damage rule with:
=IF(Damage >= 1, "PASS", "FAIL")Test monotonic behavior by comparing two rows that differ only in attack power:
=IF(Damage_StrongerWeapon >= Damage_WeakerWeapon, "PASS", "FAIL")A check should identify the failing case when possible. Instead of showing only FAIL, include the row or scenario name:
=IF(TimeToKill <= TargetTime, "PASS", "FAIL: " & ScenarioName)This makes a large model easier to debug.
Check Invariants and Boundaries
An invariant is a rule that should remain true across all valid inputs. Common game-balance invariants include:
- Health, costs, and durations are not negative.
- A zero-damage attack does not produce a negative time to kill.
- A target with zero health is already defeated.
- A reward multiplier of zero produces zero bonus reward.
- A percentage input stays within its intended range.
- Cumulative cost never decreases as more upgrades are purchased.
Boundary testing checks unusual but valid values. Test the smallest and largest values that the game allows, plus values near important thresholds.
| Test case | Expected result | Why it matters |
|---|---|---|
| Defense equals attack power | Minimum damage | Checks the damage floor |
| Target health is 1 | Very short time to kill | Checks rounding and division |
| Upgrade count is 0 | Base cost or zero total cost | Checks starting state |
| Reward multiplier is 0 | No multiplied reward | Checks economy edge behavior |
Also test invalid inputs, such as a negative cost or a blank attack speed. The model should flag them rather than silently producing a plausible number.
Compare the Model with Hand Calculations
Choose a few small examples that you can calculate manually. For time to kill, the model might use:
=CEILING(TargetHealth / DamagePerHit / HitsPerSecond, 1)For a target with 100 health, 20 damage per hit, and 2 hits per second:
- Hits required: 100 / 20 = 5
- Time: 5 / 2 = 2.5 seconds
- Rounded result: 3 seconds
If the spreadsheet returns 2 seconds, it may be rounding too early or using the wrong unit. Hand calculations are especially useful before testing large progression tables.
Validate Changes, Not Just Snapshots
After changing one parameter, compare the old and new results. Record the reason for the change, the affected metric, and whether the result moved as expected.
Exercise
A weapon deals 15 damage per hit, attacks twice per second, and hits an enemy with 90 health. What time to kill should the model produce when it rounds up to whole seconds?
Show answer
Six hits are required because 90 / 15 = 6. At two hits per second, the unrounded time is 3 seconds, so the expected result is 3 seconds. Add a validation row that compares the spreadsheet result with 3.