3D Fighting Game Core System Design and Implementation Guide

    This guide walks through the engineering foundations of a 3D fighting game, explaining why polished showcase scenes often fail to translate into solid combat, and how to structure the system so it does. It covers a five-layer architecture, frame-data-driven character state machines, 2D collision detection within a 3D scene, the defense-throw-juggle strategy triangle, difficulty design based on decision quality rather than damage multipliers, local two-player session management, cinematic restraint, and performance verification. Readers will gain a practical, staged roadmap for building a deterministic combat core before layering presentation on top.

    1. Background: Why “Great Landing Page, Weak Actual Combat” Is the Norm

    A recurring pattern in 3D fighting game development is that character showcase pages and scene previews look excellent, yet the experience drops sharply once players enter an actual match. This is not the fault of either the art or the engineering team; it stems from the fact that the two types of systems have different technical goals.

    A showcase page is essentially “offline rendering plus preset animation.” Lighting can be baked in advance, the camera position is fixed, and high-precision animations loop with almost no real-time computation pressure. Actual combat, by contrast, is “real-time interaction plus state-driven logic.” It must complete input sampling, state transitions, collision detection, animation blending, AI inference, and render submission within a frame budget of roughly 16 milliseconds. The two scenarios differ by an entire order of magnitude in their demands on performance and determinism.

    The correct engineering order for a fighting game is therefore to build a deterministic combat core first, then layer presentation on top. Reversing that order—starting with the showcase—usually means refactoring the entire state and detection system later.

    2. Layered Architecture

    It is advisable to divide the system into five layers that communicate through well-defined interfaces, preventing animation logic and detection logic from contaminating each other.

    • Input layer: captures keyboard or gamepad input and handles debouncing, buffering, and direction normalization.
    • State layer: the character state machine, responsible for transitions among idle, walk, jump, attack, hit, block, knockdown, and so on.
    • Detection layer: intersection testing between attack boxes and hurtboxes, with frame ranges driving hit windows.
    • Presentation layer: animation blending, visual effects, camera, and audio.
    • Session layer: round management, scoring, pause, results, AI, and routing for two-player input.

    The key principle is that the detection layer reads only state and frame numbers, never the world coordinates of animation nodes. Animations can be swapped out or downgraded, but detection must remain stable.

    3. Character State Machine and Frame Data

    The feel of a fighting game comes down to the precise configuration of frame data. Each move should explicitly describe its startup frames, active frames, and recovery frames, along with whether it can be interrupted.

    1. class Move:
    2. def __init__(self, name, startup, active, recovery,
    3. damage, hitstun, blockstun, cancelable_from=None):
    4. self.name = name
    5. self.startup = startup # Startup frames; cannot hit
    6. self.active = active # Active frames; generate detection
    7. self.recovery = recovery # Recovery frames; recovery lag
    8. self.damage = damage
    9. self.hitstun = hitstun # Hitstun on contact
    10. self.blockstun = blockstun # Blockstun when guarded
    11. self.cancelable_from = cancelable_from or set()
    12. def is_active(self, frame):
    13. return self.startup <= frame < self.startup + self.active

    For state transitions, an explicit transition table is preferable to scattered if checks. A transition table is easy to edit with tooling and makes it straightforward to write automated tests that cover illegal transitions.

    4. Detection and Collision: Flattening to 2D in a 3D Scene

    Although 3D fighting games use 3D models, combat detection usually collapses onto a 2D plane: taking the character’s facing as the reference, attack boxes and hurtboxes are projected onto the same plane and tested for rectangle or capsule intersection. This preserves the 3D visuals while avoiding the jitter and unpredictability that full 3D collision introduces.

    What needs additional handling is tolerance along the depth axis (the z-axis). A common approach is to give the hurtbox a limited depth tolerance; anything beyond that tolerance counts as a miss, which gives spacing and dodging real meaning.

    1. Hit condition = frame is within the active range
    2. && attack box intersects hurtbox on the plane
    3. && depth difference <= tolerance threshold
    4. && target is not in invincibility frames

    5. Defense, Throws, and Juggle Combos

    These three form the strategy triangle of a fighting game.

    Defense needs to distinguish high attacks from low attacks, and it should introduce blockstun and pushback displacement to prevent infinite guard-hugging. A throw is essentially “a close-range check that ignores defense,” so it must be designed with a break window and a rule that a thrown character cannot immediately stand up; otherwise it becomes an infinite loop.

    Juggling and combo cancels rely on two counters: a hit counter and a combo scaling factor. Each hit increments the counter, damage decreases according to the scaling factor, and when the counter resets the character lands and enters hitstun. The cancel mechanic uses a “cancel already used” flag to limit repeated cancels of the same move, preventing infinite combos.

    6. AI Design: Three Tiers of Decision Quality, Not Three Tiers of Numbers

    A common mistake in low-quality AI is to adjust only the damage multiplier. A sound approach makes difficulty a matter of decision quality.

    • Easy tier: longer reaction delay, low probability of defending, combos that only output the first hit.
    • Standard tier: actively creates distance and can recognize and guard obvious long-range attacks.
    • Hard tier: has prediction and resource management, chooses a super move when energy is full, and actively sets up cancel opportunities.

    Structurally, use a four-step “perceive–evaluate–decide–act” flow with a configurable reaction-frame delay in the middle, so AI behavior feels human-like and remains easy to debug.

    1. def decide(self, state, difficulty):
    2. delay = {0: 12, 1: 6, 2: 2}[difficulty]
    3. if state.frame_since_perceive < delay:
    4. return None # Simulate human reaction time
    5. if state.enemy_is_attacking and difficulty >= 1:
    6. return "block"
    7. if state.energy_full and difficulty == 2:
    8. return "super"
    9. return self.policy(state)

    7. Local Two-Player and Round Session Management

    Local versus play involves no network latency, but it must still handle input focus and pause semantics. It is best to make the session layer an explicit finite state machine: character select → opening → match → round end → results. Best-of-three scoring and draw handling should be centralized in one place rather than duplicated across the codebase.

    Pause must freeze both the frame timer and the AI decision clock; otherwise detection will desynchronize after resuming. This is the detail most easily overlooked in practice.

    8. Camera and Close-Ups: Restraint in the Presentation Layer

    Close-up cameras belong to the presentation layer and must never alter detection. The correct approach is to trigger a read-only camera animation only after a super move has been confirmed to hit; character state is locked during it, and the camera returns to the standard position afterward. If camera logic feeds back into state, it undermines competitive fairness.

    9. Performance and Verification

    It is recommended to establish a frame budget table that sets an upper time limit for each module, and to write regression tests for frame data so that tuning values does not break combo and defense balance. For observability, the common practice is to integrate logging services and monitoring alerts to pinpoint sources of stutter during stress testing; asset bundles and replay recordings can be stored in object storage to make issues easier to reproduce.

    10. Evolution Roadmap

    Phase one delivers a working state machine and detection system; phase two completes the AI and the two-player session; phase three polishes camera, effects, and audio; phase four handles balance regression and performance stress testing. Leaving the showcase page for last, and using real combat data to guide art precision in reverse, is the fundamental way to avoid “great landing page, broken combat.”