How Do Games Make Sure a Level Can Be Beaten?

How do games make sure a level can be beaten? Why it matters

If you have ever asked how do games make sure a level can be beaten, the short answer is: they check it several ways, and no single check is enough. A level that cannot be won is worse than a hard one. A hard level teaches you something. An impossible one just tells you the game is broken.

This post walks through the checks, from a designer playing the level to a program that proves a path exists. Tank City Reboot is the worked example, because its code shows one of these checks clearly.

The first check: designers play it themselves

Every level starts with someone playing it. The designer builds a rough version and asks three plain questions. Can I get from the start to the goal? Can I survive the first minute? Do I know what to do when I lose?

This catches the obvious problems fast. A wall in the wrong place, a door that never opens, an enemy that spawns inside a block. It also has a weakness: the designer knows the level too well. They know where the danger is, so they play around it without noticing.

Doing the math: enemy counts, fire rate, and projectile speed

Before anyone plays again, you can check a level on paper. Count what the player has to destroy, then work out how long that takes.

The time to destroy an enemy depends on how often you can fire. Our plain guide to fire rate covers the idea. In Tank City Zero Day, the wait between shots starts at 0.3 seconds and shrinks by a quarter with each level of the Cache upgrade. That gives waits of 0.3, 0.225, about 0.17 and about 0.13 seconds.

Now run a check. The boss on wave 10 takes 55 hits. With the starting cannon, firing one shot at a time, even if every shot lands, that is at least 55 times 0.3, or 16.5 seconds of clean shooting. With all three Cache levels it is closer to 7 seconds. If the boss would wipe you out in 10 seconds, you know the level asks for upgrades the player may not have yet. You can decide whether that is fair before a single person plays it.

Shot speed matters in the same way. In Zero Day your shots travel at 200, or 270 with the first level of Pipelining. Your shots also cancel enemy shots, so speed shapes how a fight feels. Our guide to projectile speed explains why a few points of speed matter. And the spread shot is another number to check: Multithreading fires 1, 2, 3, then 5 shots per volley, which changes how fast a crowd goes down.

Spawn rates and pacing that keep a level fair

Enemy counts are only half of it. When they arrive decides whether you can cope. We cover the general idea in how games decide how fast enemies appear. Here is what that looks like with real numbers.

In the first Tank City game, each stage sends 20 tanks, never more than four on the field at once. On stage 1 a new tank enters every 2.6 seconds. Each later stage shaves off a quarter second, down to 1.1 seconds from stage 7. The designer is turning one dial slowly, so the player gets stronger as the pressure rises.

Zero Day uses formulas instead of a fixed list. For a normal wave:

  • The number of threats is 6 plus 2 per wave, capped at 30.
  • The number on the field at once is 4 plus one per 3 waves, capped at 8.
  • The wait between entries is 2.0 seconds minus 0.08 per wave, never under 0.6.
  • Enemy speed rises 3% per wave until wave 15.

The caps are the important part. Without them, a late wave could send more enemies than any tank can handle. Caps are how a formula stays beatable at any wave number.

Bots, automated tests and real players

Paper math tells you the level is plausible. A program can tell you it is possible. Many studios write bots that play a level thousands of times, or tools that search the level's layout for a route from start to goal.

Bots are good at finding things humans skip: a corner where the player gets stuck, a gate that is sealed in one random layout in a hundred. They are bad at telling you whether the level is fun. A bot that wins is proof the level can be won. It is not proof anyone will enjoy it.

This matters most when levels are generated, because you cannot play every random level yourself.

Playtesting with real players

Real players find what nobody else will. They do not know the level, so they walk into the trap the designer avoided without thinking. They also quit in places that surprise you.

Good playtesting is quiet. You watch where people stop, where they die three times in a row, and where they look confused. The fix is often small: move a power-up, slow the first spawn, add a safe corner. A level that feels unfair feels unbeatable, even if it is winnable.

Common reasons a level becomes unbeatable

  • No path to the goal. Walls or hazards cut the start off from where you need to go.
  • Blocked spawns. An enemy enters inside a wall, or the player starts boxed in.
  • Numbers that outgrow the player. Enemy health and speed rise faster than anything the player can gain.
  • Unavoidable damage. Shots fill the screen with no gap and no way to dodge or block.
  • A required item that never appears. The level assumes a power-up the player might not have.

That last one connects to the first Tank City game. The 4th, 11th and 18th tank of each stage carry a power-up and blink, so you can see them coming. Our post on the carrier enemy explains the idea. Because the help is shown, the stage does not depend on a power-up you cannot find.

How Tank City Reboot tests its levels

The code shows one clear way Tank City Reboot guards against an unbeatable level, in Tank City Zero Day. Every wave is a freshly generated arena, 13 by 13 tiles, mirrored left to right and drawn from a seed. That is exactly the case where you cannot play every level by hand.

So the game checks each arena before you see it. The generator keeps clear the three enemy gates on the top row, the player start and the wall around the CPU core. Then it tests fairness: every gate and the player start must be able to reach the tiles beside the core, going around silicon and coolant. Firewall counts as open, because any tank can shoot through it.

Diagram of how Zero Day builds an arena: draw it, test it, redraw up to 40 times, then fall back to a safe arena

If an arena fails the test, it is thrown away and drawn again, up to 40 times. If all 40 fail, the game uses one fixed, safe arena of firewall blocks. The game's own tests also check 300 arenas (30 seeds, waves 1 to 10) and fail if any is unfair.

The rule uses a fact about the terrain. Coolant blocks tanks but not shots. Silicon blocks both, and your shots only break it at Pipelining level 2. Firewall can be shot away at any time. So the check treats silicon and coolant as walls to path around, and a firewall maze still counts as winnable.

The first game takes the opposite route. Its six stages are fixed maps, and each has a set 20 tank lineup. Stage 1 is 18 worms and 2 trojans. Stage 6 is 4 trojans, 6 spyware and 10 rootkits. Because the maps do not change, a person can play them, and the numbers can be tuned by hand. After stage 6 the maps loop and enemy speed rises 8% each loop.

There is also a softer safety net. A new tank of yours arrives with a shield of about 3.9 seconds in the first game and 2.5 seconds in Zero Day, and it cannot be hit while it arrives. A level feels fairer when a death does not chain into the next one.

One honest limit: a path from gate to core shows a level can be reached, not that you will win it. Whether you can kill a 55 hit boss in time is a question for the math and for players.

Frequently asked questions

How do games check that a level has a path to the goal?

Many run a search from the start and each enemy gate to the goal, treating walls as blocked. If any route fails, the level is rejected or redrawn. Tank City Zero Day does this for its generated arenas.

Can a level be beatable but still unfair?

Yes. A route can exist while the damage, speed or enemy count is too high for a normal player. That is why designers also check the numbers and watch real people play.

Why do games cap enemy counts and spawn speeds?

Caps stop a formula from growing past what a player can handle. In Zero Day, no more than 8 threats are on the field at once, and entries never come faster than every 0.6 seconds.

Do randomly generated levels get tested?

They have to be checked by the game itself, since no one can play every one. A common method is to generate a level, test it, and draw a new one if it fails.

Get started

The best way to see this is to play it. Try a few waves of Zero Day and notice how the arena always leaves you a way to the core. Then try the six fixed stages of the first game and see how the lineups climb from worms to rootkits.

Play Tank City Reboot: it is free, plays in your browser on a computer or a phone, and needs no account.

0 likes

Comments

No comments yet.

Sign in or make an account to comment.