Uh oh – it’s another “Wow how the bloomin’ time flies!” blog post opening!
Well it’s been ages since I could get to write some more code on the game. Some pesky IndieCity launch combined with family and Xmas prep has meant that I haven’t had much of a chance at all to get coding lately.
But there’s more to it than that. During the first week away I’d been mulling over the frontend and level select system and hit upon an idea that I wanted to see through. Unfortunately I was going to have to shuffle around huge chunks of the code base and I knew that this would see me needing a switched-on brain and a good run of 2-3 spare hours.
So what happened? I ended up getting up early a couple of days ago, blasting through the code-base as quickly as possible, getting it compiling and running and…..creating one bloody great mess!
Here are the more gruesome details…
Game Length and Levels
I’d initially been thinking about the kind of game I wanted this to be from a play-length / replayability point of view, and given the mechanics my preference was to make something highly replayable that only took 20-30 mins a sitting. So I went with the classic branching approach where after every completed level you can choose the next one to be easier or harder. So you end up with a branching triangle where you can try out many different paths through to the end.
So far so good. That approach should work nicely I thought…I can have high scores for each stage, and maybe a ‘bonus’ set of levels part-way through that are more points-tastic but perhaps with a smaller barrier or something.
So next I started thinking about the menu screens for selecting the levels, and what style they should take. And that’s when I had the “Good Idea” that’s been causing the problems:
My maps are tiny .png files that load up and get parsed in milliseconds, so why don’t I load them all up at the start and connect them together with corridors with no loading times! And then the high scores and other info could be displayed on the walls in the corridors as the player walks through them deciding which way to go. THAT WOULD BE AWESOME!
Having at least a modicum of sense I knew that this would put a real strain on the time remaining, but decided that it would really make the game hang together better, and went for the ‘what the Hell’ approach.
So a massive rewrite was called for as I was going to have to change the loading, updating and rendering of levels to be under a MapManager object that did all of the stitching together of stages and corridors, deciding which ones to draw and when. I desperately hope that I get the chance to show the levels being constructed while the player is on their current stage or corridor: wall pieces flying in from the side and pickups dropping down from above while you’re in the preceding corridor etc. Fingers crossed I get time for that
So getting up before dawn one morning I spent just under two hours typing furiously, and stupidly it was only near the end that I realised I’d have to use a bunch of matrices to rotate, translate and rotate again all of the corridors and levels so that they stitched together correctly. With about 10 mins to go I just blatted out some almost-complete guesswork matrix calls, and made one HELL of a mess. In fact the only good thing about it was that it was so bad I thought I should render all of the maps and corridors “connected by my matrices” to show badly wrong it was!
A pretty awesome balls up even if I do say so myself! Here it is in more detail:
And then the kids got up so I had to leave it like that! Bugger!
Progress at last
Tonight I’ve finally had a chance to look at the code more carefully, and spot the STUPID mistakes such as running the matrices through a bloody gameTime parameter (man I must have been really rushing!) and I’ve actually thought through what’s needed.
And happily progress is now being made and it looks like this:
That there is one T-junction corridor in the middle and two identical maps being loaded and stitched to the corridor exits (the white boxes) – Huzzah!
Of course as soon as I started walking through the corridor I crashed into an invisible wall, since the collision hasn’t been run through the matrices – d’oh! That’s going to take a bit of head-scratching to sort out, but hey, at least things are moving forwards again
More blog posts coming soon I sincerely hope!