Skip to content

feat: Phase 1 & 2 — Game foundation, multiplayer networking, lobby UI#1

Open
tung-lee wants to merge 3 commits intomainfrom
phase-1-foundation
Open

feat: Phase 1 & 2 — Game foundation, multiplayer networking, lobby UI#1
tung-lee wants to merge 3 commits intomainfrom
phase-1-foundation

Conversation

@tung-lee
Copy link
Copy Markdown
Member

@tung-lee tung-lee commented Apr 3, 2026

Summary

  • Phase 1 (T1-T13): pnpm monorepo, deterministic sim engine (packages/sim), Phaser 3 client with procedural textures, Colyseus server scaffold, 60Hz game loop, full best-of-3 round/match flow, stomp mechanic, arena shrink
  • Phase 2 (T14-T24): Full multiplayer stack — Colyseus MatchRoom with room codes + reconnection, server-side BotAI (10-tick delay), client NetworkManager, client-side prediction with reconciliation, opponent interpolation, matchmaking lobby UI

What works

  • Solo vs Bot at http://localhost:3000 → Play → VS Bot (Local)
  • Online 2-player: two tabs → Quick Play → auto-paired via Colyseus
  • Private room: Create → share 6-char code → friend joins by code
  • Bot fallback: 15s wait with no opponent → bot auto-offered

Test plan

  • Open http://localhost:3000, verify landing page renders
  • Click Play Now → VS Bot (Local) → game loads, WASD moves player, click shoots
  • Verify bot chases and shoots back
  • Round timer counts down, round ends on death, score increments
  • Start server (pnpm dev:server) + two tabs → Quick Play → both auto-match
  • Verify both players visible, inputs sync across tabs

🤖 Generated with Claude Code

tung-lee and others added 3 commits April 3, 2026 14:26
…eus server

- pnpm monorepo with workspaces: apps/client, packages/sim, services/server
- packages/sim: deterministic physics sim (gravity, AABB collision, wall-jump,
  double-jump), 5 weapons with cooldowns/projectile lifetime, rocket splash,
  stomp/escape mechanic, arena shrink at tick 1200, full best-of-3 round/match
  flow, Mulberry32 PRNG, Mulberry32 seeded shotgun spread
- apps/client: Vite + React 19 + Phaser 3.87, BootScene (procedural placeholder
  textures), GameScene (60Hz sim loop, player/projectile/pickup rendering, HUD),
  bot AI opponent, dark navy design system (Press Start 2P + JetBrains Mono)
- services/server: Colyseus 0.15, MatchRoom (60Hz server-authoritative sim),
  LobbyRoom stub, typed protocol messages
- All 3 packages type-check clean; client builds and dev server runs

Closes T1-T13

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Server:
- MatchRoom: room codes, 15s bot-offer with auto-accept, 5s reconnection
  window, room disposal after match, input validation + rate limiting
- BotAI: server-side bot with 10-tick reaction delay, tracks target,
  maintains ideal engagement distance, shoots within 400px cone
- Server tsconfig switched to CommonJS for colyseus CJS interop
- packageExtensions in root for colyseus ESM resolution

Client:
- NetworkManager: joinQuickplay/createPrivateRoom/joinByCode via colyseus.js,
  typed event emitter for all server messages
- PredictionManager: local sim ahead of server, input buffer (128 slots),
  reconcile on server tick, position correction (<2px snap, 2-15px lerp,
  >15px hard-snap)
- OpponentInterpolation: 2-frame buffer, lerp between server states
- GameScene: solo/network mode switch, smoothed local player, interpolated
  opponent, HUD shows server tick in network mode
- PlayPage: full matchmaking UI — quickplay/private room/join-by-code,
  animated spinner, player cards with YOU badge, bot countdown

Closes T14-T24

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ation

Move contracts (contracts/arena/):
- game_config.move: admin config, server ed25519 public key registry
- player_profile.move: PlayerProfile resource, ELO tracking (K=32, floor/ceil 100/9999)
- match_registry.move: immutable MatchResult storage, ed25519 sig verification
- weapon_nft.move: WeaponNFT resource, 5 types × 4 rarities, mint/equip
- cosmetic_nft.move: CosmeticNFT resource, skins/titles/emotes, mint/equip
- tests/player_profile_tests.move: unit tests for profile + ELO

Client wallet integration:
- InterwovenKitProvider wrapping app with auto-sign enabled
- useWallet, useAutoSign, useTransaction, useMatchRecording hooks
- ConnectButton, WalletDropdown, AutoSignToggle, TransactionToast components
- Typed EventBridge replacing lib/event-bridge.ts
- HomePage: Connect Wallet button + Seamless Play auto-sign prompt
- vite.config.ts: nodePolyfills for @initia/initia.js browser compat

Server attestation:
- attestation.ts: ed25519 key management + signMatchResult()
- Server exposes /server-pubkey endpoint on startup
- MatchRoom: accepts walletAddress on join, signs match results,
  includes attestation payload in matchEnd broadcast for client tx submission
- NetworkEventMap updated with attestation field in matchEnd

All packages typecheck clean. Deployment blocked on T25 (weave init).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant