On this page
Reading the notes
This wiki is the readable front of a much larger body of text: the notes. Every page here ends with a line that names the notes it was written from. The notes are where a claim meets its evidence, and where you look when a page is not enough. They were written by many hands in a hurry and have a vocabulary of their own; this page is the key to it.
Where things are#
| Folder | What is in it |
|---|---|
notes/ (top) | the index (README.md), the conventions, the workflow, what is known about the original binaries and their source tree |
notes/subsystems/ | one file a part of the engine: the object model, physics, the renderer, the network, the AI, the HUD, sound .. |
notes/formats/ | one file a file format: meshes, collision meshes, animation, terrain, textures, fonts, demos, navigation data |
notes/tracks/ | goals that cut across parts: playability, multiplayer, physics a player meets, menus, the HUD, performance, input, validation |
notes/bf2142/, notes/bfheroes/ | what differs in the other two games, and their own systems (the Titan, abilities, widgets) |
notes/editor/, notes/tools/ | the port's own tools |
re/data/, re/symbols/ | tables read out of the binaries, and the curated names of their functions |
Start at notes/README.md: it is a table of every file with one line on its topic. The tree as a whole is described in docs/release/LAYOUT.md, and how to build it in docs/release/BUILDING.md.
How a claim cites its evidence#
The first rule of the notes: a claim about the original cites what it rests on. Three kinds of evidence count:
- an address:
BF2.exe!0x0083d498is the function at that address of that program; - a string of the binary (a console command's name, an error message, a source file path left in by the compiler);
- a test against the game's data or the original's code (an oracle case, a parser that reads every shipped file of a kind).
The forms of an address#
| Form | Program |
|---|---|
BF2.exe!0x........ | Battlefield 2's client, version 1.50 |
bf2_w32ded.exe!0x........ | Battlefield 2's dedicated server for Windows: the same engine with fewer client parts, often the easier one to read |
RendDX9.dll!.., AIDLL.dll!.., BF2Audio.dll!.. | the renderer, the bots, the sound: libraries beside the game |
BF2142.exe!.., bf2142ded!.. | Battlefield 2142's client, and its Linux server |
BFHeroes.exe@bfh126!.. | Heroes' client of version 1.126 (the tag behind @ names the version); an address of an older version is named in words, as in "1.89's 0x00974b0c" |
A bare address in a note belongs to the program the file's head names. The Linux servers matter for a reason: they shipped with their symbols, so their function names are the developers' own. Names in the notes that look like real C++ (GhostManager::setControlObject) usually come from there, carried over to the Windows programs by matching the functions.
Offsets look like +0x2b0: a field at that offset of an object. vt+0x1d4 is an entry of a virtual table: "the object is asked a question through its table at that slot", used when the function behind it was not named.
The status words#
Notes say how sure they are, and the wiki keeps their words:
| In a note | Means |
|---|---|
| verified | compared with the original by a check that runs: an oracle case, a differential, every shipped file |
| read / as read / a reading | somebody read the listing and wrote down what it does; no check holds it yet |
| surveyed | the functions are found and named with their addresses; the bodies were not read through |
| (unverified) | an inference: a guess from names and context, marked so on purpose |
| open | known to be missing or not understood |
| traced | followed through the original's code, not implemented |
| filed difference | the port does something else than the original, and a row says what |
When this wiki says "as the sweep read it" or "a reading", it is passing on the second row and not the first.
Sweeps and their rows#
A sweep is a pass over every thing of one kind: every HUD variable, every widget, every screen, every ability. A sweep file (notes/bfheroes/hud_sweep.md, widget_sweep.md, screen_sweep.md, ability_sweep.md) is mostly one big table. A row has:
- the thing (a variable's name, a widget);
- where the original writes or runs it (an address, and whether the function was read whole);
- what the original does;
- what the port does, with the Rust function;
- the verdict: SAME, DIFFERS, MENDED, NOT WIRED, NOT SETTLED;
- what a player sees of a difference.
Behind the table come sections by round ("Round 27", "Round 28") that say what changed: which rows were mended, which were played in a client, what was left. A row's state today is its last mention, so read the table and the last round's section. The counts at a round's end ("83 rows: 64 SAME, 8 MENDED ..") are the quick answer to "how far is this".
Task numbers and other marks#
H1234is a task of the project's queue;R-0096a request from a player or the owner. They tie a paragraph to the change that made it.chain link 785is the 785th merge of the landing chain: the notes' way of saying "as of this state of the tree".bots12,render21,h19 round 27name the worker and round that wrote a section. They are history; the content is what counts.- A crossed-out or "corrects render8" remark means an older section was wrong. The newer one wins; the notes keep both so the reason is not lost.
Looking a function up yourself#
With the analysis export on your machine (it is made from your own copy of the game and is not in the tree) the query helper answers by address or name:
python re\py\bfre.py fn BF2.exe 0x006a8730 # the decompiled function
python re\py\bfre.py dis BF2.exe 0x006a8730 60 # its instructions
python re\py\bfre.py callers bf2_w32ded.exe 0x00557270
python re\py\bfre.py str BF2.exe "heightmapcluster" # strings and who uses themThree facts about the binaries save time: they were built with a 2003 Microsoft compiler; methods take this in the ecx register; and console commands are objects built with their name and argument types as strings, so a command's name leads straight to its code.
From a wiki page to its notes#
Every page ends with Notes: .. and most have an "In the code" table. To check a statement of a page:
- open the note it names and search for the address the page gives;
- read the status word beside it;
- open the Rust file from "In the code" and find the same address in a doc comment;
- look for a test that names the address (
rg 0x006a8730 crates).
If the page says more than the note does, the page is wrong: tell us. See also how a port is made, the glossary and the questions people ask.
How it is tested#
This page explains; it holds no code of its own. The notes' own checks are tools of the tree: a lint for comments that cite the original (re/py/comment_lint.py) and the parity counter's --check, which fails on a citation that names no function's start. 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#
This page names no crate of its own. How the codebase is organised maps the crates by area, and docs/release/LAYOUT.md in the tree has one line for every folder and crate.
docs/dev/guide/reading-the-notes.md · built from bf2-rs e3b4f05 · part of the Battlefield 2 / 2142 / Heroes reimplementation. Not affiliated with EA or DICE.