unity-gameplay

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

unity-gameplay — a genre is a set of constraints, and the constraints pick the skills

unity-gameplay —— 类型是一组约束,而这些约束决定选用哪些 skill

A genre name decides nothing you can build from. "Platformer" does not say who owns the transform, what the level unit is, or which clock the camera reads. Six constraints do, and two games with the same label and a different transform owner share no controller code — while two with different labels and the same six share almost all of it.
类型名称并不能决定你能构建什么。 “Platformer” 并没有说明谁拥有 transform、关卡单位是什么,或者相机读取哪一只时钟。是六个约束决定了这些;两个标签相同但 transform 归属不同的游戏不会共享任何控制器代码——而两个标签不同但这六项相同的游戏却几乎共享全部代码。

Request → where to go

请求 → 去哪里

The requestGo to
"make a platformer", "build a top-down shooter", "which skills for a tactics game"§0, then the genre file it names
"add a player character"§0, then the controller row in Load what the situation needs
"how wide can the gap be", "the jump cannot reach the ledge"Discipline (numbers before levels) and
reference/level-metrics.md
"what do we build first", "is the prototype done"
reference/pipeline-stages.md
The idea, the brief, the look, a preview before code
unity-game-brief
Controls · camera · Animator work
unity-input
·
unity-camera
·
unity-animation
Any other system a game needsLoad what the situation needs
ConstraintValuesWhat it picks
Dimension2D · 3DThe physics vocabulary, and every component name after it
Projectionorthographic (size, pixels per unit) · perspective (FOV, distance, pitch)Camera rig, sorting, pixel snapping
Viewside · top-down · isometric · behind the character · through its eyes · fixedWhat "up" means to the stick, what occludes what
Movement modelfree · lane · cellController shape, level unit, what a journey asserts
Transform ownerkinematic motor · dynamic body ·
CharacterController
·
NavMeshAgent
· root motion · the cell map
Who may write position — exactly one
Level unittile · cell · kit module · lane widthWhat every level number is a multiple of

请求去往
“做一个 platformer”、“构建 top-down 射击游戏”、“tactics 游戏需要哪些 skill”§0,然后是它命名的类型文件
“添加一个玩家角色”§0,然后是 Load what the situation needs 中的 controller 行
“间隙最大能有多宽”、“跳跃够不到那个平台边缘”Discipline(先定数字再做关卡)和
reference/level-metrics.md
“我们先构建什么”、“原型做完了吗”
reference/pipeline-stages.md
想法、简报、美术风格、编码前的预览
unity-game-brief
操作 · 相机 · Animator 工作
unity-input
·
unity-camera
·
unity-animation
游戏需要的任何其他系统Load what the situation needs
约束取值它决定什么
维度2D · 3D物理词汇,以及此后每个组件的名称
投影orthographic(size、pixels per unit)· perspective(FOV、distance、pitch)相机装置、排序、像素对齐
视角side · top-down · isometric · 角色背后 · 角色第一视角 · fixed摇杆的“上”代表什么,什么遮挡什么
移动模型free · lane · cell控制器形态、关卡单位、一段旅程所断言的内容
transform 归属kinematic motor · dynamic body ·
CharacterController
·
NavMeshAgent
· root motion · the cell map
谁可以写入位置 —— 恰好一个
关卡单位tile · cell · kit module · lane width每个关卡数字的基数

0. Which game is this? (route before you build)

0. 这是什么游戏?(在构建之前先路由)

