I started off the week by working on a simple lighting system. This turned out to be a lot easier than I expected it to be – I’m currently not bothering with making the lights get occluded by anything, so really it’s just a set of methods for creating a dark, possibly textured, surface, and poking gradient holes in it to let bits of the level show through. Hell, it’s so short and simple, here’s the entire thing. The biggest problem I’m running into is just that in order to make this look decent I need to set it as a blend layer (usually add or multiply), and non-standard blend modes tend to be pretty slow in Flash/AIR so it’s potentially a big source of slowdown. On the plus side, it shouldn’t be much slower with lots of lights on the same layer than it is with just one or two, so it’s at least very up-front about its performance costs. In terms of how I’m likely to use it in the game, I’m trying to decide whether I should make an editor for this or just create a set of simple light-controlling behaviors and just push those entities into any level that requires non-standard lighting. Probably the latter, since it’s less work and just as much control. Adding occlusion is also a possibility for the future, but I’m not sure how much that would add and I’m not sure how I’d want to approach it (just occluded by level tiles? By static details? By animated particle effects?)
I also optimized the level drawing cache – probably a less dire necessity now than it was before, but still probably important for the general performance of the game.
Most importantly, I made a big decision this week: Fairly early on in this project, I declared that I wanted this whole thing to be in 1080p. Why? Well, that’s what I’ve been wondering. I mean, that’s generally The Resolution games are made to run at nowadays, but in all honesty I see a lot of games where the developer just wasn’t up to making the art look good at that high of a resolution. It looks too smoothed and gradiated, bereft of texture: The higher resolution just makes the flaws more visible, and trying to conceal them just drains the character from the art. I’m not trying to put anyone down here, I’m just saying that, frankly, it’s hard. And, for me, struggling to keep the frame rate up, I don’t think it’s worth it. I think I can do this better, better looking and better performing, if I cut the resolution down. So I’m going to be developing this game in 960×540, which you might notice is half of 1920×1080 – well, a quarter of the size, but half along each dimension – you know what I mean. Anyway, this will let it scale up nicely on 1080p systems, while still maintaining the distinctive tooth and character of pixel art. This will also allow me to maintain a lot more control over my art, something I was concerned about, especially as a beginner to this scope of project – and, moreover, it will allow me to create more interesting per-pixel effects, since individual pixels will be a far more significant presence on the screen.
While all of the core game code was written to be resolution independent, a lot of the UI stuff for level editors and other tools wasn’t. Today I went through and fixed most of that, but there’s still inevitably bugs to clean up and a few spots I missed. So over the next week I’ll be fixing those up, tackling some other bugs I’ve had sitting around, constructing the behaviors and entities to work with the light system, and maybe do some more work on the game enemies. It’s also apparently time to familiarize myself with some pixel art programs, so I’ll be working on that as well. It feels nice to make a decision that reduces the scope of the game for once, especially since it will also, I believe, make it more appealing in many ways. Everything feels a bit more doable now.