How does Bot's SetWanderDistance Work?

Author Topic: How does Bot's SetWanderDistance Work?  (Read 1472 times)

Does anybody know how SetWanderDistance actually works for bots? I ran an experiment to try and figure out how it works. I put a bot hole in the middle of a grid of 4x4 plates, and each plate had the event onBotTouch > self > SetColor. I used this to see how far they were wandering away from their spawn. The results left me even more confused than when I started.

It seems completely arbitary what number you put in the wander value. It is also odd to me that the minimum number is 8, and that even when you set it to 8 the bot wanders at least 30 stud spaces away from their spawn. I've also found totally different results with different bots. Blockhead bots (as well as Stegosaurus, which is why I started the experiment, because I'm building a dinosaur Island) seem to wander about 32 studs away from their spawn when you set the value to 8. So if that was consistent you might believe that each point value is 4 studs. However, the horse bot when set to 8 doesn't hesitate to wander 52 studs away from spawn. Also when I doubled the value and used 16, the stegosaurus and blockhead both seemed to wander about 40 spaces.

There seems to be absolutely no consistency in the wander distance value on my end, so I just wanted to know if anyone actually knows how it works and how I can better understand how to event my bots. Basically all I want is to prevent my dinosaurs from wandering off my island and into the water. If anyone has an idea on how to do that same thing without using setWanderDistance I'd also be open to the suggestion.

Short answer: It doesn’t

Many of the bot events dealing with movement do not work as intended or even at all, and if they do it’s in a way no one has comprehended. The bothole system is a really basic attempt at bringing ai into a torque game which really isn’t happening to any degree of complexity.

Some have made their own ai systems such as Port making an entire village of bots essentially, Simba’s zombie path finding and Trader’s bot system from many many years ago. They were all specially made and required manually placed pathnodes.

I could be wrong about the first bit, but as you yourself tested, and I have yet to come up with any rhyme or reason myself in years. The movement portion of bots is a mess.


wander distance just defined the distance at which if the bot is that far or farther away from the spawn, the next logic tick will tell it to go back to its spawn

the value should be in TU so it should be 0.5 per stud.

wander distance just defined the distance at which if the bot is that far or farther away from the spawn, the next logic tick will tell it to go back to its spawn

the value should be in TU so it should be 0.5 per stud.
noedit: you can check the code in the default Bot_Hole addon to determine its exact behavior

wander distance just defined the distance at which if the bot is that far or farther away from the spawn, the next logic tick will tell it to go back to its spawn

the value should be in TU so it should be 0.5 per stud.
So how do I make it not wander past that distance?