Flave, a new open source AS3 Verlet physics engine

Do you remember Luis Fernando Silva?

He released a Box2D platform engine some months ago, and now I am publishing his last work, a Verlet physics engine.

If you need more information about Verlet integration, check this post.

This is what Luis says:

« So, I was developing a small physics engine for a game of mine (Flash Physics Engine v2), and the thing started to get bigger and take shape of a real physics engine, or atleast with enough features to run a ragdoll simulation.

I’ve received feedback from some guys at FGL and so I decided it was time to release it as open source! After commenting each line of code as much as I could, after 2 weeks of bug-testing to remove some instability and after an afternoon coding some samples, I have here packed for you guys at the blog the v0.6b version!

As you can guess, it’s a verlet engine so it isn’t as stable as rigid-body engines like Box2D or Motor Engine, and the only real solid there is the particle primitive. Which is a small circle (how exciting!). But since your blog gets so many hits from all kinds of coders, I tought maybe (like with my other samples posted on your blog), some more skilled coder could improve it into something better! »

This is a demo completely developed with the engine:

Use arrow keys to navigate through the 10 samples.

Besides the engine itself, it’s a great example of solid OOP programming, with a lot of comments in the source code.

Download the source code.

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (14 votes, average: 4.43 out of 5)
Loading ... Loading ...
Flash Templates provided by Template Monster are pre-made web design products developed using Flash technology.
They can be easily customized to meet the unique requirements of your project.
Be my fan on Facebook and follow me on Twitter! Exclusive content for my Facebook fans and Twitter followers

