So currently I’ve been working on a boss fight in my game which includes a boss with the canvas size of 1800x900. I know this is kind of messy since it’s almost as big as a 1920x1080 screen, so it sure will slow down the game theoretically. It literally makes the game crash daily because it uses too much of the memory. However, it’s not only a huge object, but also an object with over 600 frames and 50 animations. I’m hoping to find a way to reduce lagging without removing or remaking this boss.
The other reason why I’m still not giving up is that in my previous game, I made a boss with slightly smaller canvas size (1350x900) which caused no lagging at all. I have some hypothesizes:
- The current boss has much more frames and animations than the previous one.
- The movement of the camera in the current game is more frequent and faster.
- The current game uses animation names to switch animations while the old game uses animation numbers.
By the way, my game resolution is originally 2400x1440, but since it is too big for most of the computers, I change the camera zoom and apply lower resolution. This method did improve the performance at the beginning, but it doesn’t seem to be working anymore.
Maybe I decided the canvas size too early when these problems weren’t so apparent. Anyways, I’m still looking forward to finding a solution to keep the current canvas size and improve performance.