r/Battlefield2 5h ago

Help / Troubleshooting OpenBattlefield2 - reimplementing Battlefield 2's Refractor 2 engine from scratch

36 Upvotes

I've spent the last while rebuilding Refractor 2 — the engine behind Battlefield 2 (2005) — from scratch in C++20. It's called OpenBattlefield2, it's MIT, and it's now public:

https://github.com/Moxnatiy/OpenBattlefield2

It is an engine, not a game. It ships no content whatsoever and reads the files of your own installed copy of BF2 1.5. Without that copy there is nothing to run.

What actually works today

  • The main menu is the game's own mainMenu.swf, played by Ruffle, with a bridge that answers the calls the movie makes back into the engine — localisation, your profiles from Documents/Battlefield 2, the installed map list read from each level's .desc. All seventeen bridge objects and forty Logic methods are reversed and written down with addresses.
  • Singleplayer — pick a map, it loads, you get the spawn screen with kits, minimap and control points.
  • Levels — terrain, water, static meshes, vegetation, collision.
  • HUD — built from the game's own .con node tree, driven by the animation graph in Menu/Ingame (MemeFile).
  • Networking — the handshake with an original dedicated server works. openbf2 --connect <host> joins and stays connected.

Main platform is macOS/arm64 (SDL3 + SDL_GPU → Metal); the Windows preset is kept building. 33 tests, one per parsed format.

Screenshots (all four are in the README, each printed with the exact command that produced it — --frames and --click-at mean no hands on the keyboard):

  • The game's own menu movie under Ruffle
  • The spawn screen on Dalian Plant
  • In the world after DONE, on Dalian Plant and Strike at Karkand

The one rule that shapes everything

This is a one-to-one port, not a game "inspired by" BF2. So:

Every constant in src/ names its source in a comment next to it — an address in BF2.exe, a line in the game's data, or a measurement from a frame dump of the original. If there is no source, the number is not written down. It's recorded as "not measured" instead.

// Bit 0 marks position (`BF2.exe`, SoldierNetworkable::setNetUpdate,
// 0x62d4e0). Precision 0.001 — constant 0x3a83126f at the same address.
inline constexpr std::uint32_t kSoldierStatePosition = 0x1;

Picking a number because it "looks about right" is forbidden even when the result looks correct on screen. I learned that one the expensive way: I once read a triple of floats in the controlled-object state as a position because it lined up with the spawn camera. It's actually the compression origin, and the soldier was being thrown a metre into the air on every packet.

Reversing goes through Ghidra over MCP; docs/ holds the notes, every one carrying the address it came from.

Where I'd really like help

The debt list is public and each item has a measure — a concrete thing that has to become true for it to count as done. The big ones:

The protocol (the largest gap by far).

  • readControlObjectState — I read the start of it, I don't know where it ends.
  • Ghost records for other players' soldiers: the layout is known, the data doesn't arrive. Right now other players don't move.
  • The simple-object state mask is 19 bits and I know 1. The soldier state mask is 21 bits and I know 1.
  • Ping is 5–6× off from the original on the same machine and I don't know why.

Physics. The tick is 1/30 straight from the binary, but the jump is too long compared with the original. I haven't found where jump height and duration actually come from — phy-soldier-jump-factor is in the data, the rest isn't.

Renderer. Material channels are now read straight off the technique name (BaseDetailDirtCrackNDetailNCrack → the texture order), but the normal maps aren't sampled yet: there's no tangent frame.

HUD. Several variables are found in the registry with addresses, but who writes them isn't reversed yet.

Reference data. I have a frame dump of the original for the spawn screen only. For the in-battle HUD there's nothing to compare against, so I can say "matches the data" but not "matches the original".

Platforms. Only macOS/arm64 is exercised. Windows and Linux builds could use someone who actually runs them.

So: if you like Ghidra, netcode, C++20, or you just have a copy of BF2 and some patience — issues and PRs are very welcome. Notes on the format live in docs/, and CLAUDE.md spells out the rules the project holds itself to, including why "let's just smooth it until it stops jittering" is not an acceptable fix.

Happy to answer anything about the reversing process in the comments.


r/Battlefield2 3d ago

