Game Development Community

AiPlayer slowdown

by Petter Holmberg · in Torque Game Engine · 09/02/2005 (9:43 am) · 4 replies

This is related to my previous post here:

www.garagegames.com/mg/forums/result.thread.php?qt=34046

I may have found the reason why the player "spins" upon arrival at a destination point. If you simply walk from point A to point B with setMoveDestination(%xyz, 0), there appears to be a problem when the AiPlayer stops. On the other hand, if I walk with a slowdown (setMoveDestination(%xyz, -1)) the problem does not appear. onReachDestination works in either case, but the player will only stop completely when walking with slowdown.

I don't mind using a walk with slowdown for the last point on a path, but I need to minimize that slowdown. Ideally it wouldn't even be noticeable, because it doesn't suit my game. Can I do this from the script side?

#1
09/02/2005 (1:25 pm)
Ok, this is not the whole truth. Upon further testing I have been able to ascertain that the spinning problem is not isolated to stopping after a walk. It is with the demo orc, which also has this problem every time, but it happens at the start of walks with my own characters, and only sometimes. I haven't even found a pattern for when it happens and when it doesn't. I used trace(true); from the console and absolutely nothing is being called during a spinning walk, so it's definitely not a script function causing it. There's only a setMoveDestination call, with a valid target coordinate, and the player starts spinning! I'm at a loss for more ideas.
#2
09/02/2005 (2:38 pm)
Sounds like it is time for you to dive into the C++ side of things! Do you have the source code? If you do then the player.cc file is where you will find the answers. You will learn quite a bit by browsing through it.

B--
#3
09/02/2005 (5:21 pm)
Yes, I suppose so... It's caused by the engine somehow, possibly because something with the models is fishy. It's strange that the orc and my models make for a different effect, although it's without doubt related. It's worth noting that my AiPlayer walks are usually between points that are pretty close to each other. Maybe it has something to do with things. Another strange thing is how this effect has gone from practically never happening to happening frequently without any code changes affecting walks. What has changed that could matter is that more content has been put into the mission file. It's pretty heavy on the graphical side as it uses complex static shapes. Up until recently there have been only one AiPlayer in the game though.
#4
03/19/2006 (7:08 pm)
I was making an animal model and having the same spinning problem,
I've tried the solution you offered but seems it doesn't work for me,
then I moved the eye node closer to the center of the bounding box,
(it's originally at the animal's head, which is 2 to 3 units aways from the centre of the bounding box)
it seems that the spinning problem is solved now.

See if it helps