← Back to Pull requests

Add monetization, trial paywall, progression grind, and storyline narrative #1

Closed
unknown closed this pull request without merging on Oct 12, 2026 20:44 UTC
View on GitHub
unknown unknown commented on Oct 12, 2026 20:12 UTC
Author

Hyperfy required a monetization and progression framework featuring free public exploration alongside a 14-day trial paywall for world hosting/creation, daily/weekly missions awarding cosmetic unlocks and badges in a family-safe high-intensity presentation, and an introduction storyline detailing the game's universe.

Core Changes

Billing & Entitlements (src/core/billing.js, src/core/systems/ServerNetwork.js):
Unrestricted public world exploration (canUserExplore) preserved for all users.
Server-side action gating in ServerNetwork enforcing trial or active subscription status before processing builder and world-hosting mutations (onBlueprintAdded, onEntityAdded, onEntityRemoved, onSettingsModified, onSpawnModified, onAi).
Automatic activation of 14-day Architect Trial upon a user's first building action; dispatches billingBlocked when an unentitled action is attempted.

Progression & Lore System (src/core/progression.js):
6 progression tiers driven by XP curves with unlocked badges, auras, skins, and accessories.
Daily and weekly mission definitions for exploration, building, and social interactions, with claim verification logic.
HyperCore Odyssey: The Architect Initiative storyline introduction and chapter dossiers explaining the game universe and player objectives in a dramatic, family-safe cyberpunk tone.

Database Layer (src/server/db.js):
Migration #19 adding plan, subscriptionStatus, trialStartedAt, trialEndsAt, stripeCustomerId, stripeSubscriptionId, xp, tier, unlockedCosmetics, missionProgress, and equippedCosmetics to the users table.

API Endpoints & Network Protocol (src/server/routes.js, src/core/packets.js, src/core/systems/ClientNetwork.js):
Rate-limited Fastify endpoints for /api/storyline, /api/billing/status, /api/billing/start-trial, /api/billing/upgrade, /api/billing/webhook, /api/progression, /api/progression/claim, and /api/progression/equip.
Realtime packet synchronization for billing status, blocked actions, trial initiation, progression updates, and cosmetic equipping.

UI Components (src/client/components/):
TrialBanner.js: Persistent countdown timer and Pro upgrade CTA.
UpgradeModal.js: Plan comparison between Free Explorer, 14-Day Trial, and Architect Pro.
* MissionsPane.js: Dual-tab sidebar interface for mission grinding / cosmetic rewards and storyline lore dossiers.

Entitlement Enforcement Example

// src/core/systems/ServerNetwork.js
onBlueprintAdded(client, blueprint) {
  const user = client.user
  if (!canUserBuild(user)) {
    // Check for first-time trial eligibility or reject expired access
    if (!user?.trialStartedAt) {
      const trial = startUserTrial(user)
      Object.assign(user, trial)
      this.send(client, 'billingStatus', getBillingStatus(user))
    } else {
      this.send(client, 'billingBlocked', {
        reason: 'trial_expired',
        message: 'Your 14-day Architect Trial has ended. Upgrade to continue building.',
      })
      return
    }
  }
  // proceed with blueprint mutation...
}

Diff: 397 lines (+297 / -100) across 4 files Reviewer: tjkilgore93-stack Review duration: 31m
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.66) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.66 · 397 lines diff across 4 files
0.66
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.358
Shallow Review Depth shallow_review_depth
0.289
Sensitive Paths sensitive_paths
0.066
Real PR Conversation Timeline
1 comments
"Review active on #1"
general weight: 0.35
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed sensitive_module
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 66.4% (HIGH) · Higher = larger blast radius
66.4%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 26.2% · Safe to merge
26.2%