Skip to content

Add Virtual Funfair: 3-D multiplayer game with photo avatars and NPCs - #814

Open
timwebwiz wants to merge 1 commit into
github-tools:masterfrom
timwebwiz:timwebwiz-virtual-funfair-game
Open

timwebwiz wants to merge 1 commit into
github-tools:masterfrom
timwebwiz:timwebwiz-virtual-funfair-game

Conversation

@timwebwiz

Copy link
Copy Markdown

Adds a self-contained prototype in virtual-funfair/: a cross-platform (browser) 3-D multiplayer funfair where players turn a photo into a full-body avatar and share a park with simulated NPCs.

Approach

  • Client (Three.js): players upload or capture a photo; the face is mapped onto the head and skin, hair, shirt and trouser colors are sampled to build a colored full-body avatar. Fairground scene with Ferris wheel, carousel and booths, keyboard and touch-joystick controls, chat, and a day/night cycle.
  • Server (Node, Express, ws): relays player state and runs the NPC simulation at 10 Hz so all players see the same world.
  • NPCs (npcs.js): security (posted and patrolling), medics and visitors with scripted, rule-based behavior.
    • Guards and medics only react to incidents they perceive (vision cone, close-range hearing), or that a visitor, player report (R) or help request (H) surfaces.
    • Incidents: ruckus, restricted-area violation, medical emergency, help request.
    • A "Park management" dispatcher sets code green/yellow/red alerts and guards and medics coordinate over a radio feed.

Notes for review

  • Avatars are stylized and parametric, not photorealistic. public/avatar.js is the seam for plugging in an image-to-3D service.
  • NPCs are rule-based, not AI-driven.
  • The prototype is isolated in its own folder and does not touch the existing library code.
  • Verified with scripted WebSocket clients against the server (medic treatment, ruckus warning and escort, restricted-zone escort, report flow). The browser client has not been exercised visually yet.

Run with npm install && npm start in virtual-funfair/.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant