The invasion of the giraffes

The Giraffe Family

Yey! Giraffes! Giraffes!

Since the baby Cobra joined us late last year, there has been a marked increase in the number of giraffes in our house. From where I am sitting, for example, I can see four giraffes – which I believe is officially a swarm – and like icebergs (the frozen water ones, not the lettuce ones) that is just a small fraction of the population that has now moved in with Mrs Cobras and me.

I believe that it is possible to work out if any given household has young children or babies simply by counting the giraffes. There is no doubt that they are as cute as big smiling bumble bees or baby unicorns (except this one, which is absolutely positively not suitable for work) and I wonder if I have missed out on the clear excellence that is ‘giraffe’ during the pre-baby-cobra years of my life. Plus, they turn out to be quite easy to draw: if I stop drawing at the bottom of their necks, they’re just vertical snakes with extra prongs on their heads. How many giraffes do you have?

Posted in Miscellaneous rubbish | Tagged , , | 3 Comments

A bad travel day

So my conspiracy theory is that Shell, Esso and BP sponsor our county council to ensure that there is always at least one set of complex roadworks making town ‘bastable’1 – that’s ‘not quite impassable’.

Modern British transport methods

Some of the state-of-the-art transport methods I used to travel to and from the capital today

I imagine council bastabling clerks rushing around busy corridors clutching files, coffee and other essentials coordinating with others to ensure that easy passage in and out of the city is almost impossible. This is probably also why our flagship polished turd, the guided bus, is still not open yet: the contractor’s bastabling executives are working closely with the council’s until further delays are utterly implausible.

It is the basabling of the roads alongside the rock bottom quality of some of our bus services that resulted in an altogether non-optimal journey into the country’s capital this morning. After running for the bus, which left without me even though I was a matter of seconds from the door, my rising annoyance was reduced dramatically by the arrival of another bus. Wooohoooo! So instead of rushing through a maze of shortcuts to an alternative bus stop that would have given me more options, I waited patiently whilst the smiling bus driver completed his smoke and texting break assured that I would, unless the traffic was really bad, catch my train. After ten minutes, he opened the bus door to inform me he was in fact out of service. This noise:

Pppppffffsssssssshhhhhhhhhhheeeeeeeeee

… accurately describes the sound of steam escaping from my ears. I could actually hear my jaw drop to the floor in utter astonishment that he could have left me and another passenger standing there like lemons before breaking the news to us.

So I ran to the alternative bus stop. Eventually a bus turned up, stretching the “due in 2 minutes” to a massive man-sized quarter of an hour (the helpful screen to show you how long a bus is from arrival is powered by three drunk monkeys who spend most their time fondling each other’s parts, smearing crap over the control panels and cackling hysterically whilst drinking banana vodka). Well, there was still hope, if all the traffic lights were green. And rejoice! The crowd went wild with hope as light after light went green and because, as usual, three busses had turned up at once so we leapfrogged each other into town only stopping at one out of every three stops! Of course, the art of quality bastabling is to shatter your sense of hope at the very, very last minute leading you to believe that this was a once off and that one shouldn’t generalise this to all trips: after all, if we gave up completely, then that would not do. And today’s hope shattering was achieved care of a fantastically placed set of gas works.

I decided to make another run for it. The station was about a kilometer away and I still had nearly ten minutes. Now, as my friends know, getting fit is a continual work in progress – by which I mean that I am working on making some progress – so this was some effort, particularly when lugging a notebook computer around. Still, I made it. With 30 seconds to spare.

One most excellent and most productive meeting later, I find myself sitting here on the train to go home. In common with most trains in the UK, this one isn’t going anywhere and the tickets are whoppingly overpriced. It is about a quarter to six in the evening and this train is packed. It is packed because there are not enough seats and it is rush hour in our fine capital. The lady opposite me is doing paperwork. The bloke next to her is on the phone and shouting and screaming sufficiently loudly that I am using visual sarcasm to try and inform him of his loudness (I tell you, I wouldn’t want to be Andy, whoever he is, tomorrow morning). Next to me, some guy is editing a spreadsheet that looks really, really fucking tedious. Work is finished. Most the people on this train, including those who appear to be happy to pay a full price ticket and be forced to stand, are working. I’m relieved to say that I don’t have to do this every day. For so many people, the working day creeps, insidiously, into their spare time until it is all consuming. Life’s too short for this day in, day out, and I’d hate to miss out on the good bits, like Baby Cobra growing up. I wonder what all these people are missing out on. I wonder if it is worth it.

