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

Heroes: the three classes' values

Heroes

The six soldier templates of Battlefield Heroes 1.126 (two teams, three classes) differ between the classes in three values only: the run speed, the acceleration and the hit points. Everything else a class feels like comes from its weapons and its abilities. This page gives the numbers, the function of the original that applies each, and a verdict for each: the same in the port, or filed as differing.

Three values tell the classes apart: hit points, run speed, acceleration hit points (armor.maxHitPoints) run speed, m/s (SoldierRunspeed); pale: under Leg It, the original's reading Commando acceleration 0.3 a tick 80 5.5 6.66 Leg It x 1.1: the original 5.5 x 1.1 x 1.1 = 6.66; the port today 5.5 x 1.1 = 6.05 Soldier acceleration 0.2 a tick 110 4.5 6.48 Leg It x 1.2: the original 4.5 x 1.2 x 1.2 = 6.48; the port today 4.5 x 1.2 = 5.40 Gunner acceleration 0.2 a tick 150 3.8 7.45 Leg It x 1.4: the original 3.8 x 1.4 x 1.4 = 7.45; the port today 3.8 x 1.4 = 5.32 The factor entering twice is a filed difference (the port multiplies once); the patch is written and not landed. BFHeroes.exe@bfh126!0x0071d0d0 (the speed getter), 0x00721ba7 (the movement step)
The classes' hit points and run speeds. The pale bars are the run speed under Leg It as the original's speed getter was read to compute it.
How to read the verdicts

The numbers are the game's own data (the soldier, kit and weapon templates of a 1.126 install). A verdict SAME means one worker read the original's function in the listing and laid it beside the port's statements. DIFFERS means the port computes another number, and the difference is filed. Not settled means the function was not read yet, and the page says what is missing. The sweep behind this page is of 2026-11-27.

The numbers#

ValueCommandoSoldierGunnerTemplate line
hit points80110150armor.maxHitPoints, armor.hitPoints
run speed5.5 m/s4.5 m/s3.8 m/sSoldierRunspeed
acceleration (a tick)0.30.20.2SoldierAcceleration
deceleration0.30.30.3SoldierDeceleration
speed while aiming on foot1.5 m/s1.5 m/s1.5 m/sSoldierWalkSpeed
crouched / lying / swimming2 / 0.8 / 2.1 m/sthe samethe sameSoldierCrouchSpeed, SoldierCrawlSpeed, SoldierSwimSpeed
jumpfactor 1, length 0.98the samethe sameSoldierJumpFactor, SoldierJumpLengthFactor

The two teams differ in the hit boxes' materials only. The default weapons of the two teams have the same numbers in all nine kinds; the knife alone differs by its material, so that a knife does not hurt its own team.

Try it#

Pick a class, a stance and a speed effect. The picker shows the hit points, the speed as the original's getter was read to compute it, and the speed the port computes today.

How each value is applied#

