Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
*.gltf filter=lfs diff=lfs merge=lfs -text
*.fbx filter=lfs diff=lfs merge=lfs -text
*.obj filter=lfs diff=lfs merge=lfs -text
*.vrm filter=lfs diff=lfs merge=lfs -text

# Gaussian splat scene files — Marble outputs world.spz, world-Nk.spz tiers.
# Full-res tier is typically 30–80 MB; 100k/500k tiers are small enough
# to ship inline but everything goes through LFS for uniformity.
*.spz filter=lfs diff=lfs merge=lfs -text

# Images (large game assets only — small thumbnails are fine in git)
character-library/**/*.jpg filter=lfs diff=lfs merge=lfs -text
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ gallery/thumbnails/

# Deployment artifacts
.herenow/

# Local dev artifacts
_dev-screenshots/
38 changes: 37 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,20 @@ skills/
qa-game/SKILL.md # Add Playwright QA tests
sub-games/SKILL.md # Sub.games community platform for finding players and supporters
review-game/SKILL.md # Code review for architecture + best practices
game-creator-plus/SKILL.md # Premium tier: AI-generated 3D worlds (Marble) + characters (Meshy) via paid proxy
templates/
phaser-2d/ # Runnable 2D starter project (Phaser 3)
threejs-3d/ # Runnable 3D starter project (Three.js)
plus-template/ # Splat-world runtime — Three.js + Spark 2 + Rapier physics + cathedral pattern
scripts/
iterate-client.js # Standalone Playwright iterate loop (action → screenshot → state → errors)
example-actions.json # Example action payloads for iterate-client.js
find-3d-asset.mjs # Search & download GLB models (Sketchfab, Poly Haven, Poly.pizza)
meshy-generate.mjs # Generate 3D models with Meshy AI (text-to-3d, image-to-3d, rig, animate)
meshy-generate.mjs # Generate 3D models with Meshy AI (proxy-aware; honors GCPLUS_TOKEN)
worldlabs-generate.mjs # Generate Marble splat worlds (proxy-aware; honors GCPLUS_TOKEN)
plus-auth.mjs # Plus credit topup CLI (signup, balance, topup, dev-grant, rotate-token)
plus-generate-world.mjs # Cathedral-pattern wrapper around worldlabs-generate (rich prompt augmentation)
plus-prompt-templates.mjs# 5-scene-type prompt builder (indoor/outdoor-clearing/corridor/room/arena)
assets/
characters/ # 2D South Park-style spritesheets (photo-composite)
manifest.json
Expand All @@ -63,6 +69,9 @@ site/
schema.sql # PostgreSQL schema
Dockerfile # Railway container
package.json # Express, pg, cors
# NOTE: the game-creator-plus backend (NestJS proxy at gamecreator.dev) lives
# in a separate PRIVATE repo. This monorepo only ships the *consumer* of that
# proxy — the skill, template, and scripts.
submodules/
playdotfun/ # Git submodule: github.com/OpusGameLabs/skills
agents/
Expand Down Expand Up @@ -271,6 +280,33 @@ The `/monetize-game` command (and Step 5 of `/make-game`) registers games on [Pl

**Anti-cheat**: Games are registered with `maxScorePerSession`, `maxSessionsPerDay`, and `maxCumulativePointsPerDay` based on the game's scoring system.

## game-creator-plus (paid AI generation tier)

Premium tier that adds **AI-generated 3D worlds** (Marble Labs Gaussian splats) and **AI-generated 3D characters** (Meshy AI) to game creation. Users buy credits via Stripe; we hold the upstream API keys and proxy on their behalf.

**Three pieces:**

1. **Skill** at `skills/game-creator-plus/` — cathedral pattern, splat techniques, perf playbook, credit flow, proxy protocol. Triggered when user wants playable splat-based 3D levels.
2. **Template** at `templates/plus-template/` — runtime that renders Marble splat worlds with Three.js + SparkJS 2.0, Rapier kinematic capsule + character controller, fake-floor physics, lightness bake, splat-fog distance fade, spring-arm camera. Supports GLB and VRM characters; Meshy assets drop in via `AssetLoader.spawnAsset()`.
3. **Backend** (private repo) — NestJS 11 + TypeORM 0.3 + Postgres. Hosted at `gamecreator.dev`. Bearer-token auth, atomic credit ledger (preauth/settle/refund-delta for variable-cost jobs), reconciliation poller (30s cron), asset mirror worker (downloads upstream → local storage to outlive Meshy's 3-day TTL), admin metrics + alert cron, single-page admin dashboard at `/admin`, user usage page at `/me`, SSE proxy for live progress. Stripe Checkout with full webhook + refund + dispute handling, atomic event idempotency, dispute claw-back. **Source NOT in this repo** — see private `OpusGameLabs/plus-backend`.

**Pricing model** (see `skills/game-creator-plus/credit-flow.md`):
- 1 Plus credit = $0.01 USD; topup tiers $5/$20/$50/$100
- Markup: 17% over upstream cost; numbers verified against Marble + Meshy public docs
- Marble 1.1-Plus is variable-cost — preauth max (288 cr text / 281 cr image), reconciliation poller settles to actual on completion
- Meshy `consumed_credits` field on response is source-of-truth for actual cost

**CLI scripts** (`scripts/plus-*.mjs`):
- `plus-auth.mjs` — signup, balance, topup, dev-grant (admin), rotate-token, logout
- `plus-generate-world.mjs` — Marble proxy with cathedral-pattern prompt augmentation
- The existing `meshy-generate.mjs` and `worldlabs-generate.mjs` are now proxy-aware (route through `GCPLUS_TOKEN` / `~/.gcplus/token` if present, else direct upstream)

**Tests**: 78 (40 unit + 38 e2e), live in the private backend repo. E2E uses `plus_test` Postgres database (drops + recreates per run), nock for HTTP mocking, jest spies for Stripe SDK calls.

Production-deployment notes, sk_live key rotation, WAF rules, and SDK-upgrade
procedures live with the backend in the private `OpusGameLabs/plus-backend`
repo — they don't belong in this public-facing CLAUDE.md.

## Troubleshooting

See `TROUBLESHOOTING.md` for common issues including:
Expand Down
Loading