-§-

Imagine, if you will, some wavy lines. About an hour and a half has passed and I should be at home. However, the bus portion of the journey home – the final leg – topped off the cake of broken dreams with an icing of deadly poison. The busses are ‘up to every ten minutes’ which invariably means three at once every half an hour or so as it was this morning. Today, four arrived at once and I have to say that I feel special to have witnessed that. I would tell my friends but I doubt it would even raise an eyebrow.

There is something inherently wrong with a lifestyle that revolves around the stresses of low-quality travel on a regular basis. Granted, it’s not always this bad but it’s rarely the way that it should be. The trains around here do, usually, run approximately on time. Needless to say, this doesn’t excuse the fact that capacity is too low at rush hour and that the ticket price is verging on outrageous and that the local company’s slogan, “transforming train travel”, needs the addition of “… into bus travel” at the weekends. During the week, though, they do know how to operate a timetable to within acceptable margins. The busses, which have plenty of capacity, have little comprehension of either timetables or customer service – they actually make RyanAir look like shining beacons of first-class travel.

On my arrival home, I will be opening the emergency bottle of Châteauneuf-du-Pape (Castle Nine Popes, as I incorrectly, but lovingly, refer to it) that I keep for precisely this sort of emergency.

You only live once, try not to give it to the public transport network, eh?


1 Bastable, adjective, meaning not quite impassable. I’d love to claim credit for this, but actually, it comes from a Not the None O’Clock News comedy show’s 1982 calendar. Now I feel really old.

Posted in Miscellaneous rubbish | Tagged , , , , , | 2 Comments

That’s right, Paisley, the specification

Ahhh, the software specification. Other than arguing over whether this year is the year of Linux on the desktop or not (it isn’t), never have I seen anything more contentious than the software specification: particularly those for computer games. I have seen specifications from 0 to 50,000 words. In the worst case, project bibles were involved. Project bibles are a genius way of being able to tell your staff at anyone can design a game and can have it produced without ever having to carry through on your promise. After all, for anyone to be able to make it through the nine tests of hell is such a challenge that very few people will make it past the gate of horror, let alone successfully traverse the long, miserable corridor of “peer design reviews”. Once all the creativity has been designed out and a project bible several inches thick is produced, everyone is ready for one last final go/no-go meeting where, funnily enough, it doesn’t seem like a good idea any more.

Long Fish Is Long

Long fish is long, indeed, longer than most specifications should be

At the other end of the spectrum is the seat of one’s pants approach. In this, there is no design at all: the project just “evolves”, usually into something that is a hotchpotch of so many ideas that it isn’t good at any of them. This approach of making it up as you go along only works with very small, tight development teams where one person has a vision and it turns out to be a good one – a scenario considerably rarer than me refusing a glass of wine.

There are so many fun ways to fail with a design document that this article can merely sniff at the surface. Take the “living document”, for example, where more time is spent documenting than working. If that isn’t to your liking, how about the one where several strong-minded people have overlapping ownership of various components of the design allowing the all-chiefs-no-injuns scenario to flourish like an unwanted fungal infection. This creates a working atmosphere that you can cut with same knives you’re using to stab each other in the back: now that’s efficient!

Somewhere in this broad spectrum of choices is something that works. A design not too small as to not contain any content and not too large as to stifle creativity along the way. This kind of design inspires those that work on the project by creating a really nice foundation upon which everyone can build: a design where different ideas can be integrated without ending up with a half crocodile, half octopus; a design that actively encourages the right changes along the way whilst discouraging shiny-box syndrome.