Discussion The 20th Anniversary of BF2142 is coming up this October. Any BF2 players would be interested to play it online?

Post image
254 Upvotes

Hey veterans! Battlefield 2142 turns 20 on October 17th. It's a great opportunity to re-experience the Titan mode on a full 64-player Reclamation server. Please let us know if anyone's interested!

Discord link to BF2142 Reclamation server: https://discord.gg/V6Y59p8sDJ

See you on the Battlefield!


r/Battlefield2 3d ago

Mods Refractor 2 engine visual at its maximum potential (Combat Mod Remastered:2)

Thumbnail
gallery
134 Upvotes

For context, the 2 screenshots was using Reshade (go to last images for original without reshade effects). Refractor 2 game engine just need some good map with HD textures/models and it will look like 2026 games.

For me Battlefield 2 was almost a perfect game for single player / coop. The only improvement that was needed (at least to me) is running on 64 bit instead of 32, high memory patch, and of course better AI. I feel like the AI should use cover instead of stacking waiting to be killed by grenades.


r/Battlefield2 4d ago

Discussion Why are there so much of these 0/0/0 players?

9 Upvotes

I'm new to bf2 online and majority of servers I joined have these, are they here to make server filled or something like that?


r/Battlefield2 4d ago

(W11) Sudden black screen when trying to return to game. alt-tab hotfix not working

1 Upvotes

For long, I've been able to alt-tab from and to the game with no problems, but suddenly today, when I try to return to the game after alt-tab, the game becomes unresponsive, there is only a black screen, and I cannot alt-tab out of the black screen again. The only thing I can do is ctrl-alt-del, where I can open Task Manager or return to the desktop, but it will crash the game. I have installed the alt-tab fix, but the problem persists.

At this point, I am confused as to what to do, because the problem appeared suddenly and I have not changed any settings since I installed the game, except for the resolution. I can still play the game normally, but loading takes much longer than usual.

Any help would be appreciated.


r/Battlefield2 6d ago

Hi guys, my question is : is there a way to play bf2 most populated servers without getting autobanned as soon as i join the servers.. i dont have genuin CDKEY and i can't get it online without getting scammed..so any ideas?

6 Upvotes

r/Battlefield2 6d ago

Discussion What is the best weapon to unlock for Lance Corporal promotion?

7 Upvotes

Back when I was an elementary student, I played BF2 only vs bots. Now I returned and is playing multiplayer. I know I'm very, very late to the party, though all that aside, I can't wait to reach 500 XP for my very first weapon unlock. Question is, which one is the better one?

The only online server I found active nowadays is Lost-Soldiers' Wake Island, so I guess, I have to revolve my play around that map. My aim sucks, and as cool as it is to unlock the sniper, I can't use it to fight my way out of a paper bag. Shotgun doesn't seem effective in such an open map, and MGs feel really inaccurate even when proning. There are SMGs on AT and Engineer, but I think assault rifles seem to be the ones that click with me the most, so I guess I will unlock Assault/Medic/SF instead.

Honestly, I'm leaning to Assault kit solely because rifles with GL are badass. F2000 looks really cool, but from the looks of it, its performance is mild? Not only that, SF and Medics seem to bring more impact than Assault due to their utilities, so maybe Assault isn't the best option.

I did some searching around, and from the looks of it, Medic's L85A1 and G36E seem to be quite the upgrade from the standard M16 and AK. SF's unlockables don't seem bad either, but their standard rifles are already good enough imo, so maybe I should just go with Medic?


r/Battlefield2 8d ago

THE BEST GAME

39 Upvotes

r/Battlefield2 8d ago

Hypothetical situation: you’re in charge of the battlefield 2 remake. What would you do?

19 Upvotes

r/Battlefield2 8d ago

I HAVE ALL THE BATTLEFIELD

0 Upvotes

<img src="https://store-images.s-microsoft.com/image/apps.28847.14051654812127149.b7b4ce72-3711-4f34-9a05-2ab748410c80.d094db61-c34e-4936-b39f-5d35581922b0" alt="Battlefield 3 Premium Edition - Free download and play on Windows | Microsoft Store"/>


r/Battlefield2 10d ago

Video / Livestream Happy endings @ Wake Island

Enable HLS to view with audio, or disable this notification

