2024-04-19 06:45 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002814Spring engineGeneralpublic2011-12-18 13:31
ReporterGoogle_Frog 
Assigned ToKloot 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version84.0 
Target VersionFixed in Version85.0 
Summary0002814: Units slow to their minimun allowed speed when turning
DescriptionUnits with turninplace=1 stop completely to turn. Units with turninplace=0 and turninplacespeedlimit<maxvelocity slow to turninplacespeedlimit to turn.

Apparently this is undesired behaviour. I think units are suppose to partially slow down intelligently depending on the angle of the turn (with lower limit turninplacespeedlimit).

I'm not really sure because I am happy with the behaviour of turninplace=0 and turninplacespeedlimit=maxvelocity and am using it for everything in ZK.
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0007834

Kloot (developer)

"Units with turninplace=0 and turninplacespeedlimit<maxvelocity slow to turninplacespeedlimit to turn."

If the turn angle is large enough, yes.

"I think units are suppose to partially slow down intelligently depending on the angle of the turn (with lower limit turninplacespeedlimit)."

They do, tipSL only "defines the _minimum_ speed units will slow down to (the speed at which the turn is actually performed can be higher depending on the angular difference and turnRate)" to quote myself from the wiki. Maybe in practice units drop down to tipSL too quickly, but it is highly dependent on turnRate.

~0007835

hoijui (reporter)

aehm... sounds to me like the request is already implemented.. nothing to do.. close?

~0007836

Google_Frog (reporter)

corgator in ZK slow to a stop when turning 45 degrees if I change turninplacespeedlimitto 0. The turning in this case is done by the pathfinder, no extra move order is given after the first. This is a fairly ordinary unit.

maxVelocity = 3.7
acceleration = 0.057
brakeRate = 0.07
turnRate = 703
turninplace = 0
turninplacespeedlimit = 0

Give it a move order at 30 degrees off an axis to cause the pathfinder zig-zag to observe the over slowing.

"Maybe in practice units drop down to tipSL too quickly, but it is highly dependent on turnRate. "
Basically.

Perhaps there could be some tags to let mod devs more finely control slowing. Tags could control a function that decides how far to slow based on turn angle.

~0007837

Kloot (developer)

Last edited: 2011-12-06 20:16

"turnRate = 703"

This means the unit can turn (703 / 65536) * 360 = 3.86 degrees per frame. The speed reduction factor is proportional to (degrees(turnRate) / turnAngle), in this case (3.86 / 45) = 0.08, so while turning its speed will drop to (maxVelocity=3.7 * 0.08) = 0.29 elmos/frame. But a 45-degree turn only takes (45 / 3.86) = 11.65 frames to complete, so the unit should not lose more than (brakeRate=0.07 * 11.65) = 0.81 elmos/frame of its initial speed going into the turn. Might be a bug, please test with a recent development build (6c9931d3ed88825568c742225f26a0963d73aee9 or later).

~0007839

Google_Frog (reporter)

That is a ridiculously sharp reduction factor so in practise units will slow to turninplacespeedlimit as fast as their brake rate allows.

Could we define our own reduction factor? A linear equation would be good enough. Something like:

reduction factor = gradientTag * (degrees(turnRate) / turnAngle) + constantTag

Limit the range to [turninplacespeedlimit/maxVelocity , 1]

~0007840

Kloot (developer)

Last edited: 2011-12-07 12:14

"units will slow to turninplacespeedlimit as fast as their brake rate allows."

That is the point.

Nevertheless I asked you to test a development build for a reason, because 1) taking your own corgator example the total slowdown during a 45-degree turn should not be more than 0.81 elmos and 2) relevant parts of the code controlling acceleration changed (since 84.0). I'm not going to modify the formula without feedback.

~0007841

Google_Frog (reporter)

By "units will slow to turninplacespeedlimit as fast as their brake rate allows." I meant that for common turnRates the formula returns a very low reduction factor for the angle of turn. So the formula doesn't achieve much.

Anyway that's just clarification, I'll test the changes since 84.0 sometime and report back.

~0007856

Google_Frog (reporter)

In spring_84.0.1-461-gae47ae2 it is better for the above attributes. For a unit with higher brakeRate there is too much slowdown.
+Notes

-Issue History
Date Modified Username Field Change
2011-12-06 11:58 Google_Frog New Issue
2011-12-06 12:26 Kloot Note Added: 0007834
2011-12-06 12:35 hoijui Note Added: 0007835
2011-12-06 14:30 Google_Frog Note Added: 0007836
2011-12-06 16:55 Kloot Note Added: 0007837
2011-12-06 20:16 Kloot Note Edited: 0007837
2011-12-06 20:16 Kloot Note Edited: 0007837
2011-12-07 09:03 Google_Frog Note Added: 0007839
2011-12-07 11:20 Kloot Note Added: 0007840
2011-12-07 11:20 Kloot Note Edited: 0007840
2011-12-07 11:30 Google_Frog Note Added: 0007841
2011-12-07 12:14 Kloot Note Edited: 0007840
2011-12-11 11:03 Google_Frog Note Added: 0007856
2011-12-18 13:31 Kloot Status new => resolved
2011-12-18 13:31 Kloot Fixed in Version => 85.0
2011-12-18 13:31 Kloot Resolution open => fixed
2011-12-18 13:31 Kloot Assigned To => Kloot
+Issue History