Skip to content

AsyncStudio/dodge-tanks

Repository files navigation

Dodge Tanks Mono

A game project built with a monorepo architecture.

Overview

Dodge Tanks is a tank-based game where players must dodge incoming obstacles and enemies.

Architecture

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

Key Components

  • 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

Multiplayer Architecture

Server Authoritative

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

Client Prediction

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

Server Reconciliation

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

Getting Started

Prerequisites

  • Node.js (version TBD)
  • Package manager (npm/yarn/pnpm)

Installation

# Install dependencies
npm install

# Run the project
npm run dev

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published