Liquidfun JavaScript - LFJS - [behavior]

4 favourites
  • -deleted-

    But if I actually delete this post then the other copied post also disappears...

  • Hi Tombas - This is a totally new plugin, built from scratch with a version of Liquidfun that I modified myself using Emscripten. When I made Box2D+ I made a bunch of mistakes and poor decisions that became part of the internal workings, all of which I avoided this time around - so LFJS is much tidier and more efficient internally (it contains all of the Box2D+ features and more, apart from the image-alpha-scan-to-shape functions). It will only work in Construct 3 using the c3 runtime - are you looking to migrate over from c2 or have you already made the move? I was considering making a version for c2 a while ago but it would involve a lot of hard work - because c2 is the legacy software, right now I don't feel it's worth the effort.

  • Colludium Thanks for answers. I am using C3 but only C2 runtime. With some tools on forum I convert your C2 Box2D plugin for C3 but only C2 runtime... C2 is deprecated like you say. Just focus on C3 version :-)

    So I definitely buy your new plugin tomorrow and rewrite some code and finally start using C3 runtime with all new features. Thanks for your work :-)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Tombas - that is awesome! I hope the conversion is not complicated and you enjoy the new features.

  • I am trying to figure out a way to allow elastic 'joints' to shift over time in terms of position and strength, any suggestions on how to do that?

    Here's the effect (though in 3d) that I am looking for. An elastic group getting pummeled by other objects and changing shape.

    Also another fun LFJS example:

  • With caustics.

    I love it when dev becomes serendipitous.

  • Mikal - great demo!

    I think that 3d example uses real time mesh deformation to edit the shape of rigid bodies.

    For particle groups, I can't think of a way of actually deforming an elastic group by adjusting the particle joint strengths and/or lengths. When the group is created the particles are created in an even spread and bonded to their neighbours in pairs and triads. The engine then tries to maintain neighbour positions by using the Elastic Strength or Spring Strength system values to attract them towards each other. You can edit those system values but they are global, so it's not possible for the connections on each particle to be edited individually.

    To change the shape of an elastic group on collision, I think you're limited to deleting the particles at the impact site (via circle, aabb or shape query).

  • Ah, I see, thanks for the explanation. An example of what I am talking about would be to adjust the lengths to their current length, would that be possible?

    Thanks also for the pointer on Destroy, that also has a nice effect:

    (Also updated Caustic Wave effect w/ control over distortion and color of wave highlight.)

  • Mikal - the only adjustment you can make is to the Spring / Elastic force, which is global. There is no way to freeze or capture the current length and make it default for individual particle triads.

  • Update: v1.0.0.5

    Fixed a type-o in a particle system settings action.

  • Hello Colludium, this is amazing. I like it very much. Is there a way to try it before buy this plugin?

    How the license of this plugin works?

    Is there a video or documentation explaining and showing how your plugin works within C3?

    thanks a lot

  • Hello;

    How do I set up one of these elastic matrix shapes? Is it body type particle system? When I put a single sprite on the screen, set it as Dynamic and do nothing else it falls with gravity. If I make it a particle system it just sits there.

    If I could get a simple elastic example I would be pleased. All it has to do is fall on the floor and squish a little.



  • Hi rraffo - Thanks for your interest. The license is for one developer with no limit on the number of games. There are 39 examples / demos included in the download (separate free download from the itch page). All of the examples have comments and notes, so I hope that they make sense. If you can use the standard Physics and/or understand Box2D then I hope it will seem logical.

    Hi winkr7 - If you download the c3p demos from the itch page then the ones you are looking for are all named as "Particles" and then a description of the contents / demo. The basic particle system control design requires you to assign an object as a particle controller (in the editor properties: body type - particle system). You then assign a particle sprite (to display each particle) to that controller in an action. All of the other actions to create particle groups etc for a particle system are made through that controller. Each controller is a separate system, and each system cannot interact (limit of Liquidfun). The demo/examples should help - if you get stuck, just let me know (I hope the examples make it clear what you need to do).

    This is some good background reading, even though it's geared towards coders, because it shows you how google designed the particle element into Box2D. link to liquidfun

  • Colludium I have some more question for you:

    1) Is LFJS plugin a replacement of the C3 Native physics plugin?

    2) what if I have a working progress physics game using the C3 Native plugin? Can I easily replace the native plugin with LFJS?

    3) My target is to obtain a more robust and faster physic engine. How much faster is LFJS compared with C3 Physic engine?

    Sorry to bother you but I will probably have some more questions... :)

    thanks for your patience.

  • rraffo - good questions.

    1) No. LFJS is not a replacement for the standard physics plugin. It is just an alternative with more/different features - especially comprehensive joints and particles from liquidfun.

    2) I very tentatively say yes. There are more features to LFJS, but how easy it is to replace one with the other totally depends on how many events you have used in your project. The general design is similar, so actions should be transferable with minimum fuss (unless you have 1000 of them...). The functions and events do not all have the same names and will not automatically swap, so it will be an event by event process.

    3) The standard physics engine is very fast, but the implementation is not complete in C3. LFJS has similar performance to the standard plugin (based on a similar library) but there are a few more lines of code in the collision presolve callbacks. So, techincally, I expect that, if you were to enable collision points in LFJS, then LFJS might ever-so slightly under-perform compared to the standard plugin. There is a stress test demo that compares a tower of blocks in LFJS to the standard physics plugin and, to my humble i5 laptop, there's hardly anything between them (I think the standard plugin takes the edge, only just).

    All questions are welcome. :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)