Real-Time Rendering and Combat Logic Design for 3D Fighting Games

    This article breaks down the engineering architecture behind a 3D fighting game prototype, covering a three-layer separation of presentation, logic, and data, frame-based move configuration, a finite state machine with a unified hit detection pipeline, tiered AI design, local two-player and match flow management, camera and effects budgeting, and automated testing for measurable game feel. It explains how decoupling rendering from combat logic keeps hit detection deterministic and resolves the common problem of a polished menu paired with a degraded in-match experience.

    1. Introduction: Why Fighting Games Are a Stress Test for Real-Time Systems

    In interactive entertainment engineering, 3D fighting games have long been considered one of the most technically dense genres. They require skeletal animation blending, physics collision detection, input sampling, state transitions, camera direction, and UI feedback to complete within a single frame budget. Any jitter in that chain directly undermines the player’s intuitive sense of “hit feel.” A common pattern in source material illustrates the structural conflict the industry faces: the character showcase on the home screen looks excellent, but the experience degrades noticeably once a match starts. The root cause is that the presentation layer is coupled too tightly with the logic layer.

    Setting aside any specific product, this article frames the topic as a general engineering problem: how to use clear architectural layering to build a 3D fighting prototype with character selection, stage rendering, an AI opponent, local two-player play, a multi-round match format, and complete combat mechanics.

    2. Overall Architecture: Three-Layer Decoupling as the Basis for Stability

    Split the system into a presentation layer, a logic layer, and a data layer, with explicit interfaces between them.

    • Presentation layer: owns models, materials, lighting, particles, camera, and UI. It only reads state snapshots produced by the logic layer.
    • Logic layer: advances on a fixed timestep, handling input, state machines, collision, and hit resolution. It does not depend on the render frame rate.
    • Data layer: describes character attributes, move frame data, stage parameters, and AI weights through configuration.

    A representative structure:

    1. GameLoop
    2. ├─ Input sampling (keyboard / gamepad / touch)
    3. ├─ LogicStep (fixed 1/60s)
    4. │ ├─ State machine update
    5. │ ├─ Collision and hit detection
    6. │ ├─ AI decisions (frequency scaled by difficulty)
    7. │ └─ Resource and energy calculation
    8. ├─ RenderFrame (variable frame rate, interpolated)
    9. └─ UI/HUD refresh

    The main benefit is isolation. When visuals look poor, the render pipeline can be optimized independently without touching combat resolution. Conversely, tuning frame data does not trigger a cascade of rework on visual assets.

    3. Characters and Stages: Asset Conventions Set the Ceiling

    Strong home screen presentation with weak in-match presentation usually points to missing asset conventions. Establish a shared contract in the data layer:

    1. Character dimension: height baseline, bone naming convention, rig hierarchy, animation naming (idle / forward step / back step / jump / hit reaction / knockdown / wake-up / victory / defeat).
    2. Move dimension: each move described in frames, covering startup, active, and recovery frames, hitbox position and size, hitstun, blockstun, and cancel windows.
    3. Stage dimension: ground height, boundary range, lighting presets, and a particle budget cap for weather effects such as rain at night.

    Example frame data configuration:

    1. {
    2. "move_id": "special_uppercut",
    3. "startup": 4,
    4. "active": 3,
    5. "recovery": 18,
    6. "hitbox": {"x": 0.6, "y": 1.2, "w": 0.9, "h": 1.6},
    7. "damage": 90,
    8. "hitstun": 22,
    9. "blockstun": 12,
    10. "cancel_window": [7, 14],
    11. "energy_gain": 8
    12. }

    Once numbers are separated from logic, balance tuning becomes pure data work, so designers and engineers can move forward in parallel.

    4. Combat Core: State Machine and Detection Pipeline

    The “solid” feel of a fighting game comes from deterministic hit resolution. Use an explicit finite state machine together with a unified detection pipeline:

    • States: idle, movement, jump, attack, hit reaction, guard, throw, knockdown, wake-up, super move cinematic.
    • Guard mechanics: distinguish high / low / mid attacks. The defender enters blockstun rather than hitstun, with a small amount of guard-crush feedback preserved.
    • Throws: cannot be blocked by a normal guard, but have a throw-break window and a distance limit.
    • Juggle and combos: a hit writes a juggle flag and temporarily adjusts gravity parameters. Combo cancels depend on cancel windows and move tag matching.
    • Dash: provides invincibility frames of limited duration or a displacement acceleration curve, preventing infinite rushing.

    Pseudocode for resolution order:

    1. def logic_step(state, inputs, world):
    2. state.consume_buffer(inputs) # Input buffer, tolerant of frame delay
    3. state.update_timers()
    4. if state.can_cancel():
    5. state.try_cancel()
    6. hits = world.collect_hitboxes(state)
    7. resolve(hits, state) # Priority: throw > super > normal
    8. state.apply_physics(world.bounds)
    9. state.update_energy()

    An input buffer, typically 3 to 6 frames, is a key detail for game feel. It absorbs dropped inputs caused by network or frame jitter.

    5. AI Opponent: Explainable Design Across Three Difficulty Tiers

    AI should not simply mean “bigger numbers.” It should be a layered decision policy:

    • Easy: low decision frequency, high reaction delay, low guard probability, basic combo segments only.
    • Standard: adds distance management and randomized guarding, and can complete two- or three-hit combos.
    • Hard: higher decision frequency, plus opponent habit modeling, move startup counterplay, and optimized cancel timing.

    A practical implementation combines utility scoring with a behavior tree. The behavior tree handles macro strategy (attack / defend / create distance), while the utility function scores candidate moves.

    1. score(move) = w1*hit expectation + w2*safety - w3*counter risk + w4*energy gain

    All weights are externalized as configuration, making it easy to switch by difficulty and run automated balance tests.

    6. Local Two-Player, Match Format, and a Complete Flow Loop

    Local two-player play requires input isolation and focus management: maintain separate input mappings and buffer queues for each player to avoid key conflicts. Drive the match format with a state checklist:

    1. Character select (including random and mirror match handling)
    2. Stage confirmation
    3. Round start (countdown and a non-interactive window)
    4. Round end (win/loss resolution, draw handling)
    5. Best-of-three settlement, then rematch or return to the home screen

    Pause must freeze both the logic step and the audio clock while keeping rendering alive to hold the frame. On resume, reset the input buffer to prevent “stuck key” artifacts.

    7. Camera and Presentation: Spend the Budget on Key Frames

    Super move close-ups, hit freeze frames, screen shake, and rainy-night atmosphere are presentation-layer enhancements. Engineering recommendations:

    • Give supers a dedicated camera track, decoupled from logic time and blended with interpolation.
    • Introduce a very short freeze (about 2 to 4 frames) on hit to strengthen impact feedback.
    • Set tiered budgets for particles and post-processing, with automatic downgrade on low-end devices.
    • Use a reusable particle pool for weather effects to avoid stutter from frequent creation and destruction.

    8. Testing and Tuning: Making Game Feel Measurable

    Set up three kinds of automated validation: frame data regression tests (数值 changes must not break combos), AI win-rate statistics (to verify the difficulty curve), and input latency benchmarks. Combined with logging services and monitoring alerts, this makes it possible to locate stutter and detection anomalies during the test phase. If the prototype needs cloud distribution or save synchronization, a general combination of cloud capabilities works: object storage for asset packages, a container platform to host match services, and a message queue for asynchronous tasks.

    9. Conclusion

    The quality gap between 3D fighting games usually lies not in the number of effects but in whether the architecture lets presentation and logic evolve independently. With a fixed-timestep logic core, configuration-driven frame data, layered AI, and a clear flow state machine as the skeleton, even a small team can build a fighting prototype with solid hit feel that is extensible and easy to tune, and fully resolve the familiar “stunning menu, failing match” problem.