Week In Review — Mar 1

Back to business as usual this week! Still on the third-last level unfortunately, but I guess a longer development period is the cost of better production values. One of the many things eating up development time is all the little cinematic moments in the game, some of which I worked on this week and thought I’d get into.

Here’s Valentine’s warship that we all know and love. At several points in the game you’re going to be seeing it up-close, so this week I worked on the larger, more detailed version of the warship.

This is the big version! I created most of it, but didn’t bother with parts of the ship you’d never see. Anyways, this thing is huge! If I just saved it as a single image it’d need to be a 4096×4096 texture, which just seems insanely wasteful — so I worked a little sneaky game dev magic instead.

 

I’ll focus on the bottom of the warship, because that’s where I was able to get the best optimizations.

The idea was to break the warship down to a small group of elements that could make up the large whole. The first thing was to find parts that repeated and isolate them.

As long as I have one of each element in the sprite sheet, I can draw them as many times as I want in code. The element in the top-right isn’t a repeat — it’s a large symmetrical sprite. You can mirror sprites vertically and horizontally in code as well, so I only need half of it to make the whole thing.

I also separated the elements that couldn’t be broken down any further — some parts I’m just stuck with. Arranging everything so far gives you something like this.

The only thing missing from the warship’s underside at this point is the large areas of black. You can stretch and squash sprites in code too (isn’t code great?) so to make up the majority of the warship’s background, all I need is a little black square. A small extra image is also stretched and used for the underside of the warship.

After all that, I’ve gotten the warship’s underside down to under 1024×1024, which is much more reasonable in my eyes. You can see the sprite sheet here! I kept the repeating elements outlined in the same colours in case you need to go back and see where each piece fits.

Finally, the thrusters. Instead of using up a bunch of space for multiple animation frames, I animate them in code by squashing and stretching a single image!

When you alter sprites in code, you give an origin around which to squish, stretch, rotate, etc. Having the origin in different locations produces different effects — the lower example being what I used for the thruster animation.

And here you go, the final result! I actually shrunk the warship down a bit to record this gif (yet another thing you can do with code) because it was just too insanely huge.

Hopefully this week or next I’ll finally be done the current level and start closing out the game.

Have fun at GDC if you’re going — wish I was there!