Not every question needs routing. Teaching questions — "what is coyote time", "kinematic or dynamic for a platformer" — get answered directly. Route only when the user wants gameplay read, changed or built.
Explicit signals win. A named component, API or view is the answer:
They mentionPerspective and movement modelRecipe
Rigidbody2D
, a jump, platforms, "side-scroller", "runner seen from the side"
2D · side · free, under gravity
reference/genre-2d-side.md
"seen from above", "8-direction", "twin-stick", zero gravity, Y-sorting2D · top-down · free
reference/genre-2d-topdown.md
WorldToCell
, "turn-based", "tile puzzle", "hex", "isometric", "one tile per move"
2D · cell
reference/genre-2d-grid.md
"the screen does not scroll", "bullet patterns", "click on the object", "one screen"2D · fixed screen
reference/genre-2d-fixed-screen.md
CharacterController
,
Rigidbody
,
NavMeshAgent
, "third-person", "first-person", "lanes", meshes
3D
reference/genre-3d.md
A timed press graded in milliseconds, "swing timing", a cue ring, tennis, badminton, a rally against bots3D · broadcast view · characters move themselves
reference/genre-timing-sports.md
No explicit signal — fingerprint the project. One command, read-only, no Unity needed:
bash
python3 scripts/fingerprint.py /path/to/project --indent 2
Read the result as a whole, not key by key — packages are not a signal, physics outranks renderers, 3D physics under an orthographic camera is 2.5D, and the Cinemachine major changes the class names. A sample result, how each verdict is derived and the same checks as
find
/
grep
:
reference/perspective-fingerprint.md
.
Still ambiguous — the default ladder:
  1. Existing project → follow what the fingerprint found. Consistency beats preference.
  2. The brief has a perspective and movement block → that block is the answer.
  3. Sprite or pixel art is named → 2D. A rigged or modelled character is named → 3D.
  4. One-thumb play on a phone, nothing else stated → fixed camera, lane or cell movement.
  5. Still nothing → ask one question: "seen from the side, from above, or from behind the character?" The answer fixes view and, nearly always, dimension.
Then hand off. Fill
templates/GAMEPLAY_RECIPE.md
— the six constraints, the numbers, one row per need — open the genre file named above and build in its order.

并非每个问题都需要路由。教学类问题 —— “什么是 coyote time”、“platformer 用 kinematic 还是 dynamic” —— 直接回答即可。 只有当用户希望读取、修改或构建 gameplay 时才进行路由。
显式信号优先。 一个具名的组件、API 或视角就是答案:
用户提到透视与移动模型配方
Rigidbody2D
、跳跃、平台、“side-scroller”、“从侧面看的 runner”
2D · side · free,受重力影响
reference/genre-2d-side.md
“从上往下看”、“8 方向”、“twin-stick”、零重力、Y-sorting2D · top-down · free
reference/genre-2d-topdown.md
WorldToCell
、“回合制”、“tile puzzle”、“hex”、“isometric”、“每步一格”
2D · cell
reference/genre-2d-grid.md
“画面不滚动”、“弹幕模式”、“点击物体”、“单屏”2D · fixed screen
reference/genre-2d-fixed-screen.md
CharacterController
、
Rigidbody
、
NavMeshAgent
、“第三人称”、“第一人称”、“lanes”、mesh
3D
reference/genre-3d.md
以毫秒计时的按键判定、“挥拍时机”、提示环、网球、羽毛球、对机器人进行的 rally3D · broadcast view · 角色自行移动
reference/genre-timing-sports.md
没有显式信号 —— 对项目做指纹识别。 一条命令,只读,无需 Unity:
bash
python3 scripts/fingerprint.py /path/to/project --indent 2
要整体阅读结果,而不是逐键阅读 —— 包不是信号,物理优先于渲染器,正交相机下的 3D 物理是 2.5D,而 Cinemachine 的主版本变化会改变类名。示例结果、每个结论的推导方式,以及与
find
/
grep
相同的检查:
reference/perspective-fingerprint.md
。
仍然模糊 —— 默认阶梯:
  1. 已有项目 → 遵循指纹识别的结果。一致性优于偏好。
  2. 简报中有透视与移动模块 → 以该模块为准。
  3. 提到 sprite 或像素画 → 2D。提到绑定好的或建模的角色 → 3D。
  4. 手机上单手拇指操作,且没有其他说明 → 固定相机、lane 或 cell 移动。
  5. 仍无信息 → 只问一个问题:“从侧面看、从上往下看,还是从角色背后看?”这个答案确定了视角,并且几乎总能确定维度。
然后交接。 填写
templates/GAMEPLAY_RECIPE.md
—— 六个约束、相关数字、每个需求一行 —— 打开上面命名的类型文件,并按其顺序构建。

Load what the situation needs

按需加载

