Browser-Based Multiplayer FPS - Inspired by Crossfire, built with modern web technologies
Crossfire Web is a browser-based multiplayer FPS that brings classic Crossfire gameplay to the web. Play directly in your browser with zero downloads.
🎯 Multiple Game Modes : Team Deathmatch, Free for All, Search & Destroy, Elimination
🧟 Mutation Mode (Phase 2): Survive against infected mutants or infect all humans
🎮 Zombie Mode (Phase 2): Co-op PVE against AI zombie hordes and bosses
⚡ Low Latency : Sub-100ms gameplay with Bun WebSocket + Effect
🌐 No Downloads : Play anywhere with any modern browser
🏆 Competitive : Leaderboards, rankings, and progression
Layer
Technology
Purpose
Runtime
Bun
Ultra-fast JS runtime with native WebSocket
Framework
Effect
Functional programming, typed errors
3D Engine
Three.js
3D rendering with WebGPU support
Frontend
React + TypeScript
UI components and state
Database
PostgreSQL + TimescaleDB
Persistent data + time-series analytics
Cache
Redis
Real-time state, sessions
Protocol
MessagePack over WebSocket
Binary serialization
crossfire/
├── apps/
│ ├── client/ # React + Three.js frontend
│ └── server/ # Bun + Effect backend
├── packages/
│ ├── shared/ # Shared types and utilities
│ └── database/ # schema and migrations
├── docs/ # Documentation
│ ├── 01-product-requirements.md
│ ├── 02-game-features.md
│ ├── 03-technology-stack.md
│ ├── 04-system-architecture.md
│ ├── 05-database-design.md
│ ├── 06-api-network-protocol.md
│ ├── 07-deployment-infrastructure.md
│ └── 08-development-roadmap.md
└── README.md
# Clone the repository
git clone https://github.com/harrytran998/crossfire
cd crossfire
# Install dependencies
bun install
# Setup environment
cp .env.example .env
# Run database migrations
bun db:migrate
# Start development servers
bun dev
Mode
Description
Players
Team Deathmatch
Two teams compete for kill limit
8v8
Free for All
Every player for themselves
16 players
Search & Destroy
Plant/defuse bomb objective
5v5
Elimination
No respawn team elimination
5v5
Mode
Description
Players
Mutation Mode
Survivors vs Infected mutants
16 players
Hero Mode
Special heroes vs mutants
16 players
Zombie Mode (PVE)
Co-op vs AI zombie hordes
4-8 players
Challenge Mode
Boss battles and objectives
4-8 players
Bun >= 1.0
Node.js >= 20 (optional)
PostgreSQL >= 16
Redis >= 7
bun dev # Start all services in development
bun build # Build all packages
bun test # Run tests
bun lint # Lint code
bun typecheck # Type check
📊 Architecture Highlights
Real-Time Game Processing
Server Tick Rate : 20-30 Hz authoritative server
Client Prediction : Immediate local input response
State Sync : Delta-compressed state updates at 20Hz
Time-Series Analytics : TimescaleDB for kill/death events, match telemetry
Data Type
Database
Purpose
Player profiles, inventory
PostgreSQL
Persistent relational data
Match history, stats
PostgreSQL
Historical records
Real-time telemetry
TimescaleDB
Time-series analytics
Game room state
Redis
In-memory real-time state
Sessions, matchmaking
Redis
Ephemeral state
Phase
Timeline
Focus
Phase 0-1
Weeks 1-5
Auth, backend, WebSocket foundation
Phase 2
Weeks 6-8
Room system, matchmaking
Phase 3
Weeks 9-12
Game engine, physics, networking
Phase 4
Weeks 13-16
Combat system, weapons
Phase 5
Weeks 17-20
Game modes, match flow
Phase 6
Weeks 21-24
Social, progression, leaderboards
Phase 7
Weeks 25-28
Polish, optimization, launch
Contributions welcome! Please read our documentation and follow conventional commits.
MIT License - see LICENSE
Built with ❤️ using Bun + Effect