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

Battlefield 2142

2142

Battlefield 2142 runs on the same engine one generation later. bf2-rs runs it from the same crates and binaries: a data root with mods/bf2142 switches the code to Game::Bf2142.

At a glance#

Data rootmods/bf2142
Original binariesBF2142.exe (client, listen and dedicated server), the Linux bf2142ded, RendDX9.dll@2142, AIDLL.dll@2142
Game modesgpm_ti (Titan), gpm_cq, gpm_ca (assault lines), gpm_nv (Northern Strike), gpm_sl, gpm_sp, gpm_coop
Python69 host functions, 18 host.Object methods, 64 events (reference)
How it was porteda function map pairs every 2142 function with its BF2 counterpart; matched functions are checked for differences, unmatched ones are 2142's new code (notes/bf2142/README.md, re/data/bf2142/)

What 2142 adds#

  • Titan mode: flying Titans with shields, guns and a core; the Titan* events (TitanPartDestroyed, TitanCoreDestroyed, GroundCannonDestroyed, MissileDestroyed, ...) and obj.isTitan().
  • Pods: soldiers spawn by drop pod (SpawnPoint spawnInPod, podSpawnVehicle).
  • Unlocks and field upgrades: pers_plrGiveFieldUnlock, pers_plrResetFieldUnlocks, pers_plrSetRank.
  • EMP, vehicle damage / repair / spawn events, PlayerPosition, head shots, squad leader beacons.
  • Weapon heat and gun sway: fire.heatAddWhenFire, coolDownPerSec, overheatPenalty, sway.gunSway*.
  • New template properties are listed in the cross-game table; the ones bf2-rs stores are in crates/bf2-objects/src/template/extra_2142.rs.

How it is tested#

2142's functions are tested in a 2142 process: which game runs is a process-wide setting, so each test program sets it first. Many are twin tests: a Battlefield 2 test's cases run again where the 2142 function was read beside its twin. A twin's test alone is not counted as strict (why a twin is not a proof of its own). 2142's Linux server gives traces for some orders (a tick's order, a walker's radius). Scenarios play Titan rounds. 2142 today and the port's status have the numbers.

In the code#

  • bf2_core::Game::Bf2142 branches in the shared crates, each with both citations.
  • crates/bf2-con/src/table_2142.rs: 2142's console command table (argument changes, 2142-only commands).
  • crates/bf2-server/src/hostfns_2142.rs: the 2142 host functions.
  • Notes: notes/bf2142/ (titan.md, kits.md, weapons.md, network.md, server.md).
  • Every area of the wiki with what 2142 changed in it: 2142 by area.
  • In the wiki: Titan mode among the game modes, 2142's HUD.
Source: docs/dev/games/bf2142.md · built from bf2-rs e3b4f05 · part of the Battlefield 2 / 2142 / Heroes reimplementation. Not affiliated with EA or DICE.