BF2.US bf2-rsdeveloper wiki Parity Discord bf2.us
On this page

Game modes: conquest, co-op, Titan and Heroes' modes

BF22142Heroes

A game mode is two things: a set of objects a level places for it (control points, spawn points, vehicles, flags) and a Python script that scores them. The engine underneath is the same in every mode: it keeps tickets, moves control point flags, spawns players and ends the round. This page says what each mode adds, what a ticket means in it, and what the port runs.

What a round is about, by game mode conquest gpm_cq Battlefield 2, 2142 hold control points; the team that holds less bleeds tickets co-op gpm_coop Battlefield 2, 2142 conquest's rules with bots on both sides Titan gpm_ti Battlefield 2142 capture missile silos; they fire at the enemy Titan; its hit points are the tickets team deathmatch gpm_tdm Heroes conquest's script on levels with a base a team: a death costs a ticket capture the flag gpm_ctf Heroes carry the enemy's flag to a drop-off point the hill gpm_hoth Heroes hold the hill's control point; scored on a timer team elimination gpm_cdm Heroes 1.126 heats: a team out of lives loses the heat; tickets are heats left every mode is a Python script over the same engine rules: tickets, control points, spawn groups
The modes of the three games. The colour is the game; a mode is a script over the same engine rules.

What a level holds for a mode#

A level's server.zip has one folder per mode and size: GameModes/<mode>/<players>/GamePlayObjects.con. The script in it creates that layer's objects. The same level can be a 16-player conquest map with four control points and a 64-player one with nine. The server rules page has the engine's part (the round's phases, tickets and their limits, the flag of a control point, spawning); this page is the modes'.

ModeScriptGamesObjects a layer places
conquestgpm_cqBattlefield 2, 2142control points, spawn points, vehicle spawners, the combat area
co-opgpm_coopBattlefield 2, 2142conquest's, with the AI's strategic areas
Titangpm_ti2142two Titans, missile silos with their control points
team deathmatchgpm_tdmHeroescontrol points, one uncapturable base a team
capture the flaggpm_ctfHeroesCtfObject (the flag) and CtfPoint (pickup and drop-off)
the hillgpm_hothHeroesone control point, the hill, with its rocket
team eliminationgpm_cdmHeroes 1.126two hidden control points and team spawns
basic traininggpm_tutHeroesone layer, the tutorial

Heroes' level census as the notes counted it: 20 layers of team deathmatch, 7 of capture the flag, 7 of the hill, one of basic training.

Conquest#

BF2
Battlefield 2 and 2142

Each team starts with tickets from a table by map size. A death costs the team a ticket. Control points decide the bleed: the script counts what each team holds and sets a ticket change per second for the team that holds too little. The round ends when a team's tickets cross a limit, at the time limit, or when too few players are left. A control point changes hands by standing in its radius: the flag goes down for the old owner and up for the new one, at a speed that grows with the number of capturers.

Co-op is conquest with bots on both sides. Choosing it turns the AI on whatever the command line says; the level's co-op layer adds the strategic areas the bots plan with.

Titan#

2142
Battlefield 2142

Each team has a Titan, a flying fortress. The tickets of Titan mode are the Titans' hit points: the script subtracts each damage event from them. Ground play is about missile silos: a silo belongs to the team that holds its control point, and it fires at the enemy Titan on a fixed cycle. When a Titan's hull is at or below 61 percent its shield drops and it can be boarded: inside, four consoles (7,000 hit points each) hold the core's doors and the core (40,000), whose armor passes its damage on to the Titan. A destroyed Titan ends the round 25 seconds later.

