Lately I’ve been caught up doing normal things like playing video games (instead of writing them), hiking, having BBQ’s etc. Finally, though, I found some time to work on the steering behaviors for Null Op. I thought I’d share my progress with you guys, video showing off the different stages of development for the arrival behavior below the fold:
So what’s going on here? Let’s see, so far I’ve implemented the basic locomotion and steering algorithms outlined by Craig Reynold’s Steering Behavior for Autonomous Characters. I’ve got seek, flee, arrive, and wander down at this point. With these in place I’m ready to implement separation and cohesion which will allow me to create compelling flocking behavior for a crowd of vehicles. Once that’s done it should be pretty easy to extend things to work for pursuit/evade and then leader following!
I’m still not sure how to put all of these things together in a coherent, reusable manner. I’m hoping that it will become clearer to me as I implement new behaviors. The problems I’m seeing are,
- There are a number of parameters that need to be tweaked such as max speed
- Cohesion, separation, et al have a different set of needs than seek, arrive, etc
- Does locomotion live inside the vehicle or does it exist as a separate helper
Have you guys come across this problem before? I’d appreciate any recommendations on how to approach designing this system. I’m somewhat leaning towards having a controller-helper solution which manages the parameters and locomotion respectively. This would let me create a single, simpler interface for the vehicle. Still not sure what to do about the behaviors’ interface.
Anyway, let me know if you enjoyed the clip and I hope you’re making lots of progress on your projects! Finally, if you decide to implement some steering algorithms in your game check out these handy examples (source code included) by Daniel Shiffman.
Hello, my name is Alex Schearer. I grew up in New York and currently live in Seattle.
2 Comments
I love this kind of steering stuff. Back when I was first learning programming, one of the first real projects I wrote was a 3d “flocking” demo. I could just sit there for hours watching the little things fly around.
Unfortunately, I doubt that you’d want to adopt ANY of the programming practices from that code base…. but I’ll be interested to hear what you decide on.
Yea the steering behaviors are a lot of fun to see in action. I’ve just finished some of the group behaviors and it’s really a joy to see running. Hopefully I’ll get a chance to write a more technical post describing how to implement some of them and, if I find a way, to design the system.