메뉴
HN
Hacker News • 59일 전

내가 가장 좋아하는 게임 '페르시아의 왕자'로 보는 최신 AI 모델의 발전

IMP
7/10
핵심 요약

한 개발자가 1989년 애플 II용 '페르시아의 왕자'의 원래 6502 어셈블리 소스를 AI에게 주고, 직접 코드를 건드리지 않은 채 C#으로 포팅하는 실험을 진행했습니다. Claude Opus 4.6은 그래픽은 그럴듯했지만 타일 기반 엔진 탓에 게임다운 조작감을 만들지 못했고, Codex는 표면만 다듬었으며, Claude Opus 5는 DOSBox와 원본 DOS 게임을 스스로 비교·분석해 원작의 프레임 기반 애니메이션 설계를 역추론하고 PRINCE.EXE에서 실제 애니메이션 테이블을 찾아내 완전한 엔진을 재구축했습니다. 최신 모델의 자율적 디버깅과 코드 이해 능력이 세대를 거듭하며 비약적으로 향상됐음을 보여주는 사례입니다.

번역된 본문

본 메뉴로 건너뛰기 | 사이드바로 건너뛰기

Priyan의 블로그, 2026년 9월 25일 금요일

내가 가장 좋아하는 게임 '페르시아의 왕자'(애플 II, 1989, 조던 메크너 작)로 최신 프론티어 AI 모델의 발전 분석하기

(작성 팁: "HTML 보기" 모드에서 작성할 것.) 추천 라벨: AI, Claude, Prince of Persia, C#, 레트로 게임

내가 처음 '페르시아의 왕자'를 접한 것은 1995년, IBM PC XT에서였다. 지금도 가끔 다시 플레이한다. 로토스코프로 제작된 애니메이션, 왕자가 벼랑에 매달리는 모습, 문이 쾅 닫히는 소리까지. 30년이 지난 지금도 이런 감각을 내는 게임은 없다.

2012년 조던 메크너는 20년 넘게 상자 속에 보관돼 있던 3.5인치 플로피 디스크에서 복원한 원본 애플 II 6502 어셈블리 소스를 공개했다(복원 과정 자체도 꽤 흥미로운 이야기다): github.com/jmechner/Prince-of-Persia-Apple-II

C#이 가장 좋아하는 언어인 나는 하나의 실험을 계획했다. 이 소스 코드를 AI 모델에 넘기고 C#으로 게임을 포팅해달라고 요청하는 것이다. 나는 코드를 읽지도, 직접 수정하지도 않을 것이다. 내 역할은 결과물을 플레이하고 무엇이 잘못됐는지 말하는 것뿐이다. 새로운 프론티어 모델이 나올 때마다 같은 프로젝트를 프롬프트만으로 진행했다.

소스: https://github.com/priyanr/PrinceOfPersia_C-Sharp_Port_By_AI

진행 결과는 다음과 같다.

1라운드 — Claude Opus 4.6 (2026년 2월)

첫 프롬프트는 단순했다: "이 원본 코드에 페르시아의 왕자 6502 어셈블리 코드가 있으니, 세이브 레벨 파일들을 활용해 C# 콘솔로 만들어봐."

이틀 동안 Opus 4.6은 C# 콘솔 게임을 만들고, 이어서 레벨 에디터를, 그다음엔 Raylib 그래픽 버전까지 만들어냈다. 원본 레벨 파일도 정확히 파싱했다: 방, 타일, 문, 경비병 위치까지. 애플 II 게임처럼 보이는 무언가를 렌더링하기까지 했다.

하지만 '페르시아의 왕자'답게 플레이되지는 않았다. 그 시절 내 프롬프트 기록이 잘 보여준다:

"너무 별로야. 플레이가 안 되고 그래픽이 깨져" "이제 캐릭터는 나오는데 움직임이 전부 잘못됐어... 왕자가 바닥에 있지 않아" "이제 바닥 밑으로 떨어지고 화살표 키로 움직이지도 않아"

나중에 알게 됐지만 핵심 문제는 아키텍처였다. 왕자가 타일 하나씩 셀에서 셀로 점프하는 방식이었다. 진짜 게임은 프레임당 약간씩 움직이는 손으로 그린 애니메이션 프레임을 재생한다.

2라운드 — OpenAI Codex (2026년 3월)

Codex도 시도했다. 어떤 모델이었는지는 잊었다. 같은 코드베이스를 주며 말했다: "이건 Claude가 만든 페르시아의 왕자 원본 어셈블리 코드의 C# 포팅인데 그래픽이 아직 별로야. 고쳐줄 수 있어?"

