(feat) Realistic ball spin calculation - #10
Conversation
|
Hello yusitnikov, |
|
Ground collision - fixed. Try experimenting with Old replays - fixed. That's how it goes:
I'm not that happy for this code overcomplication, but I hope that it could be useful in the future if you would want to modify the game engine further and keep old replays under control - just declare the code that you're going to change as virtual, create new class versions and override the behavior in the new version without affecting the previous engine. |
|
@danielknobe , did you have a chance to review the fixes? |
|
Thank you for the latest changes. I will review the patches as soon as possible. Unfortunately I have very little time at the moment. |
|
@yusitnikov: |
|
The technical reason for the weird ball spin in replays in that the replays have many "savepoints" of the game state (which includes ball rotation and angular speed). So, in the beginning of the match the ball spin is OK since it's just calculated to the new rules. But, starting from the first savepoint, the angular spin from the spin overrides the "realistic" ball spin and all further spin is calculated wrong because of the initial value. |
|
Thanks for the hint. Blobby Volley 1.0 still had a pure binary format for the replays. So at least for the first use of the XML format a versioning can be omitted. If you could remove the commit dfbf17b from the PR, I would do the merge. dfbf17b can then be used if necessary for a later change. If you wish, you can include the small refactoring changes (eg resetBallAngularVelocity), except for versioning, in the PR. Thank you very much for this feature. |
Hello :)
This PR contains a feature of realistic ball spin (aka angular velocity) re-calculation on ball-blob collision.
The following factors are being taken into consideration:
The following factors are not being taken into consideration:
Known issues:
You can see the result in action in slow motion here: https://www.youtube.com/watch?v=J5xxgm7GFIg