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

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

Heroes

Battlefield Heroes is the third generation: built from Battlefield 2142's code, with a newer compiler, a third-person camera and a cartoon look, and with most of 2142's military depth taken out and classes, abilities and widgets put in. The port runs it as the 2142 engine plus a product switch, with the Heroes-only systems in their own crates. This page walks the wiki's areas and says what Heroes kept, what it changed, and where to read on.

The short version#

Battlefield 2Battlefield 2142Heroes
camera on footfirst personfirst personthird person
what a soldier carriesa kit he can dropa kit built from unlocksa class with fixed weapons, abilities and widgets
health100, one model10080 / 110 / 150 by class; shields; damage over time
squads, commanderyesyesnone
control blocks a second202010
floating pointx87, values kept in registersthe samea newer compiler: intermediate results stored as 32-bit floats
game modesconquest, co-op+ Titan and five moreteam deathmatch, capture the flag, the hill, team elimination, basic training
botsyesyesnone in the original; the port adds them
share of its functions that a test of their own namesthe largestin betweenthe smallest: today's numbers are on parity

Heroes is the youngest port and has the most open rows. Its pages are also the most careful about saying so: every row of every sweep carries a verdict.

Area by area#

AreaInherited from 2142Heroes' ownRead
Engine, arithmeticthe object system, templates, the tickthe compiler stores intermediate floats where 2142 keeps them in a register, and sums some products in another order: the same formula gives another last bitfloat precision, the oracle
Networkpackets, ghosts, the control blockten blocks a second; two more gates on the block's writer, off in the shipped settings; what a weapon key coststhe control block, prediction walkthrough
Vehiclessprings, engines, seats, spawnersthe wheel's speed step divides where the others multiply by a reciprocal; pocket vehicles a hero calls from an item; ducking in a tank seatdrivetrain, widgets
The herothe soldier's input and stances, the animation runtimethree classes with their health and speeds; a speed factor that enters the speed twice as readclasses, stances
Weapons, damagefire arms, projectiles, the armor component, explosionsdamage by distance from each weapon's template; critical hits; the blast's cover ray lets thrown things through; shields as the armor's own; the point node's drag by depthHeroes: damage, damage and armor
Abilitiesthe item and fire arm classes an ability is built on18 abilities with five levels each: an item, an effect on the user, a cooldownabilities
Widgetsabout 30 one-key items on the item bar: tonics, rocket jumps, pocket jeeps, cakeswidgets
HUD2142's node tree, variable layer and several of its writers39 HUD script files; the item bar, the level arc, hit points as a number, the personal linesthe Heroes HUD, the HUD of 2142
Game modesconquest's script and control pointsteam deathmatch on conquest's script with bases that cannot be taken; capture the flag with its own objects; the hill; team elimination in heatsgame modes
Scoringthe damage handler and its eventsthe kill event carries the attacker's active ability; assists paid another way; experience, valor and prestigekills and scoring
Botsthe engine's plumbing for an AI library, and 2142's AI scripts in the datathe original ships no AI library: every Heroes bot is the port's addition, marked as onebots
Tutorial, missionsbasic training's task panel; missions with criteria and their lines on the HUDtutorial and missions
Audiothe library's designits own sound library filesound engine
Pythonthe host module and events75 host functions, 24 object methods, 86 events: abilities, experience, customisationthe Python layer

What "as read" means on the Heroes pages#

Battlefield 2 was ported with the original server running beside the port, tick for tick. Heroes has no dedicated server program to run beside: the original is a client whose code is called function by function in the oracle or read in the listing. So the Heroes pages lean on sweeps: passes over every HUD variable, every widget, every ability, every class value, each row read in the original against the port's code and given a verdict. A verdict is one of:

VerdictMeaning
SAMEread on both sides, body against body
DIFFERSa filed difference, with what a player sees
MENDEDchanged in the port, with a test that was red before
PLAYEDseen in a client by a scenario
NOT WIREDported and not called
not settledthe reading is not finished

Reading the notes explains how to read a sweep file, and how a port is made what each word claims.

Where to start, by question#

You want to knowGo to
why a number in the port differs from what you rememberquestions players ask
a class's health and speed, and what Leg It doesclasses
why a shot did the damage it didHeroes: damage
what an ability does at each level, and whether the port has itabilities
why a widget's slot is crossed outwidgets, the HUD
why the tickets stand still while you hold every flaggame modes
who killed me, the scoreboard, the end-of-round cardthe screens around the game
what basic training should showtutorial and missions
why an alt-fire from the workbench does nothingthe workbench
how far a passenger can look, why a tank has no third seat, why planes veeredHeroes' vehicles
everything that is still open, from every pagewhat is still open
how much of Heroes is provenparity

How it is tested#

This page is a guide through the Heroes pages; its statements about what was read rest on the sweeps (sweeps, wall, soak), and a sweep's verdict SAME is a reading, not a test. What is checked is on the feature checklists, per feature and per situation. 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 product switchbf2_core's game and product, chosen from the data root
rules: abilities, flags, heats, explosions, datescrates/bfh-game
the client's Heroes systems: missions, message lines, outlinescrates/bfh-client
host tables and functionscrates/bfh-server
data and templatescrates/bfh-data
menuscrates/bfh-ui

Notes: notes/bfheroes/README.md and the sweep files (hud_sweep.md, screen_sweep.md, widget_sweep.md, ability_sweep.md, class_sweep.md). The game's own page: Battlefield Heroes.

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