Liquidfun JavaScript - LFJS - [behavior], devlog, ideas, suggestions

  • WackyToaster

    OK, I've made some progress with trying to understand these problems.

    ParticleBug.c3p. The bug where a particle moving to a negative position < -12,297.21 is because of how negative numbers are stored in binary (the particle falling upwards eventually exceeds the store limit of a float32). There is nothing I can do about this: it's a limit of the engine.

    ParticleBug2.c3p. When I made the plugin I hadn't anticipated this behavior. You can create multiple shapes of particles, each shape can be given the same tag so they all associate inside the same particle group. However, if you destroy all of the particles in the group (as in this example) then the next particle creation in that group causes the engine to fail. I don't know why this is (yet) and I'm still looking into it. The work-around (for now) for creating groups in a cycle like this, is to use a variable to set the group tag and increment it after each creation cycle (see linked example).

    discrepancy.c3p. This problem was caused by the same fault as above. See the example - by changing the particle group tag then the problem can be avoided.

    grouptagmaxcountissues.c3p. This appears to be another feature of the engine: if you try to create single particles totalling more than the max count limit then it causes a crash, but only if you create them in a new group in one game step cycle (tick). I think that it doesn't happen if naming the group "A" because the max count has already been initialised. I'll take a look to see if there's a way of editing the library to fix this (that won't create an overhead).

    Here are the adjusted bug examples with the workarounds I mentioned: link

  • Update: v1.0.0.18

    Bugfix. Added preventative method to ensure that destroying a particle sprite doesn't cause the plugin to crash.

  • Thanks for the notes and workarounds!

  • Colludium Whats your experience with plugin on Mac OS / iOS? I try C3 physics demo with default addon and it works. Than I replace it with LFJS an get freeze on loading screen with this error:

    snipboard.io/VQWEm7.jpg

    Mac Os Mojave 10.14.2

    Safari 12.0.2

    After export with cordova to iOS it, didnt work on my iPad too.

    But It's work on Windows and Android good.

  • Hi Tombas

    I haven't tried using a Mac, although I can't see why the variable globalThis couldn't be found. I haven't seen anything like this before. Out of interest, are you able to test in a different browser (ie Chrome vs Safari, although I'm not sure if any differences could be the cause here)?

    Nepeo - sorry to bother you, can you think of a reason why globalThis wouldn't be declared when previewing on a Mac? This has me stuck... As far as I can tell, the implementation in my plugin is similar to that of the standard Physics plugin, so there's no reason I can think of as to why the variable wouldn't be declared. Thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have used it on Mac (Chrome), works fine for me, older version of plugin (1.0.0.0) I use globalThis in projects running on Mac.

  • Colludium & Mikal - I try it in Chrome on Mac and it works. But still didn't work in Safari. I don't know if is it some bug from Mojave Safari / Webview. I don't have newest Catalyna to try.

    Mikal - if you have mac, can you try it in Safari?

    And also after ship the project to AppStore and installed it, it didn't work on my iPad.

    I have newest version of the plugin, I don't know how to download older from itch.io

  • Thanks Mikal for the reassurance. Tombas I think that it must be a problem with Safari. This wouldn't be the first time that Apple products were not compatible with the Mozilla standards... Sorry but I don't think there's anything I can do to stop this from happening.

  • Ok, I know. New Safari/Apple bug every second month :-D :-/

    There is so many obstacles on the multiplatform road :-(

    However if someone try it on other versions Safari (Catalina) or iPad or anything else, post a reply. Thanks.

  • Works for me in Safari: Version 13.0.5 (14608.5.12), Mac: 10.14.6 (Mojave)

    Again w/ plugin 1.0.0.0 (however it should also be using globalThis).

    I am using Construct latest beta (189)

  • Thanks for response :-) Than the bug will be caused by my older version of Safari / Mac ... I am using virtual image to emulate Mac, it's hard to update to newest. Later I will try to find any solution... Thanks

  • Hey Colludium sorry for the delay. I've been out of the country for awhile.

    So globalThis is still kinda new, so I wouldn't be surprised if it wasn't supported on Safari. However, it should in theory be polyfilled by the construct runtime so that it appears to exist on all platforms for users.

    If it's not appearing then it might be because the code is running before the polyfill ( unlikely ), that you are running code in a context that the runtime hasn't polyfilled ( possible ) or that the polyfill was broken some other way.

    If you know the environment I would be tempted just to use another alias for the global object.

    As a bit of context in case you aren't aware; the reason why "globalThis" exists it is because the name of the global object changes depending on where you are running your code. In Node.js it's "global", if it's a standard browser context it's "window" and if it's a browser worker context it's "self" ( self also works standard browser context, but not Node.js ).

  • Thank you indeed, Nepeo - those were the wise words I needed to help me isolate this.

    Update: Version 1.0.0.19

    Bugfix: Removed use of globalThis which may have been causing problems in Safari.

    Tombas - I hope this fixes this problem.

  • Colludium - Cool that's really fix the problem. I tested it quickly, now it's working on Safari from previous Mac OS X Mojave :) ... Thanks

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