Most of the specification for my game, if one can call it that, is in the form of one diagram and notes on a piece of paper (although perhaps it could have done with being a fraction longer). I figured that if it needed a book to explain it would need a book to understand. Furthermore, this is an exercise in fun, not work and if it all goes tits up and I sell one copy no one is hurt but I had a blast along the way: I am not expecting to pay any bills with this game. Your situation may vary, but over complexity and misplaced detail is a killer. If you write to much at too low a level, you are quite simply inviting failure. One game project I recall had a one year schedule that was broken down into chunks sometimes only an hour long. It was late by the end of day one and you can’t even begin to imagine the leveling disaster that occurred after the first member of staff had a day off due to sickness. The real problem was that the scheduler was concentrating so much on the positions and orientations of the individual bricks that he forgot to mention that the intention was to build a house.

This is one of those three bears type situations where getting it wrong leads to one or more of the three grave digging assistants:

  1. Strategy de Jour – a new idea every day!
  2. Flogging a dead horse – the idea is doomed but ‘we’ve started, so we’ll finish…’
  3. Blindly ignoring the bleeding obvious – the market has moved on but you’ve got a dying horse that is probably going to need flogging shortly

This is a fast moving industry and the business model, design and market that looked so sexy when you set off may have gained a few pounds and stopped shaving under the armpits. As I am overly fond of saying, the art is to be open minded but not so open minded that your brains fall out.

Unless you’re truly doing it for the giggles, getting your specification right is your best weapon for actually delivering something. Don’t forget to prominently feature the actual game when you’re getting carried away with the low-level stuff that’ll change so fast as to be worthless by the end of the first month anyway: focus on what it is, not the mundane details of how it’s done.

Posted in Software development | Tagged , , , , | 1 Comment

When O-Level French just isn’t enough

I am learning French at the moment and have been for some time. Needless to say, due to ‘spare time’ constraints my French has made the same general progress as my iPhone game: I am regularly overtaken by snails. It is highly likely that Baby Cobra will overtake my knowledge of the language in the next few months and that is before she learns to speak.

Part of the problem is that I am no spring chicken and the other part is the way that language is taught. I prefer to focus on the latter because that allows me to blame someone other than myself and we all know how comforting that approach can be for a good night’s sleep. For over a year, I went to lessons every week and over that period I was staggered just how little I learnt. The whole language looked so bloody complicated: the first six verbs we we’re taught (to have, to be, to come, to go, to make and to want) are all highly irregular. We were taught parrot fashion and were provided with little or no useful context for what we were learning. By now, I figured that the language was utterly impossible to learn and I would never achieve it: I was doomed to speaking English loudly and slowly in the vague hope that the French would understand me.

Irregular Pigeon

Irregular Pigeon makes another astute language observation before taking tea in the drawing room

Then, someone lent me this eight hour CD set. I started listening to it once or twice a week for an hour or so and something not far short of ‘un miracle’ occurred: I started learning. Here’s the drill on verbs: those first six they teach you? They are indeed important, but they are virtually the entire collection of exceptions. The vast, vast majority of French verbs look like this:

Parler – to talk, to speak
Je parle I speak/I am speaking
Tu parles You speak/You are speaking
Il/Elle/On parle He/she/one speaks/is speaking
Nous parlons We speak
Vous parlez You speak
Iles/elles parlent They speak
See below for notes that collapse the complexity of this table that include: 1) je, tu, il/elle/on and ils/elles forms are pronounced the same, 2) ignore the ‘tu’ form, it’s for speaking to your mates and it’s easier to avoid screwing up by sticking to ‘vous’ and 3) there’s no ‘am-ing’ and ‘is-ing’ in French

And guess what. The ‘je’ form, ‘il, elle, on’ form and ‘ils, elles’ form are pronounced exactly the same. Exactly. And since, like me, you probably want to learn to speak the language not write philosophy in it then that is important to know. Did my lessons teach me that? No, they did not. Then there is that ‘tu’ form. It is another form of you. Do you need that at this stage? No. You do not.