The situationRead
What the project already is; reading the fingerprint
reference/perspective-fingerprint.md
Platformer, exploration platformer with gated rooms, auto-runner
reference/genre-2d-side.md
Action-adventure from above, twin-stick shooter, RPG from above
reference/genre-2d-topdown.md
Tactics, tile puzzle, isometric or hexagonal boards
reference/genre-2d-grid.md
Scrolling shooter, point-and-click adventure, single-screen casual
reference/genre-2d-fixed-screen.md
Third-person, first-person, fixed or overhead camera in 3D, lane runner
reference/genre-3d.md
Racket and bat games: the clip library bounds the simulation, contact decided by the sim, timing invariants, balance grid
reference/genre-timing-sports.md
A simulation on its own thread: absolute clock, triple-buffered snapshot, render tick, JIT warmup, sim-lag smoke gate, rules tests with no Editor
reference/sim-host-and-clock.md
Jump height, gap, step, door and corridor sizes; "can the runner make this"
reference/level-metrics.md
What to build first; when a stage is finished
reference/pipeline-stages.md
Actions, a struct gameplay reads, touch, rebinding, pointer aim
unity-input
Follow, confiner, look-ahead, jitter, shake, Cinemachine names per major
unity-camera
Animator parameters, blend trees, sprite state graphs, events, IK, root motion
unity-animation
2D character: platformer motor, motor seen from above, cell step, the Animator bridge
unity-2d-controller
2D bodies, casts, tilemap colliders, one-way platforms, the 2D layer matrix
unity-physics-2d
2D draw order, sorting by Y, 2D lights and shadows, parallax
unity-2d-rendering
2D levels as data: layer stacks, runtime tiles, rooms, chunks, LDtk and Tiled
unity-2d-level
Cell coordinates, range, pathfinding, line of sight, occupancy, turns
unity-2d-grid
Bones and weights on a sprite, PSB rigs, Sprite Library
unity-2d-animation
3D character: who owns the transform, third-person, first-person, overhead and lane controllers, the Animator bridge
unity-3d-controller
3D levels: greybox to metrics, modular kits, prefabs, collision proxies, terrain, splines
unity-3d-level
3D light modes, bakes, probes, shadows, environment, the mobile subset
unity-lighting
Switches, gates, pickups, the use prompt, point-and-click hotspots
unity-interaction
Damage events, hit and hurt boxes, attack windows, invincibility, projectiles
unity-combat
The sentry: perception, patrol and chase, pathing in 2D, waves, enemy turns on a board
unity-game-ai
The Boot scene, additive loading, pause, the save file, checkpoints, pools
unity-scene-flow
Feedback per event: hit stop, flash and squash, particles, trails, sound events, rumble
unity-game-feel
LOD, occlusion, batching, culling distances, texture streaming
unity-scene-optimisation
Situations, journeys, timelines; a feel report with no number in it
unity-play-harness
The brief, its perspective and movement block, simulation/presentation split
unity-game-brief
Project creation, which packages, version pinning
unity-new-project
Tile Palettes, rule tiles, grid layouts
unity-tilemap
Slicing sheets, pivots, clips from frames
unity-2d-sprites
Pixel art that shimmers or blurs
unity-2d-pixel-perfect
A collision or trigger that does not fire, in 3D · in 2D
unity-physics-3d
·
unity-physics-2d
NavMesh baking, agents, click-to-move
unity-navigation
A rigged, animated character from source art, stage by stage · its Unity import
game-character-pipeline
·
unity-rigged-character
HUD and menus · frame time and counters
unity-game-ui
·
unity-profiling
URP renderer, post-processing, the look of the frame
unity-render-urp
Music, sound import settings, mixers
unity-audio
Packing sprites into atlases, draw calls from sprites
unity-sprite-atlas
Trusting a test run, reading logs, screenshots
unity-debug
情况阅读
项目当前是什么;阅读指纹识别结果
reference/perspective-fingerprint.md
Platformer、带门禁房间的探索 platformer、auto-runner
reference/genre-2d-side.md
俯视动作冒险、twin-stick 射击、俯视 RPG
reference/genre-2d-topdown.md
Tactics、tile puzzle、等距或六边形棋盘
reference/genre-2d-grid.md
滚动射击、点击冒险、单屏休闲游戏
reference/genre-2d-fixed-screen.md
第三人称、第一人称、3D 中的固定或俯视相机、lane runner
reference/genre-3d.md
球拍与球棒类游戏:clip 库界定模拟边界、接触由模拟裁决、时机不变量、平衡网格
reference/genre-timing-sports.md
独立线程上的模拟:绝对时钟、三缓冲快照、渲染 tick、JIT 预热、sim-lag 冒烟门禁、无 Editor 的规则测试
reference/sim-host-and-clock.md
跳跃高度、间隙、台阶、门与走廊尺寸;“runner 能做到吗”
reference/level-metrics.md
先构建什么;一个阶段何时算完成
reference/pipeline-stages.md
动作、gameplay 读取的 struct、触控、重绑定、指针瞄准
unity-input
跟随、限制区域、前瞻、抖动、震动、各主版本的 Cinemachine 名称
unity-camera
Animator 参数、混合树、sprite 状态图、事件、IK、root motion
unity-animation
2D 角色:platformer motor、俯视 motor、cell step、Animator 桥接
unity-2d-controller
2D 刚体、投射、tilemap 碰撞体、单向平台、2D 层矩阵
unity-physics-2d
2D 绘制顺序、按 Y 排序、2D 光照与阴影、视差
unity-2d-rendering
作为数据的 2D 关卡:层栈、运行时 tiles、rooms、chunks、LDtk 与 Tiled
unity-2d-level
格坐标、range、寻路、视线、占位、回合
unity-2d-grid
sprite 上的骨骼与权重、PSB 绑定、Sprite Library
unity-2d-animation
3D 角色:谁拥有 transform、第三人称、第一人称、俯视与 lane 控制器、Animator 桥接
unity-3d-controller
3D 关卡:从灰盒到度量、模块化 kit、prefab、碰撞代理、地形、spline
unity-3d-level
3D 光照模式、烘焙、probe、阴影、环境、移动端子集
unity-lighting
开关、门禁、拾取物、使用提示、点击热点
unity-interaction
伤害事件、hit 与 hurt box、攻击窗口、无敌、投射物
unity-combat
哨兵:感知、巡逻与追击、2D 寻路、波次、棋盘上的敌人回合
unity-game-ai
Boot 场景、叠加加载、暂停、存档文件、检查点、对象池
unity-scene-flow
每个事件的反馈:顿帧、闪白与挤压、粒子、拖尾、音效事件、震动
unity-game-feel
LOD、遮挡、批处理、剔除距离、纹理流送
unity-scene-optimisation
情境、旅程、时间线;一份不含任何数字的体感报告
unity-play-harness
简报及其透视与移动模块、模拟/表现分离
unity-game-brief
项目创建、选择哪些包、版本锁定
unity-new-project
Tile Palette、rule tile、grid 布局
unity-tilemap
切图集、pivot、从帧生成 clip
unity-2d-sprites
闪烁或模糊的像素画
unity-2d-pixel-perfect
不触发的碰撞或触发器,3D · 2D
unity-physics-3d
·
unity-physics-2d
NavMesh 烘焙、agent、点击移动
unity-navigation
从源美术制作绑定好的动画角色,逐阶段 · 其 Unity 导入
game-character-pipeline
·
unity-rigged-character
HUD 与菜单 · 帧时间与计数器
unity-game-ui
·
unity-profiling
URP renderer、后处理、画面观感
unity-render-urp
音乐、音频导入设置、mixer
unity-audio
把 sprite 打包进 atlas、sprite 的 draw call
unity-sprite-atlas
信任一次测试运行、读日志、看截图
unity-debug

