Building a Combat System for a 3D Fighting Game Prototype: Lessons from the Warship Project
This article breaks down the core technical and design challenges behind "Warship," a 3D fighting game prototype focused on high-fidelity character presentation. It identifies the root cause of common combat experience issues—typically a disconnect between showcase assets and real-time battle logic—and offers a structured approach to building a unified combat framework. The discussion covers asset pipeline standardization, finite state machines for character behavior, input buffering, attack and defense rules, tiered AI difficulty design, and local versus AI flow control, along with performance and testing considerations for consistent gameplay.
The Core Issue: Divergence Between Showcase and Combat States
The “Warship” project performed well during the character showcase phase. Two anime-style 3D characters displayed a high degree of visual completion under static presentation, idle animations, and basic lighting. However, players experienced a significant drop-off in quality when the actual battle began. This is a common pitfall in 3D fighting game prototypes. It is rarely a single art or programming fault, but rather a failure to integrate showcase asset specifications, combat state constraints, input response chains, camera and effect feedback, and AI behavior design into a unified loop.
Showcase pages prioritize “first-glance quality,” often allowing for higher-poly models, complex materials, and longer idle animations. The combat state, conversely, demands stable frame rates, clear collision detection, low-latency input, seamless animation transitions, and strong feedback. When these two pipelines are developed independently, typical problems arise:
- Combat models differ from showcase models in proportion, skeleton, or materials, reducing visual quality in battle.
- Animation transitions lack finite state machine (FSM) constraints, leading to animation pops, sliding, or abnormal floating states.
- Input handling is tightly coupled with animation playback, resulting in unstable button responses and poor combo feel.
- Cameras jump erratically during dashes, jumps, or super moves, disrupting spatial awareness.
- AI performs fixed actions at fixed distances, with little discernible difference between Easy, Normal, and Hard difficulties.
- Settlement, pause, and win/loss flows lack unified state management, creating numerous edge cases.
Therefore, the focus of improvement should not be merely “adding characters” or “adding moves.” The prototype must be refactored into a data-driven, state-clear, tunable, and testable fighting game framework.
Asset and Scene Pipeline: Making Showcase Characters Combat-Ready
The two characters in the homepage showcase performed well, indicating a baseline level of art asset quality. Poor combat performance points to a need to review the asset pipeline’s transition from “showcase state” to “combat state.” A unified asset specification for each character is recommended:
- Model and Skeleton Specifications: Combat models require defined polygon budgets, bone counts, naming conventions, and root bone movement strategies. Showcase models can be high-precision, but combat models should have an independent LOD strategy to avoid performance pressure from directly reusing showcase assets.
- Material Layering: Character materials should be categorized into layers such as base color, normal maps, emission, and outlines. Non-essential effects can be disabled during combat to maintain character readability in the rain-soaked rooftop environment.
- Animation Compression and Segmentation: Animations (idle, movement, jump, dash, guard, attack, hit, air hit, down, special) should use a unified frame rate and event markers. Animation events should trigger hit detection, effects, audio, and state transitions, rather than hardcoding time points in code.
- Unified Lighting: The rain-soaked rooftop stage must balance atmosphere with character recognition. It is best to configure the key light, rim light, ambient reflections, and ground water reflections separately to prevent characters from losing their silhouette in dark areas.
For the scene itself, the battle logic should rely only on simplified collision volumes and boundaries, not the high-precision stage mesh. Stage boundaries, wall positions, maximum floating height, and camera movement limits should be configurable data, facilitating future stage expansion.
Combat Core: State Machines and Input Buffering
The essence of good fighting game feel is “stable input recognition and correct state transitions.” The character behavior should be abstracted as a finite state machine, including at minimum: IDLE, WALK, DASH, JUMP, GUARD, ATTACK, HIT, AIR_HIT, DOWN, SPECIAL, SUPER, WIN, LOSE. Each state should have clear entry conditions, exit conditions, cancellation windows, and animation events.
Pseudo-code representation:
State definitions:IDLE, WALK, DASH, JUMP, GUARD, ATTACK, HIT, AIR_HIT, DOWN, SPECIAL, SUPER, WIN, LOSEPer-frame processing:Read input bufferIf current state allows turning/guarding/jumping/dashing:Switch state based on direction and button combinationsIf current state is within an attack cancellation window:Check for special move inputs or combo cancel conditionsExecute current state logicHandle animation events: hit detection, effects, audio, state transitions
The input system should adopt input buffering and command buffering. When a player presses a button near the end of an animation, the system retains that input for a short window and immediately consumes it when the state allows. Special move commands (e.g., “down, forward, attack” or “forward, down, forward, attack”) require a short history of directional inputs, with the command window and tolerance defined in a configuration table. This prevents special moves from failing due to frame rate fluctuations.
Input processing should be decoupled from rendering. Fixed logical frames handle judgment and state progression, while rendering frames handle interpolated visuals. Pausing should freeze logical frames but keep UI responsive. Settlement flows should stop battle input, retaining only confirmation actions.
Offense and Defense Rules: Guard, Throws, Jumps, Dashes, and Aerial Combos
Core offense and defense rules define the lower limit of game feel. Guard should be differentiated into standing guard, crouching guard, and aerial guard, with clear definitions for guard stun, guard break conditions, and throw immunity. Throws need independent hit detection ranges and start-up frames to avoid sharing collision logic with normal attacks. Jumps and dashes should be configured with initial velocity, gravity, air control coefficients, and landing stun to avoid “floaty” or “slippery” movement.
Floating and combo cancellation are key to gameplay depth. Assign hit results into types such as ground hit, airborne hit, knockback, and downed. Balance these with “combo count,” “damage scaling,” and “cancel windows.” Combo cancellation should not be unconditional; it should only be allowed when:
- The current move is within a specified cancel window.
- The move has hit or has been guarded.
- The target is in a hittable state.
- Required energy or resources are available.
- The combo count does not exceed a defined limit.
Directional special moves and full-meter super moves should share the same command parsing layer but have independent presentation layers. A super move can trigger a brief cutscene: lock positions, switch cameras, play character close-ups and effects, and then return to the combat camera. Logic judgment can be paused or simplified during this cinematic; it must be fully restored afterwards to prevent state persistence issues.
AI Difficulty: Three Tiers Differentiated by Decision-Making, Not Stat Stacking
Single-player AI should support Easy, Normal, and Hard modes. Simply raising attack power or reaction speed makes the experience feel mechanical. Difficulty should be distinguished across four dimensions: perception, decision-making, execution, and error tolerance:
- Easy: Small perception range, larger reaction delay, fewer combos and special moves, and more random guard decisions.
- Normal: Recognizes mid-range threats, uses guards, throws, and basic combos, with a cooldown on special moves.
- Hard: Exhibits stable punishes and combo cancellation, adjusts distance and attack rhythm based on player habits, yet still leaves readable openings for counterplay.
Pseudo-code configuration example:
AI Configuration:Easy: reaction window = large, guard probability = low, combo length = short, special cooldown = longNormal: reaction window = medium, guard probability = medium, combo length = medium, special cooldown = mediumHard: reaction window = small, guard probability = high, combo length = long, special cooldown = short
AI should not cheat by reading the player’s internal state. It should make approximate decisions based on visible, observable information. The Hard difficulty should demonstrate strength through faster simulated inputs and better option selection, not through unconditional prediction.
Local Versus, Character Select, and Flow Closure
Local versus play requires unified input device mapping and player index management. The character select screen should display character attributes, control tips, and confirmation states. The battle flow should use a clear state machine: character select, loading, round start, battle, round end, match result, rematch or return. For a “best of three” format, edge cases such as double K.O., time over, or both players down simultaneously need handling.
The pause function should save a snapshot of the current battle logic or at least freeze the logic frames and block battle input. Input buffers should be recalibrated upon resume to prevent button presses during the pause from being misread. The match result screen should display the winner, round scores, key action statistics, and a rematch prompt. All UI states should be driven by the flow state machine.
Performance and Testing: Ensuring Consistency Through Observability
Combat performance optimization should focus on stable frame rates, input latency, and presentation consistency. It is recommended to build a debug panel that displays, in real-time, logical frame rate, render frame rate, character state, current animation, hit detection boxes, input buffer contents, and AI decisions. For the rain-soaked rooftop scene, pay attention to performance fluctuations when rain effects, reflections, semi-transparent effects, and super-move cutscenes are layered simultaneously.
The test checklist should include: all state transition boundaries, guard and throw priority, jump landing stun, dash cancellation, damage scaling in aerial combos, special move command tolerance, super-move camera restoration, pause and resume, “best of three” match settlement, and simultaneous input conflicts for both players. Only by translating the showcase’s high-quality presentation into a stable, reproducible asset, state, and feedback pipeline for combat can the “Warship” project evolve from a character presentation prototype into a 3D fighting game prototype with a complete combat experience.