Codex는 합리적인 작은 수정들을 했다: 아트가 흐려지지 않도록 선명한 픽셀 필터링, 스프라이트 배경 투명화, 열린 문을 통과할 수 있게 하기, 기둥 상단이 더 이상 벽처럼 작동하지 않게 하기 등. 하지만 왕자는 여전히 엉뚱한 위치에 놓였고 여전히 걸렸다. 표면을 다듬었을 뿐, 그 아래의 엔진은 여전히 잘못돼 있었다.

3라운드 — Claude Opus 5 (2026년 9월)

여기서 규칙을 조금 바꿨다. DOSBox를 제어하는 Claude Code 스킬(프로그램 실행, 키 입력, 스크린샷 촬영)과 임의의 Windows 프로그램을 제어하는 스킬, 두 가지를 작성했다. 그다음 내가 갖고 있던 원본 DOS판 페르시아의 왕자를 Opus 5에게 보여주며 말했다: 진짜 게임과 비교하고, 성공하거나 새벽 6시가 될 때까지 계속 돌려라.

밤새 작업하면서 가장 먼저 한 일은 아키텍처 문제를 진단하는 것이었다. 기존 엔진은 타일 그리드 엔진이었지만 진짜 게임은 프레임 시퀀스로 구동된다는 것을 알아낸 것이다. 그래서 원작 자체의 설계에 맞춰 엔진을 재구축했다.

그리고 내 예상을 넘어서기 시작했다. DOS 게임 파일들의 포맷을 스스로 분석해 실제 데이터를 직접 읽어냈다: 왕자의 모든 애니메이션 프레임, 던전 아트, 그리고 15개 레벨 전부. 애플 II 소스에서 알고 있던 바이트 패턴을 검색해 PRINCE.EXE 내부에서 원본 애니메이션 테이블을 찾아냈고, 각 테이블을 두 번째로 알려진 값과 대조해 확인한 뒤에야 신뢰했다. 저작권이 있는 게임 데이터는 내 저장소에 하나도 들어가지 않았다. C# 프로그램이 그 데이터를 실시간으로 읽어온다.

