0
101 Aug 14, 2009 at 09:21

I try to find a better way to handle physics in our 2d-flying game. My current solution is to use different maths:

For movement vectors - it’s simple to change speed and direction.
For gravity orthogonal - it’s simple to change y-location.

This works fine as you can see here http://isopuli.net/2009/index.php?id=0 (it’s Java applet) but the code is very hard to modify.

Any idea how to combine the best of both maths?

7 Replies

0
102 Aug 14, 2009 at 21:31

Could you make the question a bit more specific? What exactly are you doing?

0
101 Aug 15, 2009 at 10:37

I have coded a 2d-flight model where plane is influenced by its inertia and forces: lift, drag, steering (left-right), thrust, wind, gravity, kinetics. I did not succeed to implement this model as a simple algorithm so I just add one force at time.

Now I would like to add turbulence etc., but it is a bit too difficult to swap between different coordinate systems and also checking trigonometry discontinuity. Especially, as I have to teach AI pilots to fly and fight again each time I change the model.

Briefly: Any good ideas how to implement 2d-flying model?

0
101 Aug 17, 2009 at 00:09

You have to define what you mean by “turbulence, etc”

You sound like you’re on the right track as far as updating the position, orientation, and velocity of the plane based on the various forces. Perhaps you need to consult a book on the mathematics of aviation if you want even more realism.

0
101 Aug 17, 2009 at 08:54

Your game looks promising. But which coordinate systems do you have now? One for the world, and one relative per plane?

0
101 Aug 17, 2009 at 21:10

Sometimes, it’s good to look for open projects and see how others have tackled it. For example, I remebered this one:

Also, you can try emailing them too.

0
102 Aug 18, 2009 at 20:53

I played the game and see what is going on, but I don’t understand exactly what you mean by “gravity orthogonal” versus “movement vectors”.

0
101 Aug 19, 2009 at 17:59

@roel

Your game looks promising. But which coordinate systems do you have now? One for the world, and one relative per plane?

That’s just great! I really should have done it that way: different models to forces of world, between objects and plane itself. And I bet it will be very interesting to combine all of these together. Sure!

That flyer2d is a good study of joint body2d kinetics, but it’s hard to see how you apply AI to such a theoretic (i.e. non-intuitive to me) model.