Sign in to follow this  
liquid11111

steering behavior along physical system

Recommended Posts

liquid11111    100
hi
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
ApochPiQ    23000
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
liquid11111    100
I want to implement similar steering behaviors like the original [url="http://opensteer.sourceforge.net/"]OpenSteer[/url]. 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)

or

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

Or else?




Thank for patience!

L.

Share this post


Link to post
Share on other sites
ApochPiQ    23000
You do not want to duplicate your world representation between physics and steering. Steering should [i]ask questions from the physics system[/i] 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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this