Using Chipmunk for RPGs
Posted: Wed Nov 25, 2009 9:25 pm
I'm working on some code for an RPG with a couple artists. Chipmunk's been pretty useful to us, but there's a couple interesting "features" that they've been complaining about, so I've decided to see if I can get some help.
- Boxes of roughly 20x100 can push through each other at 60 FPS, both glancing and straight angles. I'm not sure if this is related to how I'm doing motion; right now I'm using Body.apply_impulse to the moving body, and then clamping the velocity during the velocity callback. Not sure if there's a better way to do this.
- Shapes are not solid to the pixel. This is a problem for e.g. dungeon walls, which shouldn't have any give to them.
- Shapes are easier to push through each other when they're glancing, almost as if the math is being done on ovals instead of boxes.
- Boxes shouldn't rotate. I think my solution of forcing the angle to zero inside a position callback is the best way, but I'm not sure.
- Collisions aren't swept. I think the best thing is to cut my dt into small chunks and step the space multiple times per frame, but again, I'm not sure.
While they might be complaining, I honestly feel that Chipmunk's a big step up from the hand-rolled code I was using before, and I'd like to keep using it, but they're kind of insisting that I find solutions to these. Any help would be appreciated.
~ C.
- Boxes of roughly 20x100 can push through each other at 60 FPS, both glancing and straight angles. I'm not sure if this is related to how I'm doing motion; right now I'm using Body.apply_impulse to the moving body, and then clamping the velocity during the velocity callback. Not sure if there's a better way to do this.
- Shapes are not solid to the pixel. This is a problem for e.g. dungeon walls, which shouldn't have any give to them.
- Shapes are easier to push through each other when they're glancing, almost as if the math is being done on ovals instead of boxes.
- Boxes shouldn't rotate. I think my solution of forcing the angle to zero inside a position callback is the best way, but I'm not sure.
- Collisions aren't swept. I think the best thing is to cut my dt into small chunks and step the space multiple times per frame, but again, I'm not sure.
While they might be complaining, I honestly feel that Chipmunk's a big step up from the hand-rolled code I was using before, and I'd like to keep using it, but they're kind of insisting that I find solutions to these. Any help would be appreciated.
~ C.