Developing a Complete Combat System for 3D Fighting Games

    This article explores the architectural gap between character presentation and combat gameplay in 3D fighting game development. It details a five-layer architecture—presentation, input, logic, rules, and data—to ensure consistent frame-stepping and scalable system design. Key topics include shared character interfaces, input buffering and priority resolution, a robust combat state machine, parameterized AI difficulty scaling, and essential observability tools for local multiplayer and system regression testing.

    1. Problem Definition: The Disconnect Between Presentation and Combat Layers

    In 3D fighting game prototypes, a common issue is that characters look great on the main menu but feel significantly worse during actual matches. The root cause is rarely just an art or animation problem; rather, it is the lack of a unified abstraction between the presentation and combat layers. The presentation layer focuses solely on animation playback and camera framing, while combat requires a closed loop of input, state machines, collision, rules, AI, cinematic sequences, and result settlement. If both layers maintain separate character states and animation mappings, entering combat often leads to stiff action transitions, inconsistent input responses, uncontrollable combo windows, and missing win/loss flows.

    Therefore, the engineering goal should be clearly defined: two independent characters fighting in a rainy rooftop scene, supporting player vs. AI across three difficulty levels, local two-player versus, character selection, best-of-three rounds, block/throw/jump/dash/air-juggle/combo-cancel, directional input special moves, full-meter super specials with cinematic cameras, pausing, and match settlement. During implementation, “playability” must be decomposed into configurable, testable system capabilities rather than scattered across animation blueprints or scene scripts.

    2. Layered Architecture: Separating Presentation, Input, Logic, Rules, and Data

    A five-layer structure is recommended:

    • Presentation Layer: Handles animations, visual effects, cameras, and UI.
    • Input Layer: Manages device mapping, buffering, and combination key recognition.
    • Logic Layer: Manages the character state machine, collision, and frame data.
    • Rule Layer: Manages rounds, win/loss conditions, pausing, and settlement.
    • Data Layer: Stores character parameters, move frame data, AI difficulty parameters, and scene configurations.

    The logic layer should advance at a fixed timestep, while the presentation layer can use interpolated rendering to prevent frame rate fluctuations from affecting combat hit registration.

    1. tick(dt):
    2. input = inputLayer.sample(buffer)
    3. for fighter in fighters:
    4. fighter.logic = stateMachine.update(fighter, input, frameData)
    5. combat.resolveHits(fighters)
    6. rule.updateRound(fighters)
    7. presentation.sync(fighters, alpha)

    A fixed timestep is the foundation of consistent game feel in fighting games. The presentation layer only reads snapshots from the logic layer and does not reverse-modify hit registration results. Camera close-ups, hit effects, and screen shakes should all be subscribed to as presentation events, preventing cinematic logic from breaking combat rules.

    3. Character and Scene Asset Standards: Shared Interfaces and Differential Configurations

    Two independent characters should not duplicate two sets of combat code. A unified character interface should be defined: bone sockets, attack/hitboxes, animation state mappings, move tables, energy resources, and hit feedback configurations. Character differences are expressed through data configuration, such as movement speed, jump height, move frame data, special move directional sequences, and cinematic assets. This ensures that adding a new character only requires extending configurations and assets, without modifying the core state machine.

    The rainy rooftop scene requires careful control over lighting, reflections, rain effects, and VFX budgets. Scene collision volumes should be separated from the combat plane: combat logic relies only on a simplified ground and boundaries, meaning visual details do not affect hit registration. Character hitboxes and attack boxes should be visualized in debug mode to ensure animation presentation aligns with hitbox ranges.

    4. Input and Game Feel: Buffering, Priority, and Combination Recognition

    The core of game feel is “whether input is correctly understood.” It is recommended to use a circular input buffer storing directions and button timestamps to support pre-inputting, combo cancel windows, and directional combination recognition. Block, throw, jump, dash, normal attack, special move, and super special move require explicit priority and conflict resolution rules to avoid random outcomes during simultaneous inputs.

    1. command = recognize(buffer, window):
    2. if energy.full and matchSequence(buffer, superMotion): return SUPER
    3. if matchSequence(buffer, specialMotion): return SPECIAL
    4. if nearOpponent and press(THROW): return THROW
    5. if press(DASH): return DASH
    6. if hold(BACK): return BLOCK
    7. return NORMAL

    Directional sequence recognition for special moves should be based on time windows and fault-tolerant directions, rather than requiring frame-perfect precision. Combo cancels need to read the cancel window from the move’s frame data, allowing transitions to specified states only after a hit or block is confirmed. Input buffer length and window parameters should be configurable to facilitate tuning across different characters and difficulties.

    5. Combat State Machine and Rule Loop

    The character state machine should be divided into sub-states such as ground, air, hit-stunned, blocking, throw, special move, and cinematic lock. Each state contains entry conditions, exit conditions, cancelable move sets, and animation mappings. States like air juggle, knockdown, and wake-up invincibility must coordinate with hitboxes and collision layers to prevent repeated hits or infinite combos.

    The rule layer maintains round states: intro, fighting, round end, match end, and paused. Best-of-three should be an independent rule configuration, supporting KO, time over, draw handling, and rematches. Pausing must distinguish between “logic pause” and “presentation pause”: logic pause freezes input and state advancement, while presentation pause only halts cameras or effects and should not alter hit registration.

    1. roundState:
    2. intro -> fighting -> roundEnd -> nextRound
    3. fighting -> matchEnd when wins == 2
    4. any -> paused on pauseEvent

    Win/loss settlement should display the winner, round scores, key statistics, and a rematch entry point. The settlement UI only reads results from the rule layer and does not recalculate combat logic.

    6. AI Difficulty Design: Parameterization Over Input Reading Cheats

    The three difficulty levels for player vs. AI should be implemented using explainable parameters: reaction delay, decision cycle, block probability, combo length, pursuit tendency, and special move usage frequency. The easy level reduces continuous pressure and hit-confirm capabilities; the standard level features basic blocking and combos; the hard level improves punish confirms and resource utilization, but should not directly read player inputs or force hits. AI makes decisions based on visible states and historical behavior using behavior trees or utility scoring.

    AI regression testing should fix random seeds, recording win rates, average round duration, and abnormal states for each difficulty level to avoid tuning-induced difficulty cliffs. Difficulty parameters should be separated from character move tables so the same AI can adapt to different characters.

    7. Local Multiplayer, Cinematic Sequences, and Observability

    Local two-player mode requires handling device assignment, shared screen camera, UI mirroring, and pause menus. Both characters share the same logic clock, and input device mappings are determined before the match starts. Cinematic sequences for special and super special moves should separate logic from presentation: the logic layer locks input and advances the cinematic timer, while the presentation layer plays cameras, effects, and close-ups; after the sequence ends, the game returns to a predefined state. Full-meter super specials must validate resources, hit conditions, and sequence interruption rules.

    Observability includes state transition logs, input buffer snapshots, hitbox visualization, frame rate and input latency sampling, and abnormal state alerts. Testing should cover at least the state transition table, combination inputs, boundary collisions, best-of-three settlement, pause/resume, and two-player device switching. Through configuration and automated regression, teams can maintain stable combat experiences when expanding characters and scenes.