Skip to main content

Session Overview

A game session is the core unit of gameplay in Abyss. Each session:
  • Has a unique session ID
  • Belongs to a single player
  • Tracks all game state (score, level, spins, items, etc.)
  • Can be competitive (prize pool) or free play

Session Lifecycle

Creating a Session

Function Signature

Process

  1. Generate new session ID
  2. Initialize GameSession struct
  3. If competitive: transfer CHIP deposit
  4. Store session data
  5. Add to player’s session list
  6. Return session ID

Session Initialization

Session Data Structure

Session Actions

Spinning

  • Decrements spins_remaining
  • Generates random grid via VRF
  • Calculates patterns and score
  • Applies relic effects
  • Checks for 666 game over

Buying Items

  • Deducts cost from score
  • Adds item to session inventory
  • Items persist until session ends

Relic Actions

  • Equip: Store relic token ID (once per session)
  • Activate: Queue effect for next relevant action

Session Ending

Game Over Conditions

End Session Function

  1. Validate session is active and owned
  2. Mark is_active = false
  3. Finalize score
  4. Update leaderboard if competitive

Leaderboard Submission

For competitive sessions:
  1. Validate session ended
  2. Compare score to leaderboard
  3. Insert if qualifies for top positions
  4. Shift lower rankings down

Session Queries

Get Session Data

Returns complete session state.

Get Player Sessions

Returns all session IDs for a player.

Get Last Spin Result

Returns the most recent spin’s grid, score, and patterns.

Session Items

Items purchased during a session are stored separately:
Items are read during:
  • Score calculation (bonuses)
  • 666 check (La Biblia)
  • Level up (spin bonuses)