Not exactly a breakthrough…
… but some progress.
After putting more time in my steering project, things seem to fall into their place slowly.
I have created some AIBrain and AIMotor scripts for testing. The first is where decisions are made. At the moment this means calling one function from AIMotor and passing it the goal for pathfinding. The AIMotor then performs the pathfinding sets the correct Vector3 array with the node coordinates of the path. When this array isn’t null movement automatically begins. This might not be the best solution, but that is what I came up with for now.
Collison avoidance with spherical objects looks like it’s starting to work after all. I have a SteeringSensor set up, which is basically a trigger that is passing a reference of all the gameobjects inside it to the AIMotor. This way the algorithm only considers the objects that are near. Always a good thing to cut down the input for poorly optimized algorithms. A very helpful thing in this is Unity’s physics layer system. I use this so that the SteeringSensor only considers objects on certain physics layers, again cutting down on input, and additional sorting out.
Right now I’m using the weighted blending approach for mixing the accelerations that the individual steering behaviours return, but I’ll be trying out the proritygroup method in the future as well.
A third method is the creation of a so-called steering pipeline, but that is way over my head for now. It’s a good idea to go step by step anyway imho, so if everything works I can upgrade later.
I’ve been cursing the writers of the book for messing up vector subtractions in the pseudo code (not really), but I had a tough bug, where I essentially did the same stupid mistake, so I was reminded to remain humble. This was the rambling.
There’s nothing to post pictures about really. I will try to do a video some time, but again I don’t want to waste time on video editing, so it might not happen.
Have a nice day! Bye!