Rebuilding a Classic RTS After the Source Is Lost: A 14-Day LLM Reverse-and-Rewrite Practice

    When only binaries, resource packs, maps, and scattered docs remain, can intelligent coding tools reverse, reimplement, and rebuild a classic real-time strategy game? This article walks through a 14-day experiment in staged reverse engineering, private-format parsing, constrained code generation, licensing, and multi-layer validation—aimed at teams using LLMs for legacy rebuilds, protocol recovery, and internal-tool reconstruction.

    When a classic real-time strategy (RTS) game has lost its original source and only executables, resource containers, map data, and a few public notes remain, can intelligent coding tools still reverse, clone, and rebuild it? It sounds like a geek adventure. From a software-engineering view, it is a combined practice of legacy reconstruction, binary analysis, format reverse engineering, automated generation, and continuous verification.

    This article uses a 14-day experiment—having an intelligent coding tool continuously reconstruct a classic RTS—as a case study. It unpacks how to split a large goal into executable stages, how models handle private formats, how to keep generated code under engineering control, how to treat licenses and compliance, and how automated tests plus visual results show whether the code actually works. The process is useful for developers who want LLMs to speed legacy maintenance, old-game reimplementation, protocol recovery, or internal-tool rebuilds.

    1. Background: After the source is gone, reverse and rewrite are the remaining paths

    Many classic systems share this bind: the original project is lost; maintainers have binaries, assets, configs, and community write-ups. Traditional maintenance fails: you cannot fix defects in source or extend features cleanly. Three paths usually remain:

    1. Local binary patches
    2. Running the old program under an emulator or compatibility layer
    3. Reverse-engineering key modules and reimplementing a maintainable version

    This experiment took the third path: have the tool analyze old-program behavior, recover resource formats, rebuild core logic, and gradually generate a runnable new implementation. The goal was not a UI clone, but a full runtime chain: resource loading, map parsing, unit control, combat resolution, UI, and online sync.

    LLMs fit this kind of work for three reasons. Goals are clear and can be staged. Intermediate artifacts are testable (map load, unit display, a completed attack). Generated code volume is too large for line-by-line review, so tests and observation are required. The difficulties are equally clear: closed formats, complex behavior, huge context. Models get lost in details unless engineering constraints are strict.

    2. Overall plan: Split “rewrite the game” into a 14-day schedule

    The experiment did not ask the model for a complete project in one shot. It used a staged plan:

    • Research: basic analysis of the executable and resource formats
    • UI: main menu, loading screens, basic interaction
    • Combat: movement, attack, damage, win/lose
    • Online: state sync, replay, basic networked play

    This matches large-system reconstruction: a runnable skeleton first, then fill in complexity. Each day had a concrete deliverable:

    • Day 1: format analysis and a read framework
    • Day 2: resource index and animation parsing
    • Day 3: map load and terrain rendering
    • Day 4: unit data structures and movement
    • Day 5: combat rules and damage model
    • Day 6: pathfinding and collision
    • Day 7: UI system and input events
    • Day 8: audio and video playback
    • Day 9: deterministic logic and RNG control
    • Day 10: network sync framework
    • Day 11: replay system
    • Day 12: performance and memory
    • Day 13: automated tests and regression
    • Day 14: package a runnable candidate

    Operation was near-continuous generation, with hundreds of commits per day. Humans could not read every line; they watched builds, screenshots, logs, and tests. That is an emerging engineering shape: developers define goals and constraints and review results, rather than writing every line.

    3. First hard problem: reverse private formats and rebuild parsers

    The hardest part of old games is often not main logic but resource formats. Maps, animation, video, audio, fonts, and particles often use private containers or modified encodings. With no public spec, the model must reverse the format.

    A typical flow:

    1. Read the header; identify magic, version, offset tables
    2. Analyze the index; confirm block layout
    3. Detect compression, encryption, or checksums
    4. Recover frame structure, palettes, audio samples, or tile attributes
    5. Write a parser and validate on samples
    6. Convert parsed data into structures the new engine can consume

    Illustrative code:

    1. parse_container(bytes):
    2. header = read_header(bytes)
    3. index = read_index(bytes, header.index_offset)
    4. for entry in index:
    5. block = read_block(bytes, entry.offset, entry.size)
    6. decode(block, entry.codec)
    7. return container

    Models are strong at generating many candidate implementations and iterating on errors. They also stall on local details—retrying one constant while ignoring architecture. Humans should intervene so the work becomes “testable hypotheses,” not “guess the format.”

    A more stable approach is golden samples per format. After parsing an animation, require a fixed frame count, size, and offsets; after a map, fixed width, height, and tile count. Mismatches mean the parser is still wrong. That turns fuzzy reverse work into a regression-ready engineering task.

    4. Code generation: constraints, not free-form “write a game”

    If you only prompt “implement the game,” you often get complete-looking unmaintainable code. Define module boundaries and interfaces first.

    Example resource and game split:

    1. ResourceLoader
    2. - load_index()
    3. - load_texture()
    4. - load_animation()
    5. - load_audio()
    6. GameWorld
    7. - update(dt)
    8. - render()
    9. - handle_event(event)
    10. BattleSystem
    11. - apply_damage()
    12. - resolve_attack()
    13. - check_victory()

    With interfaces, the model owns one module at a time, which cuts context pressure and makes bad implementations replaceable.

    Require the model to:

    • Prefer compiling code over pseudocode
    • Attach a minimal test per module
    • Avoid unexplained heavy dependencies
    • Annotate sources or assumptions for key constants
    • Emit TODOs for unknown behavior instead of fake implementations

    Those rules reduce “it seems to run but cannot be maintained.”

    5. Licenses and compliance: reverse engineering is not only technical enthusiasm

    In the original experiment the model was highly sensitive to licenses and even reimplemented pieces when dependencies were incompatible. That detail matters. Legacy rebuilds often mix third-party libraries, old snippets, reference implementations, and community notes. Ignoring licenses turns a technical project into legal risk.

    A practical compliance process:

    1. Use only dependencies compatible with the project license
    2. Mark provenance of reference code
    3. Do not copy protected expression
    4. Independently implement critical algorithms
    5. Keep design notes and derivation history
    6. Set lawful-use bounds for binary reverse engineering

    For long-lived work, set license policy at init and put dependency scanning, license checks, and origin audits in CI. Models can help write code; they cannot replace compliance review.

    6. Validation: from “it compiles” to “it runs” to “behavior matches”

    The largest risk is generating a lot of code without knowing it is correct. Use layered verification.

    Layer 1: compile after each generation; catch syntax and obvious type errors.

    Layer 2: unit tests for parsers, map load, damage, pathfinding, and other pure logic.

    Layer 3: snapshot tests for render output, parse results, and state transitions; later versions must match baselines.

    Layer 4: replay verification—the same input sequence must yield the same positions, resource changes, and combat outcomes.

    Layer 5: human observation of frames, logs, and exceptions each day.

    In a cloud experiment environment, generic capabilities such as containers, object storage, logs, and alerts—on platforms including Baidu AI Cloud—can host builds, store samples, collect run logs, and raise exceptions so long automated runs stay traceable, recoverable, and auditable.

    7. Real model limits: strong at expansion, weak at last-mile rescue

    Fourteen days showed that intelligent coding tools can greatly speed legacy reconstruction, especially for:

    • Parser skeletons
    • Fixes from error logs
    • Splitting fuzzy requirements into small tasks
    • Large amounts of repetitive code
    • Tests for old logic
    • Switching among candidate implementations

    Weaknesses:

    • Dropping constraints in very large context
    • Weak long-term memory of implicit rules
    • Plausible but unverifiable implementations
    • Unstable grasp of licenses, security, and edge cases
    • Local patching in complex interactive systems

    The right role is not “replace the developer” but “high-intensity executor.” People define goals, split work, set acceptance, and make key decisions. Models produce candidates and iterate.

    8. Reusable conclusions

    Five takeaways:

    First, start with formats and data. Without resource parsing, upper logic has nothing to stand on.

    Second, LLMs work in stages, not one-shot generation of a complex system. Clearer stages raise success.

    Third, automated verification beats human reading of generated code. Tests and snapshots are the real guardrails.

    Fourth, put compliance first. Licenses, provenance, and reverse-engineering bounds belong at project start.

    Fifth, human value is problem definition and acceptance. Models write code; whether the goal is real and the result usable is still an engineering judgment.

    Having an intelligent coding tool reverse and rebuild a classic RTS is not only a technical spectacle. It previews a possible way of building software: when generation is fast enough, competitiveness shifts from typing speed to system design, verification design, and risk control. Teams that maintain old systems, rebuild internal tools, or reimplement historical software can reuse this method directly.