Page 1 of 1

What is turninplaceanglelimit for and is it in 87.0?

Posted: 18 Mar 2012, 06:20
by Google_Frog
Beherith added turninplaceanglelimit to BA but I cannot get it to work. If I understand correctly turninplaceanglelimit=130 and turninplacespeedlimit=0 should cause units to only slow down for sharp turns. My units slow down for any turn with these tags set.

Re: What is turninplaceanglelimit for and is it in 87.0?

Posted: 31 Mar 2012, 12:49
by Google_Frog
It still looks like the tag has no effect in 88.0.

Re: What is turninplaceanglelimit for and is it in 87.0?

Posted: 31 Mar 2012, 14:14
by jK

Re: What is turninplaceanglelimit for and is it in 87.0?

Posted: 05 Apr 2012, 17:01
by Google_Frog
That was not helpful. What is the angle range of this tag?

Re: What is turninplaceanglelimit for and is it in 87.0?

Posted: 05 Apr 2012, 17:59
by jK
It is helpful, just check where turnInPlaceAngleLimit occurs.

tip: turnInPlaceSpeedLimit & turnInPlaceAngleLimit are mutual exlusive.
tip2: the range of such values in that code part is obv. in degree (there are *180 & *360). Still you should check if there is a space-transform in the UnitDef when reading them from LuaDefs.

Re: What is turninplaceanglelimit for and is it in 87.0?

Posted: 06 Apr 2012, 13:09
by knorke
I did not really understand it either.

Code: Select all

if (reqTurnAngle > ud->turnInPlaceAngleLimit) {
targetSpeed = turnSpeed;
hm ok.
so reqTurnAngle is

Code: Select all

const float reqTurnAngle = math::fabs(180.0f * (owner->heading - wantedHeading) / SHORTINT_MAXVALUE);
With the wantedHeading I am lost.

But I also do not understand some fundamental things:
I thought spring units can only turn at always the same rate.
So to drive a bigger circle units still turn at the same amount per frame, just with longer pauses in between (while going forward)?
So what angle is turnInPlaceAngleLimit really compared with?
---
CGroundMoveType::BreakingDistance, startBreaking etc:
Isn't it spelled without "e"? (to brake = slow down, break = fall apart. note sure but google agrees)

Re: What is turninplaceanglelimit for and is it in 87.0?

Posted: 06 Apr 2012, 13:59
by Kloot
With the wantedHeading I am lost.
imagine how units feel
I thought spring units can only turn at always the same rate.
yes
So to drive a bigger circle units still turn at the same amount per frame
yes
just with longer pauses in between (while going forward)?
no, by going faster (turning radius is a function of turnrate *and* speed)
So what angle is turnInPlaceAngleLimit really compared with?
the requested/required (reqTurnAngle) turning angle
Isn't it spelled without "e"?
both spellings contain an 'e', just in different places (but yes)

Re: What is turninplaceanglelimit for and is it in 87.0?

Posted: 06 Apr 2012, 14:29
by knorke
no, by going faster (turning radius is a function of turnrate *and* speed)
i guess mostly by going slower? seeing as units should already be at maxspeed most of the time?
the requested/required (reqTurnAngle) turning angle
So units look ahead and slow down before turns? Wouldnt it be better if "the turning that actually happens" slowed them?
Like
deltaHeading = currentHeading-oldHeading
slowDown = some function of deltaHeading


I thought about it and looked at stuff but now I am confused and don't even know what to ask.
Though I see why pathing always breaks. *bada-bom-szhh*

Re: What is turninplaceanglelimit for and is it in 87.0?

Posted: 06 Apr 2012, 14:58
by Kloot
i guess mostly by going slower? seeing as units should already be at maxspeed most of the time?
yes, or that (lower speed decreases the radius)
So units look ahead and slow down before turns?
nonono
Wouldnt it be better if "the turning that actually happens" slowed them?
they do (because turnSpeed *= (maxTurnAngle / reqTurnAngle); forces them to)
slowDown = some function of deltaHeading
stare at the two targetSpeed = ... turnSpeed ... lines until you see.
I thought about it and looked at stuff but now I am confused and don't even know what to ask.
you have reached the beginning phase of enlightenment
Though I see why pathing always breaks
sadly getting complicated things right is harder than getting them wrong.