Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1075919 Posts in 44152 Topics- by 36120 Members - Latest Member: Royalhandstudios

December 29, 2014, 03:21:36 PM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Box2D and Chipmunk
Pages: [1]
Print
Author Topic: Box2D and Chipmunk  (Read 552 times)
roflha
Level 0
*


View Profile
« on: December 19, 2011, 11:43:49 AM »

I am working on setting up collision detection for a game I am working on, and I am looking to use either Chipmunk or Box2D with my game for just collision detection. Now, there is a chance I may end up using the physics portion too, but not as a main focus.

If the game I am working on is a platformer made in C++, where it is not really tile based, which physics engine would work best for my project?

I also considered just writing my own since platformers don't really need that much in the way of physics, but I have another couple of games I want to make that will be more physics heavy so my hope was that I could reuse some code from this project or at least become familiar at working with one of the physics engines.

I have heard many places that Chipmunk's C API is much better than the API in Box2D, but most sources I find stating this are a couple years old. Given the most recent versions of both of them (6.0.3 Chipmink and 2.2.1 Box2D), is that still true?
One other thing I have heard and seen is the very active and helpful developer of Chipmunk being very involved with the community, which is nice, but also, something about the Chipmunk Pro thing is scaring me away from even the free chipmunk...

I am completely new at this pre-built physics engine stuff and would just like to learn, so any help is grealty appreciated!
Logged
zacaj
Level 3
***


void main()


View Profile WWW Email
« Reply #1 on: December 19, 2011, 01:23:36 PM »

Chipmunk has a VERY good api, and the dev is VERY helpful.  Id reccomend just using it for your platformer, including physics.  Its pretty easy to get regular platformer-esque jumping,etc working in it
Logged

My twitter: @zacaj_

Quote from: mcc
Well let's just take a look at this "getting started" page and see--
Quote
Download and install cmake
Noooooooo
roflha
Level 0
*


View Profile
« Reply #2 on: December 19, 2011, 04:07:53 PM »

I don't miss anything by using the free do I?
it is just some extra for the paid right.
Logged
zacaj
Level 3
***


void main()


View Profile WWW Email
« Reply #3 on: December 19, 2011, 04:09:06 PM »

Yeah
Logged

My twitter: @zacaj_

Quote from: mcc
Well let's just take a look at this "getting started" page and see--
Quote
Download and install cmake
Noooooooo
mcc
Level 10
*****


glitch


View Profile WWW Email
« Reply #4 on: December 19, 2011, 06:44:26 PM »

I have used Chipmunk on every one of my projects and love it to pieces. My experience with Box2D has been more limited so I do not know if I can make an intelligent comparison between the two. However from what I have seen of Box2D I feel like Chipmunk's API is organized in a way that more directly matches the way you actually want to use a physics engine, so that it is easier to make the Chipmunk API do what you want.
Logged

My projects:<br />Games: Jumpman Retro-futuristic platforming iJumpman iPhone version Drumcircle PC+smartphone music toy<br />More: RUN HELLO
roflha
Level 0
*


View Profile
« Reply #5 on: December 19, 2011, 06:52:56 PM »

I am definitely leaning towards chimunk I think. Popular opinion has been that it is more pleasant to work with, and that is appealing.

@mcc For your projects, have you had experience with using chipmunk for just collision detection? Just browsing some example code made it seem like you needed to modify parts of the actual chipmunk engine to make it work for that.
just wondering if you knew anything about using it like that.

Thanks

Logged
mcc
Level 10
*****


glitch


View Profile WWW Email
« Reply #6 on: December 19, 2011, 07:36:40 PM »

@mcc For your projects, have you had experience with using chipmunk for just collision detection? Just browsing some example code made it seem like you needed to modify parts of the actual chipmunk engine to make it work for that.
just wondering if you knew anything about using it like that.
Depends on what you mean by that but Chipmunk for collision detection only should be fine, there should be a couple different ways to do that (some may not be very efficient tho). In a worst case scenario you could have all collision handlers return false (meaning Chipmunk will not act on collisions ever) or use cpSpaceShapeQuery a ton.

I actually do a thing in a number of my games where I have a very simple GUI system built around Chipmunk, I add all the buttons to a space as shapes, and then I do point queries anywhere the user clicks. In this program I use Chipmunk extensively to detect things like collisions but no actual physics occurs in the program.
Logged

My projects:<br />Games: Jumpman Retro-futuristic platforming iJumpman iPhone version Drumcircle PC+smartphone music toy<br />More: RUN HELLO
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic