LLM-Assisted Modding for Classic RTS Games

    Large language models can help classic RTS modders turn design goals into testable engine changes. This article outlines a validation-driven workflow for investigating pathfinding, unit congestion, stale cell occupancy, aircraft and garrison behavior, and mode-specific AI configurations—while keeping in-game evidence, rather than model output, as the basis for decisions.

    Classic real-time strategy modders often have plenty of assets and ideas. What they lack is a practical route from “what I want to change” to a working mechanic. Base games and their expansions can differ substantially in passenger firing, garrison kill attribution, and aircraft attack logic. Sparse tutorials make those gaps harder to bridge, leaving many projects unfinished.

    AI coding tools and large language models make a workflow built around descriptions, observed behavior, and parameter comparisons more practical. They do not replace engine knowledge. Instead, they help shorten the cycle of forming hypotheses before and after reverse engineering, running controlled experiments, and fixing related defects.

    This article takes a neutral technical approach to using these tools for pathfinding, assembly-point congestion, stale cell occupancy, and mode-specific AI file switching. Every conclusion must be verified in the game, not accepted because a model states it confidently.

    Why Base-Game Mechanics Can Block Modding Goals

    Expansions often add support for passengers firing from vehicles, more granular garrison weapons and experience attribution, and more appropriate ranged attacks for airborne units. Recreating similar behavior on the base-game engine can expose structural limitations.

    Without open-topped vehicle logic, for example, a battle-fortress-style unit may become little more than an armored container with limited capacity and no passenger firing. Its practical value can fall below that of a cheap transport.

    Garrison behavior presents a different problem. An engine may switch an entire building’s primary and secondary weapons according to the first infantry unit inside it, then credit kills to the building. That can undermine the intended progression and balance of bunker-type structures. An expansion may instead resolve attacks and experience through individual garrisoned infantry and their garrison weapons.

    Aircraft can encounter similar mismatches. If airborne units all follow an airship-style bombing routine, a modder’s intended helicopter-like unit—factory-built, permanently airborne, and capable of ranged attacks—may still execute the wrong attack sequence.

    These problems cannot necessarily be solved by adjusting a few values. They require understanding how engine objects select weapons, occupy cells, and queue movement.

    For hobbyist modders, niche problems may never attract enough community attention to receive a useful answer. Assets, definitions, and plans accumulate, but an unsupported platform offers no clear implementation path. LLMs can help organize scattered experience from third-party modification tools and forum discussions into hypotheses that can be questioned and tested. Comparing base-game and expansion behavior can then narrow the scope of experiments.

    Turn Descriptions into a Testable Change List

    A useful request is not simply “make the AI stronger.” Break the work down by observable behavior instead.

    Typical tasks include:

    • Units becoming stuck in narrow passages or on bridges.
    • Large infantry groups congesting assembly points and pushing against one another.
    • Stale occupied cells causing later units to detour or preventing units from landing.
    • Internal errors triggered by particular production queues or attack orders.
    • Loading different custom AI configurations by game mode: sustained pressure in skirmish, and on-screen troop density approaching a full-strength infantry regiment in deathmatch.

    Describe each task using four elements: input conditions, visible symptoms, expected behavior, and observable metrics.

    For an exit-congestion problem, that might mean:

    • Input conditions: Issue simultaneous attack orders to an infantry group above a given size through a shared exit.
    • Visible symptoms: Exit cells fill up, while units behind them remain stationary.
    • Expected behavior: Units leave in waves or yield to one another.
    • Observable metrics: Exit throughput, time spent stuck, and pathfinding recalculation count.

    A model can suggest which object types, movement layers, occupancy flags, or script stages deserve investigation first. However, parameter meanings must be grounded in experience with the specific engine, and the behavior should be reproduced on a small test map.

    Pathfinding, Congestion, and Stale Occupancy: From Symptoms to Hypotheses

    Pathfinding improvements are often less about making units “smarter” than about reducing unnecessary occupancy.

    During continuous large-scale attacks, infantry can form deadlocked queues at rally points, chokepoints, and bridges. Possible directions to test include:

    • Increasing the spread of assembly points and the interval between attack departures.
    • Giving melee and ranged units different movement priorities.
    • Reducing how long some units retain cell occupancy near exits.
    • Clearing occupancy left behind by dead or invalid objects.

    These are investigation directions, not guaranteed fixes.

    Stale occupancy, sometimes described as “ghost cells,” can occur when a unit is removed without its cell state being reset. Later units still treat that cell as blocked. The repair approach is to locate the cell-release path at the end of the object’s lifecycle and check occupancy consistency at entry points such as production, airdrops, and unloading.

    Use logs and saved-game replays alongside these changes. A fix to one occupancy path can introduce a new internal error elsewhere.

    Aircraft and garrisons involve logic branches rather than only movement behavior. If the engine routes all aircraft that cannot land through a bombing routine, the investigation needs to distinguish weapon type, hovering support, vehicle-factory production, and attack-target filtering.

    For garrisons, establish whether kills and experience belong to the building or to individual infantry. Otherwise, the strength progression of bunker-type structures may run counter to the design.

    LLMs are useful for comparing behavioral descriptions from two sets of reference material, identifying possible branch points, and generating controlled tests. Examples include placing the same infantry group in a garrison or ordering the same aircraft group to attack ground-based anti-air units.

    They should not be treated as a source of the “one correct” internal field name. Unverified field names should not appear in technical write-ups or patches.

    Prompt Quality Sets the Limit of Assistance

    For modders, the usefulness of model assistance depends heavily on the instructions provided. A productive prompt should specify:

    • Whether the target is the base game or an expansion.
    • Whether the current approach uses configuration edits or deeper logic patches.
    • Observed behavior and reproduction steps.
    • Hypotheses already ruled out.
    • Intended differences between modes, such as sustained skirmish attacks versus high on-screen density in deathmatch.

    Ask for a hypothesis list, verification steps, and rollback conditions, rather than applying a large patch all at once.

    Interpret parameters through your own experiments. The same value can have different practical effects depending on map size, unit limits, and script timing.

    Mode-specific AI file switching is a comparatively low-risk engineering approach. A skirmish configuration can emphasize staggered waves, alternate routes, and sustained pressure. A deathmatch configuration can use higher on-screen unit limits and more aggressive assembly behavior.

    Perform the switch at the rules layer, and provide a conservative fallback configuration when a file is missing. A missing configuration should not cause an internal error as soon as the match starts.

    Validation in a Single-Player Test Environment

    Use a fixed seed where available, or keep the map and opponent scripts unchanged. Record:

    • Interruptions in the attack flow.
    • Duration of exit congestion.
    • Number of stale occupancy incidents.
    • Conditions that trigger internal errors.
    • Peak on-screen unit count.
    • Frame time.

    The goal is not to maximize unit numbers indiscriminately. Continuous attacks and passable exits must coexist.

    As infantry formations approach full strength, check whether repeated pathfinding calculations overwhelm local frame performance. Increased battlefield density is not useful if movement processing makes the game impractical to play.

    Claims that a tool or workflow has “learned reverse engineering” need to be reduced to observable results: a particular unit type behaves more like its expansion counterpart on a particular terrain type, without broadly breaking existing campaign scripts.

    Scope and Practical Recommendations

    For a personal mod, this workflow is sufficient as a working discipline: collect assets and plans, use a model to accelerate comparisons and hypothesis generation, and let in-game testing determine which changes survive.

    Do not treat model output as engine documentation. Avoid bulk changes to global movement parameters without understanding occupancy and weapon selection. Do not transplant expansion logic into the base game without testing kill and experience attribution.

    On platforms that have gone unmaintained for years, prioritize the gaps that block the design itself: passenger firing, airborne ranged attacks, garrison attribution, and pathfinding congestion. Visual assets and story work can follow once those mechanics are viable.

    The transferable lesson is a repeatable process: maintain a symptom list, run controlled comparisons, separate AI configurations by mode, and keep intelligent tools inside the validation loop—not ahead of the evidence.