Skip to content

Latest commit

ย 

History

History
75 lines (56 loc) ยท 2.08 KB

File metadata and controls

75 lines (56 loc) ยท 2.08 KB

๐ŸŽฎ Rust Multiplayer Minigame

A mini multiplayer game written entirely in Rust โ€” featuring an async Tokio TCP server, WGPU-based GUI client, and a CLI client alternative. Designed to be real-time, modular, and highly testable.

Features:

  • โœ”๏ธ Lobby system
  • โœ”๏ธ Hider/Seeker role logic
  • โœ”๏ธ Custom JSON protocol
  • โœ”๏ธ Procedurally generated map
  • โœ”๏ธ Full async & multithreaded code
  • โœ”๏ธ Unit & integration tested
  • โœ”๏ธ Ingame Chat (CLI only so far)

Quick Try

You can download the latest release here

Run server

rust_multiplayer server

Start client (new player):

rust_multiplayer player

Lobby

Players who connect are placed in the lobby. Once all click Ready, the game begins:

Gameplay

One player is randomly selected as the Seeker. The Seeker left-clicks entities to uncover hidden players:

  • โŒ A wrong guess costs a heart
  • ๐Ÿ’ก Finding a real hider uncovers them
  • ๐Ÿ•’ Game ends when time or lives run out

Architecture

Server:

  • Async TCP server built with [Tokio]
  • 2 main tasks loops:
    • networking handling incomming connections, handling requests, forming responses
    • game world managing game states, updating entities
  • Players are decoupled from entities (ECS-style)

Client:

  • Abstractian over TCP request-responses
  • Multithreading friendly
  • WGPU frontend

Tests & Running

Tests:

  • Unit tests coves complex logic
  • Integration tests covers cleint-server requersts and state transition

Run:

  • server mode rust_multiplayer.exe server, server will be exposed on default address,
  • client mode rust_multiplayer.exe player, client will be conencted to server, server assigns random player name
  • cli mode rust_multiplayer.exe client, in development, executing requests

Crates / Tools Used

[Tokio] โ€“ async runtime [Serde] โ€“ serialization [WGPU] โ€“ GPU rendering [Clap] โ€“ command-line parsing [thiserror] โ€“ error handling