-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix diagonal movement speed bug #752
base: develop
Are you sure you want to change the base?
Conversation
I suggest to merge this fix later when we no longer need game state to be consistent with original. For now it will be good to have Thyme work similar to Original, so we can use Original Replays to backtest and find issues. This change would break this ability. |
Fix is done, but converting to Draft for the time being. |
dfde4bb
to
74cc4c4
Compare
Functions were moved from header to cpp file. Change updated accordingly. |
const float dir_len = GameMath::Sqrt(dir->x * dir->x + dir->y * dir->y); | ||
float len = vel_len * dir_len; | ||
// Scale len by (1 + sqrt(2)) / 2 to adjust to the average of the former min/max movement speed. | ||
len /= 1.20710678f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May as well multiply by the inverse (may be faster).
Would need to think about if this factor is the correct one. It should be scaled by:
speed *= average_before/average_after
What is average_before though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiplication indeed is favourable here. That would be 1/1.20... = 0.82842712 then.
74cc4c4
to
4b6826b
Compare
Codecov ReportPatch and project coverage have no change.
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## develop #752 +/- ##
=======================================
Coverage 2.67% 2.67%
=======================================
Files 822 822
Lines 89290 89294 +4
Branches 14799 14799
=======================================
+ Hits 2387 2390 +3
- Misses 86559 86560 +1
Partials 344 344
☔ View full report in Codecov by Sentry. |
This change fixes the diagonal movement speed bug.
Reference TheSuperHackers/GeneralsGamePatch#650
Demo
game.2022-10-03.20-18-12-35.mp4