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

Battlefield 2142, area by area: what differs from Battlefield 2

2142

Battlefield 2142 is Battlefield 2's engine one generation later, built from the same source tree: its Linux server still calls its main object BF2Engine and its Python package bf2. The port treats it that way: one code base, and a branch wherever 2142's own function does something else. This page walks the wiki's areas and says for each what is the same, what is 2142's, and where to read on.

How much is shared#

The survey measured it before any porting, without running a 2142 program:

MeasureValue
function names of 2142's Linux server that Battlefield 2's server also has23,799 of 26,794 (88.8 %)
console command names of BF2142.exe that BF2.exe also has1,800 of 2,300; 500 are new
script commands in the data: only 2142 / shared / only Battlefield 2413 / 1,427 / 227
client functions paired with a Battlefield 2 function by the function map27,645 of 40,702: 20,236 identical, 7,409 changed
levels20; all 51 combinations of level and game mode load on the port's server
Python: host functions, object methods, events69, 18, 64 (52 host functions shared)

"Changed" mostly means small: a field at another offset, a constant, one new branch. That is why a twin's test counts only generously in the parity count: the map cannot see a small difference, and small differences are what 2142 is made of. The count today: 7,193 of 13,319 functions strictly tested.

Area by area#

AreaThe same as Battlefield 22142's ownRead
Engine, objectsthe object system, templates, the console, the tick413 script commands of its own; the port stores those it does not yet act on and runs them as recorded no-opsobjects, what the games share
Physicsnodes, responses, collision, the vehicle partsthe point node's drag in another operand order; a "new soldier response" variable; walkersphysics, projectiles
Networkthe transport, the protocol version, the connect request, ghosts and the control blockits own build number; about 17 new game events and 11 gone; its own connection type table, read by the same codepackets, ghosts, prediction
Vehiclessprings, engines, seats, cameras, spawnerswalkers (legs as a new template type), hover craft where Battlefield 2 has wing aircraft (the data has no wing or rotor engines), drop pods, EMP; a Titan never blocks a spawnerboats and aircraft, seats and cameras, spawners
Soldierinput, stances, sprint, ladders, the animation runtimethe turn rate clamped; prone-delay-after-jump 0.2 s where Battlefield 2 has 1.0; a soldier going prone is lifted 0.3 m first; a breath effectstances, prediction walkthrough
Weaponsthe fire arm's components, deviation, projectiles, damage and armorweapon heat and gun sway in more places; unlocks and field upgrades; gadgets as new components; a Titan's damage is clamped to its hit pointsfire arms, damage and armor
Audiothe same library design, codecs and templatesits own library build; other volume defaults (music and help voice 0.5); voice-over files in another foldersound engine, voices and space
HUDthe node tree, the builder's commands, the variable layerits own writers for the weapon panel, crosshair, capture interface, vehicle armor; the Titans' rowthe HUD of 2142
MenusFlash menus on the same playerthe menu files are stored scrambled and unscrambled at load; 23 native objects with 687 methods; one localization table for all languagesthe Flash layer
Server, rulesstart-up, tickets, control points, scoring's eventsTitan mode; seven game modes; persistence calls for ranks and unlocksgame modes, start-up, kills and scoring
Botsthe AI library's designits own rule for which team a new bot joins; walker entries; the Titan's turrets have a bot templatebots
Levels, assetsevery binary asset format has Battlefield 2's header and versionsbooster pack archiveswhat goes into a level, terrain
Pythonthe same embedded Python and bf2 package shape17 more host functions; the Titan* events; isTitan, getMaxDamagethe Python layer

The three things 2142 is known for#

Titans#

A Titan is a remote controlled object of its own type with a shield, guns, four consoles and a core. Its hit points are its team's tickets; missile silos on the ground fire at it for whoever holds their control point; at or below 61 percent of the hull the shield drops. The whole chain, with the functions of 2142's Linux server and what the port runs, is on game modes. The HUD's row of silos and Titan parts is on the HUD of 2142.

Pods#

A soldier can spawn in a drop pod: the spawn point's template says so (spawnInPod, podSpawnVehicle). The notes list bots not using drop pods among the differences of a co-op round against the original.

Unlocks and field upgrades#

Unlocks and field upgrades reach the engine through Python's persistence functions (pers_plrGiveFieldUnlock, pers_plrResetFieldUnlocks, pers_plrSetRank). The port has the host functions the game modes need; eleven that only store a player's progress are stubs, marked as such.

Where the port stands#

The notes' area table, in its own words:

AreaStatus
data, archives, formatssurveyed: all the same as Battlefield 2's
renderer, shaderspartial: levels draw with 2142's own shaders; post production runs
menus, HUDstarted; the HUD's missing functions are listed in notes/bf2142/hud-missing.md
soundstarted: 2,024 of 2,028 files of the test level load
physics, soldier, vehiclesstarted: walkers load as templates; their legs' physics is open
Titan modepartial: a Titan round runs to its end against the original's numbers
botspartial: co-op rounds are played; fewer kills and less vehicle use than the original's bots
Python game modespartial: all seven modes run; 11 host functions are stubs

"Partial" and "started" are meant. Battlefield 2142 can be joined and played on the port; it is the second-most complete of the three games, and its pages say where each piece stands.

How it is tested#

The table "Where the port stands" is a hand-written summary; each of its rows rests on the area's own page and that page's tests. What is counted, function by function, is on parity; 2142's test programs run in a 2142 process, and a test of a Battlefield 2 twin alone does not count as strict. The wiki's test checks that every link and anchor on it leads to a page of the build and that its diagrams are the ones the script draws.

In the code#

WhatWhere
the game switchbf2_core::Game::Bf2142, chosen from the data root
2142's console command tablecrates/bf2-con/src/table_2142.rs
2142's host functionscrates/bf2-server/src/hostfns_2142.rs
Titan modecrates/bf2-server/src/titan.rs
template properties only 2142 hascrates/bf2-objects/src/template/extra_2142.rs
the function map and its tablesre/data/bf2142/

Notes: notes/bf2142/README.md, notes/bf2142/survey.md, notes/bf2142/STATUS.md, notes/bf2142/funcmap.md, notes/bf2142/titan.md. The game's own page: Battlefield 2142.

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