HcXy
September 8, 2024, 3:40am
18
To answer your initial question “is there something that can be done outside of remaking this boss”:
No, there is not.
A 1800x900 size sprite is 6.5 mb of VRAM in a GPU (textures are uncompressed when loaded into a GPU, so the memory size would be length * width * RGBA (4 pixels for color and alpha)). That’s for a single frame. at 600 frames for a single animation, that’s 3.9 gigabytes for your animation to be stored in your GPU’s ram.
For context, Hollow Knight’s largest single sprite size is 500x500, with the screen size ones broken up into separate parts. This allows for the parts not currently being rendered to more easily be culled from memory. Also, most of Hollow Knight’s bosses have most of their parts as non-animated single frames that are moved with game logic, so there’s no animation frames being loaded.
Edit: Your previous posts mentioned you were using Skul as a reference/comparison. I did some digging and Skul’s native resolution is 640x360 and their largest sprite has a max height of 400. Your assets, unfortunately, may just be too large for your GPU (or most game engines). Scale and create captivating 2D pixel art | Unity Blog | Unity Blog
This is what the left corner of the screen looks like when the game crashes. The audio and control still work fine but the screen is invisible. I guess this might be because I used oversized images (1800*1200 canvas size) for a moving sprite in the game which overflow the memory as reported in the console.
Seems like it has led to some ‘context lost’, which I don’t quite understand. I’m still wondering if there are any other possible reasons of the crash other than oversized sprites.
For almost a year I’ve been lying to myself that a remake is unnecessary… but sadly it is inevitable. I agree with that blurring images rather than applying in-game blurring is better, but sometimes it may increase the file size. That’s another reason for me to update all the background resources.
Points:
Regarding images cut and placed like puzzles, I always heard that they gave better performance (a large image, with only a part visible, the system will render the whole thing). However, I myself have tried using several images for different objects and it ended up giving me less performance. I’m using more Panel Sprite and Tiled Sprite. I always wanted to have a correct answer about what gives less or worse performance, but in practice the results are different than what I expected or what I had heard.
Did you put different parts of the background into different objects? Or did you use separate animations of the same object to display the parts? From my experience, having more animations is better than having more objects. Also, having too many global objects can cause performance issues. If you did use too many objects, it won’t be surprising that the method did not work.