johanhelsing / johanhelsing.github.io

Johan Helsings github page
1 stars 0 forks source link

Extreme Bevy 4: Keeping score #36

Open johanhelsing opened 9 months ago

johanhelsing commented 9 months ago

https://johanhelsing.studio/posts/extreme-bevy-4

ConnorBP commented 8 months ago

Thank for for the excellent tutorial series! This has helped me get up and running with both deterministic state synchronization and bevy ecs. Very helpful learning tool, thank you.

Now, I have a couple of bug observations from the project up to this state:

  1. Hard to pinpoint the cause, but there is a desync issue on player death events. Sometimes when killing a player one or both clients don't respawn the player that died and the game either continues the round with only one player alive and the other looking at a blank screen or the other player respawns but only on their side. They still continue to see you moving and shooting in that case, but you cannot see them and no round end events happen for the player who didn't see the other respawn from then on.

  2. This one is maybe a problem with the matchbox implementation: WebRTC requires wss secure sockets to be used when you want to host your webasm game on an https secured site. This however does not seem to work as the matchbox server denies connections using wss over ws currently. Edit just saw this: https://johanhelsing.studio/posts/deploying-matchbox which solves this problem. It would still be nice to support secure sockets out of the box though.

Side note: I made a quick js binding snippet to check for https or http mode on the page to dynamically select which connection type to use for web sockets if you would like I can post it for you to add to the next version of the game. I also came up with a novel method of creating a session hash from the two players uuids to use as a deterministic prng seed for player random spawns I can contribute if you would like. My next step is probably wave collapse map generator and simple cell based collision.

johanhelsing commented 5 months ago

Hard to pinpoint the cause, but there is a desync issue on player death events. Sometimes when killing a player one or both clients don't respawn the player that died and the game either continues the round with only one player alive and the other looking at a blank screen or the other player respawns but only on their side. They still continue to see you moving and shooting in that case, but you cannot see them and no round end events happen for the player who didn't see the other respawn from then on.

Thanks for spotting and reporting this. It has now been fixed in part 3.5, which adds desync detection.