Chipmunk questions

Member
Posts: 131
Joined: 2010.08
Post: #1
Would it be good for me to read Game Physics if I want to make physics games, as I could just use existing engines or libraries?
Quote this message in a reply
Moderator
Posts: 3,577
Joined: 2003.06
Post: #2
I haven't read that book myself, but it seems a bit on the expensive side IMHO.

Are you interested in doing 3D physics or 2D physics?

For 3D, I would recommend reading at least one book, such as that one, and then using the Bullet physics library (or perhaps Newton or ODE). For 2D, I'd recommend finding some online resource for learning basic 2D physics, then using the Chipmunk physics library.

Physics itself is pretty straight-forward, and worth learning, but the associated collision detection and response can make things much more complicated. In 2D it is reasonably doable, but in 3D it can become crazy hard to work with outside of spheres and boxes -- even the best 3D developers out there use third-party libs for the most part.
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #3
I have the collision detection book in that series. It's been very useful, but it's not terribly complete. If it's anything like that I would expect that it's full of great ideas, but not enough that you would be able to write a complete physics engine after reading it.

The question is, do you want to learn how to make a physics engine or make physics based games? When I started Chipmunk, there weren't really and 2D physics engines, and I wanted to make 2D physics games. Not sure if I would have written it if there was a good engine to use.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Moderator
Posts: 916
Joined: 2002.10
Post: #4
TBQH, for 2D physics, chipmunk physics is all you need. But as anotherjake said: if you don't know basic physics, then using a physics engine won't help you much, if at all.

Anyways, keep cost of development low. Everything is out there, on the web, and free.
Quote this message in a reply
Member
Posts: 131
Joined: 2010.08
Post: #5
I am trying to use chipmunk. How to do collision detection with the window's edges with it?
Side question: is chipmunk the most widely used 2D game physics engine?
Quote this message in a reply
Moderator
Posts: 916
Joined: 2002.10
Post: #6
1) create static lines that are the edge of the window.
2) Probably not, as Havok is used everywhere in the industry, however chipmunk has a large enough following through cocos2d to make it used in an ass-ton of iPhone games

EDIT: I take back my 2) cause you said "2D" specifically, to which that specifically: who the hell knows or cares?
Quote this message in a reply
Member
Posts: 131
Joined: 2010.08
Post: #7
The reason that it should be cared about is that the most widely used is usually the best (fastest and robustest).
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #8
Box2D seems to be quite a bit more popular than Chipmunk for Windows stuff for sure. Probably in no small part due to the prevalence of C++ there. Chipmunk is written in C to make it easier to bind to other languages. Both are well optimized, but use different algorithms which make them have different performance for different types of simulations.

Box2D supports swept collisions (with a pretty hefty performance penalty when enabled) which may be a killer feature. I get a lot of compliments from people that Chipmunk's API is better.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Moderator
Posts: 452
Joined: 2008.04
Post: #9
For what it's worth, I think Chipmunk is the best one. Grin

Howling Moon Software - CrayonBall for Mac and iPhone, Contract Game Dev Work
Quote this message in a reply
Member
Posts: 131
Joined: 2010.08
Post: #10
If you would make a game for a console like Wii, would you use chipmunk?
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #11
Andy and I can't really give you an unbiased answer, we of course would use it. Rasp It has been used in a few Wii games including Eternity's Child and the yet to be released Night Sky. Those are the only two I remember off the top of my head though.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Member
Posts: 131
Joined: 2010.08
Post: #12
I have never before used an engine, so it is difficult to understand the callback and collision pair sections in http://files.slembcke.net/chipmunk/relea...test-Docs/. Does chipmunk automatically do normal momentum-conservation collisions or do I have to do them using callbacks?
Quote this message in a reply
Moderator
Posts: 452
Joined: 2008.04
Post: #13
Chipmunk handles normal collision resolution- like conserving momentum between two collisions. The callbacks are for special gameplay features you may wish to add- in fact, you can model simple physics situations without using them at all.

Usually you'll use callbacks in simple ways, to play a sound when a rock falls or to take away hit points after a bullet collided with the player.

Howling Moon Software - CrayonBall for Mac and iPhone, Contract Game Dev Work
Quote this message in a reply
Member
Posts: 131
Joined: 2010.08
Post: #14
Thanks. Should I add force or increase velocity when I want acceleration?
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #15
Callbacks are just for catching collision events. You only need to make them if you want to trigger sounds or handle collisions conditionally. If you just want "normal" collisions, then you don't have to do anything.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Post Reply