I have some questions about effects...

0 favourites
  • 12 posts
From the Asset Store
Wind effect
$2.49 USD
Animated wind effect for objects, grass, trees, etc.
  • I love construct 2 and now i'm using more effects and i have some questions.

    What use more CPU and GPU:

    • Change Sprite Color by Behaviour or change Sprite Color by WebGL Effect?
    • Use WebGL effects on layer or use WebGL effects each instaces objecs.

    Thank's for listening.

  • Are you developing for mobile or desktop?

  • Are you developing for mobile or desktop?

    Both.

    I'm using more in mobile, but my html5 games need to run in both on a web page.

  • Then i wouldn't recommend using WebGl effects. Cheapest possible way would probably be to just have duplicate sets of sprites, for a bit more memory use, or maybe try the blend modes?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Then i wouldn't recommend using WebGl effects. Cheapest possible way would probably be to just have duplicate sets of sprites, for a bit more memory use, or maybe try the blend modes?

    Hum, i have 1 character with 8 animations.

    I want to have 8 characters with different colors.

    I have 3 ways:

    1 - Change color by WebGL Effects;

    2 - Change color with a behaviour plugin;

    3 - Create 8 sprite on photoshop just changing color and create 8 animations to each others (the game will be heavy);

    I don't know if i have more ways to change color.

  • Although I think option 3 you will get much better fps, but the game will use a bit more memory, and load a little bit slower. That's just my experience from working for mobile. I'm using option 3 at the moment, because the other solutions i lost too much FPS.

    EDIT: but the best way is of course to try it. What's best for your game. Test and see how it performs.

    Try all options and decide the one that you think get you better performance.

  • Although I think option 3 you will get much better fps, but the game will use a bit more memory, and load a little bit slower. That's just my experience from working for mobile. I'm using option 3 at the moment, because the other solutions i lost too much FPS.

    EDIT: but the best way is of course to try it. What's best for your game. Test and see how it performs.

    Try all options and decide the one that you think get you better performance.

    Hum. Do you know if i use effect and behaviours to change color, the construct 2 still change color at run time in 60 fps?

  • You probably won't notice any major performance impact unless you have a LOT of stuff going on already.

    You will need to create a miniature "stress-test" perhaps... so make like 1000 of your sprite objects at runtime using a loop (just for testing) and try the different effects to see which one works faster/slower.

    You can make an FPS and CPU counter on your project as well to help see visually the difference. Just make a text box object and every tick set the text to;

    "FPS: "&fps&"CPU LOAD: "&round(cpuutilisation * 100)

    This will give you a nice FPS counter and a rough approximation of CPU load.

    ~Sol

  • Answer your own performance questions with measurements

    although I will add:

    • there's no official behavior that can change the color of an object, I guess you're looking at a third-party addon?
    • if you have a lot of objects and many overlap, applying the effect to the whole layer can be faster, since it only processes everything once. Otherwise overlapping areas are processed more than once. On the other hand if you only have one or two small objects, it would be a waste to apply the effect to the whole layer, since it will have to process a larger area than necessary.
  • You probably won't notice any major performance impact unless you have a LOT of stuff going on already.

    You will need to create a miniature "stress-test" perhaps... so make like 1000 of your sprite objects at runtime using a loop (just for testing) and try the different effects to see which one works faster/slower.

    You can make an FPS and CPU counter on your project as well to help see visually the difference. Just make a text box object and every tick set the text to;

    "FPS: "&fps&"CPU LOAD: "&round(cpuutilisation * 100)

    This will give you a nice FPS counter and a rough approximation of CPU load.

    ~Sol

    Hey, thanks, i'm making some tests!

  • Answer your own performance questions with measurements

    although I will add:

    - there's no official behavior that can change the color of an object, I guess you're looking at a third-party addon?

    - if you have a lot of objects and many overlap, applying the effect to the whole layer can be faster, since it only processes everything once. Otherwise overlapping areas are processed more than once. On the other hand if you only have one or two small objects, it would be a waste to apply the effect to the whole layer, since it will have to process a larger area than necessary.

    Hum, i got it! But, i don't know one thing... The WebGL shade effects like "setHLB" will run one time (will run the script one time to change the sprite color) or will run everytick (every step)?

  • All WebGL shaders run every time the image is drawn, usually every frame.

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