Game Development Community

Path Node: Keep running and not do a stop & run

by elvince · in Torque 3D Professional · 03/11/2010 (11:57 pm) · 6 replies

Hi,

How do you manage that when AI is following a path it do not stop at each node?

It fact in a looping path, when it goes from last node to first node to second node, there is no stop.
For all others it slows down, stops, and go again.

I tried to set msToNext to 0 with no effect.

My function are using the setMoveDestination to move to a node.
I check in C++ code, and no where we can pass the msToNext value, so I'm not sure how it's used.

What the role of the path manager? is it just for the editor?

Thanks,

#1
03/12/2010 (2:50 am)
I would suggest to test this in debug,because bitstream assertfatals are ignored in release builds.
I few months ago I signaled that using very long paths (20+ nodes) lead to out of bounds in bitstream,and the only solution I got is reducing the node max count in c++.
#2
03/16/2010 (9:20 am)
Hi Ivan,

I run my game in debug mode without any error. My paths is really small (5-6 markers)

here is my path in case this help:

new Path(road) {
      isLooping = "1";
      canSave = "1";
      canSaveDynamicFields = "1";
         Node = "121.451797 -27.181772 244.042877 10.000000";

      new Marker() {
         seqNum = "1";
         type = "Normal";
         msToNext = "1000";
         smoothingType = "Spline";
         position = "119.266 -21.9342 246.097";
         rotation = "1 0 0 0";
         scale = "1 1 1";
         canSave = "1";
         canSaveDynamicFields = "1";
      };
      new Marker() {
         seqNum = "2";
         type = "Normal";
         msToNext = "0";
         smoothingType = "Spline";
         position = "130.328 -36.5797 243.121";
         rotation = "1 0 0 0";
         scale = "1 1 1";
         canSave = "1";
         canSaveDynamicFields = "1";
      };
      new Marker() {
         seqNum = "3";
         type = "Normal";
         msToNext = "1000";
         smoothingType = "Spline";
         position = "151.097 -28.3039 239.063";
         rotation = "1 0 0 0";
         scale = "1 1 1";
         canSave = "1";
         canSaveDynamicFields = "1";
      };
      new Marker() {
         seqNum = "4";
         type = "Normal";
         msToNext = "1000";
         smoothingType = "Spline";
         position = "142.127 -4.58641 242.384";
         rotation = "1 0 0 0";
         scale = "1 1 1";
         canSave = "1";
         canSaveDynamicFields = "1";
      };
      new Marker() {
         seqNum = "5";
         type = "Normal";
         msToNext = "1000";
         smoothingType = "Spline";
         position = "131.007 6.90526 242.61";
         rotation = "1 0 0 0";
         scale = "1 1 1";
         canSave = "1";
         canSaveDynamicFields = "1";
      };
   };
#3
03/16/2010 (11:12 am)
If you wanted to have the AI pause ... wouldn't it need to be in the AIplayer.cs? Maybe in onReachDestination when it checks if it needs to move the the next node?

I don't see msToNext referenced in there - I did't check the engine code to see if it does gets passed anywhere.
#4
03/16/2010 (11:18 am)
In fact, I don't want the AI to pause.

The onreachdestination is called once you reach the node, that's mean you are already stopped!

More what I don't understand it's why between last node - First node - Second there is no stop. So the behavior is not the same between all markers.

Did someone succeed in setup a path with an AI move node to node without any pause in BETA1?
#5
03/16/2010 (11:36 am)
lol!
Sorry, I did misread your original post!
Doh!
#6
03/17/2010 (8:52 am)
You can tell setMoveDestination to not slowdown when reach a destination and add a ConsoleMethod for setMoveTolerance which is 0.25 by default.
Raising the tolerance means it does not exactly reach the point but depending on the speed of your aiplayer it can help that it not stop or run to far.