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
| Leaderboard | Source | Validation |
|---|---|---|
| THPS1 High Scores | Memory address read | Save state hash |
| THPS2 High Scores | Memory address read | Save state hash |
| Speed Runs | Timer from save state to goal | Save state + timestamp |
| Combo Records | Score delta measurement | Frame-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:
- Nostalgia — Every skater over 25 grew up playing THPS
- Competition — Leaderboards drive engagement
- Content — Gameplay clips fill the feed alongside real skating
- Community — Challenges create shared experiences
- 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.