pymunk, a chipmunk python binding.

Share your projects and Chipmunk enhancements.
viblo
Posts: 206
Joined: Tue Aug 21, 2007 3:12 pm
Contact:

Re: pymunk, a chipmunk python binding.

Post by viblo »

crazy-chris wrote:I think pymunk is a great work -- thanks for making chipmunk accessible for us python developers! :) I'm currently supporting the OLPC European Developer Network and will try to port the engine and bindings to the XO laptop and see if I can get a few well running examples done.

I'd love to contribute to pymunk as well, if I anyhow could.
I'd suggest to setup some basic infrastructure for collaboration on pymunk:

* Wiki
* Forum (subforum here?)
* IRC Channel (#chipmunk or #pymunk on irc.freenode.net?)

I'd already have a few nice examples, i would like to post, and also a few questions to ask -- so some infrastructure could help a lot for sharing those as well :)

Chris

EDIT: I'll upload my pymunk examples to http://linuxuser.at/pymunk/
Previously I didn't thought that there were enough interest in pymunk to justify anything more than this thread :) But now when it has become a bit more usable than before it might be time to do something..

In general I think that it is a good idea to keep pymunk tight with chipmunk, after all, many (most?) questions are real for chipmunk as well, such as how to do an infinite body or how to contruct a ragdoll. No point in separating the knoweledge as there aren't that much people around using either chipmunk or pymunk.
* irc I think the best would be to share a channel with chipmunk, but as I don't think such a channel exist yet it might be better with #pymunk if you and me (and anyone else which happens to enter it) is there.
* Forum. Im not sure pymunk needs a separate forum or even a separate subforum yet. After all, only you, me, alecthomas and Ezequiel are the only one that have written anything with a connection to pymunk yet :)
* Wiki: A generall chipmunk wiki with a section about pymunk would be nice. Many things are as I said the same so that would be good. Slembcke has this planned in his master plan according to the post here: http://www.slembcke.net/forums/viewtopic.php?f=1&t=97 However, I don't know the current status..
http://www.pymunk.org - A python library built on top of Chipmunk to let you easily get cool 2d physics in your python game/app
crazy-chris
Posts: 7
Joined: Tue Mar 04, 2008 3:40 am
Contact:

Re: pymunk, a chipmunk python binding.

Post by crazy-chris »

viblo wrote:Previously I didn't thought that there were enough interest in pymunk to justify anything more than this thread :) But now when it has become a bit more usable than before it might be time to do something..
Are you kidding? :D Lot's of people doing things with python -- and this is the first time it's possible (and easy!) to integrate physics in own software -- like with pygame. Everyone is excited about this -- just look at Crayon Physics. It's exciting how well the physics engine works and there are lots of cool open-source ideas -- not even only games but also educational and simulation tools. And, imo now is the beginning of open-source physics usable for everyone! This will have some impact and interest for sure! And lot's of projects...

To reach a broader audience, I think it would be good to have:
* a wiki (/pymunk/... on a shared chipmunk wiki!)
* an easy API (the idea of the pymunx class)
* good documentation (in the Wiki) (like the pygame reference?)
* examples (10 - 20, from simple to complex)
* how-to's (getting started, joints, ...)

And last, but not least, some killer extras like:
* A function for polygons to arrange the vectors the right way
* Auto-detection of non-convex polygons and correction (by splitting into smaller polys or so)

There sure are many other cool ideas as well - so also
* A feature request list :-)
In general I think that it is a good idea to keep pymunk tight with chipmunk, after all, many (most?) questions are real for chipmunk as well, such as how to do an infinite body or how to contruct a ragdoll. No point in separating the knoweledge as there aren't that much people around using either chipmunk or pymunk.
* irc I think the best would be to share a channel with chipmunk, but as I don't think such a channel exist yet it might be better with #pymunk if you and me (and anyone else which happens to enter it) is there.
* Forum. Im not sure pymunk needs a separate forum or even a separate subforum yet. After all, only you, me, alecthomas and Ezequiel are the only one that have written anything with a connection to pymunk yet :)
* Wiki: A generall chipmunk wiki with a section about pymunk would be nice. Many things are as I said the same so that would be good. Slembcke has this planned in his master plan according to the post here: http://www.slembcke.net/forums/viewtopic.php?f=1&t=97 However, I don't know the current status..
I agree, it's best not to split/add infrastructure if not necessary. We could start posting here, and maybe get a own subforum... But for now a wiki would be nice to have (as soon as possible) -- a /pymunk subpage in a shared chipmunk wiki would be perfect!

Looking forward to a interesting chipmunk/pymunk time :)

Chris
viblo
Posts: 206
Joined: Tue Aug 21, 2007 3:12 pm
Contact:

