redhat-gamedev / srt-godot-client

Space Rings Thing Game Client (for Red Hat Gaming)
Apache License 2.0
7 stars 5 forks source link

when two ships are touching, sometimes the missile reload sequence fails to ever reload #61

Open thoraxe opened 1 year ago

RoddieKieley commented 1 year ago

Looks like the missile lives on forever and thus a new one cannot be created. Looking at the client we see that the missile is added to the group "missiles" but never removed and only QueueFree()'d upon explosion. While a miss that could be cleaned up other ways if the node is auto removed from the group upon destruction but not sure if that's the case.

However doing that alone is not enough as testing today with 20 server side players showed that if the client fired and held down the 2nd missile would pass through the same ship and likely the missile would live forever as there was never a boom to be heard after it went off screen.

An update server side in the ExpireMissile function like: // check if reload complete if (MissileReady == false) { // _serilogger.Debug($"PlayerShip.cs: player {uuid} not done with reload - skipping"); // return; _serilogger.Debug($"PlayerShip.cs: player {uuid} not done with reload - continuing anyway and setting MissileReady!"); MissileReady = true; }

Avoids this behaviour but probably isn't safe so it may come down to the timing between reload and explosion and how that's handled. A little more digging and testing would likely say for sure.