원문 보기
원문 보기 (영어)
skip to main | skip to sidebar Priyan 's Blog Friday, September 25, 2026 Analyzing Frontier Model Progress with My Favourite Game: Prince of Persia (Apple II, 1989) by Jordan Mechner "HTML view" (the icon), not "Compose view". Post title (put this in Blogger's Title box): Analyzing Frontier Model Progress with My Favourite Game: Prince of Persia (Apple II, 1989) by Jordan Mechner Suggested labels: AI, Claude, Prince of Persia, C#, Retro Games--> I first played Prince of Persia in 1995 on an IBM PC XT. I still go back to it from time to time: the rotoscoped animation, the way the prince hangs from a ledge, the clank of a gate slamming shut. Thirty years later it still feels like nothing else. In 2012 Jordan Mechner published the original Apple II 6502 assembly source, recovered from 3.5" floppy disks that had sat in a box for over 20 years (the restoration itself is quite a story): github.com/jmechner/Prince-of-Persia-Apple-II C# is my favourite language, so I set myself an experiment. I would hand that source to an AI model and ask it to port the game to C#. I wouldn't read the code or edit it myself. My only job was to play the result and say what was wrong. Every new frontier model that came out got the same project, with nothing but prompts. Source is in https://github.com/priyanr/PrinceOfPersia_C-Sharp_Port_By_AI Here's how it went. Round 1 — Claude Opus 4.6 (February 2026) My first prompt was simple: "in this original code there 6502 assembly code for prince of persia, use the save level files and try to do it in c# console." Over two days Opus 4.6 produced a C# console game, then a level editor, then a Raylib graphics version. It parsed the original level files correctly: rooms, tiles, gates, guard positions. It even rendered something that looked like the Apple II game. But it didn't play like Prince of Persia. My prompts from those days tell the story: "its bad not able to play its running graphics is scrambled" "now char coming but movement everything wrong ... prince is not in floor" "now it dropped below floor and arrow keys doesnt move" The core problem, as I learned later, was the architecture. The prince moved one tile at a time, hopping from cell to cell. The real game plays hand-drawn animation frames with a small movement per frame. Round 2 — OpenAI Codex (March 2026) I tried Codex too, though I've forgotten which model it was. I gave it the same codebase: "this is prince of persia original assembly code to c# port done by claude still graphics not good can you fix it." It made sensible small fixes: sharp pixel filtering so the art wasn't blurred, transparent sprite backgrounds, open gates you could walk through, and pillar tops that no longer acted as walls. The prince still ended up in wrong positions and still got stuck. It polished the surface, but the engine underneath was still wrong. Round 3 — Claude Opus 5 (September 2026) This is where I changed the rules a little. I wrote two Claude Code skills: one that controls DOSBox (launch a program, send keys, take screenshots) and one that controls any Windows program. Then I pointed Opus 5 at my original DOS copy of Prince of Persia and said: compare against the real thing, and run until you succeed or until 6am. It worked through the night, and the first thing it did was diagnose the architecture problem. The old engine was a tile-grid engine, while the real game is driven by frame sequences. So it rebuilt the engine around the original's own design. Then it went further than I expected. It worked out the formats of the DOS game files and read the real data straight out of them: every animation frame of the prince, the dungeon art, and all 15 levels. It found the original animation tables inside PRINCE.EXE by searching for byte patterns it recognised from the Apple II source, and it confirmed each table against a second known value before trusting it. None of the game's copyrighted data went into my repo. The C# program reads it live from my own DOS install. In the morning I had something playable. The prince dropped in, landed, turned, ran, jumped, fell through the gap and crouched on landing, all with the real animation. In a second session I played the first screens in DOSBox while it watched my screenshots, and it found a bug in how it detected ledges: it was looking for a ledge in the wrong cell. It fixed that by going back to the original assembly routine. But the levels still didn't look right. The bricks, the gates and the decorations were all slightly off. Opus 5 had placed every piece by matching it against screenshots, one piece at a time, and whatever it couldn't explain it filled in with guesswork. Round 4 — Claude Opus 5.5 (September 2026): one prompt When Opus 5.5 came out I gave it a single prompt: "the character moves runs jumps but gate positions bricks all different, you are new model let see anything u can improve." It took a completely different approach. Instead of tuning positions by eye, it found the original game's own room-drawing routine, as documented in SDLPoP by Dávid Nagy and the princed.org community, an open-source port of the DOS game reconstructed from its disassembly, and ported that routine. The result, DosRoomDrawer.cs , is a straight C# port of SDLPoP's room-drawing code ( src/seg008.c ), and the file says so in its header. SDLPoP's documentation explained what the earlier sessions had only guessed at: The "random" brick pattern isn't random at all. The original seeds its random number generator from the room, row and column, so every wall looks the same on every visit. The gate at the start of level 1 is actually open in the level data. The original game presses a hidden button as you drop in, which is why you hear the gate slam shut. Opus 5.5 found some things on its own, by checking against my files and the real game: PRINCE.EXE is actually compressed (Microsoft EXEPACK). The earlier tables had only worked because they happened to sit in a stretch the packer left untouched. It wrote an unpacker and read the tile-drawing tables out of my own copy of the executable. The screenshot crop used in earlier sessions was off by one pixel row, and an earlier theory about "stencil colours" was wrong. Those colours are the real teal of the exit door. Then it checked its work pixel by pixel against the real game running in DOSBox. On the first screen of level 1, the number of pixels that differed from the original went from 8,429 to 2 (a torch flame caught at a different moment). The second room and the exit door on level 3 matched too. It wasn't flawless. It also changed where the prince's sprite is drawn, based on the original code, but it had only verified that with him facing one way. Facing the other way, he sank a few pixels into walls. I noticed something was off and gave it my backup from before its changes. It proved that the movement itself was identical in all test ticks, found the sprite problem, and reverted just that part. That self-check is also a sign of progress. For the first time, the levels look like Prince of Persia. What I take away Opus 4.6: could read 6502 and write C#, but picked the wrong architecture and couldn't tell. Codex (March 2026): good small fixes, but didn't question the foundation and never ran the game. Opus 5: with tools to see the real game, it diagnosed the architecture, rebuilt it, and dug the real data out of the original files. That was the first playable version. Opus 5.5: from one prompt, went looking for how the original actually does it instead of approximating, and proved the result pixel by pixel. To be fair, the key to the last session was knowledge that already existed: the room-drawing routine that Dávid Nagy and the SDLPoP community had documented from years of reverse-engineering. Opus 5.5 knew where to look, ported it and verified it. I'm not sure it could have worked all of that out from the DOS binary alone. So I asked it, and it said: "Honestly, probably not in one prom