GS Optimization

I published my game demo and realized it runs VERY slow. Does resizing all images to be divisible by 2 actually help the games performance? I also found recommendations to use images instead of Display Text. One article also claimed the way you organize all your game logic can effect performance. Can anyone confirm any of these tips? And are there any other tried and true tips?

Comments

  • AlchimiaStudiosAlchimiaStudios Member Posts: 1,069
    edited February 2018

    Divisible by 2 is more for fidelity's sake more than performance. But texture size does matter quite a bit, so for example if you have a image at 513x513 pixels, that's actually considered a 1024x1024 size texture, which uses more memory (RAM) than a 512x512. So it's more being conscious of textures that really don't need to use a texture size up. This usually isn't going to hit FPS though.

    Standard texture sizes are powers of 2 on x and y (: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048)

    Display text is honestly pretty performant, as long as you aren't going hogwild with tons and tons of them. If you are, it could certainly be a problem. You can try images instead.

    Logic organization is a real one for sure. But it's not so easy to pin down. Well structured code sort of just takes time to get right.

    Some other things to consider that might cause lag are:

    1. Nested spawns (spawns that spawn another spawn).
    2. Spawns that occur every frame or close to it (spawns on a loop, spawns every .05 seconds, etc).
    3. Really complex constrains (nested constrains, expressions with tons of complex math used multiple times).
    4. Particles that spawn large sized images very often, or multiple instance of these.
    5. Tables that save very often (like every second or less).
    6. Excessive blending modes on large textures.
    7. Better collision turned on with loads of collision points or custom collisions.

    If the lag occurs right after scene change it could be related to large amounts of code execution at the same time. This can be worked around by delaying the code a little using timers or thinking about the rules in a different manner.

    It could also be related to assets loading right away, or even them not loading right away. Try changing the settings for preload art on actors with many images.

    It can also just be a combination of things adding up to too much work for the hardware. Try turning off suspected code until he game stops lagging, this should give you an idea of what's causing it.

    Follow us: Twitter - Website

  • ArmellineArmelline Member, PRO Posts: 5,363

    @sinbot said:
    I published my game demo and realized it runs VERY slow. Does resizing all images to be divisible by 2 actually help the games performance? I also found recommendations to use images instead of Display Text. One article also claimed the way you organize all your game logic can effect performance. Can anyone confirm any of these tips? And are there any other tried and true tips?

    The biggest impact will come from the game logic. The more efficient your logic, the smoother your game will play. Images as definitely more efficient than display text, but you'd need a lot of text being displayed for it to make a noticable difference.

    What kind of game is it? Does it have a lot of actors on scene at once?

Sign In or Register to comment.