Spellcasting
Cast Scoring Pipeline (Draft)
Each cast gets one weighted quality score built from separate parts; each spell can weight the parts differently. Fourier descriptors were considered but set aside, since they smooth out corners and ignore orientation and timing.
- Capture: record each thumb's path as points with timestamps.
- Shape: resample each stroke to a fixed number of points (e.g. 64), normalize size and position, and compare point by point to the template ($1 / Protractor-style recognizer).
- Pace: compare each stroke's speed profile to the template's using dynamic time warping, which forgives an overall faster draw but catches rushing one part.
- Sharp angles: detect corners where direction changes suddenly; score their count, position and sharpness separately so rounded corners lose points.
- Thumb sync: for mirrored spells, flip the left stroke and compare it directly to the right; score start time, end time and pace alignment between thumbs. Non-mirrored spells skip the flip but keep timing sync.
- Breath: the cast must finish within the player's breath window.
- Combine: weighted score decides fizzle vs. cast and the cast's quality.
- Validation: server-side checks that input looks human (natural jitter and timing variation).
Weights in the game
The default weights every spell uses unless it overrides them, read from Assets/Scripts/Scoring:
Coil overrides them
Mend overrides them
- Fizzle line
- 45% overall
- Shape minimum
- 30% on each thumb
- Sync tolerance
- 80 ms
- Power range
- 0.6x to 1.5x
From Mobile RPG Codex › Spellcasting › Cast Scoring Pipeline (Draft)