Forgotten Saga (1997 का Korean DOS RPG) का source port करना
प्रेरणा
- 30 साल पहले, प्राथमिक स्कूल के समय मैंने जो पहला पैकेज गेम खरीदा था, वह Forgotten Saga था
- जीवन का पहला RPG, और स्वाभाविक रूप से उसमें गहराई से डूब गया
- 20 साल से ज़्यादा समय तक उसे भूलकर जीता रहा, फिर पता चला कि आज भी बहुत से लोग इसे खेल रहे हैं
- "क्या इसे multi-platform game नहीं बनाया जा सकता?"
- जो बचा था, वह सिर्फ 1997 का PE32 executable + data files थे (स्वाभाविक रूप से source code नहीं था)
कार्यप्रणाली
- मूल गेम को फिर से बनाने के दो बड़े तरीके थे
- spec-आधारित reinterpretation — gameplay देखकर उसे मिलते-जुलते रूप में फिर से बनाना
- मूल function unit के स्तर पर faithful restoration — decompiled code को वैसा का वैसा port करना
- मैंने दूसरा तरीका चुना, ताकि अनुमान नहीं बल्कि सत्यापित मूल behavior का पालन किया जा सके
- मूल संस्करण 1997 Windows MSVC पर बना था
विश्लेषण में क्या मिला
मूल binary का decompile
- Ghidra 12 से PE32 को प्रोसेस किया। 937 functions का 100% decompile सफल रहा
- 51,799 lines की pseudocode C
data format cracking (48 प्रकार, सभी verified)
- LZSS — standard + FAM variant (ring init
0x00, ref_offset bit layout अलग)
- SPB — 256 colors + RLE, 1,155 images
- MOB — character/NPC animation के 2,699 frames।
0xA4 header + RLE pixel + frame stride 20B
- SCP — bytecode VM, 128+ opcode, 6,026 entry, 43,036 dialogue lines
- FAM — 292 maps, 5 layers (base / overlay / collision / ...)
- DAT — CHAR / ITEM 290 types / MAGIC / ABILITY / MONSTER
- SAV — actor struct
0x2A4 (676B), party + inventory + global vars
user input की direct verification
- save files को सीधे parse करके actor struct offsets verify किए
- पहले की गलत mapping (
0x3C ATK→STR, 0x40 INT→TLT आदि) को सुधारा
क्या बनाया गया
- Lua की 263 files, 157,277 lines
- 3,760 assets
- LÖVE 2D 11.5 desktop build + love.js (emscripten) web build
- mobile virtual joystick + Korean IME का direct implementation
- SharedArrayBuffer enable किया (COOP/COEP via coi-serviceworker)
- IndexedDB sav persistence (browser environment)
- 5 deployment channels — Web / iOS / Android / Windows / macOS
reproduction scope
- title / character creation / field / dialogue / shop / inventory / equipment / trap / DETECT·UNLOCK / save — पूरा
- combat system — प्रगति पर
AI tools का उपयोग
- मुख्य रूप से GPT 5.5 की
/goal feature, Claude Code सहायक + real-time debug के लिए
GPT 5.5 /goal की भूमिका — decompile analysis / accumulated correction
- मूल function cluster / call graph / opcode reference का automated analysis
- data format deep dive (sav format, actor offset, FAM structure आदि)
- शुरुआती auto-decoded version की mislabel corrections को लगातार जमा किया गया (51,799 lines का corrected version)
Claude Code की भूमिका — Lua porting + immediate verification cycle
- मूल function read → Lua port →
verify.sh test run (100+ test mode, 1,000+ assertion)
- browser environment debug (IDBFS / IME / SharedArrayBuffer आदि)
- user report मिलने पर debug → fix → dev deploy → verify → live deploy cycle
कार्य अवधि
यह किस तरह का परिणाम है
- Play (browser): https://forgottensaga-classic.blogspot.com/2026/05/…
- PC और mobile दोनों पर चलता है। mobile में virtual joystick + Korean IME खुद implement किया गया है
- मूल gameplay की faithful reproduction — Z sorting, palette cycle, NPC state machine, SCP VM आदि में मूल behavior 1:1
अभी कोई टिप्पणी नहीं है.