Colorizer make the game lag when used

Hi, I was wondering why the colorizer make my project lag when used…
I setted up a color change for a certain event, but when I run the preview, and the color happen, it drop to 0.5 fps and I don’t get why…

The code is simple tho :

Anyone have an idea to fix it

Trigger once
I noticed once that if you let recolorizer run each frame it will devour your FPS

1 Like

There is still a drop of frame even with trigger once… Any good alternative ?

I’m wondering if the color map effect (there’s an object and layer version) would be quicker. It would be 1 effect versus multiple. I have 0 experience with the effect.

https://wiki.gdevelop.io/gdevelop5/interface/scene-editor/layer-effects/#color-map

Nah i stopped using it after i discovered it
Also if you added trigger once but still spam it since you most likely are cause you need per frame then trigger once will not help you

Do in an “At the beginning of the scene” event? Or is it necessary to do it during game time?

If you’re changing to set colours, then consider making a sprite in those colours. IIRC, colouriser modifies pixels in the sprite. This is always going to be slow and processor consuming, unless you do it at a lower level (which we can’t with GDevelop).

That’s a good idea. Hi Sa-x, but if it’s not suitable then you could try the ColorReplace effect instead, I always you use it.

I did two tests, first with the effect. Then second with the behaviour. I removed the effect and the behaviour from the test of the other. There is only one event and only one colour change. Here are the results from the Profiler. There seems to be a big difference for my test so it could be worth trying.

ColorReplace effect




Sprite Recolorizer extension




Both did from this to this:

image

Yeah it need to be always on… One is used for 2 suits changed (Original color is orange, one change all pixels orange (and shades) to a yellow, and one to a purple, so it need to be constantly active.
And the one i’m maing right now change the entire sprite palette to a green …

Oh that’s nice, but since it uses pixel art, can I do it pixel by pixel ? Like one of the color will become purple, another color will become a shade of purple etc…

I don’t see why not. But you would have to have lots of effects, one for each colour change and then have to disable and enable each of them. That’s all possible, and if you think it’s worth experimenting with, you’ll find out if multiple effects perform okay.

Your events are sub events of an event which runs every frame. So, technically you are not triggering once.