This post has 29 comments

  1. Luiz Fernando

    on January 18, 2010 at 5:00 pm

    Thanks for publishing it, Emanuele! :D

    It might sound funny, but there’s a 0.6.2b already, fixing some bugs and adding a CS3 support.

    Here’s the link:

    http://www.mediafire.com/?zywiindbdd2

    I’m actually hosting a SourceForge page, later I’ll comment here with a link!

    Thanks,

    -Luiz

  2. Luiz Fernando

    on January 18, 2010 at 6:26 pm

    Ohwell! Gosted on SourceForge!: https://sourceforge.net/projects/flave/

    For now on, all updates will be uploaded there :]

  3. Fardeen

    on January 18, 2010 at 6:38 pm

    Cool !

    Please put it on google code. I like to be able to use externals with SVN.

  4. Luiz Fernando

    on January 18, 2010 at 6:46 pm

    Google Code happens to be a pain in the arse. But I’ll give it one more try!

  5. wrobel221

    on January 18, 2010 at 6:50 pm

    Really great examples and great engine. Have you already optimized the code or it will be done just before version 1.0?

    Thanks for sharing it

  6. Luiz Fernando

    on January 18, 2010 at 7:38 pm

    http://code.google.com/p/flave

    GoogleCode page now up!

    @wrobel221 I have optimized as much as I code, but there might be better and faster methods to do some of the tasks the engine does. I’ll be looking forward each release to look at this different methods.

    Thanks!

  7. mmankt

    on January 18, 2010 at 7:46 pm

    hm nice work but from the game makers point of view it’s still better to work with box2d. Anyway i admire your effort and i’ll definatly look into your code cuz the circle – line collsiion stuff is a great start for my particle engine.

  8. Luiz Fernando

    on January 18, 2010 at 7:58 pm

    Yes, it was for learning only. Although I see some potential on the ray-casting engine (altough it’s a little slow right now).

  9. vitaLee

    on January 18, 2010 at 8:00 pm

    Luiz why don’t you host your project on GitHub?

  10. Pedram

    on January 18, 2010 at 8:44 pm

    Grate, it’s very easier than box2d but it’s not complete yet,
    thanks for publishing,
    good luck,

  11. Luiz Fernando

    on January 18, 2010 at 9:30 pm

    I’ll try to upload to all websites that have an easy updating scheme (SVN, for example)

  12. Guest

    on January 18, 2010 at 10:25 pm

    Thanks for sharing…. i like the samples but i noticed that the collisions had issues at high speeds

  13. mmankt

    on January 18, 2010 at 11:35 pm

    yeah , it looks good. i see shadows being drawn by connecting those lines;) with som eoptimisations it should be pretty great :)

  14. Vlad

    on January 19, 2010 at 7:36 am

    If you go to the FLAVE part (10/10) and drag the middle vertex from E into the middle of F, it starts having fun on its own ! :D

  15. dVyper

    on January 19, 2010 at 12:27 pm

    That second ray-casting example is excellent :D

  16. Kaustav

    on January 20, 2010 at 4:59 pm

    I think its quite good. I am very interested in how you managed collision response for the joints between the balls. Do you use broadphase optimization?

  17. Sharedtut

    on February 1, 2010 at 6:15 am

    This is impressive, have you try playing with the Z-Axis to see if a 3d box can be created with this same code?

  18. palani

    on March 23, 2010 at 9:26 am

    I appreciate you. thanks for publishing.

  19. leon49 | ForeverYone

    on July 19, 2010 at 8:46 am

    [...] engines Flave – verlet physics engine 2D JigLib – 3D physics engine Box2D – 2D physics APE [...]

  20. Flash ????

    on July 19, 2010 at 11:16 am

    [...] engines Flave – verlet physics engine 2D JigLib – 3D physics engine Box2D – 2D physics APE [...]

  21. wordpress expert

    on July 31, 2010 at 12:19 pm

    Just tell you your web blog seems truly strange in Mozilla on a linux.

  22. flash?????? | LuFree???????

    on August 3, 2010 at 10:01 am

    [...] Flave – 2D???? JigLib – 3D???? Box2D – 2D???? APE (ActionScript Physics Engine) – 2D???? WOW Engine – 3D???? Particle Engine – ???? [...]

  23. dorkbot

    on September 6, 2010 at 3:07 am

    Can anyone recommend a good steering behavior engine? I like the engine explained in AdvancED ActionScript 3.0 Animation, but it doesn’t accommodate limiting rotational movement, so often the Vehicles flip around, or spin.

    Thanks!

  24. WILEz

    on September 10, 2010 at 9:26 pm

    Gran bel lavoro! :)
    Pensi possa essere usato per un gioco sullo stile “Sensible Soccer/Dino Dini game?
    Cmq, lo sto scaricando.

  25. flashVT » Part II – Prototyping LilBits game

    on December 23, 2010 at 12:57 am

    [...] it to Objective C through the Flash exporter. I then did some more digging, I had more success with FLAVE, but it was still a little clunky on the iPhone. Since “LilBits” does not need a ton of [...]

  26. Flash Gaming Engines « vgioniop2007060

    on January 25, 2011 at 5:48 am

    [...] Flave – verlet physics engine 2D JigLib – 3D physics engine Box2D – 2D physics APE (ActionScript Physics Engine) – 2D physics WOW Engine – 3D physics [...]

  27. oh...well?!

    on May 12, 2011 at 2:09 am

    Are The Particles able to cross constraint with high speed?
    if yes, it would be easy to avoid it by finding the cross point between the constraint and the line between the position of the particle last frame and the actual frame. The you could set the Particle Radius to Zero or at least 1. Then the Rigid body would be more like rigid bodies…

    I wrote two very similar Physik-Engine in PureBasic. You can see them on my website (http://motomoto.cms4people.de/) but it’s german.

    sorry for my poor english

  28. flash????? | Amyflash

    on July 16, 2011 at 3:54 pm

    [...] Flave – 2D???? JigLib – 3D???? Box2D – 2D???? APE (ActionScript Physics Engine) – 2D???? WOW Engine – 3D???? Particle Engine – ???? [...]

  29. JimmyBitmapLester

    on January 7, 2012 at 4:29 am

    Finally a AS3 physics engine that works first try in Flash. Way easier to use than ape or box2d. Be sure it will be in my next projects.
    Thanks again!
    <3 Jimmy Bitmap Lester