Re: pymunk, a chipmunk python binding.

Post by viblo »

I made an update to the first post (and this post is just to bump to make the forum mark the thread for those who might be interested).
http://www.pymunk.org - A python library built on top of Chipmunk to let you easily get cool 2d physics in your python game/app
viblo
Posts: 206
Joined: Tue Aug 21, 2007 3:12 pm
Contact:

Re: pymunk, a chipmunk python binding.

Post by viblo »

I made yet another update to the first post for the newly released pymunk 0.8 (and this post is just to bump to make the forum mark the thread for those who might be interested).
http://www.pymunk.org - A python library built on top of Chipmunk to let you easily get cool 2d physics in your python game/app
viblo
Posts: 206
Joined: Tue Aug 21, 2007 3:12 pm
Contact:

Re: pymunk, a chipmunk python binding.

Post by viblo »

pymunk 0.8.1 is now released, see the first post in this thread and http://code.google.com/p/pymunk for details (this post is just to bump the thread to make the forum mark the thread for those who might be interested).
http://www.pymunk.org - A python library built on top of Chipmunk to let you easily get cool 2d physics in your python game/app
JoeStrout
Posts: 7
Joined: Fri Nov 28, 2008 11:46 pm
Contact:

Re: pymunk, a chipmunk python binding.

Post by JoeStrout »

Thank you so much for Pymunk! I've just discovered it this evening and have been playing with it for about an hour, and already I love it.

There's one thing I can't figure out, though: how can I detect collisions? For example, I want to play a little "bonk" sound every time a ball bumps into something. In Chipmunk, it looks like I can use a "collision pair function" for that. But I don't see anything like that in pymunk. Am I missing it, or is pymunk?

Thanks,
- Joe
viblo
Posts: 206
Joined: Tue Aug 21, 2007 3:12 pm
Contact:

Re: pymunk, a chipmunk python binding.

Post by viblo »

There are two examples on how to detect collisions in the examples dir of pymunk (demo_contact.py and demo_contact_with_callback.py).

However, you probably want to add some little logic to use it for sound playing as you want the sound to only play once for a collision but in reality chipmunk might take a couple of frames to resolve the collision (each time generating a callback), and you dont want the sound each frame if for example a ball is placed on a table.

There are a couple of ways you can handle it, and which way is best depends on your game/program, for example only play sound if the penetration distance is greater than a specific number, or play it if the impulses used to resolve the collision is greater than a specific number (I think this is better than penetration distance in most cases), or if the two objects didn't collide last frame. Take a look at this thread on the same problem: http://www.slembcke.net/forums/viewtopi ... ound#p1374 (not pymunk specific, but Im sure you can decode it, otherwise post here I can try to translate it to python/pymunk)

I have used a simple "if objects didnt collide last frame then do collision stuff (play sound, do game logic)" algorithm in a game me and a friend made for pyweek, http://pyweek.org/e/Bouncy/ But in that game we didnt want to play sound on all collisions, just when the objects had some interaction like when a ball hit a gravity twister or bouncer. (Note: If you look at its source remember that pymunk has changed since then and that the source was written very quickly)
http://www.pymunk.org - A python library built on top of Chipmunk to let you easily get cool 2d physics in your python game/app
JoeStrout
Posts: 7
Joined: Fri Nov 28, 2008 11:46 pm
Contact:

Re: pymunk, a chipmunk python binding.

Post by JoeStrout »

Thank you, that all makes perfect sense. I'm going to update a few of the demos to "bonk" properly. Would you like me to submit them back for possible inclusion in the next version of pymunk?
viblo
Posts: 206
Joined: Tue Aug 21, 2007 3:12 pm
Contact:

Re: pymunk, a chipmunk python binding.

Post by viblo »

JoeStrout wrote:Thank you, that all makes perfect sense. I'm going to update a few of the demos to "bonk" properly. Would you like me to submit them back for possible inclusion in the next version of pymunk?
Absolutely, its clearly something people have questions about so a demo or two would be great.
http://www.pymunk.org - A python library built on top of Chipmunk to let you easily get cool 2d physics in your python game/app
viblo
Posts: 206
Joined: Tue Aug 21, 2007 3:12 pm
Contact:

Re: pymunk, a chipmunk python binding.

Post by viblo »

viblo wrote:pymunk 0.8.1 is now released, see the first post in this thread and http://code.google.com/p/pymunk for details (this post is just to bump the thread to make the forum mark the thread for those who might be interested).
A new version, pymunk 0.8.2 has been released, see the first post in this thread and http://code.google.com/p/pymunk for details (this post is just to bump the thread to make the forum mark the thread for those who might be interested).
http://www.pymunk.org - A python library built on top of Chipmunk to let you easily get cool 2d physics in your python game/app
Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests