Skip to main content

TrickBook Integration

Play Tony Hawk's Pro Skater in the browser. Record your best combos. Share them with the skating community.


The Vision


Feature Integration

1. THPS Clips → TrickBook Feed

The clip appears in the TrickBook feed alongside real skateboarding clips. Virtual tricks and real tricks in the same social space.

2. Leaderboards

LeaderboardSourceValidation
THPS1 High ScoresMemory address readSave state hash
THPS2 High ScoresMemory address readSave state hash
Speed RunsTimer from save state to goalSave state + timestamp
Combo RecordsScore delta measurementFrame-by-frame validation

3. Challenges

Challenge: "500,000 Point Combo at School II"
├── Starting save state (provided)
├── Goal: Score >= 500,000 in single combo
├── Time limit: None (or optional)
├── Proof: Save state at moment of completion
└── Reward: Badge on TrickBook profile

4. User Profile Integration

A TrickBook profile shows:

  • Real tricks landed (from the mobile app)
  • THPS high scores (from the emulator)
  • Clips (both real video and gameplay recordings)
  • Challenges completed (both real and virtual)

Implementation on TrickBook Website

The TrickBook website (TrickBookWebsite NextJS app) gets a new route:

thetrickbook.com/
├── /play ← N64.wasm emulator page
├── /play/thps ← THPS-specific page with leaderboards
├── /play/clips ← User's recorded gameplay clips
├── /leaderboard ← THPS leaderboards
└── /challenges ← Active challenges

Shared Authentication

User logs into TrickBook once → session shared between:

  • Mobile app
  • Website
  • Emulator features (saves, clips, leaderboards)

JWT from existing auth system works for all emulator API calls.


Memory Reading for Scores

THPS stores scores at known memory addresses. We can read them:

// THPS N64 memory map (known addresses)
const THPS_MEMORY = {
currentScore: 0x8009A4B0, // Current combo/run score
highScore: 0x8009A4B4, // Session high score
currentLevel: 0x8009A4C0, // Level ID
timeRemaining: 0x8009A4C8, // Run timer
comboMultiplier: 0x8009A4D0, // Current combo multiplier
};

// Read from emulator memory
function getScore(core: N64Core): number {
const memory = core.getMemory();
const view = new DataView(memory.buffer);
return view.getUint32(THPS_MEMORY.currentScore - 0x80000000, false); // Big-endian
}

:::warning RESEARCH NEEDED These memory addresses need to be verified through actual testing with THPS1 N64 ROM. The addresses above are illustrative. :::


Save State Sharing Flow

URL Format

https://thetrickbook.com/play/state/abc123def456
└── short ID mapped to save state blob

TrickBook API Endpoints

New endpoints for the Backend (repos/Backend):

POST /api/emulator/clips Upload a gameplay clip
GET /api/emulator/clips/:userId Get user's clips
POST /api/emulator/scores Submit a high score
GET /api/emulator/leaderboard Get leaderboard
POST /api/emulator/states Upload a save state
GET /api/emulator/states/:id Download a save state
POST /api/emulator/challenges Create a challenge
GET /api/emulator/challenges List active challenges
POST /api/emulator/challenges/:id/attempt Submit attempt

These integrate with the existing TrickBook user system, social feed, and notifications.


Why This Works for TrickBook

TrickBook is a skateboarding platform. Tony Hawk's Pro Skater is the most iconic skateboarding game ever made. The integration creates a unique value proposition:

  1. Nostalgia — Every skater over 25 grew up playing THPS
  2. Competition — Leaderboards drive engagement
  3. Content — Gameplay clips fill the feed alongside real skating
  4. Community — Challenges create shared experiences
  5. Differentiation — No other skating platform has this

The emulator isn't just a tech demo — it's a social feature that ties the community together across real and virtual skateboarding.