A game project built with a monorepo architecture.
Dodge Tanks is a tank-based game where players must dodge incoming obstacles and enemies.
This project uses a monorepo structure to organize related packages and applications:
dodge-tanks-mono/
├── packages/ # Shared packages and libraries
├── apps/ # Application code
└── README.md # This file
- Monorepo Structure: Centralized codebase for easier dependency management and code sharing
- Modular Design: Separation of concerns between game logic, rendering, and utilities
- Shared Packages: Reusable components across different parts of the application
The game uses a server-authoritative architecture where:
- All game state is managed and validated on the server
- The server is the single source of truth for player positions, collisions, and game events
- Clients send inputs to the server, not direct state changes
- Prevents cheating and ensures consistent gameplay across all clients
To maintain responsiveness despite network latency:
- Clients predict the outcome of their inputs locally
- Players see immediate feedback for their actions
- Predictions are later reconciled with authoritative server state
When client predictions diverge from server state:
- Server sends authoritative updates to clients
- Clients replay unacknowledged inputs from the corrected state
- Smooth corrections prevent jarring visual jumps
- Ensures eventual consistency between client and server
- Node.js (version TBD)
- Package manager (npm/yarn/pnpm)
# Install dependencies
npm install
# Run the project
npm run dev