NEVER Do (Expert Anti-Patterns)
Physics & Handling
- NEVER use a rigid camera attachment; strictly use a Smooth Follow pattern with
lerp()to prevent motion sickness. - NEVER prioritize realism over fun; strictly increase Gravity Scale (2x-3x) and keep friction high for responsive arcade feel.
- NEVER use
VehicleBody3Ddefault settings for karts; strictly rewrite suspension using Raycasts or custom spring/damper models. - NEVER apply steering torque directly to mass; strictly use a steering curve factored by lateral velocity.
- NEVER calculate suspension without a damper model; strictly include damping to prevent eternal oscillation (bouncing).
- NEVER ignore the Center of Mass property; strictly offset it downward to ensure stability during high-speed turns.
- NEVER multiply engine force by
delta; it is an integrated force in the physics solver. - NEVER rely on
is_action_pressed()for manual gear shifting; strictly useis_action_just_pressed()for single-tap accuracy.
AI & Competition
- NEVER use static AI speeds; strictly use Rubber-Banding to keep races competitive based on player distance.
- NEVER run AI pathfinding across the entire track every frame; strictly use a "Look-Ahead" point on a spline/path.
- NEVER ignore racing Checkpoints; strictly enforce sequential
Area3Dvalidation to prevent track shortcuts. - NEVER use standard
Area3Dfor slipstreaming without a Dot Product check to ensure the player is directly behind.
Visuals & Audio
- NEVER skip "Sense of Speed" effects; strictly implement dynamic FOV scaling, motion blur, and high-speed camera shake.
- NEVER update minimap transforms for static elements in
_process(); strictly update dynamic racers only. - NEVER serialize ghost cars as mass transform lists; strictly store positions/quaternions at fixed intervals.
- NEVER use constant pitch for engine sounds; strictly map RPM or engine load to
pitch_scale. - NEVER spawn particles for skid marks every frame; strictly use Trail3D or procedural strips for low-cost persistence.
- NEVER use standard Strings for surface detection; strictly use
StringName(e.g.,&"asphalt").
🛠Expert Components (scripts/)
Original Expert Patterns
- arcade_vehicle_physics.gd - High-performance arcade handling with custom gravity, air control, and friction-slip drifting.
- spline_ai_controller.gd - Professional racing AI using Path3D predictive steering and rubber-banding logic.
Modular Components
- arcade_vehicle_controller.gd - Alternative tight, raycast-based vehicle movement model for non-physics karts.
- raycast_vehicle_controller.gd - RigidBody3D + RayCast suspension for crisp arcade sims.
- lap_checkpoint_manager.gd - Sequential checkpoint / lap authority.
- spline_track_spawner.gd - Path3D track scaffolding for AI lines.
- slipstream_handler.gd - Drafting zones with relative dot-product checks for speed boosts.
- lap_tracker.gd - High-precision lap management with sequential checkpoint logic.
- ghost_recorder.gd - Binary transform serialization for lightweight ghost car playback.
- engine_audio_controller.gd - RPM-to-pitch audio synthesis for engine revving and gear shifts.
- skid_mark_emitter.gd - Conditional tire-slip trail system for persistent visual feedback.
- minimap_icon_projector.gd - 3D-to-2D bridge for projecting racers onto a localized UI.
- force_feedback_router.gd - Haptic and rumble management based on terrain and collisions.
- raycast_suspension.gd - Spring/damper model for raycast wheels with configurable stiffness.
- racing_checkpoint.gd - Indexed trigger gate for modular track-based lap progression.
Core Loop
- Race: Player controls a vehicle on a track.
- Compete: Player overtakes opponents or beats the clock.
- Upgrade: Player earns currency/points to buy parts/cars.
- Tune: Player adjusts vehicle stats (grip, acceleration).
- Master: Player learns track layouts and optimal lines.
Related Skills (build order)
Use the Reference → Related Skills lattice — do not invent skill ids:
- Prerequisites — godot-project-foundations, godot-physics-3d, godot-input-handling
- Complements — godot-camera-systems, godot-ai-navigation, godot-particles, godot-ui-containers, godot-raycasting-queries
- Downstream — godot-save-load-systems, godot-economy-system
Decision Tree — Vehicle Model
| Feel | Choose | MANDATORY |
|------|--------|---------------|
| VehicleBody3D arcade (torque / wheel slip) | Built-in wheels + gravity/friction tweaks | arcade_vehicle_physics.gd |
| Custom suspension / kart crispness | RigidBody3D + RayCast springs | raycast_vehicle_controller.gd (+ raycast_suspension.gd) |
Do not paste a bare VehicleBody3D sample — read the chosen script first. Optional input shim: arcade_vehicle_controller.gd.
Golden Path (script order)
- Vehicle — pick physics script above.
- Checkpoints / laps — racing_checkpoint.gd → lap_checkpoint_manager.gd / lap_tracker.gd.
- AI — spline_track_spawner.gd → spline_ai_controller.gd.
- Ghost — ghost_recorder.gd.
Also wire as needed: slipstream_handler.gd, skid_mark_emitter.gd, engine_audio_controller.gd, force_feedback_router.gd, minimap_icon_projector.gd.
Floaty Physics / Feel — Fallback Table
| Symptom | Knob | Where |
|---------|------|-------|
| Car floats / weak stick | Raise gravity_scale (≈2–3×); Fun > raw realism | arcade_vehicle_physics.gd |
| Tips / rolls easily | Lower COM (center_of_mass_mode + offset) | VehicleBody3D / RigidBody3D |
| Ice-skating lateral slip | Raise wheel_friction_slip / normal_friction_slip; lower drift slip only while drifting | arcade_vehicle_physics.gd |
| Raycast kart too bouncy | Tune spring_stiffness / spring_damping / tire_grip | raycast_vehicle_controller.gd, raycast_suspension.gd |
| Bad / rigid camera | Marker3D + lerp follow; never hard-parent to chassis | godot-camera-systems |
| Tunnel vision / no speed read | Scale FOV with speed; optional shake, wind lines, motion blur | Camera3D + Environment; FOV tween on boost |
Advanced Racing Meta-Systems
Do not paste inline DriftBoost/Ghost samples — extend the scripts:
- Drift-Boost / Mini-Turbo — MANDATORY: use drift hooks in arcade_vehicle_physics.gd (
is_drifting,drift_friction_slip); charge +apply_central_impulseon release; brief Camera FOV tween for boost feel. - Tire-Smoke / skids — MANDATORY: skid_mark_emitter.gd gated by
get_skidinfo(); pair with godot-particles — never spawn particles every physics frame. - Replay-Ghost binary — MANDATORY: ghost_recorder.gd for transform serialization; persist via godot-save-load-systems.
MANDATORY for depth beyond decision trees and script catalog: racing-systems-deep.md. Do NOT Load on first-pass wiring — use bundled
scripts/first.
Architecture Overview
1. Vehicle Controller
Handling the physics of movement.