Over 90% of French verbs follow the above pattern exactly. Most of the remainder follow an incredibly similar pattern. So here are some interesting verb facts that make learning French less frightening which I wish someone had told me:

  • Only one verb in the entire French language has a ‘nous’ (we) form that doesn’t end ‘on’. It is être, to be, and that is ‘nous sommes’ (we are). There are no other special cases
  • Only three verbs in the entire French language have a ‘vous’ (you) form that doesn’t end ‘ez’ (pronounced like ‘hey’ but without the ‘h’). They are dire (to say), faire (to make/do) and that être one again. These exceptions follow a nice neat pattern: vous êtes, vous faites and vous dites
  • There is no ‘am-ing’ or ‘is-ing’ in French. You don’t say ‘I am learning’ or ‘I am speaking’, you say ‘I learn’ and ‘I speak’
  • French ears are generalement tuned to endings. In English you can afford to be lazy with endings, but in French, that doesn’t fly. Detecting tenses such as future and past are darn hard if you don’t make an effort to make your word endings clear. Likewise, you’ll start getting the gist of French from the endings long before you can piece together all the parts

Ce n’est pas difficile; it is not difficult.

As a computer nerd it is infuriating not to have been taught this basic fundamental structure. It is also incredibly annoying not to have been told that so much of French is the same as English, but with a French accent and pronunciation. It turns out that if you guess a verb or noun and pronounce it with your best comédie french accent (warm up with haw-he-haws, a croissant and a glass of red if required), it will probablement be compréhensible. If it doesn’t sound right, it almost certainly isn’t.

Next time I will bore you senseless with attempting to put my pathetically small knowledge of French pronunciation tips on paper and then follow up with how amazingly easy the future tense is and how, in fact, you need not bother in most cases: the French don’t. À la prochaine.

Posted in Learning French slowly | Tagged , , , | 4 Comments

It has 64 bits, so it must be better!

Germs! Bugs!

These little chaps may LOOK cute, but trust me when I say that you absolutely don't want your software infested with them

Since, oh, 1989 or so, I have been developing on 32 bit platforms. First it was the Amiga and then the PC. Even when 64 bit capabilities arrived, most stuff was 32 bit and I didn’t really need those extra bits for what I was doing. Indeed, for a great deal of time in the past decade, very few people have needed or would have noticed 64 bit data processing. In fact, 64 bits generally made people’s lives less pleasant; badly written software wouldn’t have benefited and generally small things got bigger (nudge nudge, wink wink). Net result is that I have worked with high performance 32 bit software for absolutely yonks: for over twenty years now. In fact, it is only recently that I have had any reason to consider 64 bit programming: memory. Finally, in the last decade, I created a piece of software that could actively benefit from accessing more than 4GB of memory.

Generally, though, I stick to 32 bits and assume 32 bits out of habit and sheer exposure. Where is this going, you may well quite reasonably ask? Well, when I was working up my iPhone app – the reference one, not the game – for submission to the app store, I needed to knock out a data converter utility. This little baby would take a raw data file and preprocess it into data that the app could load in the blink of an eye without any complex parsing.

It was such a straightforward piece of software that nothing could possible have gone wrong. Indeed, if the thing compiled it should work. There was absolutely no chance at all that any bugs, even those like the cute little guys in the picture, could trip me up for more than a second or three. Program, program, program-coffee-program, program, program-coffee-program, compile, job’s a good’un, crack open the vin rouge. If these sound like famous last words, then my work here is nearly complete.

I knocked this app out in Xcode on the Mac as a Unix command line tool. Previously in my life I would have done this on the PC side of my computer and used Visual Studio and knocked out a quick 32 bit command line application… but, I like Xcode, and I couldn’t be arsed to reboot into bootcamp repeatedly all day to try it so I figured I would write a Unix command line tool instead.

Oddly, though even though the utility was able to encode and decode the file just fine, the same decoding code in the iPhone app didn’t work. This was enormously frustrating: it should work, but it didn’t. I looked at the code again and again. It absolutely should work. There was nothing complex there at all.

Then Me and Mr Debugger got down to a serious session that actually lasted all of a few minutes when I looked at the loaded file header: the critical number I was reading was 4 bytes away from where it should have been and there was an odd set of 4 unexpected zeros after the header code. You see, according to the C and C++ standards, the size of ints and longs have a minimum size, but the maximum could easily change. Indeed, on 32 bit platforms or with 32 bit software generally, they are 32 bits. On 64 bit platforms… well, you get the idea. My Mac utility was compiling as 64 bit and the iPhone was reading it as 32 bit. Same software, wildly different results. My mistake was getting so used to 32 bit platforms that I did not consider designing this kind of fault out of my development by using fixed size types like uint32_t (from C99 specification) for 32 bits. These nice types were also adopted for the new C++0x standards (although you will need to have the Boost libraries installed or grab this if you’re not using at least Microsoft’s Visual Studio 2010).

