Skip to content

hathora/topdown-shooter-bevy-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Topdown Shooter Bevy Client

An implementation of the multiplayer Hathora topdown shooter client using Rust and Bevy. This consumes the Rust Hathora client

Assets from Kenney

demo.mov

Running Locally

Install cargo via rustup

cargo run # create a new room with default APP_ID
cargo run -- $ROOM_ID # connect to an existing room with default APP_ID
cargo run -- $ROOM_ID --app-id $APP_ID # connect to an existing room with a custom APP_ID

Overview

This client reads and writes data from a Hathora server. The server data is treated as authoratitive, so this client just renders server updates and passes inputs to the server for processing.

Server updates and user inputs are sent and received over a websocket. The server is configured to send updates every 50ms. The client update loop is decoupled from server updates by configuring the underlying TCP stream to be non-blocking. When updates are received, they are added to an interpolation buffer. This allows the client to smoothly display updates with a high frame-rate, regardless of the server's tick rate.

Building a distributable release

cargo will generate an executable file. This file assumes that assets like sprites are in specific directories relative to the executable. To build an executable bundled with assets, a release script is available:

./release.sh

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published