AI-Generated 3D Fighting Game Character Performance Optimization for Dynamic Battles
This article explains why AI-generated 3D fighting game characters often look good on the character select screen but lose frame rate and gain input latency once a battle starts. It compares static display with dynamic battle workloads, ranks the main performance bottlenecks by impact, and describes LOD, skeleton simplification, and hitbox separation as optimization methods. It also covers cloud rendering trade-offs, acceptance metrics, and a troubleshooting order for measuring results.
AI-generated 3D fighting game characters usually look impressive on the character select screen. Once a battle begins, however, frame rate drops and input latency become noticeable. This article first explains the differences between the two scenarios, then ranks the performance bottlenecks by their impact, and finally presents optimization methods that can be measured and verified.
1. Differences Between Static Display and Dynamic Battle
In the static display stage, the camera view is fixed or limited in range, so the engine’s workload is small. Frustum culling skips objects outside the view. It only checks whether an object is inside the frustum. Backface culling is a separate technique that skips triangles facing away from the camera. The two techniques cannot replace each other. AI-generated models are mostly closed meshes, so backface culling is usually enabled by default. If a material is set to double-sided rendering, the back faces of hair and cloth are also drawn, which increases rendering cost.
The static screen still uses real-time rendering. Its load is low because the scene is simple, few objects are on screen, the character plays only an idle animation, and there is almost no physics calculation per frame.
Once a battle starts, all load conditions change. Players can rotate the camera freely. Character movement, jumps, and skills drive skeletal animation, while hit reactions and effects appear at the same time. Model polygon counts, cloth simulation, and collision calculations that were previously ignored now fall within the per-frame budget.
2. Performance Bottlenecks and Their Ranking
Ranked by their impact on frame time, from largest to smallest, the bottlenecks are dynamic bones and physics, collision detection, and memory and VRAM scheduling. Before optimizing, use a profiling tool to confirm the time spent on each item instead of relying on experience.
1. Dynamic Bones and Physics Simulation
Long hair and skirts are usually driven by cloth or soft-body simulation. On the static screen, this motion can be baked into animation. In battle, it must be solved every frame. In Unity, you can check the time spent by cloth components and physics simulation on the CPU timeline of the Profiler. If this part takes noticeably more main-thread time than other modules, it is the first optimization target.
2. Collision Detection
Fighting game hit detection is based on rectangular boxes in the logic layer. Most AI-generated models have no simplified colliders designed for collision. If mesh colliders are used directly, the computation cost grows quickly.
A naive pairwise comparison grows with the square of the number of objects. For example, with 30 hitboxes on screen, 30 × 29 ÷ 2 = 435 pairs must be compared. With 100 objects, the number of pairs rises to 4,950. This cost is acceptable for battles with few characters and few effects. However, when many skill effects and projectiles appear at the same time, it becomes a clear bottleneck. Before adopting spatial partitioning, count the comparisons per frame and measure how long the collision system takes.
3. Memory and VRAM Scheduling
This item covers two kinds of problems that should be investigated separately.
Garbage collection on the managed heap causes pauses when too many objects are allocated, appearing as periodic stutters. VRAM fragmentation relates to how textures and buffers are allocated. Driver-level behavior varies widely and is hard to observe directly. It usually appears as sudden frame drops during resource loading.
Check the following items:
- Use object pools for effects and hit sparks instead of instantiating new objects for every move.
- Preload the character’s commonly used animation clips when the scene loads.
- Load skill assets asynchronously so that loading does not block the main thread.
- Avoid creating temporary objects and string concatenation in Update.
- Measure GC.Alloc during battle in the Profiler, and set an upper limit on allocation per frame.
3. Core Optimization Methods
1. Model LOD and Material Downgrading
Multi-level LOD (Level of Detail) lets a character use lower-precision models when it is far away or less important on screen. The example below is based on Unity 2021.3 LTS, with three LOD levels already configured in the LODGroup. The distance thresholds are only starting points. Adjust them after testing on target devices. The example uses distance to select the level. By default, LODGroup selects levels based on screen coverage. If you want the selection to stay consistent with the camera’s focal length, you can use screen coverage instead. ForceLOD overrides the engine’s automatic selection, so the switching logic must fully control every state.
using UnityEngine;// Attach to the character root node. Configure three LOD levels in the LODGroup.public class CharacterLodController : MonoBehaviour{[SerializeField] private LODGroup lodGroup;[SerializeField] private Camera battleCamera;[SerializeField] private float nearDistance = 10f; // Unit: meters. Measure on target devices.[SerializeField] private float farDistance = 30f; // Unit: meters. Measure on target devices.[SerializeField] private float hysteresis = 1.5f; // Hysteresis band for switching, to prevent flickering at boundariesprivate int currentLod = 0;private void Awake(){if (lodGroup == null) lodGroup = GetComponent<LODGroup>();if (battleCamera == null) battleCamera = Camera.main;}private void LateUpdate(){float distance = Vector3.Distance(battleCamera.transform.position, transform.position);int next = currentLod;// Switch only after crossing the hysteresis boundary. Keep the current level when the distance is near the threshold.if (currentLod == 0 && distance > nearDistance + hysteresis) next = 1;else if (currentLod == 1 && distance < nearDistance - hysteresis) next = 0;else if (currentLod == 1 && distance > farDistance + hysteresis) next = 2;else if (currentLod == 2 && distance < farDistance - hysteresis) next = 1;if (next != currentLod){currentLod = next;lodGroup.ForceLOD(currentLod);}}}
During dense effect moments, you can raise the mipmap bias of character textures or disable subsurface scattering (SSS). Switch materials during gaps between moves, and combine the switch with a short fade-in and fade-out. Ot
