Jump to content


- - - - -

What to study in prep for writing a physics engine?


8 replies to this topic

#1 InvisibleMan

    New Member

  • Members
  • Pip
  • 4 posts

Posted 16 June 2011 - 02:01 PM

I'm planning on going through the resources Chris Hecker recommends in his article Physics References, however that article (from what I gather) was written in around 1997: 14 years ago.

I suspect that there have been new developments since the article was put together, which brings us to the reason for this post: Do you guys have any additions/changes to the list he gives? For example, changing the order in which a topic is studied, a new and better book for a particular topic in the list, new topics to add to the study list (with accompanying book recommendations if you can), etc.

I like the fact that he discusses each set of books and the pros/cons. If you guys could provide similar notes with your recommendations, as well as when I should study that topic (right after reading the Calculus book? After reading everything else in that list?) and what I will be able to do in my physics engine after I study it (like his "milestones"), it would really help :) Thanks

#2 roel

    Senior Member

  • Members
  • PipPipPipPip
  • 698 posts

Posted 16 June 2011 - 03:43 PM

Rigid body physics haven't changed since Hecker's article ;) I think that it is a good starting point. Random things:
- Hecker doesn't handle friction iirc, the Coulomb friction model is popular.
- Stacking objects is a nasty problem, I've read and used the ideas from the famous "nonconvex rigid bodies with stacking" paper for my own engine. I recently read a series of articles how Angry Birds (might) work, it discussed the physics as well but I didn't read it, so I don't know if it is interesting: http://www.wildbunny...y-birds-part-1/ that guy has more physics stuff on his page iirc.
- Box2d has tech info which was presented at some (?) conference.
- I think that it isn't wrong to start in 2D and get an idea of how complex physics engines can be before you advance to 3D.

#3 InvisibleMan

    New Member

  • Members
  • Pip
  • 4 posts

Posted 17 June 2011 - 04:44 PM

Alright, thanks for the information :)

#4 alphadog

    DevMaster Staff

  • Moderators
  • 1716 posts

Posted 20 June 2011 - 07:50 PM

InvisibleMan said:

What to study in prep for writing a physics engine?

Uhm, all of Newtonian (classical) mechanics? ;)
Hyperbole is, like, the absolute best, most wonderful thing ever! However, you'd be an idiot to not think dogmatism is always bad.

#5 InvisibleMan

    New Member

  • Members
  • Pip
  • 4 posts

Posted 20 June 2011 - 07:56 PM

alphadog said:

Uhm, all of Newtonian (classical) mechanics? :blink:
That appears to be listed in Chris Hecker's article :) The main question is: "Are there any resources for learning it which are better than the ones recommended in the article?".

#6 alphadog

    DevMaster Staff

  • Moderators
  • 1716 posts

Posted 20 June 2011 - 08:02 PM

Game Physics, by Eberly. On the theoretical side. Also, there's a multi-author book called Game Physics Pearls with "practical" articles on a collection of topics. Also, I recommend a book called Collision Detection by Christian Ericson.
Hyperbole is, like, the absolute best, most wonderful thing ever! However, you'd be an idiot to not think dogmatism is always bad.

#7 InvisibleMan

    New Member

  • Members
  • Pip
  • 4 posts

Posted 20 June 2011 - 08:06 PM

alphadog said:

Game Physics, by Eberly. On the theoretical side. Also, there's a multi-author book called Game Physics Pearls with "practical" articles on a collection of topics. Also, I recommend a book called Collision Detection by Christian Ericson.
Alright, thanks for the recommendations :)

#8 bucketsize

    New Member

  • Members
  • Pip
  • 1 posts
  • Locationbangalore

Posted 30 August 2012 - 02:07 AM

I wouldn't go by any book/article the teaches you game engine physics. But ofcourse, Ive read a few, that may have influenced my thoughts over how I write code. But never believe everything you read.

The way I see it, physics is just a set of interaction rules for various actors involved. Just like ticket reservation system.

Learn the rules, when you see a box tumble down a slope, it shouldn't look magical. If you can garner exactly whats at play, you can apply the rules in programming.

Now the trick with game physics: it bends the rules slightly, some will skip details, simplify a model, reduce the number of variables.
Using finite element/slice methods - in this you simulate a few set if equations over a finite body for a finite duration of time (cycletime).

Physics engines wouldnt be realtime if they really simulated reality.

Read kinematics and rigid body mechanics in 'Fundamentals of Physics - Resnick and Haliday'.
Try to solve a problem or two from 'Problems in Physics - Irodov'

Then comes the programming.
There is always a debate - go procedural / object oriented , have inheritance hierarchies / composites.
In the end you'd really have to be a good programmer - no alternatives.

Master double dispatch and visitor pattern for c++/java, or take to dynamic languages like Ruby.

--
JB

#9 thisisdog

    New Member

  • Members
  • Pip
  • 2 posts

Posted 16 February 2013 - 05:53 AM

I realize this thread is probably dead, but I thought I would point out something important.
While knowing the rules of physics is obviously important, it's not enough.
Numerical stability is very important to achieving realistic results. This stems from the fact that you tick your physics engine at discrete time intervals.

To solve this you must understand how Integration works, this is the best article I've seen on the internet:

http://gafferongames...gration-basics/





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users