3D Fighting Game Engine Architecture and Practical Implementation
This article explains why 3D fighting games often look impressive on the main menu but feel weaker in actual combat, and how to fix it through engineering structure. It covers separating the showcase and combat pipelines, structuring character assets into skeleton/animation, logic, and presentation layers, decoupling stage collision data from visual assets, and building combat around frame data and state machines. It also details the block-throw-guard break triangle, juggle and cancel windows, tiered AI design based on intent generation, local two-player synchronization, event-driven camera work, and engineering practices such as split logic/render frame rates, hot reload, replayable logs, and performance budgets.
1. Problem: Why the Main Menu Looks Great but the Fight Feels Off
In 3D fighting game development, a common pattern is that the character showcase and stage atmosphere on the main menu look excellent, but the experience drops noticeably once actual combat begins. The cause is usually not the art, but the engineering structure.
The main menu is a controlled scene: characters only need to play fixed animations, camera paths can be designed in advance, and lighting and post-processing can be tuned repeatedly. Combat is a real-time interactive scene that must handle input, state transitions, collision detection, animation blending, AI decisions, and camera following all at once. Any jitter in any of these is felt directly by the player.
The right approach is to split the project into two separate pipelines that share resources:
- Showcase pipeline: high-fidelity rendering, fixed camera, offline baked lighting;
- Combat pipeline: deterministic logic, predictable frame cost, replayable states.
The two pipelines share character assets and materials, but rendering budgets and update rates must be managed separately.
2. Characters and Stages: From “Good-Looking” to “Playable”
2.1 Three-Layer Character Structure
Split each character into three layers to avoid coupling logic with presentation:
- Skeleton and animation layer: handles animation playback, bone blending, and IK correction;
- Logic layer: handles position, velocity, state, energy, and hit flags;
- Presentation layer: handles materials, effects, decals, and close-up camera triggers.
The logic layer does not hold direct references to render objects; it only exposes state and events. This makes it directly reusable for replays, network synchronization, and AI simulation.
2.2 Making the Stage “Judgeable”
A stage like a rainy rooftop has plenty of reflections and particles visually, but combat only needs a small amount of key information: ground height, boundary walls, breakables, and light direction. Maintain a separate “collision stage description” decoupled from the visual assets:
StageCollision:ground_height: 0.0bounds: {min_x: -6.0, max_x: 6.0}walls: [ {x: -6.0, normal: +1}, {x: 6.0, normal: -1} ]breakables: [ {id: 1, hp: 30} ]
This way, rain streaks, puddle reflections, and neon flicker can be swapped freely without affecting combat detection.
3. Combat Core: State Machines and Frame Data
A fighting game is essentially a deterministic state transition system. The core is not animation, but frame data.
3.1 State Machine Design
Each character needs at least these states: idle, walk, jump, crouch, guard, hit, airborne, knockdown, wake-up, throw, special, super, and guard break. State transitions must be driven by logic frames, not animation events; otherwise detection will drift at different frame rates.
if state == IDLE and input.attack == PRESS:enter(ATTACK, startup=6, active=3, recovery=12)
The startup/active/recovery phases are the design core: startup frames decide who wins the exchange, active frames decide hit range, and recovery frames decide risk.
3.2 The Guard, Throw, and Guard Break Triangle
- Guard: hold back continuously to enter guard state, taking reduced damage and pushback;
- Throw: close range, ignores guard, but has long startup and can be avoided by jumping;
- Guard break: continuous guarding drains the guard gauge, causing stun and forming an offense-defense loop.
Together these form the minimum playable mind-game loop. Missing any one of them degrades combat into a single optimal solution.
3.3 Juggle and Combo Cancels
Juggling requires tracking a “juggle count” and “gravity decay” to prevent infinite combos. Combo cancels rely on a “cancel window” flag: only within specific frames after a hit can follow-up skills interrupt the current recovery.
on_hit(target):target.airborne = truetarget.air_frames += 1attacker.cancel_window = [hit_frame, hit_frame + 8]
4. AI Difficulty: Three Tiers, Not Just Bigger Numbers
A common mistake with low-quality AI is only scaling damage and health. A better approach is layering:
- Easy: only basic attacks and guard, 200-300ms reaction delay, no combo cancels;
- Standard: uses directional special moves, about 100ms reaction, occasionally dashes in proactively;
- Hard: reads input, pre-inputs guard, links specials inside cancel windows, and manages energy.
The recommended implementation is to make the AI an “intent generator” that outputs the same virtual input as the player, ensuring AI and player go through exactly the same detection pipeline and avoiding “AI-only rules.”
AIIntent:move: -1|0|1guard: boolattack: none|light|special|superjump: bool
5. Local Two-Player and Synchronization
Local two-player does not need network synchronization, but input sampling must still be consistent. Advance with a fixed logic step (such as 60Hz) and interpolate for rendering. Keep 2-3 frames of input buffer for throw and special move leniency.
A best-of-three match format is managed by a “match controller” decoupled from character logic: it only handles round switching, countdown, win/loss detection, and reset.
6. Camera and Presentation Layer
Close-up cameras must be event-triggered, not computed every frame: super hit, KO, and round start each trigger once. During these moments logic continues but input is temporarily blocked to prevent accidental player actions. The camera uses damped follow and slight shake, and shake amplitude must be configurable to accommodate different players’ comfort.
7. Engineering Recommendations
- Split logic and rendering frames: fixed step for logic, variable frame rate for rendering;
- Asset hot reload: animation and frame data tables support runtime changes;
- Replayable logs: record per-frame input and state to resolve detection disputes;
- Performance budget: set caps for particles, reflections, and post-processing, and automatically downgrade effects when combat frame cost exceeds target.
8. Conclusion
The experience gap in 3D fighting projects almost always comes from mixing “showcase thinking” with “interaction thinking.” Making frame data, state machines, collision stages, and AI intent into independent and deterministic systems, then letting rendering and camera express freely on top of them, preserves the visual impact of the main menu while giving combat real depth. If you later need replays, leaderboards, or multiplayer expansion, you can build on common cloud capabilities such as container platforms, object storage, and log monitoring, keeping the logic layer unchanged for smooth evolution.
