Don't you love it when you fix a bug that's been haunting you for months (and in this case, I mean the better part of a year)? For some reason, I could change the game resolution a few times, and them boom - nothing I rendered would show up anymore. I tried everything - I put in full GL error checking (which just told me there was a GL_INVALID_PARAMETER somewhere, but given the exact same error popped out when the thing worked, it didn't help much), I made sure all my matrix stacks pushes and pops were matched up, I made sure I was releasing and re-creating all my context managed objects, etc, etc. After a week of banging my head against it, I resigned myself to the bug - which has for the last few months forced me to restart my game periodically.
Well, 5 minutes ago, I found it. My camera objects only re-submit their matrices when they're moving. And so if the camera happens to be static for the first frame after a context switches, it would render using an uninitialised camera matrix. No big deal I thought, the next time the camera moves, all will be ok. Wrong - on OSX for some reason, as soon as you get this kind of error, the GL context hoses itself - and nothing will ever render properly using that matrix again .... Even after you set it to a sane value.
With that off my chest, let's talk UI. And if you think UI is boring, blame Ravuya. You see, I took a look at Glow for the first time a few weeks back, and I was blown away by the presentation. It's glorious. I think I spent more time admiring the nice flickering logo effect and cool menus that I did playing it (which isn't saying anything bad about the game - just how sexy the front end is). At the same time, I'd be reading some developer diaries and post mortems where they all seem to say 'we'd love to release the game/level editor, but there are lots of bugs, it's really hard to use, you have to know lots of black magic to get it to work, etc'. And together, these made me think 'I'm going to be using my game authoring tools for the next few years - so why wait until the very end to make them easy to use?'. Not only will authoring my game content be easier, but I'm hoping a nice editor will make me more productive, and hopefully allow me to let others create some content too.
Firstly, I knocked up some new tool icons for my built-in editor, and knocked up some flavour-of-the-month radial menus:
Next, I fleshed out all the map management code, including the ability to create a level from scratch, load and save maps, all without typing a line of script. I even threw in some user-friendly dialogs that let you know when things worked (or didn't as in the case below):
Not very exciting I know - but it does make my life a lot easier.
The next step (which I'm in the middle of right now), is allowing you to edit the objects in the game. Again, not exciting from a game play perspective, but I'm actually really stoked with how it's turning out.