Guide
Game negative and positive edge input timing explained
Harbor Brawl's charge-shotgun character required holding back for 40 frames, then pressing punch while still holding back. Telemetry showed 41% of intended projectiles became whiffed jabs: players released back to walk forward and tapped punch on the same frame, but the engine only listened for positive edge (button press). The press registered while back was already gone, so the motion check failed. Support tagged it “inputs eat my specials.” The combat team enabled negative edge on charge specials — firing the move on punch release when the charge timer was satisfied — and paired it with a two-frame input buffer on directional release. Successful charge-fire rate rose from 59% to 87% with no change to charge duration or projectile speed.
Every digital input has two moments: when a button goes down and when it comes up. Most action games trigger on press; many fighting-game systems deliberately trigger on release for charge moves, parries, and certain option selects. Edge timing is distinct from buffering (which delays execution) and from plink priority (which resolves simultaneous presses). This guide explains positive vs negative edge, edge-detection implementation, charge and parry patterns, interaction with motion inputs and rollback, the Harbor Brawl refactor, a technique decision table, pitfalls, and a production checklist.
Positive edge vs negative edge
Positive edge fires an action when a button transitions from
not pressed to pressed (0 to 1). This is the default in most engines: Unity's
GetButtonDown, Unreal's Started trigger, and raw
fighting-game notation treat the press frame as the command frame.
Negative edge fires when a button transitions from pressed to not pressed (1 to 0). Classic Street Fighter charge characters use negative edge so a player can hold punch during the charge, release back to advance, and still fire the special on the punch release frame as long as back was held for the required duration.
A single physical tap produces both edges one frame apart (press on frame N, release on frame N+1 or N+k depending on switch debounce). Games must decide which edge owns which move class. Mixing edges without documentation creates double-fire bugs or silent failures.
Edge detection implementation
Maintain per-button state from the previous frame:
- Positive edge —
pressed && !prevPressed - Negative edge —
!pressed && prevPressed - Held —
pressed && prevPressed - Neutral —
!pressed && !prevPressed
Poll inputs once per simulation frame before gameplay logic. Arcade sticks and keyboards debounce differently; cap minimum hold length if tap-hold-tap glitches appear on mechanical switches. For rollback netcode, edge flags must be derived from synchronized button history, not from OS events that may arrive between frames.
Charge moves typically track:
- Direction held timer (e.g., back held 40 frames).
- Attack button state (held, not yet released).
- On negative edge of attack button, if direction timer satisfied, fire special.
- Optionally accept positive edge if direction still held at press time.
Supporting both edges on the same move increases leniency but requires mutual exclusion: if positive edge already consumed the charge this frame, suppress negative edge on the release frame of the same tap.
Charge moves and directional release leniency
Charge characters create a tension between holding back (defensive) and tapping forward (movement). Competitive players often charge in down-back, then release to neutral or forward while negative-edging punch. Without leniency, releasing back one frame before punch release breaks the charge.
Common patterns:
- Direction buffer on release — back charge remains valid for 2–4 frames after releasing back (similar to motion-input slides).
- Up-charge diagonal tolerance — down-back counts as back and down for charge-down and charge-back simultaneously.
- Negative edge only for specials — normals stay positive-edge so jabs do not fire on button release during charge hold.
Parry and guard on release
Some defensive systems bind to negative edge:
- Release parry — hold parry during blockstun, release on the opponent's frame trap to counter; rewards intentional timing over mashing.
- Charge-guard release — perfect guard triggers when block button releases inside a 2-frame window after impact (cousin to just guard on press).
- Negative-edge throw tech — rare; release throw input during grab startup to tech without repeating press OS.
Release-based defense feels crisp for skilled players but opaque for beginners. Tutorial text must say “release block as they attack,” not “press block.”
Interaction with buffers, plinks, and OS
Edge timing stacks with other leniency layers:
- Input buffer + negative edge — buffer stores a release event; on recovery frame, charge check runs against buffered negative edge. Clear buffer if direction charge expired during stun.
- Plink + edge — plinking resolves simultaneous presses; negative edge on the trailing button can fire a special if motion completed on the plink frame. Document priority: plink resolution before edge dispatch.
- Option select — holding two buttons and negative-edging one can OS special vs throw break; cap OS chains in ranked modes if degenerate.
Just-frame links usually require positive edge on the exact link frame; negative-edge links are almost never intentional (they feel one frame late). Keep JF rewards on press.
Harbor Brawl refactor (worked example)
Before the patch, charge shotgun's neutral game was statistically weaker than motion-input rivals despite identical frame data on paper. The failure mode was mechanical, not balance:
- Players held back + punch during blockstring escape plans.
- On the fire frame they released back to walk forward.
- Positive-edge punch registered without back held — jab whiffed.
The refactor shipped three changes:
- Negative edge enabled for all charge-type specials (not normals).
- 3-frame back-charge persistence after releasing back (not forward).
- Training mode overlay showing charge timer, valid negative-edge window, and which edge fired.
Ranked win rate for the character moved from 48.2% to 51.1% over two weeks — within balance tolerance without numeric buffs. Charge-fire success in neutral rose 28 points; average round length unchanged (confirming fewer accidental whiffs, not longer stall games).
Technique decision table
| Input model | Player feel | Best for | Risk |
|---|---|---|---|
| Positive edge only | Snappy, predictable | Normals, dashes, platformers | Charge characters feel stiff |
| Negative edge only (specials) | Hold-and-release flow | Charge back/fwd/down characters | Accidental release fire if hold too long |
| Both edges (mutually exclusive) | Maximum charge leniency | Accessibility presets, casual modes | Double-fire if exclusion bug |
| Release parry | High skill ceiling defense | Frame-trap-heavy meta | New players never discover it |
| Buffer without negative edge | Early press still works | Motion specials, reversals | Does not fix charge + walk forward |
| Direction persistence only | Easier motion without release fire | Half-charge hybrids | Diagonal SOCD edge cases |
Common pitfalls
- Double fire on tap — positive edge fires jab, negative edge fires special on same tap; exclude one path per button per move class.
- Normals on negative edge — releasing punch after block accidentally throws; restrict negative edge to specials list.
- Charge loss on hitstun — holding buttons during combo releases charge on stun end; freeze charge timers during blockstun or clear on damage.
- SOCD cleaning order — last-win vs neutralize changes which edge sees a direction; lock SOCD before edge evaluation in rollback.
- Keyboard ghosting — release events dropped when holding 3+ keys; test charge chars on common keyboards.
- UI lies — tutorial says “press punch” while code uses negative edge; align copy with implementation.
- Macro abuse — hardware scripts alternate press/release; detect inhuman edge intervals in tournament modes if needed.
- Mixing with charge-attack hold normals — hold-to-release heavies and charge specials on the same button need separate state machines.
Production checklist
- Document per action: positive edge, negative edge, both, or held-only.
- Implement edge flags once per frame from synchronized prev/current button state.
- Mutual exclusion table for same-button press+release on one physical tap.
- Charge specials: direction timer, attack hold, negative-edge dispatch, direction persistence frames.
- Unit tests: hold back 40f, release back, negative-edge punch — assert special.
- Unit tests: tap punch without charge — assert normal only, no double special.
- Training overlay: show active edge type and charge validity.
- Rollback manifest: SOCD mode, edge order, persistence constants versioned.
- Telemetry: charge-fire success rate, accidental jab-on-release rate, edge type distribution.
- Accessibility option: widen direction persistence without enabling negative-edge normals.
Key takeaways
- Positive edge is press; negative edge is release — charge characters often need release to fire while walking forward.
- Edge detection is not buffering — it chooses which transition triggers the move, not when a buffered move executes.
- Mutual exclusion prevents one tap from firing both a normal and a special across press and release.
- Direction persistence after releasing back is the usual companion patch to negative-edge charge specials.
- Harbor Brawl fixed a 41% charge failure rate with negative edge and 3-frame back persistence — no frame-data buff required.
Related reading
- Game input buffering explained — pre-input queues and coyote time
- Game motion input and special move systems explained — quarter-circle leniency and slides
- Game plink and input priority systems explained — simultaneous input resolution
- Game charge attack systems explained — hold-to-release heavies and armor tiers