Thursday, October 23, 2008

2.0.2b0 Released!


With nearly no response from the community, this time-consuming project might end at this version.

I'm also hoping that the OS X installers work well enough for everyone. It took a good amount of time to figure out how to (properly?) release for it.

In any case, here's the changelog:
First release that's not based on a major Box2D release. It combines Box2D SVN r177 and contributions from shaktool (thin line segment) and BorisTheBrave (controllers/buoyancy).

* Thin line segment support (forum post)
* Buoyancy with generic controller support (forum post)
* Pyglet 1.1 testbed (still has some issues. run convert-from-pygame.py to convert the tests from pygame)
* OS X Installer
* Python 2.6 support
* Line joints (see LineJoint test)
* Raycasts (see RayCast test and BoxCutter test)
* TestSegment support
* BreakableBody test (forum post)
* Fixed: == was working, but != comparisons weren't.
* Access to polygon normals, core vertices, etc.
* cvar list fixed
* Off by one bug fixed for vertices

New time step will require a few minor updates to your code:

Old:
world.Step(timeStep, iterationCount)

New:
world.Step(timeStep, velocityIterations, positionIterations)

velocityIterations is usually 10, and positionIterations is usually 8.

20 comments:

  1. Sad that you consider abandoning this project... I'd like to use it in my game, but pyBox2D seems a little bit hard and non-pythonic. Maybe I'm just too lazy.
    Anyway, the BoxCutter example is great! But it crashes sometime with that message:
    Assertion failed: d.y >= 0.0f, file Collision/Shapes/b2PolygonShape.cpp, line 225

    ReplyDelete
  2. I am sorry to hear that you are considering dropping it. Please check out Mekanimo (mekanimo.net).

    Currently I am using a custom DLL using box2d but was considering using pybox2d in the near future.

    ReplyDelete
  3. Thanks for the feedback, guys.

    I don't know, perhaps I'm expecting too much. But for the 6 months or so that I've maintained the project, thotep's bug is probably the 2nd I've gotten from a user. Is the code just that good? Of course not.

    Oh, and those degenerate shapes should be caught by the checkValues() function. I'll take a look into it...

    I can understand the issues with it being non-Pythonic, and have considered restructuring the API in the past. However, given the huge amount of support you can receive from the Box2D forums for the standard API, and the support of only one person for the Python API, ... well, the choice was obvious.

    fahri:
    Your Mekanimo project looks very nice!

    ReplyDelete
  4. I think box2d has much more functionality than chipmunk and I would really like to see your project continued.

    Maybe you want a contributor to the project?

    here is my first patch:
    Index: Python/testbed/pyglet/convert-from-pygame.py
    ===================================================================
    --- Python/testbed/pyglet/convert-from-pygame.py (revision 104)
    +++ Python/testbed/pyglet/convert-from-pygame.py (working copy)
    @@ -5,7 +5,7 @@
    import re

    print "Running this will overwrite files."
    -os.system("pause")
    +raw_input()

    def checkFile(file):
    if file[-3:]==".py" and file[:5]=="test_":


    as in osx you don't have the pause command. I want to help in improving the packaging and the testbed of pybox2d, that is, if you want help.

    ReplyDelete
  5. Leonardo:
    Thanks for the fix; I didn't test the OS X version as well as I should have.

    I would love some help with the project. Show me a bit more of what you can do to contribute (in some non-trivial cases) and I'd be happy to add you onto the project.

    ReplyDelete
  6. Ok I will be posting patches on the issue tracker.

    @thotep:
    It was a very simple error on the size checking code, I fixed it and will be posting the patch on the issue tracker.

    ReplyDelete
  7. I hope you don't abandon the project! I understand that the lack of feedback and projects using pybox2d put down the motivation for mantaining your project, and no one can blame you!

    I don't know if this helps, but I'm using pybox2d in a project, and it's working very well. This project is still no big deal, but I expect releasing something until the end of October. I'll post a comment when I put it online.

    Meanwhile, thank you for the very good work!

    ReplyDelete
  8. Hey, just wanted to let you know that I've only begun following PyBox2D and think it's great. I looked at Chipmunk but thought it would be perfect to fit PyBox2D into my game--I can see how it'll save me a lot of time and effort.

    The only bug I could find was in the Python testbed test_SensorTest.py which dies when I try to run it on Kubuntu 8.04, Python 2.5.2, pygame 1.7.1:

    File "test_SensorTest.py", line 85, in Step
    center = ground.GetWorldPoint(circle.GetLocalPosition())
    AttributeError: 'b2PolygonShape' object has no attribute 'GetLocalPosition'

    ReplyDelete
  9. Thanks for the input, michael.

    Perhaps with Santagada's help and a bit of cheering on from you guys, the project will be able to continue. :)

    re: your bug, it's actually fixed in the latest SVN.

    ReplyDelete
  10. Hi, I've "released" my project. It's still full of bugs and missing features, but take a look! =)

    http://sites.google.com/site/pytform

    ReplyDelete
  11. Looks interesting! Hope to see it developed more. (Added it to the projects page here)

    ReplyDelete
  12. Thank you! I'll surely develop it more, as I start creating my games and see missing features...

    ReplyDelete
  13. NOOOOOO don't leave us! D=
    Granted, I haven't used pybox2d yet, but I plan to in the very near future!

    ReplyDelete
  14. Seems like lots of people are abandoning their projects... bet you didn't know that I'm using pyBox2d in conjunction with Opioid2d for a side-scroller? Seems like Shang has better things to do, so O2d is not being worked on at the moment. Please don't follow in his footsteps!

    Looking forward to the implementation of planetary physics and something that will allow for top-view collision systems (eg. original Grand Theft Auto). Know anything about these?

    ReplyDelete
  15. Zorbicon, you should take a look at the new controllers on pybox2d. I think you can simulate planetary physics with them.

    ReplyDelete
  16. Thanks for your comments.

    Zorbicon, you can use it for overhead views with no problem -- just set gravity to (0,0). And as Santagada said, controllers should take care of the gravity.

    I look forward to seeing your projects. That's the main thing that will keep me interested in maintaining pybox2d.

    ReplyDelete
  17. Thanks for the advice. I guess the finer point I'm getting at is simulating the resistance to changes in the inertia vector of an object traveling on different substances (like asphalt for cars and water for boats). After a certain threshold, a car skids, so the behavior is dynamic. Also boats turn more easily about their axis at lower speeds....


    Anyway, keep up the good work.

    ReplyDelete
  18. Sorry, just noticed the cartop demo. Nice!

    ReplyDelete
  19. Sad that you are considering abandoning the project, I just discovered it and I like it better then pymunk.

    What about a module that offers a more pythonic interface but uses pybox2d on the inside?

    ReplyDelete
  20. Re Pythonic API see issue 5:
    http://code.google.com/p/pybox2d/issues/detail?id=5

    Glad to hear that you like it, but it would appear that you are in the minority. :)

    ReplyDelete