Phewland is a browserโbased multiplayer 3D shooter playground built with React, Three.js, and peerโtoโpeer networking โ no backend server required.
A fastโpaced experimental thirdโperson shooter that runs entirely in the browser, combining modern React tooling, realโtime physics, and hostโauthoritative multiplayer.
- ๐ฏ Realโtime multiplayer shooter
- ๐ Fully browserโbased (WebGL + WebRTC)
- ๐ซ No traditional backend server
- ๐งฑ Hostโauthoritative peer synchronization
- โ๏ธ Physicsโdriven gameplay
- ๐งช Designed as:
- A game prototype
- A ReactโThreeโFiber reference
- A multiplayer architecture experiment
- ๐ซ Realโtime shooting with physicsโbased bullets
- ๐ง Thirdโperson character controller
- ๐ 3D map & environment lighting
- ๐ก Peerโtoโpeer multiplayer (PlayroomKit)
- ๐ Live leaderboard (kills / deaths)
- ๐ฎ Joystick + keyboard support
- ๐ฅ Hit effects & audio feedback
- ๐ฅ๏ธ Fullscreen gameplay
- React 19
- TypeScript
- Vite
- Three.js
- @react-three/fiber
- @react-three/drei
- @react-three/postprocessing
- Rapier Physics
- @react-three/rapier
- playroomkit
- Player state synchronization
- Hostโauthoritative logic
- Peerโtoโpeer networking
- Input abstraction
- Tailwind CSS
- GLTF / GLB 3D models
- Action audio (MP3)
Phewland uses a hostโauthoritative peerโtoโpeer model:
- First player becomes the host
- Host simulates:
- Physics
- Bullets
- Damage
- Kills / deaths
- Other clients:
- Send input
- Receive synced state
- Rendering and controls are fully local
graph TD
Host[Host Player]
Client1[Client Player]
Client2[Client Player]
Host -->|State Sync| Client1
Host -->|State Sync| Client2
Client1 -->|Input| Host
Client2 -->|Input| Host
.
โโโ index.html
โโโ package.json
โโโ vite.config.ts
โโโ eslint.config.js
โโโ tsconfig*.json
โโโ public/
โ โโโ vite.svg
โโโ types/
โ โโโ global.d.ts
โโโ src/
โโโ main.tsx
โโโ App.tsx
โโโ index.css
โโโ assets/
โ โโโ audio/
โ โโโ models/
โ โโโ index.ts
โโโ components/
โโโ experience.tsx
โโโ map.tsx
โโโ leader-board.tsx
โโโ player-info.tsx
โโโ character-controller.tsx
โโโ character-soldier.tsx
โโโ crosshair.tsx
โโโ bullet.tsx
โโโ bullet-hit.tsx
- Initializes WebGL canvas
- Enables shadows & postโprocessing
- Wraps the scene with physics & suspense
experience.tsx (Game Orchestrator)
- Player join / leave handling
- Bullet lifecycle management
- Kill & death tracking
- Network synchronization
- Lighting & environment setup
- Movement & rotation
- Shooting logic
- Camera follow
- Health, death & respawn
- Collision damage detection
- Physicsโbased bullets
- Hostโvalidated collisions
- Visual hit shards
- Automatic cleanup
- Live player list
- Kill / death stats
- Player colors & avatars
- Fullscreen toggle
sequenceDiagram
participant Client
participant Host
Client->>Host: Movement Input
Client->>Host: Fire Event
Host->>Host: Simulate Physics
Host->>Host: Detect Collisions
Host->>Host: Update Game State
Host->>Client: Sync State
- Move: Keyboard or joystick
- Aim: Player rotation
- Fire: Shoot button
- Fullscreen: Topโright icon
- Node.js 18+
- npm / pnpm / yarn
npm installnpm run devOpen: http://localhost:5173
npm run build
npm run preview- First player becomes host
- Host:
- Controls physics
- Validates hits
- Updates scores
- No dedicated server
- If host disconnects โ session resets
- No dedicated server
- No anti-cheat system
- Not suitable for large lobbies
- Experimental networking
- Browser performance dependent
This project is licensed under the MIT License. See the for details.
