GS Optimization
sinbot
Member Posts: 232
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
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:
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
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?
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support