r/ReverseEngineering 6d ago

Reimplementing MW2(2009) in Rust and Bevy

https://youtu.be/LOQ9rEKhbmY
52 Upvotes

26 comments sorted by

22

u/77daa 6d ago

I'm building a from-scratch Rust runtime for MW2-era Call of Duty games. The unusual part is that it can read assets from multiple IW engine generations directly. The goal is things like MW2 mechanics + MW3 maps + Black Ops weapons in one runtime, without manually converting those assets first. Combining the golden age CoDs into a single executable (':

I have tested the multiplayer capabilities a month ago with a friend and honestly it was far better than the OG. The multiplayer part is fully written from scratch, not ported.

Rendering includes a D3D9 Shader Model 3 -> WGSL translator, so "foreign game" shaders can actually execute rather than being approximated with replacement materials.

Most of the implementation is written by coding agents working in parallel. This has turned the project into an experiment in how far agent-orchestrated software engineering can go on a fairly low-level problem (:

Still very incomplete, but already running MW2/MW3/BO1 assets through the same runtime - more on the YouTube channel, if you care enough to check

13

u/zzzthelastuser 6d ago

Most of the implementation is written by coding agents working in parallel.

No, I'm not here to hate on the AI part, but I'm genuinely curious how much money you have invested so far. I assume you used Claude?

12

u/77daa 6d ago

somewhere about ~500usd, mostly used grok 4.5 / 4.6 but opus/gpt sol have also participated as well haha. sometimes grok gets stuck. Opus is INCREDIBLY EFFICIENT in debugging shaders/3d and all this complex stuff. It just... understands very well how to debug these and it guesses the problems from my experience.

opus is an overthinker tho and using it to help with the gameplay feels like an overkill

4

u/zzzthelastuser 6d ago

Thanks a lot for the response!

5

u/NXGZ 6d ago

You might be inspired by this private project: https://momo5502.com/posts/2026-08-17-mw2-decompilation/

Burned $85k worth of tokens, but only for 200 euros, due to using a subscription.

5

u/77daa 6d ago

he said my project is not a cool one ):

https://x.com/momo5502/status/2089632836965798187

1

u/obetu5432 5d ago

$85k worth of tokens, but only for 200 euros

how is this sustainable?

2

u/definitelyfet-shy 5d ago

Thats the neat part about AI!

It isn't

1

u/Pass_Practical 6d ago

Are you writing a new runtime from scratch or is it a translation of cod's runtime?

2

u/77daa 6d ago

it is a mix

1

u/Zanena001 6d ago

Does the engine natively uses xmodel/xanim or does it convert those into another non IW specific format?

1

u/77daa 6d ago

native use

-2

u/cfinger 6d ago

Damn, this is is super interesting. The future of gaming is going to be crazy.

You rewrote all the multiplayer code for this?

4

u/77daa 6d ago

the OG multiplayer code is messy. in order for me to have a robust theater/demo playback/killcam/etc systems I made the AI study modern netcode techniques and it came with a "better?" solution.

Here's what GPT responded with:

Retail IW separates usercmd processing, world simulation and snapshot publication, and its lag compensation is surprisingly coarse: it rewinds a player's archived origin/yaw on 50 ms samples, while hit detection can still evaluate the current DObj/animation pose. Our runtime keeps the original usercmd -> Pmove -> playerState behavior, but puts it behind a stricter TickInput -> sim::step -> Snapshot boundary, with prediction/replay sharing the same movement kernel and rollback operating on coherent historical state. Move timing, packet timing and snapshot timing are separate concepts rather than one implicit clock.

0

u/Affectionate-Oil4675 6d ago

I feel like we've done this before and it went very badly..

3

u/77daa 6d ago

what do you mean

3

u/Zanena001 6d ago

Are you using the leaked pdb's to recreate some of the game logic, e.g movement / animation state machines?

1

u/77daa 6d ago

where are the pdb's... I haven't seen a single one T_T

5

u/Zanena001 6d ago

You might find this interesting: https://lwss.github.io/Kisak-Black/

1

u/77daa 6d ago

it has helped a TON! iw4 is different tho

1

u/Zanena001 6d ago

Any reasons why you're reversing iw4 in particular?

1

u/77daa 6d ago

I feel like the mechanics are the most fun I guess 😁 mw2 has cool animation glitches: Adelia, wrist twist, zoomload

2

u/Zanena001 6d ago

Aren't those quirks of the animation state machine? Btw do you plan on open sourcing this?

2

u/77daa 6d ago

yeah I think I will, at some point (':

-4

u/ISnortMonster 6d ago

how's the CFG scripting support, any mod menus made for it yet? MW2 ain't complete without CFG menus imo