First Game With a Cover System? Guinness Says WinBack (1999)
Guinness World Records names Operation: WinBack, a Koei game from 1999, as the first third-person shooter with a cover system, and Kill Switch, a Namco game from 2003, as the first game built around cover. Time Crisis had a dedicated button for taking cover in 1995, so the answer depends on what you count as a cover system.
Who claims what?
| Source | Claim |
|---|---|
| Guinness World Records (WinBack) | First third-person shooter with a cover system that let players hide around corners and shoot when the chance came, dated 23 September 1999 |
| Guinness World Records (Kill Switch) | First game to make cover-based shooting its core mechanic. It says Time Crisis (1995) and The Getaway (2003) "experimented with cover systems" before |
| Kotaku (Brian Ashcraft, 2010) | Credits Time Crisis with a dedicated cover button, its foot pedal, and says Gears of War "did not invent the cover system" |
| Wikipedia, Cover system | Starts the line in 1975, with characters taking cover behind destructible objects, and calls Kill Switch credited with cover as its core mechanic |
| Den of Geek (Ryan Lambie, 2019) | Calls Rolling Thunder, from the end of 1986, "in many ways" the precursor to the modern cover shooter |
The two Guinness records do not contradict each other: one is about the genre, the other about cover being the point of the game. Wikipedia's history section leans on Kotaku for most of its steps, so the two are not independent.
How did cover change over the years?
| When | Game | What changed | Source |
|---|---|---|---|
| 1975 | Gun Fight | Obstacles between the two shooters block shots and can be destroyed. Not yet a move the player makes | Wikipedia |
| 1977 or 1978 | Space Invaders | Bunkers shield the player's cannon and are shot away bit by bit. Kotaku says 1977 and adds that this was not a mechanic as such; Wikipedia gives 1978 | Kotaku, Wikipedia |
| End of 1986 | Rolling Thunder | The player hides behind crates and other obstacles and lurks behind doors to avoid fire | Den of Geek |
| 1995 | Time Crisis | A foot pedal works as a dedicated cover button. Kotaku points out that the path is fixed, as in any rail shooter | Kotaku, Wikipedia |
| 23 Sep 1999 | WinBack | Cover at corners in a third-person shooter. The game does not let the player run and shoot; they stop, pop out from crates and corners, and fire | Guinness, Kotaku |
| 13 Nov 2001 | Metal Gear Solid 2 | The wall press now allows firing from cover, and enemies take cover too and pop out to shoot | Wikipedia |
| 2003 | Kill Switch | Cover becomes the core of the game, and blind fire from behind cover is added | Guinness |
| November 2006 | Gears of War | A shooter focused entirely on cover, which Kotaku says led a wave of cover games. At GDC 2007 the team named Kill Switch as the main inspiration for its cover | Wikipedia, Kotaku, Game Developer |
| February 2009 | Killzone 2 | Cover in a first-person shooter. Its designers at first struggled to carry their third-person cover over into first person | Kotaku |
| October 2010 | Vanquish | Some cover breaks easily, and the score drops the longer the player stays in cover | Wikipedia |
What did the designers say?
Kotaku's 2010 history quotes the people who built the later games. Cliff Bleszinski of Epic compared run-and-gun play to a water gun fight and cover to paintball, where "the entire point is not to get hit". "Games are defined by verbs," he said, and Gears wanted to give players a verb they had not really experienced. Lee Perry, also at Epic, thought Kill Switch's cover was a "breath of fresh air" when he saw it.
We found no statement by the designers of WinBack or Time Crisis on where their cover came from.
What counts as a cover system?
- Something on screen that blocks shots. Gun Fight and Space Invaders fit, but there the player does not take cover; the cover is simply there.
- Hiding as a move in a 2D action game. Rolling Thunder fits.
- A dedicated input for cover on a fixed path. Time Crisis fits.
- Sticking to cover and leaning out to shoot in a third-person shooter. WinBack fits, and this is what the Guinness record describes.
- Cover as the core of the game. Kill Switch fits, per Guinness and Wikipedia.
- Cover that breaks or that the game discourages. Space Invaders had breaking cover early. As a deliberate push to keep moving, Vanquish is the clearest case in the sources we read.
What can we say with confidence?
WinBack, 1999, is the earliest game we can document with a source naming it for a third-person cover system, and Kill Switch, 2003, the earliest named for making cover its core. Time Crisis, 1995, is earlier with a dedicated cover input, and destructible cover on screen goes back to the 1970s. Every source we read agrees that Gears of War spread cover widely and did not invent it.
Build it today
Our cover system blueprint holds the rules this timeline added one at a time. Cover shields one side only, so a hit from the other side ignores it. It has health of its own, like the bunkers that were shot away in the 1970s, and passes on only what it cannot take when it breaks. Stepping in and peeking out to shoot both leave the character open for a moment, the price of stopping to shoot that Kotaku describes for WinBack. A hit and a peek in the same moment are judged by where the character stood when the moment began. Blind fire, Kill Switch's addition, is not in it: shooting without peeking would be a rule to ask your AI for on top.
- 16 tests pass on the reference code.
- The state diagram was checked against the code, at the default values and at every listed low and high value.
- Checked with TLA+, Z3 and Lean, with what the tools printed
Add "Cover System" to my game.
What it should do: Cover turns a fight into a choice between safety and shooting: the player hides to survive, then pays with exposure each time they peek to hit back.
Build it exactly as this state machine. First check that it fits my game, then build it like this:
```mermaid
stateDiagram-v2
[*] --> open
open: In the open
entering: Stepping in
covered: Behind cover
peeking: Peeking
open --> entering: cover button held
entering --> covered: step is done
entering --> open: button let go
covered --> peeking: peek pressed
covered --> open: leaves or cover breaks
peeking --> covered: peek is over
peeking --> open: leaves cover
```
Use these starting values:
- maxHealth: 100
- coverHealth: 60
- enterTime: 0.3 s
- peekTime: 0.45 s
Watch out for these common mistakes:
- Hits from the other side: Tell your AI: cover has a side. Only a hit from that side goes into the cover, and a hit from the other side hurts the character in full.
- Damage bigger than the cover: Tell your AI: the cover takes what it has left, and only the rest goes through to the character.
- A hit and a peek in the same moment: Tell your AI: decide from where the character stood when the tick began. The hit goes into the cover, and the peek starts afterwards.
- Peeking for no cost: Tell your AI: a peek lasts a set minimum time, even if the button is let go at once.
- Cover that was destroyed while in use: Tell your AI: when the cover's health reaches zero, put the character back in the open that same tick and refuse to step into that cover again.
Do not change anything else in the game. Do not claim anything without proof: model what it takes, and show me what your solution rests on and how I can see that it works. If you cannot show something, say you do not know. When you are done, tell me in plain words how to try it.
The code, from https://spielerando.com/en/mechanics/cover-system (TypeScript, tested):
```ts
/* Cover: an object the character can stand behind to stop hits from one side. Cover has a side it
shields and health of its own. A hit from that side, while the character is fully behind it, goes
into the cover first; only what the cover cannot take goes through. Stepping in takes time and
peeking to shoot is open, so cover has a price at both ends. A hit from the other side
ignores cover completely.
What a tick does is decided from the state it began in: a hit and a peek in the same tick
are judged as the character stood when the tick began. Time is in seconds.
`phase` names where the character is, for the model in mechanic.json. */
export interface Params {
/** The character's full health. */
maxHealth: number;
/** What a new piece of cover can take before it breaks. */
coverHealth: number;
/** Time to step in behind cover, s. Not protected yet. */
enterTime: number;
/** The least time a peek lasts once it has begun, s. Letting go early does not shorten it. */
peekTime: number;
}
export const DEFAULT_PARAMS: Params = { maxHealth: 100, coverHealth: 60, enterTime: 0.3, peekTime: 0.45 };
/** Summing dt leaves rounding error: a timer counts as run out below this. */
export const TIMER_EPSILON = 1e-9;
export type Phase = "open" | "entering" | "covered" | "peeking";
export interface State {
phase: Phase;
health: number;
/** What the cover can still take. At zero it is gone. */
coverHealth: number;
/** The side of the attackers this cover shields: -1 left, 1 right. */
coverSide: 1 | -1;
/** Time left in stepping in or in the shortest peek, s. */
timer: number;
/** The character fired during the last tick. */
fired: boolean;
}
export interface Hit {
/** The side the attack comes from: -1 left, 1 right. */
side: 1 | -1;
damage: number;
}
export interface Input {
/** The cover button is held. */
takeCover: boolean;
/** The peek button is held. */
peek: boolean;
/** The fire button went down during this tick. */
fire: boolean;
/** The cover within reach: 0 none, otherwise the side it shields. */
cover: -1 | 0 | 1;
/** An attack reaches the character during this tick. */
hit: Hit | null;
}
export function initialState(params: Params = DEFAULT_PARAMS): State {
return { phase: "open", health: params.maxHealth, coverHealth: params.coverHealth, coverSide: 1, timer: 0, fired: false };
}
export function phase(state: State): Phase {
return state.phase;
}
/** Whether a hit would go into the cover. Only fully behind it, and only from the side it shields. */
export function isShielded(state: State, hit: Hit | null): boolean {
return state.phase === "covered" && state.coverHealth > 0 && hit !== null && hit.side === state.coverSide;
}
export function step(state: State, input: Input, params: Params, dt: number): State {
let health = state.health;
let coverHealth = state.coverHealth;
const damage = input.hit !== null && input.hit.damage > 0 ? input.hit.damage : 0;
if (damage > 0) {
if (isShielded(state, input.hit)) {
const taken = Math.min(damage, coverHealth);
coverHealth -= taken;
health = Math.max(0, health - (damage - taken));
} else {
health = Math.max(0, health - damage);
}
}
const fired = input.fire && (state.phase === "open" || state.phase === "peeking");
const base = { health, coverHealth, fired };
const wants = input.takeCover && input.cover !== 0 && coverHealth > 0;
switch (state.phase) {
case "open":
if (wants && input.cover !== 0) return { ...state, ...base, phase: "entering", coverSide: input.cover, timer: params.enterTime };
return { ...state, ...base };
case "entering": {
if (!wants || input.cover !== state.coverSide) return { ...state, ...base, phase: "open", timer: 0 };
const timer = Math.max(0, state.timer - dt);
return timer <= TIMER_EPSILON ? { ...state, ...base, phase: "covered", timer: 0 } : { ...state, ...base, timer };
}
case "covered":
if (!wants || input.cover !== state.coverSide) return { ...state, ...base, phase: "open" };
if (input.peek) return { ...state, ...base, phase: "peeking", timer: params.peekTime };
return { ...state, ...base };
case "peeking": {
if (!wants || input.cover !== state.coverSide) return { ...state, ...base, phase: "open", timer: 0 };
const timer = Math.max(0, state.timer - dt);
if (!input.peek && timer <= TIMER_EPSILON) return { ...state, ...base, phase: "covered", timer: 0 };
return { ...state, ...base, timer };
}
}
}
```
Add "Cover System" to my game.
What it should do: Cover turns a fight into a choice between safety and shooting: the player hides to survive, then pays with exposure each time they peek to hit back.
Build it exactly as this state machine. First check that it fits my game, then build it like this:
```mermaid
stateDiagram-v2
[*] --> open
open: In the open
entering: Stepping in
covered: Behind cover
peeking: Peeking
open --> entering: cover button held
entering --> covered: step is done
entering --> open: button let go
covered --> peeking: peek pressed
covered --> open: leaves or cover breaks
peeking --> covered: peek is over
peeking --> open: leaves cover
```
Use these starting values:
- maxHealth: 100
- coverHealth: 60
- enterTime: 0.3 s
- peekTime: 0.45 s
Watch out for these common mistakes:
- Hits from the other side: Tell your AI: cover has a side. Only a hit from that side goes into the cover, and a hit from the other side hurts the character in full.
- Damage bigger than the cover: Tell your AI: the cover takes what it has left, and only the rest goes through to the character.
- A hit and a peek in the same moment: Tell your AI: decide from where the character stood when the tick began. The hit goes into the cover, and the peek starts afterwards.
- Peeking for no cost: Tell your AI: a peek lasts a set minimum time, even if the button is let go at once.
- Cover that was destroyed while in use: Tell your AI: when the cover's health reaches zero, put the character back in the open that same tick and refuse to step into that cover again.
Do not change anything else in the game. Do not claim anything without proof: model what it takes, and show me what your solution rests on and how I can see that it works. If you cannot show something, say you do not know. When you are done, tell me in plain words how to try it.The tested code (TypeScript)
/* Cover: an object the character can stand behind to stop hits from one side. Cover has a side it
shields and health of its own. A hit from that side, while the character is fully behind it, goes
into the cover first; only what the cover cannot take goes through. Stepping in takes time and
peeking to shoot is open, so cover has a price at both ends. A hit from the other side
ignores cover completely.
What a tick does is decided from the state it began in: a hit and a peek in the same tick
are judged as the character stood when the tick began. Time is in seconds.
`phase` names where the character is, for the model in mechanic.json. */
export interface Params {
/** The character's full health. */
maxHealth: number;
/** What a new piece of cover can take before it breaks. */
coverHealth: number;
/** Time to step in behind cover, s. Not protected yet. */
enterTime: number;
/** The least time a peek lasts once it has begun, s. Letting go early does not shorten it. */
peekTime: number;
}
export const DEFAULT_PARAMS: Params = { maxHealth: 100, coverHealth: 60, enterTime: 0.3, peekTime: 0.45 };
/** Summing dt leaves rounding error: a timer counts as run out below this. */
export const TIMER_EPSILON = 1e-9;
export type Phase = "open" | "entering" | "covered" | "peeking";
export interface State {
phase: Phase;
health: number;
/** What the cover can still take. At zero it is gone. */
coverHealth: number;
/** The side of the attackers this cover shields: -1 left, 1 right. */
coverSide: 1 | -1;
/** Time left in stepping in or in the shortest peek, s. */
timer: number;
/** The character fired during the last tick. */
fired: boolean;
}
export interface Hit {
/** The side the attack comes from: -1 left, 1 right. */
side: 1 | -1;
damage: number;
}
export interface Input {
/** The cover button is held. */
takeCover: boolean;
/** The peek button is held. */
peek: boolean;
/** The fire button went down during this tick. */
fire: boolean;
/** The cover within reach: 0 none, otherwise the side it shields. */
cover: -1 | 0 | 1;
/** An attack reaches the character during this tick. */
hit: Hit | null;
}
export function initialState(params: Params = DEFAULT_PARAMS): State {
return { phase: "open", health: params.maxHealth, coverHealth: params.coverHealth, coverSide: 1, timer: 0, fired: false };
}
export function phase(state: State): Phase {
return state.phase;
}
/** Whether a hit would go into the cover. Only fully behind it, and only from the side it shields. */
export function isShielded(state: State, hit: Hit | null): boolean {
return state.phase === "covered" && state.coverHealth > 0 && hit !== null && hit.side === state.coverSide;
}
export function step(state: State, input: Input, params: Params, dt: number): State {
let health = state.health;
let coverHealth = state.coverHealth;
const damage = input.hit !== null && input.hit.damage > 0 ? input.hit.damage : 0;
if (damage > 0) {
if (isShielded(state, input.hit)) {
const taken = Math.min(damage, coverHealth);
coverHealth -= taken;
health = Math.max(0, health - (damage - taken));
} else {
health = Math.max(0, health - damage);
}
}
const fired = input.fire && (state.phase === "open" || state.phase === "peeking");
const base = { health, coverHealth, fired };
const wants = input.takeCover && input.cover !== 0 && coverHealth > 0;
switch (state.phase) {
case "open":
if (wants && input.cover !== 0) return { ...state, ...base, phase: "entering", coverSide: input.cover, timer: params.enterTime };
return { ...state, ...base };
case "entering": {
if (!wants || input.cover !== state.coverSide) return { ...state, ...base, phase: "open", timer: 0 };
const timer = Math.max(0, state.timer - dt);
return timer <= TIMER_EPSILON ? { ...state, ...base, phase: "covered", timer: 0 } : { ...state, ...base, timer };
}
case "covered":
if (!wants || input.cover !== state.coverSide) return { ...state, ...base, phase: "open" };
if (input.peek) return { ...state, ...base, phase: "peeking", timer: params.peekTime };
return { ...state, ...base };
case "peeking": {
if (!wants || input.cover !== state.coverSide) return { ...state, ...base, phase: "open", timer: 0 };
const timer = Math.max(0, state.timer - dt);
if (!input.peek && timer <= TIMER_EPSILON) return { ...state, ...base, phase: "covered", timer: 0 };
return { ...state, ...base, timer };
}
}
}
The tests the reference code passes
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import test from "node:test";
import { chance, forAll, pick, real, seeded } from "../../../proofs/property.ts";
import { DEFAULT_PARAMS, type Hit, type Input, type Params, type Phase, type State, initialState, isShielded, phase, step } from "./reference.ts";
const DT = 1 / 60;
const P = DEFAULT_PARAMS;
const idle: Input = { takeCover: false, peek: false, fire: false, cover: 1, hit: null };
const hold: Input = { ...idle, takeCover: true };
const peekIn: Input = { ...hold, peek: true };
const hitFrom = (side: 1 | -1, damage: number): Hit => ({ side, damage });
function at(over: Partial<State> = {}): State {
return { phase: "covered", health: 100, coverHealth: 60, coverSide: 1, timer: 0, fired: false, ...over };
}
/** Ticks of holding the cover button until the character stands behind it. */
function intoCover(s: State = initialState(), params: Params = P): State {
for (let i = 0; i < 600 && s.phase !== "covered"; i++) s = step(s, hold, params, DT);
return s;
}
test("a-hit-from-the-shielded-side-goes-into-the-cover", () => {
const s = step(at(), { ...hold, hit: hitFrom(1, 20) }, P, DT);
assert.equal(s.health, 100);
assert.equal(s.coverHealth, 40);
});
test("a-hit-from-the-other-side-ignores-the-cover", () => {
const s = step(at(), { ...hold, hit: hitFrom(-1, 20) }, P, DT);
assert.equal(s.health, 80);
assert.equal(s.coverHealth, 60);
});
test("stepping-in-takes-time-and-is-not-protected", () => {
let s = step(initialState(), hold, P, DT);
assert.equal(s.phase, "entering");
s = step(s, { ...hold, hit: hitFrom(1, 25) }, P, DT);
assert.equal(s.health, 75);
assert.equal(s.coverHealth, 60);
assert.equal(intoCover().phase, "covered");
let ticks = 0;
let t = initialState();
while (t.phase !== "covered") {
t = step(t, hold, P, DT);
ticks++;
}
assert.ok(Math.abs(ticks * DT - P.enterTime) < 2 * DT, `${ticks} ticks`);
});
test("peeking-is-not-protected", () => {
let s = step(at(), peekIn, P, DT);
assert.equal(s.phase, "peeking");
s = step(s, { ...peekIn, hit: hitFrom(1, 30) }, P, DT);
assert.equal(s.health, 70);
assert.equal(s.coverHealth, 60);
});
test("a-break-passes-on-what-the-cover-could-not-take", () => {
const s = step(at({ coverHealth: 10 }), { ...hold, hit: hitFrom(1, 25) }, P, DT);
assert.equal(s.coverHealth, 0);
assert.equal(s.health, 85);
assert.equal(s.phase, "open");
});
test("broken-cover-cannot-be-used-again", () => {
let s = step(at({ coverHealth: 10 }), { ...hold, hit: hitFrom(1, 25) }, P, DT);
for (let i = 0; i < 120; i++) s = step(s, hold, P, DT);
assert.equal(s.phase, "open");
assert.equal(isShielded(at({ coverHealth: 0 }), hitFrom(1, 5)), false);
});
test("shooting-needs-a-peek", () => {
assert.equal(step(at(), { ...hold, fire: true }, P, DT).fired, false);
assert.equal(step(at({ phase: "peeking", timer: 0.2 }), { ...peekIn, fire: true }, P, DT).fired, true);
assert.equal(step(initialState(), { ...idle, fire: true }, P, DT).fired, true);
});
test("a-peek-lasts-its-shortest-time", () => {
let s = step(at(), peekIn, P, DT);
let ticks = 1;
while (s.phase === "peeking") {
s = step(s, hold, P, DT);
ticks++;
}
assert.equal(s.phase, "covered");
assert.ok(Math.abs(ticks * DT - P.peekTime) < 2 * DT, `${ticks} ticks`);
});
test("a-hit-and-a-peek-in-one-tick-are-judged-from-behind-cover", () => {
const s = step(at(), { ...peekIn, hit: hitFrom(1, 20) }, P, DT);
assert.equal(s.coverHealth, 40);
assert.equal(s.health, 100);
assert.equal(s.phase, "peeking");
});
test("letting-go-of-the-cover-button-leaves-cover", () => {
assert.equal(step(at(), idle, P, DT).phase, "open");
assert.equal(step(at(), { ...hold, cover: -1 }, P, DT).phase, "open");
assert.equal(step(at({ phase: "entering", timer: 0.2 }), idle, P, DT).phase, "open");
});
test("health-stops-at-zero", () => {
const s = step(initialState(), { ...idle, hit: hitFrom(1, 500) }, P, DT);
assert.equal(s.health, 0);
});
test("zero-or-negative-damage-changes-nothing", () => {
const s = step(at(), { ...hold, hit: hitFrom(1, -30) }, P, DT);
assert.equal(s.health, 100);
assert.equal(s.coverHealth, 60);
});
function anyHit(r: () => number, max: number): Hit | null {
return chance(r, 0.15) ? hitFrom(pick(r, [1, -1] as const), real(r, -5, max)) : null;
}
function anyInput(r: () => number, held: { takeCover: boolean; peek: boolean; cover: -1 | 0 | 1 }, max: number): Input {
if (chance(r, 0.05)) held.takeCover = !held.takeCover;
if (chance(r, 0.1)) held.peek = !held.peek;
if (chance(r, 0.03)) held.cover = pick(r, [0, 1, 1, 1, -1] as const);
return { ...held, fire: chance(r, 0.1), hit: anyHit(r, max) };
}
test("property: health and cover stay in range and cover never mends", (t) => {
forAll(t, 201, 400, (r) => {
const params = { ...P, maxHealth: real(r, 20, 500), coverHealth: real(r, 10, 300) };
let s = initialState(params);
const held = { takeCover: true, peek: false, fire: false, cover: 1 as -1 | 0 | 1 };
for (let i = 0; i < 400; i++) {
const before = s;
s = step(s, anyInput(r, held, 200), params, real(r, 1 / 240, 1 / 15));
assert.ok(s.health >= 0 && s.health <= params.maxHealth);
assert.ok(s.coverHealth >= 0 && s.coverHealth <= before.coverHealth);
}
});
});
test("property: a shielded hit is shared between cover and character, nothing lost or added", (t) => {
forAll(t, 202, 400, (r) => {
const params = { ...P, maxHealth: 1e6, coverHealth: real(r, 10, 300) };
const held = { takeCover: true, peek: false, fire: false, cover: 1 as -1 | 0 | 1 };
let s = intoCover(initialState(params), params);
for (let i = 0; i < 100 && s.phase === "covered"; i++) {
const hit = chance(r, 0.5) ? hitFrom(pick(r, [1, -1] as const), real(r, 1, 100)) : null;
const before = s;
s = step(s, { ...held, hit }, params, DT);
if (hit === null) continue;
const lost = before.health - s.health + (before.coverHealth - s.coverHealth);
assert.ok(Math.abs(lost - hit.damage) < 1e-9, `${lost} of ${hit.damage}`);
if (hit.side !== before.coverSide) assert.equal(s.coverHealth, before.coverHealth);
}
});
});
test("property: outside full cover a hit never touches the cover and the character takes all of it", (t) => {
forAll(t, 203, 400, (r) => {
const held = { takeCover: true, peek: false, fire: false, cover: 1 as -1 | 0 | 1 };
let s = initialState(P);
for (let i = 0; i < 300; i++) {
const input = anyInput(r, held, 40);
const before = s;
s = step(s, input, P, DT);
if (before.phase !== "covered" && input.hit && input.hit.damage > 0) {
assert.equal(s.coverHealth, before.coverHealth);
assert.equal(s.health, Math.max(0, before.health - input.hit.damage));
}
}
});
});
/* The model in mechanic.json against the code, both ways. */
const mechanic = JSON.parse(readFileSync(new URL("./mechanic.json", import.meta.url), "utf8"));
const model = mechanic.model as { states: { id: string }[]; moves: { from: string; to: string }[] };
const listed = new Set(model.moves.map((m) => `${m.from}>${m.to}`));
function drive(params: Params, seed: number, ticks: number, moves: Set<string>, visited: Set<string>): void {
const r = seeded(seed);
const held = { takeCover: true, peek: false, fire: false, cover: 1 as -1 | 0 | 1 };
let s = initialState(params);
visited.add(phase(s));
for (let i = 0; i < ticks; i++) {
if (i % 200 === 199) s = initialState(params);
const before: Phase = phase(s);
s = step(s, anyInput(r, held, params.coverHealth * 0.6), params, DT);
const after = phase(s);
visited.add(after);
if (after !== before) moves.add(`${before}>${after}`);
}
}
test("model-matches-code", () => {
const specs = mechanic.spec.parameters as { name: keyof Params; min: number; max: number }[];
const variants: Params[] = [P];
for (const p of specs) for (const v of [p.min, p.max]) variants.push({ ...P, [p.name]: v });
const moves = new Set<string>();
const visited = new Set<string>();
variants.forEach((params, n) => {
const here = new Set<string>();
for (let seed = 1; seed <= 20; seed++) drive(params, n * 100 + seed, 4000, here, visited);
for (const move of here) assert.ok(listed.has(move), `the code does ${move}, which the model does not list (variant ${n})`);
for (const move of here) moves.add(move);
if (n === 0) for (const move of listed) assert.ok(here.has(move), `at the default values the model's ${move} never happens`);
});
for (const move of listed) assert.ok(moves.has(move), `the model's ${move} never happens`);
for (const state of model.states) assert.ok(visited.has(state.id), `state ${state.id} is never reached`);
for (const id of visited) assert.ok(model.states.some((s) => s.id === id), `the code reaches ${id}, which the model does not list`);
});
Was this page helpful?
Next step
Sources
- Guinness World Records, First third-person shooter videogame with a cover system
- Guinness World Records, First cover-based shooter
- Brian Ashcraft, How Cover Shaped Gaming's Last Decade, Kotaku, 20 January 2010
- Wikipedia, Cover system
- Ryan Lambie, Rolling Thunder: Namco's Hidden Arcade Gem, Den of Geek, 15 March 2019
- Wikipedia, Metal Gear Solid 2: Sons of Liberty
- Jason Dobson, Post-GDC: Cliff Bleszinski Says Iteration Won Gears of War, Game Developer, 12 March 2007
- Wikipedia, Vanquish (video game)