我反编译了我可能有史以来最喜欢的游戏:战地1942,并把它放到了网上,带多人模式供你在这里玩:👉 http://bf1942.pieter...

·

产品与工具 · 2026/11/03

作者使用 Claude Code 将《战地1942》的免费试玩版反编译并移植到网页,支持多人游戏。过程包括反汇编 x86 机器码、将 57,000 个函数翻译成 C 代码、编译为 WebAssembly,并重写 300 多个 Windows/Direct3D 函数为 WebGL 2/OpenGL,以及构建基于 WebSockets 的网络栈。最终游戏可在浏览器中运行,作者邀请玩家试玩并反馈 bug。

该项目展示了利用 AI 工具将经典游戏移植到网页的可行性,技术挑战大且具有创新性,为游戏保存和网页游戏开发提供了新思路。

I decompiled probably my favorite game ever: Battlefield 1942 and I put it on the web with multiplayer for you to play here:

👉 http://bf1942.pieter.com 👈

(It's the free shareware demo)

It was way harder than the other ports like Quake and DOOM I did because they already had lots of open source projects and work behind them

In case of Battlefield 1942 there was literally absolutely nothing to work on top of, nobody had ever ported it and there was no open source engine for it, nor did the makers ever open source it (like id Software did with Quake 3)

I tried it 6 months ago and essentiay gave up but I tried it today again with Opus 5.5 asking "can you try port the BF1942 demo in this folder to web"

So me and Claude Code (well let's be honest mostly Claude Code) did crazy shit today:

- it disassembled the x86 raw machine code to find 57,000 x86 functions

- it translated each x86 function into a C function (mov eax, [esi+0x110] becomes eax = READ32(esi + 0x110), I have no idea what any of this means btw)

- it outputed 100,000 lines of C

- it then compiled that to WebAsswmbly with Emscripten

- there were 300x Windows and Direct3D functions used which we had to rewrite to WebGL 2 and OpenGL to work on the web

- then we had to build our own network stack so it could connect to our multiplayer server via WebSockets

I have no idea how it did any of this but it did it and it seems to work! 😊

Come play and report any bugs here!

在原站观看视频

<hr />@levelsio: I may or may have not just decompiled Battlefield 1942's raw C engine with Claude Code to run it in the browser 😬

在原站观看视频

资讯配图

资讯配图

阅读原文

参与讨论