Architecture

Monsterion spans a game client, a set of web services, and an on-chain protocol. This page is the bird's-eye view of how the pieces fit.

The layers

┌─────────────────────────────────────────────────────────────┐
│  GAME CLIENT (Godot 4)                                        │
│    prototype/         desktop "Web" build                     │
│    prototype-mobile/  touch build (custom_features=mobile)    │
│    → exported to WASM, served on Cloudflare Pages             │
└─────────────────────────────────────────────────────────────┘
            │ account / skins / deposits
            ▼
┌─────────────────────────────────────────────────────────────┐
│  WEB SERVICES                                                 │
│    server / server-cf   lobby, accounts, Solana watcher       │
│    tavern-worker        proximity chat / social               │
│    skins_cdn            skin asset hosting                     │
│    multiocular          launchpad + flywheel (Next.js 14)     │
│    docs-site            this documentation (Next.js 14)        │
└─────────────────────────────────────────────────────────────┘
            │ settle / read
            ▼
┌─────────────────────────────────────────────────────────────┐
│  ON-CHAIN (Solana / Anchor)                                   │
│    launchpad workspace  8 programs (factory, router, staking… )│
│    ions_skins           primary skins program                 │
│    ions_market          secondary marketplace escrow (planned) │
└─────────────────────────────────────────────────────────────┘

Game client

Built on Godot 4. One codebase, two export flavors (desktop + mobile), each deployed to its own Cloudflare Pages project on every push via GitHub Actions. The web export uses threading (SharedArrayBuffer), so the deploy sets cross-origin isolation headers, and large WASM/PCK files are Brotli pre-compressed to fit Cloudflare's 25 MiB limit. See Game Overview.

Networking model

Multiplayer is a relay model (no server-side simulation): leaders are owner-authoritative and synced; minions/towers can drift. The remote-leader puppet uses snapshot interpolation (buffer + render ~100 ms in the past, lerping between real snapshots) for smooth motion, with 20 Hz integer-quantized sends.

Web services

ServiceRole
server / server-cfLobby, accounts, Solana deposit watcher (skins, marketplace).
tavern-workerSocial / proximity-chat features.
skins_cdnSkin asset hosting.
multiocularThe launchpad + PYUSD flywheel app (Next.js 14 / TS).
docs-siteThis GitBook-style documentation site (Next.js 14).

On-chain protocol

An Anchor workspace of fee/staking/treasury programs (deployed to devnet) plus the skins programs. See Programs. The design philosophy: config-as-source-of-truth — the UIs mirror the on-chain constants so they can't drift.

Account & ownership model

  • Accounts are linked to a verified Solana address via a SOL micro-deposit (no wallet-connect).
  • Skin ownership is an off-chain ledger (owned_skins), keyed per edition.
  • The secondary marketplace settles USDC on-chain and re-keys the ledger on confirmation. See Marketplace Architecture.