View topic - What is turninplaceanglelimit for and is it in 87.0?


All times are UTC + 1 hour


Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: 18 Mar 2012, 06:20 
Moderator

Joined: 12 Oct 2007, 08:24
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.
Top
 Offline Profile  
 
PostPosted: 31 Mar 2012, 11:49 
Moderator

Joined: 12 Oct 2007, 08:24
It still looks like the tag has no effect in 88.0.
Top
 Offline Profile  
 
PostPosted: 31 Mar 2012, 13:14 
Spring Developer
User avatar

Joined: 28 Jun 2007, 06:30
https://github.com/spring/spring/blob/d ... e.cpp#L544
Top
 Online Profile  
 
PostPosted: 05 Apr 2012, 16:01 
Moderator

Joined: 12 Oct 2007, 08:24
That was not helpful. What is the angle range of this tag?
Top
 Offline Profile  
 
PostPosted: 05 Apr 2012, 16:59 
Spring Developer
User avatar

Joined: 28 Jun 2007, 06:30
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.
Top
 Online Profile  
 
PostPosted: 06 Apr 2012, 12:09 
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
I did not really understand it either.
Code:
if (reqTurnAngle > ud->turnInPlaceAngleLimit) {
targetSpeed = turnSpeed;

hm ok.
so reqTurnAngle is
Code:
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)
Top
 Offline Profile  
 
PostPosted: 06 Apr 2012, 12:59 
Spring Developer

Joined: 08 Oct 2006, 15:58
Quote:
With the wantedHeading I am lost.


imagine how units feel

Quote:
I thought spring units can only turn at always the same rate.


yes

Quote:
So to drive a bigger circle units still turn at the same amount per frame


yes

Quote:
just with longer pauses in between (while going forward)?


no, by going faster (turning radius is a function of turnrate *and* speed)

Quote:
So what angle is turnInPlaceAngleLimit really compared with?


the requested/required (reqTurnAngle) turning angle

Quote:
Isn't it spelled without "e"?


both spellings contain an 'e', just in different places (but yes)
Top
 Offline Profile  
 
PostPosted: 06 Apr 2012, 13:29 
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
Quote:
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?

Quote:
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*
Top
 Offline Profile  
 
PostPosted: 06 Apr 2012, 13:58 
Spring Developer

Joined: 08 Oct 2006, 15:58
Quote:
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)

Quote:
So units look ahead and slow down before turns?


nonono

Quote:
Wouldnt it be better if "the turning that actually happens" slowed them?


they do (because turnSpeed *= (maxTurnAngle / reqTurnAngle); forces them to)

Quote:
slowDown = some function of deltaHeading


stare at the two targetSpeed = ... turnSpeed ... lines until you see.

Quote:
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

Quote:
Though I see why pathing always breaks


sadly getting complicated things right is harder than getting them wrong.
Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Site layout created by Roflcopter et al.