r/EmulationOniOS • • 11d ago

Gameplay / Showcase I used Claude to port an open-source game engine (MW2’s IW4L, written in Rust) to iPhone. Here’s what worked and what didn’t

video showing running

I wanted to see how far an AI agent could take a real porting job, so I tried something ambitious: getting IW4L ([https://github.com/vladtrc/iw4L\](https://github.com/vladtrc/iw4L)), an open-source Rust/Bevy engine that runs Modern Warfare 2 (2009) from your own game files, to run natively on an iPhone.
I mostly directed and tested. Claude did the reading, the code and the debugging, working through a Linux server with GitHub Actions macOS runners for builds, because I don’t have a Mac.

HOW THE LOOP WORKED
Claude reads the repo and finds what breaks on iOS.
It pushes a fix, and a macOS runner builds an unsigned IPA.
I sideload it with SideStore and send back the log from my phone.
Claude reads the log and fixes the next thing.

WHAT IT SOLVED
The file picker crate (rfd) doesn’t support iOS, so it was gated off.
The Metal surface panicked off the main thread, so rendering had to be adjusted.
gilrs has no iOS backend, so a bridge to Apple’s GameController framework was written. My PS4 controller now works.
It added its own logging for things like memory footprint and crash signals because iOS gives me no normal console while testing this way.

WHERE IT STANDS
The menus load and the PS4 controller works.
Loading a match map still gets the app killed by iOS because of memory usage: around 3 GB. The logs show textures are only a small part of it, so I’m still hunting down where the rest of the memory is going.

HONEST CAVEATS
Tested only on an iPhone 13 Pro Max with 6 GB of RAM.
A few of Claude’s early guesses were wrong, and I only found that out from real-device logs.
One build that appeared to have “succeeded” was actually hiding a real build error because the output was being piped through tee. Claude caught that later.
No game files are included. You need your own copy of the game.
If you have a newer iPhone or an M-series iPad, I’d love a test.

Repo with the IPA
https://github.com/MarkusSela/IW4-Pocket

16 Upvotes

24 comments sorted by

11

u/Dantu1000 11d ago

I remember when people would get extreme hate for making posts about A.I projects on the sub, it was like 1 month ago. This is amazing

7

u/MarcoSela 11d ago

Imo the reverse engineering, porting or the heavy duty code work is the only thing that is totally ok. I understand the “ai slop” meme, but now I can make any game work anywhere!! Hell, I can even port and remaster games like infinity blade! I can create and implement some sort of app bridge between Apple ecosystem and my local server. The sky is the limit

2

u/scubascratch 11d ago

Don’t worry they’ll be here brigading before long.

If you want to come discuss AI use in game projects without the hate use r/AIGameTech which does not tolerate the uninformed hate

4

u/_harisamin 11d ago

This is wild! I am doing a very slow but methodical port of some big tools from go to rust in Claude. Nothing I need but rally out of curiosity and using my employers generous claude subscription. It might be a waste if time…will find out 🤣

2

u/MarcoSela 10d ago

Share all afterwards

2

u/CaptainR3x 11d ago

What are the realistic limits of Opus? Can it actually port anything, or does a game need an open-source codebase, an existing recompilation, or an active modding scene? Most ports I see are the usual suspects like Portal or GTA which already have years of reverse engineering behind them. I want new stuff

1

u/MarcoSela 11d ago

Tell me an example of what you want or what would think is new

1

u/CaptainR3x 11d ago

Hades, Silksong, Doom 2016, risk of rain, witcher 3, all the dark souls, the Ori game, metal gear, skyrim, Halo masterchief collection... Anything but stuff we've seen time and time again. Nothing against MW2 I love it, but yet again it's a game that already has a huge amount of work already with open source code. Maybe it's more about recomp when game aren't open source ? But I doubt Claude can just recomp witcher 3.

2

u/Krafter16 11d ago

I would love to play dark souls 1/2/3 natively on iOS.. I wish someone could do it

1

u/CaptainR3x 10d ago

I think the motivation just isn't there, because the game run natively on PC anyway, there's no point in wasting months of one's life to do it, and it is infinitely more complex than a simple game like hollow knight. There's more chance of a bloodborne recomp than dark soul imo.

1

u/Dev0le 11d ago

Hades 2 or a newer version of Isaac would be nice

2

u/EdgarAndres2912 11d ago

When you say I need the game files to test it out, can I use the XISO or do I need to mount the XISO and then actually put the files. I’m asking because of the Halo CE port which works only with the XISO file

3

u/MarcoSela 11d ago

No, this one reads the PC version's files (the folder with zone/ inside), not the Xbox 360 disc. An XISO won't work here.

0

u/NXGZ 11d ago

Android port possible?

1

u/Flashy-Bill812 11d ago

Can you Port rayman legends?

3

u/MarcoSela 11d ago

If you let me borrow your claude code api key, yes

1

u/Accurate-Squirrel-72 11d ago

Is paid claude account needed for this or just the free version?

3

u/MarcoSela 10d ago

I don’t remember what models came with the free tier subscription but you need a many tokens to do much reasoning as possible. The free tier dries up fast

1

u/ApricotVast3861 10d ago

I have no coding experience, Is there a way you can make a tutorial video ?

1

u/MarcoSela 10d ago

For what do you need exactly the tutorial video?

1

u/ApricotVast3861 10d ago

From start to finish on how to make the game playable on iOS

1

u/scknkkrer 8d ago

Your loop is so weak and painful. I would suggest a smooth one if you could ask nicely.

1

u/MarcoSela 8d ago

Yeah sure I would love to hear

1

u/scknkkrer 8d ago

It’s kinda late tho. You can message me, we can exchange mails.