I am a great believer in defensive programming: deliberately writing code in a way that ensures that common errors of general buffoonery cannot occur. I do this, for example:

if (1 == counter)

Rather than:

if (counter == 1)

Because it is too easy for me to miss one of the =s out and completely change the meaning and functionality of the code. My first way of writing it means that the compiler will spot my error before I have to tear my increasingly greying hair out looking for subtle errors involving an easy mistype.

I have annoyed myself falling for this bittage issue. It therefore falls into my list of things to get right, always, which includes:

  1. const correctness always
  2. absolutely every deadly error condition checked in code
  3. high quality error messages
  4. write non-platform specific standards-compliant code wherever possible
  5. constants always on the left, if possible, on any equality test
  6. correct use of signed and unsigned types
  7. make no assumptions
  8. write functional comments when you write the code paying careful attention to explaining the non-obvious
  9. prefer code readability generally
  10. no premature optimisation no matter how tempting it is

… a basic philosophy of “let the compiler work for you, and when it can’t make sure you’re rolling in useful data for debugging”. To this list, I now add:

  1. when you want and expect 32 bit, use a bloody 32 bit data type, you tool, particularly in protocols, data file formats or anything else where 32 bits magically becoming something else will screw you over. I.e., if it’s nails you’re putting in, use a hammer, not a cement mixer and a drunken octopus: “implementation dependent” is not put into standards for a bit of a giggle, it actually means something.

Anyhow, lesson learnt, but with an awfully large amount of code to convert.

Posted in Software development | Tagged , , , , , , | 2 Comments

Pause for thought (or not, as it turns out)

Paws for thought

The wrong type of paws, yesterday

For more than ten years, I’ve been generally working on massively multi-player technology. One of the things with that sort of stuff is that “Pause” is not a feature that you need. In fact, the software is usually asynchronous, heavily multi-threaded and real-time. From the server’s perspective it never ends: you keep on going and you never stop. From the client’s perspective, pause is a feature implemented with the disconnect button if at all. So perhaps, with this in mind, you might find it forgivable that I should completely forget to implement such a feature in my iPhone game. And by “completely forget” I mean at all levels. I failed to put it architecturally into the engine. I didn’t even think to put a button on the screen. I have not remotely considered making some programmer art for it… until I was playing my one level the other day to show a friend.

Ping! Yes, that was the bleeding obvious machine registering a hit at my expense. “Why yes, the pause function, it’s here somewhere. Well, it’s not, but it won’t be hard to add… should be a five minute job…”

Oh, cocks.

It turns out that adding pause functionality into my engine is akin to changing the tyre on a car roaring down the motorway at 130kph when you’re driving at the same time. I’m rolling in timers that are all over the place. They’re in the entities. They’re in the entity manager. They’re sprawled sexily across the game components showing off their awesome accuracy, they’re everywhere. On top of that, there’s the classic “Christ on a bike. I can’t believe I’ve done that again” mistake: with the fact that I’m running a fixed frame rate which I know in advance, I figured I’d “save myself some time” and merge the entity update with the entity render. Update handles collision detection, simple physics, the constraint engine, life and death of entities and all sorts of gubbins. When I pause, that needs to pause. But the rendering, well, that needs to continue…

And then there are those pesky timers. A global pause is almost fine because ultimately, there’s a static component to all timers that manages the details: I could simply add a static PauseAllTimers() and ResumeAllTimers() and I’d be cooking on gas — with the exception of the timers and entities I’d love to use on the pause menu for the buttons, animations, backdrops and other stuff.

Solving this kerfuffle involves a number of steps:

  • Separate Update() and Render() code paths
  • Remove timers from the entities: each tick has a fixed delta-T, they can count ticks: at 20ms, count 50 updates and a second has gone by even if the game was paused for an hour in between
  • Add master super-classes to the entities so that they can be paused by super-class: this allows UI prettiness to continue
  • Remember that whilst a detailed design might be overkill, some design may have avoided this…

