Core Combat System Design and Implementation for 3D Fighting Games
This article explains how to design and implement the core combat systems of a 3D fighting game, focusing on system architecture rather than visuals. It covers separating character data from presentation, organizing match state machines, building a frame-driven hit detection pipeline, structuring AI difficulty tiers, handling local multiplayer input, and tuning performance and gameplay consistency. Readers will find practical engineering patterns, sample configuration structures, and a checklist for maintaining stable and reproducible combat behavior.
1. Introduction: Why the Challenge Is the System, Not the Graphics
In 3D fighting games, there is often a clear gap between the impression created on the main menu and the actual experience once a match begins. The cause is usually not rendering quality but the completeness of the combat system: whether state transitions are rigorous, whether hit detection is stable, whether inputs are buffered correctly, and whether the AI is readable. Using a neutralized “warship” theme as the setting, this article abstracts a general implementation framework and discusses how to decouple the presentation layer from the combat layer through engineering methods while preserving playability.
2. Organizing Character and Stage Resources
2.1 Separating Character Data from Presentation
It is recommended to split a character into three data sets: skeleton and mesh assets, animation assets, and numerical configuration. The numerical configuration includes health, movement speed, hit stun duration, and the startup, active, and recovery frames plus damage multipliers for each move. Externalizing these values into a configuration table allows characters to be balanced without changing code.
Example configuration structure:
{"character_id": "hero_a","hp": 1000,"walk_speed": 4.2,"moves": {"punch": {"startup": 4, "active": 3, "recovery": 8, "damage": 40, "hitstun": 14},"kick": {"startup": 7, "active": 4, "recovery": 12, "damage": 70, "hitstun": 18}}}
2.2 Stage and Lighting
For a rainy rooftop stage, the focus is balancing atmosphere with readability: overly strong reflections and particles can obscure hit feedback. It is advisable to define a consistent exposure range for the stage and to separate ground collision from visual decoration so that decorative meshes do not participate in physics calculations.
3. Match State Machine: Define What Cannot Be Done and When
The core of the fighting experience is clear constraints. A usable match state machine should include at least: intro, normal combat, pause, cinematic sequence, and win/loss resolution.
MATCH -> INTRO -> FIGHT <-> PAUSEFIGHT -> FINISH -> RESULT -> MATCH
The key points are: pause must freeze frame counters and input buffers; during cinematic sequences, both players’ inputs should be blocked while already-triggered hit resolutions continue, preventing the visual issue of “losing health during a cutscene.”
4. Combat Hit Detection Pipeline
4.1 Frame-Driven Three-Phase Detection
Each move is divided into startup frames, active frames, and recovery frames. An attack hitbox is generated only during active frames and tested for intersection with the opponent’s hurtbox. To prevent fast attacks from passing through, continuous detection should be performed during active frames rather than checking a single frame position.
4.2 Hit and Counter Relationships
A common approach is to distinguish high, mid, and low attacks and their corresponding defensive stances, and to introduce the rule that throws cannot be blocked by ordinary defense. A successful block leads to a brief stun, creating a rhythm of transitions between offense and defense.
4.3 Juggle, Combos, and Cancel Windows
The juggle state requires independent gravity and landing recovery parameters. Combos depend on a “cancel window”: after a move connects, a limited frame range opens during which specific moves can interrupt the current recovery. Too wide a window leads to infinite combos, while too narrow a window makes controls feel stiff. It is recommended to make this an adjustable parameter measured in frames and to support it with automated regression tests.
5. Implementing Layered AI Difficulty
Three difficulty tiers should reflect behavioral strategy differences, not just numerical scaling:
- Easy: high reaction delay, low blocking probability, limited combo length;
- Standard: basic blocking and counterattacks, uses one- to two-hit combos;
- Hard: introduces spacing control, throw-based guard breaks, and use of cancel windows.
For implementation, a three-layer “perception-decision-execution” structure can be used: the perception layer samples distance and opponent state; the decision layer outputs intent via a finite state machine or behavior tree; the execution layer converts intent into virtual inputs that go through the same pipeline as human input, ensuring consistency and easing debugging.
6. Local Two-Player Mode and Input Handling
Local versus play requires handling input timing and device contention. It is recommended to maintain a separate input buffer queue for each player, measured in frames (for example, 3 to 5 frames), and to sample uniformly before hit detection begins to avoid unfairness caused by key press order. Character selection and best-of-three rounds belong to the match format layer and should be decoupled from the combat layer, driven by an upper-level manager that handles scene transitions and score tracking.
7. Performance and Experience Tuning Checklist
- Decouple hit detection calculation from rendering frame rate, and use a fixed logic step to ensure reproducible detection;
- Provide tiered toggles for visual features such as particles and reflections, prioritizing frame stability on low-end devices;
- Build frame data tables and regression cases for each balance change;
- Log key state changes to help diagnose issues such as “lost detection” or “swallowed inputs.”
8. Conclusion
The quality of a 3D fighting game depends on whether system constraints are internally consistent. Implementing resources, state machines, hit detection, AI, and input in layers, supported by configuration and a fixed timestep, is what delivers a stable match experience beyond visual presentation.
