From e5fdbaadbf01f14290e70c49482e1dce3c9816d8 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 18 Sep 2024 14:05:34 +0200 Subject: update documentation --- protocol.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'protocol.md') diff --git a/protocol.md b/protocol.md index b5201abd..35671e75 100644 --- a/protocol.md +++ b/protocol.md @@ -13,7 +13,6 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . - --> # Hurry Curry! protocol @@ -32,9 +31,8 @@ The protocol schema is defined in [`protocol.ts`](./test-client/protocol.ts) - `add_player` for every player in the game - `set_player_item` for every item held by a player 5. Run the game loop - - Send your position every 40ms. - - Send `interact` when the player interacts with a tile. Make sure to set the - `edge` parameter consistently. + - Send your position every 20ms - 40ms. + - Send `interact` when the player interacts with a tile. - Receive packets 6. The Game ends. The server will remove all players and tiles. Then continue at step 4. @@ -62,9 +60,11 @@ be used if either minor or major version differs. ## Movement -Movement is handled mostly client-side. Therefore it is implemented three times: +Movement is handled server-side but should be predicted by client for better +latency. For this reason it implemented three times: -- In the test-client: [movement.ts](./test-client/movement.ts) -- For customers in the server: [movement.rs](./server/src/customer/movement.rs) -- In the client: +- In GDscript (for the Godot client): [controllable_player.gd](./client/player/controllable_player.gd) +- In Rust (for server, pixelcurry and customers): + [movement.rs](./server/protocol/src/movement.rs) +- In TypeScript (for test-client): [movement.ts](./test-client/movement.ts) -- cgit v1.2.3-70-g09d2