All skills
thedivergentai avatar

/godot-genre-shooter-fps

@9d6e91e

Expert blueprint for First-Person Shooters: fps_camera_look, fps_movement_logic, hitscan_weapon_query, weapon_bobbing_system, procedural recoil, and FPS NEVER rules. Shared TPS/cover theory links to godot-genre-shooter. Keywords: FPS, movement physics, weapon bobbing, camera sway, hitscan, viewmodel, air control.

Use this Skill: https://skilld.dev/gh/thedivergentai/gd-agentic-skills/godot-genre-shooter-fps

This session only. Nothing lands on disk.

SKILL.md

β‰ˆ85 tokens always: the name and description. β‰ˆ2.4k when used: this file. β‰ˆ1.7k more on demand in 2 files.

MANDATORY script reads (start here)

  1. fps_camera_look.gd β€” raw _input mouse look (yaw/pitch)
  2. fps_movement_logic.gd β€” accel/friction/air control
  3. hitscan_weapon_query.gd β€” space-state hitscan
  4. weapon_bobbing_system.gd β€” viewmodel bob/sway

Also: procedural_recoil_handler.gd, hitscan_weapon_logic.gd, advanced_fps_controller.gd, weapon_state_machine.gd, frame_perfect_input.gd, bullet_decal_spawner.gd, weapon_spread_calc.gd, server_projectile_instance.gd, player_anim_bridge.gd, recoil_system.gd (pattern + bloom), aim_assist.gd (controller friction/magnetism).
advanced_weapon_controller.gd is shared theory β€” keep FPS feel in the scripts above; genre routing for TPS β†’ sibling skill.

Core Loop

Move/Look β†’ Aim β†’ Fire (hitscan) β†’ Recoil recover β†’ Acquire

NEVER Do (FPS)

Gunplay & registration

  • NEVER hit-detect in _process β€” use _physics_process + intersect_ray.
  • NEVER apply recoil only to the gun mesh β€” kick camera + bloom/spread.
  • NEVER trust client damage β€” server authority + lag compensation.
  • NEVER forget exclude / add_exception for the player RID.
  • NEVER use == on float cooldowns β€” is_equal_approx.

Input & movement

  • NEVER poll mouse in _physics_process β€” _input / _unhandled_input for look.
  • NEVER accumulate look on a raw Transform3D β€” store yaw/pitch floats.
  • NEVER multiply velocity by delta before move_and_slide().
  • NEVER use Transform3D.looking_at for muzzle forward β€” use -transform.basis.z.

Polish

  • NEVER single AudioStreamPlayer for gunfire β€” layer mechanical + shot + tail.
  • NEVER leave decals forever β€” fade/pool (bullet_decal_spawner.gd).
  • NEVER hardcode weapon stats β€” WeaponData Resources.
  • NEVER use plain Strings for hot weapon states β€” StringName.

Advanced FPS (keep)

Viewmodel sway / bob

Procedural sine bob + look sway β€” weapon_bobbing_system.gd.

Step-up

Ray forward/down from step_height when is_on_wall() after move_and_slide(); lift to step top for stairs.

Tactical lean

Roll camera Z + local X offset from Input.get_axis("lean_left","lean_right") with lerp.

Shared weapon theory

Hitscan vs projectile, spray patterns, and net prediction details that are not FPS-rig specific β†’ godot-genre-shooter + combat/multiplayer complements. Implement FPS fire path via hitscan_weapon_query.gd + procedural_recoil_handler.gd + recoil_system.gd.

MANDATORY for hitscan/projectile tradeoffs, three-layer recoil, aim assist, weapon balance matrices, and client prediction: fps-weapon-theory.md. Do NOT Load after MANDATORY script reads unless extending beyond bob/step/lean.

Reference

Progressive disclosure: open Official Documentation links only when researching a specific API; load Related Skills when routing to a peer domain β€” do not preload the whole lattice.

Official Documentation

  • Ray-casting β€” PhysicsDirectSpaceState3D intersect_ray patterns for hitscan registration without Area3D ballistics.
  • Physics introduction β€” collision layers/masks, layers for player exclude, and physics tick vs visual frame for gunplay.
  • Using 3D transforms β€” basis axes and -transform.basis.z forward vectors for aim, recoil, and muzzle direction.
  • Using InputEvent β€” _input vs _physics_process so mouse look stays zero-latency while movement stays physics-synced.
  • Mouse and input coordinates β€” relative mouse motion, capture, and screen-center projection for aim rays.
  • Controllers, gamepads, and joysticks β€” analog look axes and deadzones that aim-assist friction/magnetism build on.
  • Using decals β€” Decal node projection for bullet impacts instead of Sprite3D/QuadMesh stickers.
  • High-level multiplayer β€” RPC authority and fire-event patterns for server-validated hitscan without syncing every bullet.
  • Using AnimationTree β€” blend/state machines for idle/aim/fire/reload without ! in expressions.
  • Resources β€” WeaponData Resource stats (damage, recoil, spread) instead of hardcoded class constants.
  • Audio streams β€” layered mechanical/shot/tail streams for gunfire weight.
  • Optimization using Servers β€” RenderingServer RID paths for high-volume visual projectiles without SceneTree spam.

Related Skills

Prerequisites
  • godot-project-foundations β€” scene tree, InputMap actions, and Resource import basics before FPS controllers and WeaponData wiring.
  • godot-input-handling β€” mouse capture, action buffering, and look vs move split that frame-perfect fire and camera look depend on.
  • godot-raycasting-queries β€” physics-synced ray/shape queries and exclude RIDs that hitscan registration builds on.
Complements
Downstream / consumers
  • godot-monte-carlo-balancer β€” simulate weapon asymmetry matrices, TTK bands, and bloom/recoil knobs before shipping balance tables.
  • godot-genre-battle-royale β€” large-scale relevancy and lag-compensated combat that reuses FPS hitscan/recoil feel inside BR matches.
Master
  • godot-master β€” library router and mirrored module entry; open when discovering which Domain Skill owns a cross-cutting FPS concern.

Source: SKILL.md on GitHub

No alerts17d3 checks Β· Risk SAFE
  • Gen Agent Trust Hub17d

    The skill provides a comprehensive collection of GDScript templates and technical blueprints for implementing First-Person Shooter (FPS) mechanics in the Godot 4.7 engine. It covers movement physics, camera look systems, hitscan weapon logic, and procedural recoil without any security risks.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW Β· No issues

Signed by skilld at 9d6e91e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 weeks ago.

Activeupdated 2 months ago

README badge

README badge for thedivergentai/gd-agentic-skills/godot-genre-shooter-fps