Repository navigation
Conversation
|
|
Why is the horizontal movement speed being increased? In retail, units already move at their locomotor-defined speed when traveling horizontally or vertically. Wouldn't slowing down diagonal movement be the more appropriate solution? Also, changing movement speeds will inevitably alter the timing of scripted in-game cinematics. |
Because then on average the game unit movements will be around 20% slower than originally, noticably making the game play with less pace.
That is a fair point we probably need to think about. |
The amount of diagonal and straight movements is highly map dependent. A 2-player game where players start in the corners will have relatively more diagonal movements - therefore the game will be slower than before - than on a map where players start in the (middle) top and bottom - and increases the game speed compared to before. I feel like this solution is too crude. It is such a major hack that has significant impact on how the game feels. IF this solution is considered, it will need extensive testing among the community on different maps.. Also, as Pathfinding uses a grid based algorithm, therefore most movements are either horizontal/vertical or diagonal, but rarely any other angle. |
|
Hell yeah, long time due! |
Yes. But the total average of all movements will be right between former min and max speeds.
I would like to have this run as a trial.
I do not understand this statement. Movements are free into any direction, for both ground and air units. |
I have addressed this and confirmed that it works correctly in mission cinematics. From my POV this change is final right now. |
|
Needs review. |
|
Is the scaling factor 1.207 (v(x) = 1+4/pi*(sqrt(2)-1)*x) or 4/pi ~= 1.27 (v(x) = cos(x) + sin(x) if x is positive)? |
|
Here it is (1 + sqrt(2)) / 2 |
|
On the constant, for reference: the true per-heading factor is Answering penfriendz:
|
|
If the dot product is to be used to determine the velocity in the direction the object is facing then there should be a debug assert added to make sure that the dir vector is always normalised.
If the dir vector is not normalised then the expectation that we are getting the magnitude of the velocity breaks. |
19ada89 to
1b00149
Compare
|
I have completely reworked this change after several review rounds with Claude Opus. |
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: fa6fbb0e-b436-4a43-b174-6baa125115d0
📒 Files selected for processing (11)
Core/GameEngine/Include/Common/GameDefines.hCore/GameEngine/Include/Common/GameUtility.hCore/GameEngine/Source/Common/GameUtility.cppGeneralsMD/Code/GameEngine/Include/GameLogic/Locomotor.hGeneralsMD/Code/GameEngine/Include/GameLogic/Module/PhysicsUpdate.hGeneralsMD/Code/GameEngine/Include/GameLogic/ScriptEngine.hGeneralsMD/Code/GameEngine/Source/GameLogic/Object/Locomotor.cppGeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cppGeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cppGeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cppGeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
|
All review comments have been worked on. Ready for Review. |
There was a problem hiding this comment.
It looks good to me.
@Skyaero42 there's requested changes from you open
|
I am not confident about this PR. I have expressed my concerns earlier about the correction factor and its impact on the game play. I see potential issues for cross-maps vs opposite player maps, as timings - and therefore strategies will change. A diagonal attack takes roughly 22% longer, while a straight attack is like 15% slower. This may confuse the pro-players. I also am concerned about modded games like AOD, where timings will be different than before - which could have a great impact on the difficulty of the game. Additionally, I think we need the harmonic mean here instead of the arithmetic - as the goal is the similar times going across a path. You would have to calculate 1 / avg(1/ v(theta)), which according to Claude is 1.16300031 - slightly lower than the arithmetic one. I also don't like that the letterbox - a script action for a UI effect - is now used as a logic trigger. It also doesn't fully resolve the issue. Anything in game that is speed related, like a convoy or escort type of mission - will have its timings off. I'm not sure if the single player games do have any of these types, but there are a lot custom-made missions that may not be so strict on using letterbox for scripted movements. I understand this is seen as a long-awaited bug fix in the game - rightfully so. But I believe the potential consequences on (custom) maps are being underestimated. I'm dismissing my review - because I don't want to be a blocker in this. But I can't approve the PR in good faith. |
The fix is opt-in. Default disabled. We cannot modify all maps now to accomodate this code fix. It's just the way it is. Map creators can create new maps for fixed movement speeds. There is an argument to make that maybe this could be a GameData.ini opt-in, rather than compile opt-in. But making this a per map.ini setting would be silly, because then maps can play differently under the same Mod.
Why? What are the benefits? I remember I chatted with Claude about this time ago and we settled on arithmetic mean as the logical choice for preserving the former average speed for heading into all directions with equal probability.
Please suggest an alternative if there is a better way. The letter-box was picked because every cinematic in the campaign is shown with the letter box, it is determistic for logic and therefore works for this use case. It can be opted out of with a compile option.
They are not underestimated. Everyone knows this is highly controversial which is why this is default disabled. |
…en m_letterBoxActive is not serialized
…s for when m_letterBoxActive is not serialized" This reverts commit 07335ba.
30a0132 to
d30582a
Compare
Ok. I have discussed this with Claude as well again, and we have settled on the harmonic mean of the two extremes, which sits exactly between the harmonic mean and arithmetic mean. The switch is done: SummaryThe question. Retail units moved at 1x their authored speed on axis aligned headings and up to √2x on diagonals. The fix makes the speed uniform, so one constant has to decide where inside that 1 to √2 range the new speed sits. The branch used the arithmetic mean over all headings, and the question was whether the harmonic mean would be better. The candidates.
What the two means over all headings stand for. Both preserve the retail average speed, but under different assumptions:
Why we picked the harmonic mean of the two extremes.
What it gives up. It preserves no game-wide total exactly, neither average travel time nor average distance per time. The symmetry is in speed only; in travel time an axis leg is 14.6% shorter and a diagonal leg 20.7% longer. Scale of the decision. All three candidates are within 1.5% of each other, while any single route changes by up to about 17% depending on its heading. The choice is about which justification to stand behind, not about noticeable gameplay. |
|
Replicated in Generals without conflicts. |
This change fixes the diagonal movement speed discrepancy. The new 2d and 3d speeds are scaled by the harmonic mean of the two extremes of the original forward speed discrepancy.
GameDefines gets 3 new defines to control the fix in several ways:
AI Summary
Retail units moved at 1x their authored speed on axis aligned headings and up to √2x on diagonals. The fix makes the speed uniform, so one constant has to decide where inside that 1 to √2 range the new speed sits.
The candidates.
What the two means over all headings stand for. Both preserve the retail average speed, but under different assumptions:
Why we picked the harmonic mean of the two extremes.
4 - 2*sqrt(2)needs no elliptic integral and can be explained in one sentence.What it gives up. It preserves no game-wide total exactly, neither average travel time nor average distance per time. The symmetry is in speed only; in travel time an axis leg is 14.6% shorter and a diagonal leg 20.7% longer.
Scale of the decision. All three candidates are within 1.5% of each other, while any single route changes by up to about 17% depending on its heading. The choice is about which justification to stand behind, not about noticeable gameplay.
TODO