ValueThe original (BFHeroes.exe@bfh126)The portVerdict
the run speedthe speed getter 0x0071d0d0, state 3, chosen by the speed state's update 0x0071f2d8 for a standing hero who does not aim; the movement step 0x00721ba7 multiplies the direction by it and by SoldierSpeedFactorHeroMovement::from_lines, SoldierMove::pose_speed in move_p; the states by update_speed_state (crates/bf2-physics)SAME
aiming, crouched, lying, in water0x0071f2d8 picks the state: zoomed on his feet 2 (walk), crouched 1, lying 0, swimming 5; a crouched hero's speed is also multiplied by the zoom's ratio (0x0071f849)the same states; the crouch factor in soldier_phys.rs aim_viewSAME for the states
acceleration and deceleration0x00721ba7: each tick the throttle and the strafe move toward the input by (input - x) x factor; under 0.001 they are 0move_p: x += (input - x) * kSAME
the speed in the air0x00721ba7: air time (2 at a jump) x 0.5 x SoldierInAirSpeedmove_p, the same productSAME
the jumpthe jump block of 0x007220df: the up speed is 6.0 x the jump factor; the forward speed is kept x 0.98soldier_control, a Heroes armSAME
the sprintthe sprint state's update 0x00817884: a start is refused while the dissipation time is not above FLT_EPSILON, and the data says 0Sprint::update_2142, a Heroes armthe result is the same: no hero can sprint
the speed ramp at a stance change((speed - start) x time) / duration + start((speed - start) / duration) x time + start: Battlefield 2's orderDIFFERS, in the last bit at most; nothing a player can feel
the speed under a speed factorsee belowsee belowDIFFERS, filed
the hit pointsnot read in the sweepthe templates' valuesnot settled by a read; the numbers are the templates'
regenerationthe armor template has no regeneration property; whether the armor's update heals was not readnot readnot settled
the fall damage0x0072ef7f: the up part of the contact speed loses 15; the term is (speed - limit) x speed with the limit 10.5bfh_game::fall_damage::terrain_collisionSAME in the statements read

How a speed effect's factor enters#