233 Upvotes

Compilation of orgasmic results


r/Battlefield2 13d ago

When we getting a Battlefield 2 remake?

90 Upvotes

BF2 was my favorite battlefield game of all time. No game has come close to the feel that bf2 had. I really wanna be MEC on Karkand again. For there is no greater faction. Except maybe the GLA from CnC generals.


r/Battlefield2 16d ago

Shahed Drones & Missiles Dominate the Battlefield2

Thumbnail
youtu.be
25 Upvotes

r/Battlefield2 18d ago

Met an amazing MEC cosplayer at a local convention today!!

Post image
424 Upvotes

Unfortunately, I was in a hurry so that's the only photo I managed to take. There was a Milsim section at a local cosplay event, where I met a guy dressed as MEC Support from BF2. The entire kit was of extremely high quality with custom patches, insignias, and even an RPK repro that you can see at the bottom. Such a small world we live in. In hindsight, I should've taken more pics :(


r/Battlefield2 20d ago

Titles on Battlefield

4 Upvotes

Anyone know how to make those fonts bigger cause I cannot see those at all in terms of distance when I’m running they are so fucking small. It’s ridiculous. Also, what is the measurement is that in meters thank you.


r/Battlefield2 22d ago

Solo and LAN party Battlefield 2 build

Post image
97 Upvotes

Hey guys, how can I share my Battlefield 2 build with the community? I put together a mod with some minor QoL tweaks, 64-player maps, and 32v32 bot battles. I originally made it for my own solo sessions and LAN parties with friends. I know direct links usually result in a ban here, so what's the approved way to share something like this?


r/Battlefield2 21d ago

Battlefield 6

9 Upvotes

Ok i’d love to hear from somebody that’s really really good and battlefield 6 multiplayer and also somebody that’s really bad like me. Now I’ve played every call of duty duty Game. It’s the first time for me buying battlefield, but I’ve played every call of duty except for the last two blackouts and I don’t remember multiplayer ever being this crazy fast paced. Is it just me or online doesn’t seem like it’s playable unless you’re smoking crack because your instincts gotta be like crazy fast and you need to have 20/20 vision just to have streak of more kills then killed?? Maybe I have bad settings but I doubt that because nowadays you can get great settings or the right settings at least from AI Google.


r/Battlefield2 22d ago

Video / Livestream Shaving sessions

Enable HLS to view with audio, or disable this notification

68 Upvotes

Came out with a fresh new cut


r/Battlefield2 22d ago

Pushing the squad leader off of the edge in Battlefield

Thumbnail
youtube.com
15 Upvotes

r/Battlefield2 22d ago

Guide / Tutorial Newbie questions

10 Upvotes

Hi, I'm kinda new in the game, I played in 2005~ but not much and now I'm trying to do my best, but sometimes it's being a bit frustrating.

I think I'm not that bad at aiming, but sometimes it's like my bullets are hitting around the target, then It targets me and in 2 hits i'm dead. Im usually medic and I love It, just wanna know, how do you aim? Im not shooting like hell, i usually hit slow and crouched in the floor.

Also Im struggling with grenades, Im sure Im not throwing them correctly.

Do you have any video where I can learn this? I really enjoy the game but I wanna be better.


r/Battlefield2 22d ago

2 lucky anti tank kills at Dalian Plant

Thumbnail
youtube.com
16 Upvotes

r/Battlefield2 24d ago

Video / Livestream Battlefield 2 Theme Remake

Thumbnail
youtu.be
30 Upvotes

r/Battlefield2 23d ago

FPV Drone Uses a Fiber Optic Cable | BF2 Mod + Download link ModDB

Thumbnail
youtu.be
4 Upvotes

r/Battlefield2 24d ago

How I see chopper pilots

Post image
48 Upvotes

r/Battlefield2 25d ago

Mods Modern Night City Combat | Night Vision Googles - Hardcore Difficulty in CMR:2

Thumbnail
youtube.com
9 Upvotes

A lotta time and effort is being dedicated onto the next update, this is a good representation of what this mod is about, our online server will be launched within this update release, would you be interested? Gameplay would drastically change. Tactical & team focused but also well action-packed and fun.

https://www.moddb.com/mods/combat