|
OpenBF1942-Plus
Refractor 1, rebuilt from scratch
|
Last updated: 2026-11-10
| Subsystem | State | Reference |
|---|---|---|
| RFA archives | done, verified on the full retail install | rfa.md |
| CON scripts | interpreter done; all 78 levels load with every placed object resolved | con.md |
| Static meshes (.sm, .rs) | done; all 2,527 meshes parse, OBJ export with textures; collision triangles + materials decoded, drawn with --collision | sm.md |
| Tree meshes (.tm) | done; all 130 parse (Python + C++), drawn with sprite billboards | tm.md |
| Textures (.dds/.tga) | C++: DDS DXT1/3/5, uncompressed TGA (24/32-bit, colour-mapped, gray); anisotropic filtering; cut-outs tested at full resolution | — |
| Terrain | heightmap, colour tiles, detail texture (detailTexName), water plane, sky box, per-level fog (renderer.fogStart/End), sky fogged as at 250 m, sun light (sunLightDirectionVec, x and z negated); all 78 levels open. Matched against the original client on Berlin and El Alamein except Berlin's street brightness | terrain.md |
| Map objects in the viewer | static and tree meshes, child templates, spawned vehicles, animated meshes, object lightmaps; first LOD only, no effects | con.md |
| Skeletons, skins, animations | Python + C++. .baf quaternions conjugated, biped roots turned from Max space. CPU skinning with smooth posed normals; state animations, per-weapon arm states (copyState, copyState2), fire / reload (fitted to reloadTime), held weapons on their skeleton, first-person arms, seated soldiers | anim.md |
| Physics + vehicles | Jolt world: terrain height field, static .sm collision; drivable cars, tanks, aircraft and boats (--drive), handling uncalibrated | vehicles.md, ADR 0004 |
| Weapons and damage | vehicle guns from their posed barrel, the soldier kit (keys 1–9) with magazines and reload; ballistic projectiles; damage from MaterialManager tables and the armour face hit; explosions with radius; supply depots for soldiers and vehicles (vehicle guns have rounds); wrecks | weapons.md |
| Soldier on foot | --play 1 or 2: team soldier with the whole kit, first / third person, crouch / prone, parachute and fall damage; bots of both teams (see, shoot, crouch, throw grenades, fall back on pistols, lay mines and packs, run for flags on path-finding routes, board and crew vehicles); conquest flags and tickets (engine/conquest.*), ship spawn points, deaths and respawns | vehicles.md |
| Vehicle crews | seats from nested PlayerControlObjects (weapon, mouse-look parts, SeatObject, exit); player number keys 1–8 (as the original's c_PIMenuSelect; F1–F8 are the radio); bot drivers on the tank / landing-craft maps, gunners aiming through the seat's look inputs, troop boats that land their passengers | vehicles.md, weapons.md |
| Audio | SDL2 device, own mixer; .ssc patches by role (shot, reload, distant, automatic loop), driven engines | sound.md, ADR 0006 |
| Effects | C++. EffectBundle / Emitter / SpriteParticle simulated on the CPU, drawn as sorted sprites: muzzle flashes, shot end effects, impacts, vehicle damage smoke and fire, destruction | effects.md |
| HUD | .font text and the original health bar and magazine textures: crosshair, tickets and flags, health, weapon and rounds, vehicle and seat, kill / capture feed, radio menu; minimap from the colour tiles with setMinimapIcon markers | hud.md |
| Network (research) | one original client/server session recorded through a WSL relay; GameSpy LAN discovery and query documented; game transport and payload structure decoded (tools/bfnet.py): player actions, the 51 game events and ghost entries walk every packet of a 14-minute recording; per-object ghost updates and action values open | network.md |
| Engine (C++) | obf (game, headless) + obf_render (GL) libraries; obf_mapview (window), obf_sim (headless runs) | boundaries.md |
| Task | Command |
|---|---|
| Tests | python3 -m unittest discover tools |
| Build engine | cmake -S . -B build && cmake --build build -j |
| Engine tests | ctest --test-dir build |
| Build engine (Windows) | MSVC x64 prompt (VS 2019+ Build Tools) and vcpkg: vcpkg install sdl2 libepoxy pkgconf --triplet x64-windows, then cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=<vcpkg>/scripts/buildsystems/vcpkg.cmake -DPKG_CONFIG_EXECUTABLE=<vcpkg>/installed/x64-windows/tools/pkgconf/pkgconf.exe && cmake --build build (DLLs copied next to the exes) |
| Map viewer | build/obf_mapview <BF1942_DIR> <mod> <level> [--shot out.ppm] [--cam x y z yaw pitch] [--mode conquest|ctf|tdm|coop] [--soldier <template>] [--drive <vehicle>] [--play <team or soldier>] [--kit 0-4] [--sim s] [--fire-ahead] [--collision] [--no-objects] | | Headless game run | build/obf_sim <BF1942_DIR> <mod> <level> (--play <team or soldier> [--kit 0-4] \| --drive <vehicle> [--fire-ahead]) [--cam x y z yaw pitch] [--sim s] — the --shot demo without a window | | Doc checks | python3 tools/check_docs.py | | Docs site | GitHub Pages from docs/Doxyfile, built by .github/workflows/pages.yml on every push to main | | List archive | python3 tools/rfa.py list <archive.rfa> | | Extract archive | python3 tools/rfa.py extract <archive.rfa> <out_dir> | | Load mod + level | python3 tools/con.py <BF1942_DIR> <mod> [level] [mode] | | Export mesh | python3 tools/sm.py <BF1942_DIR> <mod> standardMesh/<name> <out_dir> | | Record game traffic | python3 tools/bfnet.py record <port> <server_ip> <server_port> <out.jsonl> <seconds> (holds personal data: never commit) | | Summarise a recording | python3 tools/bfnet.py summary <in.jsonl> |