Basically, the above is a 400 word excuse. Une bonne excuse, peut-être, but an excuse nonetheless. It’s a real bugger to fix and I feel like a right tool for not factoring all this in. Still, on the bright side, I decided on four levels of parallax in the end and they look great even if you can’t pause the game to appreciate their beauty.

Posted in My iPhone game | Tagged , , | 4 Comments

Corks-a-poppin’

Here’s my expression when I checked my email every morning for the past few weeks:

Terror and nervousness

It’s what I expect is the standard expression for iPhone developers going through app approval the first time. Here is the full sequence of sheer terror:

A process in progress

That last bit instilled a quivering that only jelly stuffed with vibrators could match, and that is some nervousness. Anyhow, to cut a long story far longer than it needs to be, here is how my morning gained a garnish of true splendiferousness:

Ta Daaaaaa!

So may I just modestly take a small moment to just briefly make a minor exclamation of joy?

YEEEEE-HAAAAA!

Yey squared! My first iPhone application has been published on the App store! Obviously it is not my game, as we’re not sure if that will make it at all given that it still only has one level, but instead it is a groovy little reference application that I wrote for a friend in France. I have to say, whilst the process of approval is tense (it is a little like waiting for results of a particularly mind-curdling exam) it really is quite straightforward. In a nutshell, follow the process, don’t bend the rules and Robert’s your father’s brother.

It is this good news that explains why two thirds of the Cobra family are enjoying Champagne this evening. Baby Cobra, though, is too young, so she’s chewing on a giraffe instead. As one does.

Posted in My iPhone game | Tagged , , | 1 Comment

Parallax scrolling in 2D: revisiting my past

The last time I did parallax scrolling in a game was back in my Amiga days in the early 90s. I had forgotten just how much value for money one could get from the technique. This isn’t just your average forgetfulness, either (although at my age, it could be), it is pretty deliberate. I specifically informed my brain that it did not need to remember such knowledge: 3D had arrived, it had a whole extra D than 2D and we no longer needed to fake such cool effects, we could do it for REAL! Not just one or two levels of parallax, we suddenly had infinite parallax levels. Wooohoooo!

My braaaaaiiiiiiins, braaiiiiiins, helping me remember the past, yesterday.

Then along came the iPhone and it was like going back to the Amiga days from a fun perspective, but with shaders and enough memory and processing power to make the Amiga’s 68000 look like Napier’s bones from a performance point of view.

So, with the help of home made Schnapps, I dredged parallax scrolling out of my aging memory, applied it and was again amazed by its brilliance and simplicity: so much coolness and depth added to a 2D display from so little programming. Then, after adding it as a generalised feature to my engine, I did what any self respecting programmer would do: I turned it up to eleven and added more and more parallax layers until the phone started dropping frames. I managed a good 16 with animating blocks before optimisation. It looked somewhat over-busy with that much going on, but it was pretty good fun.

Some might argue that if I focussed on baking the cake rather than decorating its uncooked gloop, perhaps I’d have more of a game at this point… but, meh, it’s my cake.

Posted in My iPhone game | Tagged , | 2 Comments

Khaaaaaaaaaaaaaaaaaan!

Some problems deserve immediate attention and simply can’t wait… a swarm of angry bees in your living room, for example, must be dealt with promptly especially if one wishes to have sex on the sofa. Other problems, such as several slithering snakes sauntering around the garden, can be brushed under the carpet for the time being – just take a little extra care when BBQing for a while until a solution presents itself or you get around to it. And solutions presenting themselves in the fullness of time is exactly what seems to happen surprisingly often in software development.

Swarm Of Bees

Yes, I did just copy and paste the same poorly drawn bee several times

Take swiping-to-scroll on the iPhone. My game, the one that’ll never be finished, has a level selection screen. Whilst it looks a little like a soviet supermarket right now, I have grand plans for filling it with a smorgasbord of wonderful level choices across several oddly conceived themes. The idea is that you swipe backwards and forwards and get that sexy velocity type thingie where you let go with your finger and the whole thing keeps moving until you bring it to a juddering halt yourself or it just runs out of steam. It I had used standard Cocoa Touch classes and all that then all this would have been given to me as free functionality but I’m not, I’m using OpenGL ES.