Battlefield 2142, Titan mode: from a silo to the round's end a team holds a silo's control point the silo's spawner gives it the team; its controller fires the missile on its reload the missile hits the enemy Titan a damage event; the script subtracts it: the Titan's hit points are the team's tickets the hull is at or below 61 percent the shield gives itself its own hit points as damage and stays as a destroyed object the Titan has no hit points left no damage past zero is taken; the destroyed Titan ends the round 25 seconds later bf2142ded!0x081936b0 (the silo's team), 0x08223430 (the shield), 0x082200d0 (the damage clamp), 0x080e1ca0 (the round's end)
A Titan round in four steps, with the functions that decide each.
RuleOriginal (bf2142ded, the Linux server)Port
what a Titan isobject_isTitan 0x08163ef0 (a remote controlled object of type Titan among the object's children)bf2_world::assets::is_titan_2142
no damage past its hit pointsArmorGLComp::damage 0x082200d0titan::before_vehicle_damage
the shield drops at a damage levelArmorGLComp::handleUpdate 0x08223430titan.rs
the round's endGameLogicDamage::serverGiveDamage 0x080e1ca0, endGame 0x08104950 with a delay of 25 stitan.rs
the Titan's movement by the commander's ordersTitanManager::setTick 0x081d2510titan.rs

The port runs Titan rounds on its own server with 2142's data: both Titans spawn, the tickets follow their hit points, the silos fire, the shield drops, and the destroyed Titan ends the round. The measurements were made against the retail Linux server with a probe in the admin script.

Heroes' modes#

Heroes
Battlefield Heroes

Heroes has no script of its own for team deathmatch: gpm_tdm runs conquest's script. Its levels give each team a base that cannot change hands, and the script only bleeds a team that holds no point at all, so on those levels flags do not bleed tickets: a death costs one ticket and that is the whole score. "I hold every flag and the tickets stand still" is a common question, and the answer is that the original does the same. The number beside the flags on the HUD is a count of flags held, not a multiplier.

By the notes' count 20 team deathmatch layers of version 1.126 have a base for each team, so no round on them ever bleeds; one level's two layers have a single base, and there a team can be left without a point.

Capture the flag is the one mode with objects of its own. A flag (CtfObject) is in one of a few states:

Heroes, capture the flag: the life of a flag (as read) home at its pickup point carried rides with the soldier dropped lies where he died taken a living enemy on foot in the radius, every 0.2 s scored at his team's drop-off point; rests there, then home the carrier dies or rides as a passenger picked up (the port's inference) its time in the world runs out, faster with its own team near: it returns BFHeroes.exe@bfh126!0x0067556b (update), 0x006750b6, 0x0067484c (pickup), 0x00675212, 0x00675145 (carried)
A flag's states and what moves it, as read.
StateRule as read (BFHeroes.exe@bfh126)
homeevery 0.2 s the first living soldier on foot of the team that may take it, within the pickup point's radius, takes it (0x006750b6, pickup 0x0067484c)
carriedthe flag rides with the soldier; within the radius of his team's drop-off point it scores (0x00675212, 0x00675145), but only while his own team's flag is at home unless the template allows otherwise. A carrier who dies, or who sits in a vehicle he does not drive, drops it
droppedit lies there for its time in the world; the time runs down faster the more soldiers of the flag's own team stand near it (one to four times). The original's client shows only the HUD's side of this state: that the flag then returns, and that an attacker who touches it carries it on, is the port's inference
at the drop-off pointafter a capture the flag rests there for a set time, then goes home

The script scores a capture in a way that surprises: the capturing team loses one ticket, and the team that reaches 0 wins. The carrier gets valor points and experience.

The flag's update is 0x0067556b. The port's rules are crates/bfh-game/src/ctf.rs, stepped by the server behind the object update.

The hill (gpm_hoth) places one control point and scores holding it on a Python timer through conquest's script, so 2142's control point code serves it. The hill carries a rocket; the port holds the rocket still as the original does (RemoteControlGLComp::init 0x0082bb23 puts it to sleep), and its launch is not ported.

Team elimination (gpm_cdm, version 1.126) is played in heats. A team's tickets are its heats left; a player has one life a heat. When a team's tickets fall by one the heat halts, the result shows, and the next heat starts after its delay (the heat's update is 0x00509349). The delays, the lives and the time limit of 180 s come from the level's GameLogicSettings.con. The port's rules are bfh_game::cdm.

What is tested#

  • The engine's part (tickets, limits, flags) has tests from the original's addresses: see server rules with its capture bar and ticket pieces.
  • Titan mode: measured against the retail Linux server run by tools/bf2142/titan_round.py.
  • Heroes: capture the flag and team elimination have unit tests in bfh-game; a played scenario holds all flags of a team deathmatch level and checks that the tickets stay; others play a capture (bfh_ctf_capture: a headless hero carries the flag to the drop-off point) and a round of heats (bfh_cdm_round).

In the code#

WhatWhere
the engine's rulescrates/bf2-game (round, tickets, conquest, control_point), crates/bf2-server
Titancrates/bf2-server/src/titan.rs
Heroes' flag and heatscrates/bfh-game/src/ctf.rs, cdm.rs
the scriptsthe game's own Python (gpm_cq.py, gpm_coop.py, gpm_ti.py, gpm_ctf.py, gpm_hoth.py, gpm_cdm.py), run by the port's Python host

Notes: notes/subsystems/game-logic-rules.md, notes/bf2142/titan.md, notes/bfheroes/gamemodes.md.

Source: docs/dev/levels/game-modes.md · built from bf2-rs e3b4f05 · part of the Battlefield 2 / 2142 / Heroes reimplementation. Not affiliated with EA or DICE.