Battlefield Heroes
Battlefield Heroes
Heroes
Battlefield Heroes is a descendant of the 2142 code (its binary still embeds the 2142 source tree
paths). bf2-rs runs it as the 2142 engine generation plus a product axis: Product::Heroes, chosen by a
data root with mods/bfheroes, with the Heroes-only systems in the bfh-* crates.
At a glance#
| Data root | mods/bfheroes (client 1.126 data; 1.89 kept for comparisons) |
| Original binaries | BFHeroes.exe (citations BFHeroes.exe@bfh126!0x... for 1.126, BFHeroes.exe!0x... for 1.89), RendDX9.dll@bfh126, SwiffPlayer.dll@bfh126, SoundEngine.dll |
| Game modes | gpm_cq (conquest), gpm_ctf (capture the flag), gpm_cdm, gpm_hoth, gpm_tut (tutorial) in mods/bfheroes/python/game/gamemodes/ |
| Python | 75 host functions, 24 host.Object methods, 86 events (reference) |
| Online | EA Plasma: FESL (login, personas, store), Theater (game lobby), Magma (web API), reimplemented in crates/bf2-backend |
| Play | the browser player at bf2.us/play/heroes with the account site at bf2.us/heroes |
What Heroes adds#
- Heroes and classes: soldier, gunner, commando per faction (Royal, National), with appearance items and a hero level. The server keeps per-hero data through
pmgr_p_getXData/pmgr_p_setXData. - Abilities: class abilities with cooldowns and levels; the
ActivateAbility,Shield,Stomp,MarkTargetevents,obj.soldier_getParam/soldier_setParam, and the extraattackerActiveAbilityargument ofPlayerKilled. - XP, valor and prestige:
pmgr_p_giveXP,pers_getPrestigePointsNeeded,sgl_sendPrestigeLevelEvent, thePlayerXP,AwardValorPoints,AwardPrestigePoints*events; ELO helperspers_eloGet*for ranked play. - Store and customisation:
custo_listItems, store items as templates, item effects on stats. - No commander and no squads UI; simpler vehicles; cartoon rendering (outlines, toon lighting).
How it is tested#
Heroes cannot be compared with a running original server, so its proofs are of three kinds: a test written from the original's listing in a Heroes process (red before a mend, one mutation caught), an oracle or emulator row where one function or one statement of the original's machine code can be run alone, and a played scenario with a picture read. What each feature has of those, line by line, is on the feature checklists; Heroes today says what a player meets.
In the code#
| What | Where |
|---|---|
| Host tables (functions, object methods, events, with addresses) | crates/bfh-server/src/tables.rs |
| Heroes host functions | crates/bfh-server/src/lib.rs (call_shared, object_call) |
| Data, templates, console additions | crates/bfh-data |
| Game rules (abilities, XP, rounds) | crates/bfh-game, crates/bf2-server hooks |
| Client, UI | crates/bfh-client, crates/bfh-ui |
| Notes | notes/bfheroes/ (README.md charter, abilities.md, python.md, templates.md, gamemodes.md, levels.md) |
| Parity | the parity dashboard |
In depth#
Questions players askHit points, speed, head shots, crossed-out widgets: short answers.The classes' valuesHealth 80 / 110 / 150, run speeds, how a speed factor enters, the default weapons.How damage is worked outDistance, the material table, critical hits, blasts, falling.Abilities and widgetsAn ability's life, levels 1 to 5, where the port stands.Widgets on the item barThe use tests, the vehicle type rule, pocket vehicles, blasts.The HUD, variable by variableWho writes what, and the screens around the game.Tutorial and missionsThe task panel and the mission lines, as read.Game modesTeam deathmatch, capture the flag, the hill, team elimination.Heroes by areaEvery area of the wiki with what Heroes kept and what it changed.
Source:
docs/dev/games/heroes.md · built from bf2-rs e3b4f05 · part of the Battlefield 2 / 2142 / Heroes reimplementation. Not affiliated with EA or DICE.