I’ve sat on this issue for several months: with one level, it’s not exactly top-of-the-list when it comes to required functionality. Furthermore, it’s still possible to drag it left and right to pick levels, it just doesn’t have that really nice velocity thing when you let go of the screen. But, to use that sadly underused word that Khan applied so excellently in Star Trek 2, it vexed me. I’d put several hours into it here and there and all I seemed to be doing was creating increasingly more complex code that provided fewer and fewer features. It was obvious that there was a super-simple, amazingly easy answer, but for some odd reason I just couldn’t see it. In the end I decided to stop attempting to flog a dead horse, leave it and see what fell out of the woodwork.

Then, after a particularly good day a couple of weeks ago, a miracle occurred whilst I was in the bath (no, not that kind of miracle): a solution presented itself. As the user drags their finger across the screen (touchesMoved), I reset a timer and store the delta. When they let go (touchesEnded), I check the timer: if it’s less than a twentieth of a second or so then I set the scroll velocity to be the last movement delta (so long as the velocity is greater than a reasonable amount). Et voila! It works! And as an added bonus, it’s three lines of code and is nicely generalised in the entity manager. Now, if I can just add another level or two then it’ll all have been worth it. Needless to say, I duplicated my one and only lonely level three times so I could whizz the screen backwards and forwards, well, it amused me. Zooooooooooooooooooooooooooooooom!

Posted in My iPhone game | Tagged , , | Comments Off on Khaaaaaaaaaaaaaaaaaan!

The Welcome Snake Welcomes you!

The Welcome Snake!

The welcome snake welcomes you to another tumbleweed in waiting!

Yey! It’s the welcome snake! And he says “Hello (rattlerattlerattle)”. You can chalk art up on the substantial list of things that I can’t do – still, it’s the thought that counts and welcome snake looks pretty cheerful and non-poisonous.

So I’ve been working on this iPhone game for the past year or so in my spare time. Spare time is a commodity that I’ve got very little of, especially now that there is a bundle of joy in the family. Between the little shrimp and vast quantities of work, I count myself enormously lucky if I have an hour to work on it during a week. Now, don’t get me wrong, it’s not as if I work 12 hours a day, but when it’s the evening or the weekend I like to chill with family and friends, cook, stick my feet up or open a nice bottle of wine and generally do things that don’t involve programming… after all, it’s time off, and it seems a little rough to do the same thing in my time off that I do in my time on, even if it is for my own project.

One of the things I figured might be fun (this is using the special definition of ‘fun’ that applies only to me) would be if I documented, on and off, the progress of said iPhone game on this blog. That way, in a few years when my daughter is old enough to read, she can laugh like a hyena knowing that I’ve still not finished the game and probably never will. Furthermore, I can laugh my way backwards realising that I’ve spent more time downloading new SDKs and upgrading the source to new iOS versions than actually adding features.

Having said that, though, it is playable. I’ve got one level. I’m planning thirty levels for no particular reason other than thirty sounds like a good number, especially if I’m going to try and prise a dollar or two out of people’s wallets or purses for the privilege of taking my game for a spin.

Needless to say, I don’t expect to make my fortune, but for me it’s a pleasurable trip back in time. You see, when I was a little programmer, one individual could reasonably write and publish a game. Then it all became so complex. Just keeping up with Microsoft’s incredible DirectX deprecation schedule was almost impossible unless you had a team the size of a small country… and that kinda took some of the fun out of it. Between being buried in procedures, project bibles (now that was a way of beating the creativity out of a good idea) and meetings it all seemed to be becoming a chore. Now, with the iPhone, one person can reasonably do it again! Ok, so I’ll try and rope someone else into doing the art for me, but right now it’s not so complex that a team is required to write a game. If it generates enough revenue to buy me a crate of wine and some decent single malt scotch whisky, then it will have been a success.

Oh, and I’ll have written one full game myself in each decade for the past three. Yup, I’m that old.

Posted in My iPhone game | Tagged , , | 1 Comment