A multiplayer web-based simulation game built with React, Phaser, Socket.IO, Supabase, and OpenAI. NPCs powered by GPT-4 interact with players in a shared virtual space.
simtown-demo.mp4
- Autonomous AI characters & interactions with them using OpenAI's GPT-4
- Real-time multiplayer synchronization with Socket.IO
- Mobile-responsive design with touch controls and virtual joystick
- Google OAuth integration
- Persistent player interactions and chat history for authorized players
The project consists of a server and a client. The server manages NPCs, rooms, and inter-player communication, while the client is responsible for the UI and game rendering.
Notable client directories include:
src/client/game/
- Core game mechanics and renderingsrc/client/ui/
- React-based game UI components
Server directories:
src/npc/brain/
- AI character behavior and decision-makingsrc/server/
- Server implementation, including room management
- Install dependencies:
bun install
- Configure environment:
cp .env.example .env
Required environment variables:
OPENAI_API_KEY
: Your OpenAI API keyVITE_SUPABASE_URL
: Supabase project URLVITE_SUPABASE_ANON_KEY
: Supabase anonymous key
Start all services in development mode:
bun dev
Or run services individually:
# Game server
bun dev:server # Runs on :3000
# Frontend
bun dev:client # Runs on :3001
Build and run the server using Docker Compose:
docker compose up -d --build