Week 5 — Sep 22 — Core Game Mechanic (critique)

Milestone: Core Game Mechanic (5 pts) is due and critiqued live today — the exercise block becomes review, not a new build.

Feeds from: Ex 2 The Verb (Wk 3) and Ex 3 Rules & States (Wk 4). By now every student has a tuned verb and a working win/lose loop; today is about taking that from "technically works" to "demonstrates design intent," which is the actual grading bar for this milestone.

Lecture topics, expanded

Debugging your mechanic. Read the Console before touching code — a red error almost always names the missing reference. Then the two silent failure modes that don't throw errors: an unwired UnityEvent (nothing happens on a valid input) and a serialized field left at its default (the mechanic runs, but at a value nobody chose). Teach students to ask "is this broken, or unwired, or untuned?" in that order before they start changing code.

Inspector tuning and serialized fields. [SerializeField] private float jumpForce = 8f; exposes a private field to the Inspector without making it public — the distinction matters for encapsulation, but more urgently: whatever a student sees in the Inspector is what's actually running, not whatever number is in the script. A field with no [SerializeField] and no public can't be tuned without a recompile, which is the #1 reason a change "doesn't do anything."

ScriptableObjects for tuning data. The first real motivation for an asset that isn't a GameObject: pull jump height, dash distance, or fire rate out of the component and into a MovementTuning ScriptableObject asset. Now the same script can drive multiple presets (Player vs Enemy, Easy vs Hard) without duplicating code, and a designer can retune the feel without opening a script at all. This is also the first appearance of the component-vs-asset distinction that recurs all semester (Guide 0 covers the vocabulary; this is the first time it's load-bearing).

Connecting it to the critique

When reviewing each build live, the two-criterion rubric (Implementation / Design decision) applies here too even though it's a milestone, not an exercise: does the verb work without console errors, and can the student point to a specific tuned value and explain why that number and not the default? "I bumped jump force until it felt right" is a real answer if they can say what "right" meant — floaty vs snappy, forgiving vs precise. A value never touched from its Inspector default is the tell that Ex 2's tuning pass didn't happen.