SmartlyDressedGames / Unturned-3.x-Community

Community portion of the Unturned-3.x repo. If you have access to the source code you can find it here:
https://github.com/SmartlyDressedGames/Unturned-3.x/
83 stars 17 forks source link

Line of sight check oversight with bullet registration #4404

Open BannanaBusBoat opened 1 month ago

BannanaBusBoat commented 1 month ago

Not sure if this issue is known or if it's been reported, I decided to make this post incase it hasn't.

If the player does not have line of sight with where a bullet impacts on an entity, then the bullet does not register. This is fine on servers without ballistics enabled. On ones where ballistics are enabled however, there are situations where bullets that should impact fail to register because of the failed line of sight check. This issue does not occur in singleplayer, only in multiplayer.

https://youtu.be/MRdbkcxMg2c

Attached above is a brief video showing this effect happening in a mostly controlled testing environment.

The gun used in the test has 0 bullet drop, a ballistic travel value of 50, and a ballistic step value of 1, meaning the gun has a bullet travel time of 50 m/s, hence the slow projectile speed.

ItsRodrigoAl commented 1 month ago

Which one is your quality terrain setting? low medium etc.

SDGNelson commented 1 month ago

Sorry, you are correct that there are false (negatives? positives?) with LoS checks with ballistics enabled. The reason is that ballistics are simulated on the client before reporting the final hit to the server, and the server doesn't do any rewind. (in the past there were some experiments with syncing hit validation time to client time, but it was rather performance heavy and I didn't do a great job of it) It's definitely a valid complaint but I don't have any current plans to better address it unfortunately. 😞

BannanaBusBoat commented 1 month ago

Which one is your quality terrain setting? low medium etc.

Terrain was set to ultra, though it also happens with map objects like buildings. Plus at the distance I was at relative to the terrain, it would likely not have had an impact.