iDevGames Forums
Chipmunk questions - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: Chipmunk questions (/thread-8057.html)

Pages: 1 2 3 4


Chipmunk questions - Miglu - Aug 26, 2010 08:28 PM

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?


RE: Should I read this book or use a physics library? - AnotherJake - Aug 26, 2010 11:01 PM

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.


RE: Should I read this or use a library? - Skorche - Aug 27, 2010 07:03 AM

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.


RE: Should I read this or use a library? - skyhawk - Aug 27, 2010 11:11 AM

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.


RE: Should I read this or use a library? - Miglu - Aug 29, 2010 04:18 PM

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?


RE: Should I read this or use a library? - skyhawk - Aug 29, 2010 06:28 PM

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?


RE: Should I read this or use a library? - Miglu - Aug 30, 2010 04:54 AM

The reason that it should be cared about is that the most widely used is usually the best (fastest and robustest).


RE: Should I read this or use a library? - Skorche - Aug 30, 2010 06:36 AM

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.


RE: Should I read this or use a library? - AndyKorth - Aug 30, 2010 07:52 AM

For what it's worth, I think Chipmunk is the best one. Grin


RE: Should I read this or use a library? - Miglu - Aug 30, 2010 08:13 AM

If you would make a game for a console like Wii, would you use chipmunk?


RE: Should I read this or use a library? - Skorche - Aug 30, 2010 08:29 AM

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.


RE: Should I read this or use a library? - Miglu - Aug 30, 2010 09:10 AM

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/release/ChipmunkLatest-Docs/. Does chipmunk automatically do normal momentum-conservation collisions or do I have to do them using callbacks?


RE: Should I read this or use a library? - AndyKorth - Aug 30, 2010 09:15 AM

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.


RE: Should I read this or use a library? - Miglu - Aug 30, 2010 11:31 AM

Thanks. Should I add force or increase velocity when I want acceleration?


RE: Should I read this or use a library? - Skorche - Aug 30, 2010 01:32 PM

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.