Score, Lives & Progression

The single authority for score, currency and lives β€” plus stage travel, banked upgrades and high scores.

πŸ†Score & lives
⏱️9 min read
πŸ—ΊοΈStage travel
πŸ’ΎHigh scores
ASKGameModeBase Β· USKRunStateSubsystem Β· USKSaveSubsystem

The game mode is the single authority for score, currency and lives. Anything that awards points goes through it, and killing an enemy or collecting a Score pickup already does. A separate run-state subsystem carries progress between levels, and a save subsystem writes high scores to disk.

Score and currency

Function / EventPurpose
Add ScoreAdds to the run score. Negative values subtract.
Add CurrencyAdds to the currency total, clamped at zero so spending can't go negative.
Get Score / Get CurrencyCurrent totals.
On Score Changed / On Currency ChangedBind on the HUD to update the display.

Score is a 64-bit value, so the scoreboard-breaking totals the genre expects are safe.

Lives, death and respawn

PropertyDefaultPurpose
Starting Lives3Lives at the start of a run. 1 makes a single death final.
Respawn Delay1.5Seconds between dying and the new ship appearing.
Respawn Invulnerability2Seconds of immunity on the fresh pawn, so it isn't killed instantly. 0 disables it.
Function / EventPurpose
Notify Player DiedSpends a life and starts the respawn, or triggers game over at zero. Called automatically by the player pawn.
Add LifeGrants or removes lives β€” what an extra-life pickup calls. Ignored once the run is over.
Is Player AliveFalse from the instant of death until the respawn completes.
On Player Alive ChangedFires on both edges. Bind it to hide anything that only makes sense while playing.
On Lives Changed / On Game OverHUD hooks.
Restart GameStarts a fresh run from the first stage, wiping all carried progress.

Stages

The stage list lives in Project Settings β†’ Game β†’ ShmupKit. Clearing a stage waits for Stage Clear Delay, then travels to the next entry. Running off the end of the list means the run was won.

Function / EventPurpose
Notify Stage ClearedEnds the stage. Called automatically when a boss dies; call it yourself for a stage with no boss. Guarded, so a second call is ignored.
On Stage ClearedFires immediately, before the delay β€” for a "STAGE CLEAR" banner and the ship's exit flight.
On Game CompletedThe final stage was cleared. Distinct from game over.
Is Game Completed / Is Game Over / Is Run OverState queries. Is Run Over covers both endings β€” use it for a results screen so winning isn't left out.
Score, currency, lives and banked weapon levels are carried across the level load automatically. The run-state subsystem lives on the game instance, which survives travel, so nothing needs saving to disk mid-run.

Banked weapon levels

Weapon upgrades are banked per mount slot for the whole run, not per weapon. They survive death and stage changes, so dying never costs firepower.

SettingPurpose
Max Weapon LevelGame-mode cap on banked levels, regardless of any single weapon's depth. Default 10.
Get / Add / Set Banked LevelRun-state functions for reading and adjusting a slot's level.
On Banked Level ChangedFires with the slot and new level.

A weapon fires at min(banked level, its own top level). Levels collected past a shallow weapon's maximum are not wasted β€” they still count toward the next weapon picked up.

High scores

High scores work out of the box with no UI at all, which matters because a name-entry screen is a menu feature you may not have built yet.

SettingDefaultPurpose
Auto Submit High ScoreOnRecords every finished run automatically β€” both endings, losing the last life and clearing the final stage.
Default High Score NameAAAThe name automatic submissions are filed under.
Max High Scores10Table size. In Project Settings.
High Score Slot NameShmupKitHighScoresSave-slot name on disk. In Project Settings.
Function / EventPurpose
Is Run High ScoreWould this run's score make the table? Call it at game over to decide whether to show name entry.
Submit Run High ScoreFiles the run under a name. Returns the rank, or -1 if it didn't qualify.
On Run Score SubmittedFires with the rank, for a "NEW HIGH SCORE" banner. Fires for automatic and manual submissions alike.
Get High Scores / Clear High ScoresRead or wipe the table.
When you add a name-entry screen, turn Auto Submit off and call Submit Run High Score yourself. That flag is the only thing preventing the same run being filed twice.

Restart

A player-facing restart is wired on the player controller. Its input context is applied only at game over and removed before travel, so the key is inert during play β€” meaning it can safely reuse a key the ship already uses. Assign a restart input action and a game-over mapping context on the controller Blueprint.

Common fixes

  • Score resets between stages β€” something is starting a fresh run; check nothing calls Restart Game on load
  • A run is filed twice β€” a name-entry screen is submitting while Auto Submit is still on
  • The stage never advances β€” nothing calls Notify Stage Cleared; a stage with no boss needs it called manually
  • The exit animation is cut short β€” it must fit inside Stage Clear Delay
  • Upgrades are lost on death β€” banked levels survive death by design; check nothing is resetting the run

Where next

HUD & UI

Display score, lives and bars.

Read β†’

Pickups & Drops

Score, currency and power-up pickups.

Read β†’

Debugging

Console commands for scores and lives.

Read β†’