17 SEP 2022:
It’s funny how this always happens. I have one week of lots of progress followed by another with practically none.
Before I left for my business trip, I was able to do some tests with sprite sheets as applied to loading times. So below I’ll recap some of my observations on the different ways of loading graphics into your game.
1) LOADING INDIVIDUAL IMAGES
PROS: Makes it very easy to change individual graphics files without tampering with the rest of them.
CONS: Doesn’t make good use of physical space, resulting in longer loading times.
2) LOADING A SPRITE SHEET
PROS: Makes better use of physical space. Only loading one .png instead of dozens (or more) individual images. Faster loading times.
CONS: Sprites need to be referenced based on their location on the sprite sheet. This may not be an issue if you’re using a game engine, but it’s more complicated if you’re using code. It also gets more complicated if the sprites have different sizes.
3) LOADING A SPRITE SHEET . . . AND THEN LOADING THE INDIVIDUAL SPRITES INTO AN ARRAY
PROS: By placing the sprites into an array you can more easily control when an animation starts and where it ends, even allowing for an animation to play backwards.
CONS: Although convenient, this also increases load times because you’re essentially loading all the graphics twice — once for the entire sprite sheet and then again for each sprite individually.
For Scrapship, I’ll probably be using option 2, although there may be a few cases (e.g. animated explosions) where I might want to use option 3.
Finally, I’m not sure exactly how QB64 differs from QB64PE, but I noticed that QB64PE consistently loads Scrapship in about 5 seconds, so that’s a huge improvement in load time without even converting all my individual images to sprite sheets!
QUOTE OF THE WEEK:
“Your time is limited, so don’t waste it living someone else’s life.” — Steve Jobs
Thanks for reading and have a great rest of your week!