fps-shooter
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFPS Shooter
FPS 射击游戏开发指南
A playbook for first-person shooters — the look/move controller, the shooting model, weapon
feel, and combat. This is a compositional skill: it wires a 3D controller, input, and AI
into a shooter. It does not re-teach 3D nodes or raycasts; it defines the shooting model and
the feel knobs (TTK, recoil, spread) that decide whether the guns feel good.
这是一份第一人称射击游戏的开发手册——涵盖视角/移动控制、射击模型、武器手感以及战斗系统。这是一项组合式技能:它将3D控制器、输入系统和AI整合为完整的射击游戏框架。本手册不会重复讲解3D节点或raycast的基础内容;而是聚焦于定义射击模型,以及决定枪械手感的关键调校参数(TTK、后坐力、子弹散布)。
When to use
适用场景
- Use when building a first-person game whose core verb is aim and shoot — arena shooter, tactical FPS, PvE shooter, boomer-shooter.
- Use when deciding hitscan vs. projectile, tuning time-to-kill, recoil, spread, or aim feel.
When not to use: third-person/2D shooting → reuse the shooting model here but build the
camera/controller from the relevant genre. Wave survival with towers → .
For the camera/character body itself, use / .
tower-defensegodot-3d-essentialsunreal-cpp-gameplay- 适用于核心玩法为瞄准与射击的第一人称游戏开发——包括竞技场射击游戏、战术FPS、PvE射击游戏、复古射击游戏。
- 适用于选择hitscan或抛射物射击模式、调校击杀时间(TTK)、后坐力、子弹散布或瞄准手感的场景。
不适用场景: 第三人称/2D射击游戏→可复用本手册中的射击模型,但需基于对应类型重新构建相机/控制器;带塔防元素的波次生存游戏→参考技能。相机/角色本体部分,请使用 / 。
tower-defensegodot-3d-essentialsunreal-cpp-gameplayCore loop
核心循环
Scan → acquire a target → aim and fire → confirm the kill (feedback) → reposition / reload
/ advance. The whole experience rests on the aim-and-fire micro-loop feeling crisp:
responsive look, clear hit feedback, and a death that reads instantly.
扫描环境→锁定目标→瞄准射击→确认击杀(反馈)→转移位置/换弹/推进。 整个游戏体验的核心在于“瞄准射击”的微循环是否流畅:响应灵敏的视角控制、清晰的命中反馈、即时的击杀判定。
Must-have systems
必备系统
- First-person controller — move (WASD/stick) + mouse/stick look, gravity, jump/crouch.
- Camera — eye-height view, configurable FOV and sensitivity, recoil kick.
- Shooting model — hitscan raycast and/or projectile spawn; one impact path for feedback.
- Weapons + ammo — damage, fire rate, magazine, reload, switching.
- Health + damage — HP, hit/headshot multipliers, death; player and enemy share the model.
- Enemy AI — perceive → alert → attack → search; cover and reaction delays ().
game-ai - Feedback — hitmarkers, impact decals/particles, hit sounds, screen shake, kill confirms.
- Objectives — what you do besides shoot: clear, capture, survive, escort.
- 第一人称控制器——WASD/摇杆移动 + 鼠标/摇杆视角控制、重力、跳跃/蹲伏。
- 相机系统——眼高视角、可配置的FOV(视野)和灵敏度、后坐力镜头抖动。
- 射击模型——hitscan射线检测和/或抛射物生成;统一的命中反馈路径。
- 武器与弹药——伤害、射速、弹匣容量、换弹、武器切换。
- 生命值与伤害系统——HP、命中/爆头伤害倍率、死亡机制;玩家与敌人共用同一模型。
- 敌人AI——感知→警戒→攻击→搜索;掩体利用与反应延迟(参考)。
game-ai - 反馈系统——命中标记、命中贴花/粒子特效、命中音效、屏幕抖动、击杀确认。
- 任务目标——除射击外的核心玩法:清场、占领、生存、护送。
Design knobs
调校参数
| Knob | Effect | Sane default |
|---|---|---|
| Time-to-kill (TTK) | lethality, forgiveness | Tune dmg × fire-rate × HP together (refs). |
| Hitscan vs projectile | aim skill type | Hitscan = flick; projectile = lead/dodge. |
| Damage falloff | range limiting | Full to ~20 m, floor by ~60 m. |
| Headshot multiplier | skill reward | ~1.5–2.0×. |
| Recoil pattern | learnable kick | Fixed pattern > pure random. |
| Spread (bloom) | suppress laser-accuracy | First shot accurate; grows while firing. |
| Fire rate / magazine / reload | rhythm, downtime | Reload = vulnerability window. |
| Mouse sensitivity / FOV | comfort, readability | Always expose both as options. |
| Aim assist (pad) | controller parity | Magnetism/slowdown near targets. |
| 参数 | 作用 | 合理默认值 |
|---|---|---|
| 击杀时间(TTK) | 致命性、容错空间 | 结合伤害×射速×HP共同调校(参考相关资料)。 |
| Hitscan vs 抛射物 | 瞄准技能类型 | Hitscan = 瞬狙;抛射物 = 预判/闪避。 |
| 伤害衰减 | 射程限制 | 全伤害至~20米,~60米时降至最低值。 |
| 爆头倍率 | 技术奖励 | ~1.5–2.0倍。 |
| 后坐力模式 | 可学习的抖动规律 | 固定模式 > 纯随机。 |
| 子弹散布(扩散) | 限制精准度 | 第一发精准;持续射击时散布增大。 |
| 射速/弹匣容量/换弹时间 | 节奏、空窗期 | 换弹 = 脆弱窗口期。 |
| 鼠标灵敏度/FOV | 舒适度、可读性 | 始终提供这两项可配置选项。 |
| 瞄准辅助(手柄) | 手柄操作平衡性 | 目标附近的磁吸/减速效果。 |
Patterns
实现模式
1. Hitscan shot (instant ray, the workhorse)
1. Hitscan射击(即时射线,主力模式)
python
undefinedpython
undefinedPseudocode. Cast from the camera; first hit takes damage scaled by range + headshot.
Pseudocode. Cast from the camera; first hit takes damage scaled by range + headshot.
direction = apply_spread(camera.forward, current_spread)
hit = raycast(camera.world_position, direction, max_dist=RANGE, mask=SHOOTABLE)
if hit:
dmg = base_damage * falloff(hit.distance)
if hit.is_head: dmg *= HEADSHOT_MULT
hit.actor.take_damage(dmg)
spawn_impact_fx(hit.point, hit.normal) # decal + sound + hitmarker
undefineddirection = apply_spread(camera.forward, current_spread)
hit = raycast(camera.world_position, direction, max_dist=RANGE, mask=SHOOTABLE)
if hit:
dmg = base_damage * falloff(hit.distance)
if hit.is_head: dmg *= HEADSHOT_MULT
hit.actor.take_damage(dmg)
spawn_impact_fx(hit.point, hit.normal) # decal + sound + hitmarker
undefined2. Projectile shot (dodgeable, leads the target)
2. 抛射物射击(可闪避,需预判目标)
python
undefinedpython
undefinedPseudocode. Spawn a moving body; it deals damage on its own collision.
Pseudocode. Spawn a moving body; it deals damage on its own collision.
p = spawn(projectile_scene, at=muzzle.world_position)
p.velocity = camera.forward * PROJECTILE_SPEED
p.on_hit = lambda other, point: (other.take_damage(base_damage), explode_fx(point))
p.lifetime = RANGE / PROJECTILE_SPEED # despawn so shots don't live forever
undefinedp = spawn(projectile_scene, at=muzzle.world_position)
p.velocity = camera.forward * PROJECTILE_SPEED
p.on_hit = lambda other, point: (other.take_damage(base_damage), explode_fx(point))
p.lifetime = RANGE / PROJECTILE_SPEED # despawn so shots don't live forever
undefined3. Time-to-kill (balance the trio together)
3. 击杀时间(TTK)——三者联动平衡
python
undefinedpython
undefinedPseudocode. TTK falls out of HP, per-shot damage, and fire rate — tune as one system.
Pseudocode. TTK falls out of HP, per-shot damage, and fire rate — tune as one system.
shots_to_kill = ceil(target_hp / damage_per_shot)
ttk_seconds = (shots_to_kill - 1) / fire_rate_per_second # first shot at t=0
undefinedshots_to_kill = ceil(target_hp / damage_per_shot)
ttk_seconds = (shots_to_kill - 1) / fire_rate_per_second # first shot at t=0
undefinedPitfalls / failure modes
常见陷阱/失败模式
- Look tied to frame rate or unscaled by → sensitivity changes with FPS. Look should be driven by raw mouse delta; movement integration uses
dt(seedt).physics-tuning - Pure random recoil/spread → feels uncontrollable and unfair. Use a learnable recoil pattern; keep the first shot accurate.
- Hitscan with no falloff → pistols snipe across the map. Add range-based damage falloff.
- No hit feedback → players can't tell if shots land. Always show hitmarkers, impact FX, and a distinct kill confirm.
- Mismatched TTK → too low feels twitchy/unfair; too high feels spongy. Tune damage, fire rate, and HP as one system (Pattern 3).
- Trusting the client in multiplayer → cheating and "I shot first" disputes. Keep authority server-side; use lag compensation (refs) and defer netcode to the engine multiplayer skill.
- No FOV / sensitivity options → motion sickness and accessibility failures. Always expose them.
- 视角控制与帧率绑定或未按缩放→灵敏度随FPS变化。视角控制应基于原始鼠标增量;移动逻辑需使用
dt(参考dt)。physics-tuning - 纯随机后坐力/子弹散布→手感失控且不公平。采用可学习的后坐力模式;确保第一发子弹精准。
- Hitscan无伤害衰减→手枪可跨地图狙击。添加基于射程的伤害衰减机制。
- 无命中反馈→玩家无法判断是否命中。始终显示命中标记、命中特效和明确的击杀确认。
- TTK失衡→过短会导致手感生硬/不公平;过长会让目标显得“肉”。需联动调校伤害、射速和HP(参考模式3)。
- 多人游戏中信任客户端→作弊和“我先开枪”争议。权威逻辑保留在服务器端;使用延迟补偿(参考相关资料),并将网络代码交由引擎的多人游戏技能处理。
- 无FOV/灵敏度选项→引发晕动症和无障碍问题。始终提供这两项配置选项。
Composition (build it from these skills)
组合构建(基于以下技能搭建)
- Controller + camera: (Godot) or
godot-3d-essentials/unreal-cpp-gameplay; Unity usesunreal-blueprints+ a character controller.unity-physics - Input: (or
input-systems) for look/move, rebinding, and gamepad aim assist.unreal-enhanced-input - Shooting physics: /
godot-physicsfor raycasts and projectile collision.unity-physics - Enemies: with
game-ai/unity-navmesh/ Godot navigation.unreal-behavior-trees - Camera & feel: for FOV/recoil kick and look smoothing;
camera-systemsfor hit-stop, screen shake, and impact juice.game-feel - Polish: for weapon/impact sound;
audio-designfor muzzle/impact VFX.shader-programming - Process: to validate aim feel before building content.
prototype-fast
- 控制器+相机: (Godot引擎)或
godot-3d-essentials/unreal-cpp-gameplay;Unity引擎使用unreal-blueprints+ 角色控制器。unity-physics - 输入系统: (或
input-systems)用于视角/移动控制、按键重绑定和手柄瞄准辅助。unreal-enhanced-input - 射击物理: /
godot-physics用于射线检测和抛射物碰撞。unity-physics - 敌人AI: 搭配
game-ai/unity-navmesh/ Godot导航系统。unreal-behavior-trees - 相机与手感: 用于FOV/后坐力抖动和视角平滑;
camera-systems用于击中停顿、屏幕抖动和冲击特效。game-feel - 打磨细节: 用于武器/命中音效;
audio-design用于枪口/命中视觉特效。shader-programming - 开发流程: 在制作内容前先验证瞄准手感。
prototype-fast
References
参考资料
- For hitscan vs. projectile trade-offs, damage falloff, recoil/spread, TTK math, hit
registration/lag compensation, and enemy AI states, read .
references/shooting-and-feel.md
- 关于hitscan与抛射物的取舍、伤害衰减、后坐力/子弹散布、TTK计算、命中判定/延迟补偿以及敌人AI状态,请阅读。
references/shooting-and-feel.md