Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llMoveToTarget: removing the slowdown near the end?

Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
04-22-2008 13:17
I have a friend who's playing with llMoveToTarget, getting an object to move along a path, and the way it slows the object down as it starts getting close to the target is driving her nuts.

Aside from deliberately overshooting each target and using llTarget/at_target, is there any way to turn this feature off or control how it behaves? I haven't seen anything in the wikis.. :(
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Darien Caldwell
Registered User
Join date: 12 Oct 2006
Posts: 3,127
04-22-2008 13:24
Nope, that's just how it works. You can play around with things to manipulate the effect, but there's no 'damper' control sadly.
_____________________
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
04-22-2008 20:31
You could try decreasing the damping coefficient as you get closer to the target position. Probably something like tau=currentDistance/VELOCITY.
RobbyRacoon Olmstead
Red warrior is hungry!
Join date: 20 Sep 2006
Posts: 1,821
04-22-2008 21:01
From: Hewee Zetkin
You could try decreasing the damping coefficient as you get closer to the target position. Probably something like tau=currentDistance/VELOCITY.


That's an interesting thought, I'm going to have to play with that idea this weekend :)
_____________________
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
04-22-2008 22:10
From: Meade Paravane
I have a friend who's playing with llMoveToTarget, getting an object to move along a path, and the way it slows the object down as it starts getting close to the target is driving her nuts.

Aside from deliberately overshooting each target and using llTarget/at_target, is there any way to turn this feature off or control how it behaves? I haven't seen anything in the wikis.. :(



That IS the way to control it. No matter what you do, having a small range value in the llTarget() function is going to cause serious damping to occur, because, as it approaches the target, it damps more, so by setting a range of say, 0.1, you're going to get ALOT of damping. The best way is to set a range of 1.5-2.0 meters in llTarget(), and adjust the waypoint you're heading for. Typically, you dont even have to do that. I have a bot I'm working on, and you set the waypoints by setting the position of the bot, clicking a menu button, and repeating. When the bot is patrolling the waypoints that you have setup, I use a range of 1.5 meters, it doesnt really make much difference that it's actually triggering at 1.5 meters from the target. I've found 1.5 meters is a good range value for llTarget, as the bot doesnt slow down so much, and his motion appears relatively fluid. I imagine decreasing the damping as it approaches the would work, but that's alot of extra code and execution overhead for something that is easily fixed by changing one variable.. range, from whatever (low I'm sure) value you have set, to 1.5. Give it a try first, and see if you can fix your issue that way before you dive into timer events and recalculating tau over time.

if you want to see my bot in action, he's in testing about my store, feel free to check it out, and if I'm around feel free to approach me with any questions.

http://slurl.com/secondlife/Midas%20Northwest/46/66/21/
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
04-28-2008 08:26
Thanks for the replies.

I was just gonna add a JIRA suggestion to change this, followed up possibly by some harrassing of Sidewinder, and found there's already one there.

Please give http://jira.secondlife.com/browse/SVC-1479 a look & a vote if you'd like an easier way to control this stuff.
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Chaz Longstaff
Registered User
Join date: 11 Oct 2006
Posts: 685
04-28-2008 18:35
voted for it, Meade.