Given inline here

直接在此提供的内容

Every genre file ends on a table naming the skill that owns each need. What no skill owns is carried here:
NeedWhere the method is
Door, corridor, step and ceiling numbers from the body
reference/level-metrics.md
§5
Playfield fit, bullets as one array of structs, the launch gesture
reference/genre-2d-fixed-screen.md
A sim thread with a clock every thread can read; pause-aware timestamp conversion
resources/SimHost.cs
,
resources/SimClock.cs
— pure C# in a plain assembly with no engine references, which the presentation references

每个类型文件末尾都有一张表,指明每个需求归属哪个 skill。没有 skill 负责的部分在这里承载:
需求方法所在位置
根据角色身体推导门、走廊、台阶与天花板尺寸
reference/level-metrics.md
§5
场地适配、作为 struct 数组的弹幕、发射手势
reference/genre-2d-fixed-screen.md
一个所有线程都能读取时钟的模拟线程;感知暂停的时间戳转换
resources/SimHost.cs
、
resources/SimClock.cs
—— 位于无引擎引用的普通程序集中的纯 C#,表现层引用它

Discipline

纪律

  • Name the transform owner before writing movement code. A kinematic motor, a dynamic body, a
    CharacterController
    , a
    NavMeshAgent
    , root motion or the cell map: one of them writes position and the others read it. Two writers produce jitter no camera setting removes.
  • Numbers before levels. Decide apex height, time to apex and run speed; derive gravity and jump velocity from them; then let
    scripts/level_metrics.py
    say how wide a gap may be. A level built first fixes the jump by accident (
    --gap 5 --height 1
    exits 1 when a number is outside reach; the commands are in
    reference/level-metrics.md
    ).
  • Measure the jump the game performs, not the one the constants describe. A fixed step moves the apex by
    v0 · dt / 2
    ; drag, a clamped fall speed or a second writer move it further —
    scripts/jump_report.py
    reads it off a journey's
    timeline.jsonl
    .
  • Gameplay reads a struct, never a device. A gamepad, a touch overlay and a journey's scripted driver all fill the same struct, which is what makes the controller testable.
  • Simulate on the fixed step, present on the frame. Input is sampled on the frame and consumed on the step; the camera reads after both. Most jitter is one of the three in the wrong place.
  • A heavy or timing-graded sim gets its own thread and an absolute clock. Draw one tick behind the clock and never clamp that to the snapshot; warm the code paths up before the clock starts:
    reference/sim-host-and-clock.md
    .
  • Measure what the clips can do before setting speeds and reach. A simulation that ran at 7 m/s against a 2.7 m/s run loop, with contact points 25 to 65 cm from where the clips put the racket, spent its whole motion pass bridging the gap:
    reference/genre-timing-sports.md
    §0.
  • 3C on greybox first. Character, camera and controls each pass one journey on untextured boxes before any art is imported.
  • A genre file is a starting set of constraints. Change one and re-pick the rows it touched.
  • 在写移动代码之前先确定 transform 归属。 kinematic motor、dynamic body、
    CharacterController
    、
    NavMeshAgent
    、root motion 或 cell map:其中一个写入位置,其余读取。两个写入者会产生任何相机设置都消除不了的抖动。
  • 先定数字,再做关卡。 决定顶点高度、到达顶点的时间与奔跑速度;由此推导重力与起跳速度;然后让
    scripts/level_metrics.py
    告诉你间隙最宽可以是多少。先做出来的关卡会意外地锁死跳跃参数(
    --gap 5 --height 1
    在数值超出可达范围时以 1 退出;命令见
    reference/level-metrics.md
    )。
  • 测量游戏实际做出的跳跃,而不是常量所描述的跳跃。 固定步长会把顶点移动
    v0 · dt / 2
    ;阻力、被钳制的下落速度或第二个写入者会把它移动得更远 ——
    scripts/jump_report.py
    会从某段旅程的
    timeline.jsonl
    中读取它。
  • Gameplay 读取 struct,绝不读取设备。 手柄、触控叠加层与旅程的脚本驱动都填充同一个 struct,这正是控制器可测试的原因。
  • 在固定步长上模拟,在帧上表现。 输入在帧上采样、在步长上消费;相机在两者之后读取。大多数抖动就是这三者之一放错了位置。
  • 重量级或按计时评分的模拟应当拥有自己的线程和绝对时钟。 绘制落后时钟一个 tick,且绝不把绘制钳制到快照;时钟启动前先预热代码路径:
    reference/sim-host-and-clock.md
    。
  • 在设定速度与触及范围之前,先测量 clip 能做到什么。 一个以 7 m/s 运行、却对着 2.7 m/s 的奔跑循环的模拟,接触点距 clip 放置球拍的位置 25 到 65 厘米,它整个动作过程都花在弥合这个差距上:
    reference/genre-timing-sports.md
    §0。
  • 先在灰盒上做 3C。 角色、相机与操作各自在没有贴图的盒子上通过一段旅程,然后才导入任何美术。
  • 类型文件是一组起始约束。 改动其中一个,并重新挑选它所触及的行。

Scope — what this skill does NOT do

范围 —— 本 skill 不做的事

Every row of Load what the situation needs that names another skill is that skill's work, not this one's: deciding what the game is (
unity-game-brief
), creating the project (
unity-new-project
), input, camera, Animator, controllers, levels, physics, draw order, light, interaction, combat, AI, scene flow, feel, journeys (
unity-play-harness
) and trusting a test run (
unity-debug
).
What is left is what no single-system skill can hold: deciding which constraints this game has, and so which skills to open — plus the level numbers that follow from the controller and the check that ends each stage.
Load what the situation needs 中每一行指向另一个 skill 的内容都属于那个 skill,而不属于本 skill:决定游戏是什么(
unity-game-brief
)、创建项目(
unity-new-project
)、输入、相机、Animator、控制器、关卡、物理、绘制顺序、光照、交互、战斗、AI、场景流转、体感、旅程(
unity-play-harness
)以及信任一次测试运行(
unity-debug
)。
剩下的,是没有任何单一系统 skill 能承载的东西:决定这个游戏具有哪些约束,从而决定打开哪些 skill —— 以及由此从控制器推导出的关卡数字,以及结束每个阶段的检查。