Jump to content
  • Advertisement
Sign in to follow this  

steering behavior along physical system

This topic is 2552 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am solving problem, how to implement Reynolds's steering behaviour along with my physical system (box2d).
Has anybody some experience with this?

I have came up with 2 approaches:

1, I will have my own description of game word in steering behavior which I get (somehow) from phys.system and I will calculate everything by myself in steer.behav

2, Every shape I need in steer.behav I create as physical stuff in b2d, and then I let phys.system calculate everything for me, and just queue it every step

3, better way?

Thank You for any feedback!

Share this post

Link to post
Share on other sites
Your steering system should only really output forces that are used by the physics system to move objects.

If you need some manner of predictive collision avoidance, check your physics library's documentation; all the good ones have queries (such as raycasts) that you can use to construct avoidance behaviors. There are ample resources describing how to go from sparse raycasts to fairly robust avoidance steering modules.

Share this post

Link to post
Share on other sites
I want to implement similar steering behaviors like the original OpenSteer. It moves with object without physical system (It has its own very lightweight one, just easy mass and forces etc).

So I am looking for the way to let this system cooperate with physical system.

As I said, I want to implement Steering Behaviors (independent on any physical sys.) and then use it in my game with Box2D. Now I looking for the way to interact these two.

For example, steering behaviors has mechanism, to prevent collisions and some mechanism how to solve them. But on the other hand, solving collisions is physical system's work.

Because of steering behaviors does not fumble with reaction to collision and friction (examples) much, it can exists without any sophisticated phys. system (PS).

But how to interact with object in my game scene (walls, obstacles, etc)? Should I have some WorldRepresentation within my steering behavior (SB), which will be initialized from real scene (box2d scene)?

I really do not see the proper interaction among those components (SB, PS).

Another example, SB solves "crowd situation" by applying some Separation behavior. PS solves this for me.

I have some trouble with asking the right question, but I believe, you can understand my problem from the text above. Nevertheless I will try to form some questions:

What is the proper way, to have SB an PS coexisting in one system with preserve SB its function without PS?

what should handle SB and what PS?

Should I calculate forces in SB and handle positions + collisions in SB (OpenSteer-like behav)


Should I calculate forces in SB and pass them into PS and let PS handle positions and collisions?

Or else?

Thank for patience!


Share this post

Link to post
Share on other sites
You do not want to duplicate your world representation between physics and steering. Steering should ask questions from the physics system when it needs to know about the geometry of the world. As I said before, this is often done with queries like raycasts or broad-phase collision checks or whatever else your physics library supports. The details of that really depend on your physics library, and again, as I said before, you should consult the documentation for the library to know how best to use it.

And, again, like I said before, the goal is to have your steering system simply emit forces that are fed into the physics system to update object positions/orientations.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!