跳到正文
@levelsio· 来源· @levelsio · X·· 21 小时前精选AI 评分78
推荐理由

展示了利用 Claude Code 将闭源游戏反编译并移植到 Web 端的完整工作流,为复杂代码重构提供了可参考的 Agent 协作范式。

正文 · 原文

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

👉 https://t.co/6C8H8KtSaU 👈

(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!

来源:@levelsio · x.com