Liquidfun JavaScript - LFJS - [behavior]

5 favourites
  • Colludium I have read about your Box2d+ plugin for C2. Is LFJS for C3 including all Box2d+ features?

    I have seen your tower stress demo (I assume it is this one: https://box2dplusdemo1.netlify.com/). I'm interested to the generation of collision polygon from an image alpha if this feature is available into LFJS.

    How fast is the scan of the polygon? I might need to have continuous scan of several polygon into the screen that are frequently changed by the dynamic of the game and I would like to understand better this point because apparently into the demo it takes some times to scan two simple objects.

    thanks again for your time.

  • rraffo - No problem at all. I'm happy to field all questions about this.

    That demo was for Box2d+ and is asm.js, so the performance is far worse than LFJS. The similarity between LFJS and the standard plugin's performance was so close I didn't bother publishing the demo that's included as an example.

    LFJS doesn't have an image scan to collision polygon feature. It only has one to create particles in the shape and colour of a sprite image. I considered it to be too risky to include it from Box2d+ because of possible glitches, due to my inexperience with the c3 runtime. I might include it in future, but no guarantees.

  • Colludium;

    I am running your example Particles - Behavior Flags - Elastic.cp3.

    I am trying to get the particle groups to stick together and not flow away by adjusting

    the parameter "particle system elastic strength" a value from 0 to 100 (according to the documentation)

    I only added one line to the example (see below). It does not have any effect if it is 1 or 99.

    Can you explain how I make the block more stiff like a rubber box instead of a liquid?

    (I tried setting spring strength too.)

    (I noticed that Particles - createsingles.c3p does not create any particles I can see)

    thanks for your time

    winkr7

    // This is all the Liquidfun documentation says about Elastic particles:

    Elastic particles deform and may also bounce when they collide with rigid bodies.

    From the cpp code, Elastic particles are connected in triads, or 3s.

    -> ctrl: LFJS Turn Elastic behavior ON for spawning

    // next line elastic strength to 99 (tried 9--makes no difference)

    -> ctrl: LFJS Particle system elastic strength: 99

    // end changes

    -> ctrl: LFJS Set spawn color to rgba(250,140,30,255)

    -> ctrl: LFJS Create particle "tag", shape box at 160, 300, width 200, height 200, angle 0

  • winkr7 - The elastic strength changes the springiness of the particle system. There is no way to make the block appear any stiffer than setting 100 - this is a limit of Liquidfun. Try adding a Wait 2 secs and then changing the system elastic strength and you'll see that the particle groups become more or less strongly sprung together. The only way to stop them from deforming is to make them rigid particle groups. Particle groups can only become rigid if they are rigid on creation - this is a limitation of Liquidfun. If you don't want them to be rigid after doing that then just create them as rigid and then set them fluid - that way you can later set them rigid again.

    Here's a version of the demo that shows you the how to do the actions as described above: link

    For the Particles - Create Singles.c3p - make sure you are pressing left mouse down to create the particles. They are then created from the center of the screen towards the mouse position.

  • Colludium;

    Thanks for the response and the example. Am I looking for a very subtle difference between 1 and 99 solid on and off?. I tried every combination in the example you sent and they all look the same--including leaving solid on and never shutting it down. I also don't see anything in the For the Particles - Create Singles.c3p so I suspect maybe I never did the install correctly. I will try it from scratch on my home computer and see if that makes a difference this evening. I can see other people have gotten the jello-like behavior to work so it must be possible.

    thanks for your time.

    yours

    winkr7

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have a problem as user winkr7. And in general, in all demos, particles simply create and fall.

    Version construct3: 174. Version GoogleChrome: 78.0.3904.108. I tried on two different computers and in Opera browser

    Video of your last example: gyazo.com/e2d6f382f69e497513836fc3555c6a5d

    Video of demo "Color mix": gyazo.com/c7373a219aa2e2fb83badc0f8cf2d001

    Video of demo "Particle sprite deletion": gyazo.com/ac9903cd82c75b157569c5bb12689d68

    Video of demo "Set color and identify by particle uid": gyazo.com/784a904ae1508f4b3ccc5c76ad7bb470

  • Version LFJS v1.0.0.5

  • Mosenrat - Mmmm. That's certainly not meant to happen.

    If you check the console, are there any error messages?

  • Mosenrat - Something else to try: does the exported demo work for you (especially after you press "3")? Demo

  • OK Mosenrat and winkr7

    Thank you for your patience. I can replicate the bug you've reported in the current version of Chrome.

    Could I please ask you to try the following: install Chrome Canary link and run C3 in that browser, with LFJS, and let me know if you see the same problems in the demos?

    I am hoping that a recent update to Chrome has created a bug that will be fixed when a newer version of Chrome goes live.... The joys of browser based game engines...

  • This project is currently on hold because of an undefined bug (Uncaught TypeError: Cannot perform Construct on a detached ArrayBuffer).

    Edit / Update: I think I have found the problem. I will post a fix later today.

  • Colludium I'm guessing you already found this, but it sounds like an issue with WebAssembly.Memory growth?

  • Nepeo - thanks for the assistance. Yes - it was a memory leak: quite a basic error of mine in some of the cpp coding I wrote when I modified the standard library to create the particle uid methods. Every day is a school day...

    Update: version 1.0.0.6

    Bugfix: Fix a memory leak that caused some odd particle behaviours. I hope that his should have fixed the issues seen by Mosenrat and winkr7 - please let me know if I have more homework to do...! Thanks.

  • Colludium;

    Yes, it looks like it is working on the elastic demo and the create particles demo.

    thanks for the fix.

    yours

    winkr7

  • Thanks for the fix!

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