"Apply effect" bug on Android / HTML5

TimDo

  • Posts: 12
Hello!

The command : "For each actor on screen : apply effect grayscale" works perfectly on Flash Player.
But if I use it on Android or HTML5, a bug occurs which make the game lag for several seconds.

Is it a known issue?
Do I have to use a workaround and import grayscale frames for each actor, and instead of applying the effect, switch frames?
Does somebody have another solution?

Luyren

  • *
  • Posts: 2019
I have no such issue on HTML5 You could describe what you are trying to achieve and post a screenshot of your code so we can take a look.

It's a good practice to try to reproduce your issue in a blank game with the bare minimum, to rule out if its a bug or an issue on the implementation of your code.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

TimDo

  • Posts: 12
Thank you very much for your advice!

So I wrote a very simple code in a blank game, with rotating actors to be able to see if the game lags.
(see first attachment)

I found the problem : the more actors, the more laggy the game gets when the effect "grayscale" is applied.
With 20 actors, there is a very noticeable lag on HTML5 at the moment the effect is applied.
On Flash Player, the game is very fluid.

I then tried to add a grayscale animation to the actor in order to switch animations instead of applying the effect "grayscale".
(see second attachment)

In this case, there is no lag at all on HTML5.
I therefore suppose that this is not a matter of code but a bug/problem with the engine.



Luyren

  • *
  • Posts: 2019
I tried rotating and grayscale, separate and at the same time, with actors placed on the scene designer and creating 20 of them at the same time with a button press. At most a dib to 55 fps for one frame is all I got with a sensor collision, 53 with solids hitting each other, and its seems to be more related to 20-40 actors being created at the same time than the rotation and grayscale. I can't test Android at the moment, so all done on HTML5 on Chrome. It lasts for less than a second and its barely noticeable, so it could still be something on your setup.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

TimDo

  • Posts: 12
Thanks a lot for taking the time to test these!
The thing is FPS are stable at 60 without any drop in my case, the lag occuring just when the effect is applied...
What do you mean by "your setup", please? I'm not sure to understand.

Luyren

  • *
  • Posts: 2019
Your setup: the phone you are using, the browser you are testing with, or something else specific to your game (though you tested with a blank one, so that should be ruled outprobably).
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

TimDo

  • Posts: 12
Well you are right, changing browser makes a difference!
In every case, 50 actors - 60 FPS without any drop.

Chrome - Internet Explorer - Microsoft Edge : noticeable lag (about 0.25 second)
Firefox : much better but still visible (about 0.1 second)

In any case I will add in my game a grayscale frame for every animation rather than using effects.
The game will be a bit heavier but lag-free. I'll sleep better at night ;)