Reverse Engineering a Classic Game with AI Coding Tools: A 14-Day Workflow Retrospective

    This article reviews a 14-day experiment in rebuilding a commercial game without source code using AI coding tools. It covers the compliance and licensing gates that must come first, a practical strategy for parsing undocumented legacy binary formats, milestone breakdown with automated acceptance criteria, and a CI pipeline that keeps hundreds of daily commits manageable. The key takeaway is a transferable methodology for reconstructing no-source systems, where AI handles mechanical rebuilding while humans own architecture, licensing, and acceptance decisions.

    1. Background: When the Source Is Gone, Reverse Engineering Is the Only Entry Point

    The source code of commercial closed-source games is often permanently unavailable after the team disbands, the media degrades, and the build chain is lost. This is a classic “legacy system” problem in the software industry. Unlike a typical business system, a game executable and its asset bundles contain a large amount of implicit knowledge that cannot be recovered from design documents: magic constants for unit balance, pathfinding cost tables, and boundary conditions in the rendering state machine.

    The experiment was therefore framed as follows: with no source code and only the executable and asset bundles available, use AI coding tools to reverse the formats, reconstruct the logic, and fill in the multiplayer layer, then observe the real output produced over fourteen days.

    The engineering value of this experiment is not “cloning a particular game.” It is validating a reconstruction methodology for systems that have no source code. That methodology transfers directly to aging internal tools whose toolchains are lost, embedded firmware with missing documentation, and enterprise applications handed over incompletely after an acquisition.

    2. Compliance First: Authorization, Licensing, and the Limits of Reverse Engineering

    The first gate was not technical but legal. When the tool received the instruction to “reverse engineer and rewrite a commercial game,” it refused outright under its content safety policy. That is expected behavior, not a defect. The workable approach is to restate the task in a legitimate engineering context, for example compatibility rebuilding, format interoperability, and algorithm reproduction research on code you own or are authorized to use.

    License compatibility also has to be handled up front. A typical conflict appeared in the experiment: the project itself used a permissive license, while the reference decoding implementations carried strong-copyleft and weak-copyleft licenses respectively, and the latter cannot be introduced under static linking either. Three engineering conclusions follow:

    • Maintain a dependency license inventory and treat license type as a hard gate for dependency admission, not an after-the-fact review item.
    • Allow “reading the algorithmic idea and implementing independently,” prohibit source-level copying, and note the reference source in the commit message.
    • For disputed magic constants and lookup tables, keep the derivation process or experimental data so the implementation is defensible.

    3. Format Reverse Engineering: Parsing Ancient Binary Formats

    Early asset formats had no public specification and no usable parsing library, which was the biggest time sink on day one. The reusable order of work is:

    1. Sampling and diffing: export several assets from the same scene, diff them at the byte level, and locate the header length field and offset table.
    2. Validating structural hypotheses: assume the header contains a magic number, version, block count, and index offset, then use a script to check in bulk whether the assumption is self-consistent.
    3. Block-level decoding: implement container unpacking first, then tackle compressed blocks and substructures such as palettes and frame offsets one by one.
    4. Attribute-based encapsulation: solidify the findings into configuration structures with default values so constants are not scattered everywhere.

    A schematic structure description can be written as:

    1. struct ContainerHeader {
    2. magic: [u8; 4],
    3. version: u16,
    4. block_count: u32,
    5. index_offset: u64,
    6. }
    7. fn validate(h: &ContainerHeader, buf: &[u8]) -> Result<(), Error> {
    8. if h.index_offset as usize >= buf.len() { return Err(Error::BadIndex); }
    9. Ok(())
    10. }

    One observation worth recording is how prompts affect behavior: directly asking the tool to “copy an existing implementation” was refused, but merely describing that “the algorithm already has a publicly documented approach” led the tool to write an independent implementation on its own, and faster. Under constraints, the more effective strategy is to describe the goal and the constraints rather than ask for finished code.

    4. Milestone Breakdown: Slicing Fourteen Days into Acceptable Stages

    The plan was divided into four stages, each with a clear deliverable. This is the key to keeping long-running automated generation from going off the rails:

    • Pre-alpha: project skeleton, asset pipeline, logging, and crash recovery.
    • Alpha: every screen and menu flow clickable end to end.
    • Beta: combat logic, pathfinding, damage resolution, and state synchronization.
    • Release: multiplayer and match services, reconnection, and state validation.

    Acceptance criteria must be automatically decidable, for example “the UI stage passes when the screenshot difference rate is below a threshold” and “the combat stage passes when the result hash of a fixed scripted replay matches.” Without automated acceptance, hundreds of commits per day only pile up changes that cannot be attributed.

    5. Automation Pipeline: Keeping Hundreds of Daily Commits Under Control

    With hundreds of commits a day and no way to review them line by line, the only viable option is to move review into the pipeline:

    1. stages:
    2. - build # compilation and dependency license gate
    3. - unit # unit tests and property tests
    4. - replay # fixed-input replay, result hash comparison
    5. - visual # UI screenshot comparison
    6. - nightly # long-running soak and memory leak observation

    Three supporting practices: first, structure commit messages and require the stage and acceptance item to be stated; second, generate a daily change summary and failure clustering so people only read the aggregated conclusions; third, disable any stage regression through a feature flag instead of reverting an entire stretch of history. Logs, metrics, and alerts are best hosted on cloud logging and monitoring/alerting services, build artifacts in object storage, and task orchestration on a container platform, so the observability of a long-running experiment does not depend on a local machine.

    6. Conclusion and a Transferable Checklist

    The experiment shows that, given clear authorization, license compliance, and automated acceptance, AI coding tools can take on a large amount of mechanical reconstruction work for systems with no source code, while architecture decisions, license judgments, and acceptance definitions must remain human responsibilities. The transferable checklist: put license and authorization gates first, then sample and diff the formats, then set automatically decidable acceptance deliverables per stage, and finally replace line-by-line human review with pipeline aggregation.