A speed effect (Leg It, the Speed Boost, a slow, a field, a weapon's below-health upgrade) is a factor on the soldier's speed. The item's template line gives one factor a class:

EffectTemplate lineCommandoSoldierGunner
Leg It (Increase_Run_Speed)ability.addUserSpeedModItem 1.1 1.2 1.4 -1 10 41.11.21.4
the Speed Boost (HeroSpeed)ability.addUserSpeedModItem 1.2 1.4 1.4 -1 0 51.21.41.4

The getter's factor is the product of three: the status item's, the fire arm's and the player's.

What the original's listing was read to do. The movement step asks the speed getter (0x0071d0d0) for state 7, "the current one". For that state the getter calls itself with the soldier's current state, whose arm has already multiplied the template's speed by the factor, and then multiplies the answer by the factor again (0x0071d1c3, 0x0071d1d0). On land the speed is the template's speed times the factor times the factor. The 1.89 client has the same shape (0x006c094b). Swimming, a factor under 1 counts as 1.

What the port does today. It multiplies once (bf2_physics::soldier::move_p, soldier_control::soldier_speed_p).

ClassRun speedUnder Leg It, the original as readUnder Leg It, the port todayThe port is slower by
Commando5.5 m/s6.66 m/s6.05 m/s9 %
Soldier4.5 m/s6.48 m/s5.40 m/s17 %
Gunner3.8 m/s7.45 m/s5.32 m/s29 %

The same holds for every other factor the getter takes: a slow of 0.8 is 0.64 in the original as read.

This is a filed difference, not a mend

The reading was made twice in the machine code (the class sweep and the ability sweep, 2026-11-27). The patch with its test (heroes_speed_factor_twice_bfh126) is written and is not in the tree: the statement is the server's and the client prediction's both, the played scenarios of the abilities hold the factor once, and a server's statement lands only in front of its replay. Until it lands, a hero under Leg It is slower in the port than in the original by the last column.

The default weapons#

One row a weapon kind a class carries by default. The damage is a random point between a minimum and a maximum that each run in straight lines from the value at 0 m to the value at the medium distance and on to the long distance (0x00705480; ours bfh_game::crit::ProjectileDamage): SAME.

WeaponClassesRounds a minuteMagazine, reloadDamage over the distanceCritical
knifeCommando120none28-35 at every distance8 % for +25
pistolCommando, Soldier4509, 2 s5-9 at 0 m, 13-15 at 12 m, 3-9 from 20 m3 % for +10
sniper rifleCommando1208, 2.5 s5-7 at 0 m, 15-21 at 30 m, 21-24 from 50 m; head x 1.25, body and limbs x 0.76 % for +15
SMGSoldier30030, 2 s5-9 at 0 m, 8-12 at 18 m, 5-9 from 23 m2.5 % for +20
shotgunSoldier, Gunner150, 8 pellets10, 3.5 sa pellet 1.5-5.5 at 0 m, 1-4.5 at 15 m, 0.75-2 from 24 m5 % for +2
machine gunGunner600110, 4 s2-6 at 0 m, 5-13 at 13 m, 2-9 from 20 m3 % for +8
anti tank weaponGunner451, 3.5 sdirect 14-19 at 0 m, 27-33 from 50 m; blast radius 9, damage 7
TNTSoldier, Gunner1, 5 sblast radius 6, damage 80; x 0.2 on a soldier
hand grenadeSoldier1, 6 sblast radius 5, damage 60, falling to 0 at 5 m

Pick a weapon, a target and a distance:

What every weapon runs through:

StepThe originalVerdict
the rate of fireticks between shots = 1800 / rounds a minute in whole numbers (0x007958ae): 300 a minute is 6 ticks, 450 is 4, 600 is 3 (weapons)SAME
a direct hit(angle term x (distance damage + the attacker's item bonus)) x the material table's factor (0x007306dc)SAME in what was read
a blast's fall-offfull inside radius x hotSpotRadiusPercent, then 1 - (distance - inner) / (radius - inner) (0x007281aa; ours bfh_game::explosion::falloff)SAME
a reload's startthe template's reload ticks less the player's ability rate (0x0079b215; ours AmmoComp::do_reload_heroes)SAME
the deviation(minDev x its zoom factor + fire + speed + turn + misc) x stance x zoom (0x0077b2c6); the nine default weapons set only minDevSAME in the tail read
recoil, the zoom's factor, the projectile's flightnot readnot settled

The counts of the sweep#

29 rows: 13 of the classes, 6 of the functions every weapon runs through, 9 of the weapon kinds and one of the shop's variants (as ranges). SAME 14, DIFFERS 2 (the speed factor, the stance ramp's last bit), not settled 3 rows whole and parts of 2. The shop's variants were not laid beside the port one by one.

How it is tested#

  • The values are the templates' own, read from the game's files in tests of bfh-game and bfh-data.
  • Movement (crates/bf2-physics/src/soldier.rs, soldier_control.rs): the speed factor that spares swimming from slows, a hero's forced run and blocked input, and a test program of its own showing that a hero's input never reads the lie key (tests/heroes_lie_input.rs).
  • The speed factor's filed difference on this page has a patch with a test, not landed: until it lands the page's number for the port is what the port does, and the original's is a reading made twice in the machine code.

Four of this page's sixteen addresses stand in a test. The hit points were not read in the sweep; they are the templates'.

In a player's words#

FeatureFor a player
+10 hit points itemAn item a hero can own: while it is among his kit's abilities his hit point limit is 10 above his class's, and he is set to the new limit when he gets it (a Soldier's 110 becomes 120)

The checklists#

Each of these has a checklist in the feature ledger: every step of the original's code behind it and every situation it must work in. None is called done until every line is checked.

FeatureCheckedWhat it doesWhat you see
Speed boosts and slows (what a hero moves at)9 of 95 lines checked2 of 140 of 14

Each of these has a checklist in the feature ledger: every step of the original's code behind it and every situation it must work in. None is called done until every line is checked.

FeatureCheckedWhat it doesWhat you see
+10 hit points item1 of 39 lines checked0 of 140 of 14

In the code#

WhatWhere
the hero's movement valuescrates/bf2-physics/src/soldier.rs (HeroMovement), soldier_control.rs
damage over the distance, critical hitscrates/bfh-game (crit)
blastscrates/bfh-game (explosion)
fall damagecrates/bfh-game (fall_damage)
a weapon's below-health speed factorcrates/bfh-game (customization::weapon_gear::SpeedBelowHealth)

Notes: notes/bfheroes/class_sweep.md, notes/bfheroes/ability_sweep.md. See also how damage is worked out, abilities, widgets, the HUD.

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