• Hey! Guest! The 40th (!!!) GMC Jam will take place between February 25th, 12:00 UTC to March 1st 12:00 UTC. Why not join in this very special anniversary jam! Click here to find out more!

SOLVED Tiled background size and performance

Pretorg

Member
I have been using in my project 4 600x600 backgrounds tiled (as they are smaller than the room), the first is just a solid colour, the other backgrounds have some scattered sprites.
I am implementing random events on the game and one of them requires a different background which is a radioactive fog that I intended to use as a foreground while also using a solid colour with low opacity on top of the other backgrounds to slightly change their colour, both of these two new backgrounds are also 600x600 and tiled.

The room is 1300x900.

I haven't had any problems until yesterday, when trying to record some footage I noticed the performance drop mostly on the video itself, while playing is not that bad but still it sometimes drops down to around 50 fps, this drop seemed to happen in a specific place of the room, where the backgrounds tile vertically.

I have tried to test smaller versions of these backgrounds and also bigger but can't really see any difference, the only thing that seems to have some positive impact was lowering the number of backgrounds in use which makes sense, but even using only 3 in total one of them being the fog the performance is still bad, my guess is that it has to do with the transparency mostly but I am also wondering if using either a smaller or bigger backgrounds would help.

My apologies if this topic has been answered before, I did both a google search and forum search as well as going through the documentation but couldn't find anything that would help me.

On this picture all the backgrounds are active, as you can see there is a lot of transparency going on.

Thanks in advance for any insight you guys might have.

VDrad.png
 

sp202

Member
I think texture swapping is the issue here. Try using larger texture pages or smaller backgrounds, whatever you can do to fit them on one texture page.
 

Ricardo

Member
I'd suggest you to run the debugger's profiler when the performance drop is happening so you can identify what's going on. Do not increase your texture pages size if you don't really need to, though. 2048x2048 (default) is most likely a good size considering the art style of your project.
 

Pretorg

Member
I'd suggest you to run the debugger's profiler when the performance drop is happening so you can identify what's going on. Do not increase your texture pages size if you don't really need to, though. 2048x2048 (default) is most likely a good size considering the art style of your project.
I did use it but couldn't see anything wrong, the memory was 13mb, the object usage was the usual and the fps were in a 200-300 range which is slightly lower than what I get while using the other backgrounds only, I'll try later to use the profiler to watch the textures and see what is going on
 

Pretorg

Member
After some more testing it looks like texture swapping was causing most of the performance issues, I deleted a lot of old sprites and backgrounds I wasn't using but still they were taking space off texture pages and reduced the size of all the backgrounds in use narrowing it down to 2 texture pages.
There are still some slight frame drops when using the extra backgrounds but it's not as bad as before, right now I think it might have to do with the parallax, constantly moving that fog and the other backgrounds...I might try a different approach and use an object to draw only on the view on top of the backgrounds and also get a better understanding on how much processing power it is taking
 
Top