InterSceptre update

Seems I’ve not written an update for ages! Last time you heard from me I’d just implemented the gravitation features of the black holes. So what have I done since?

Basically, not a lot! I’ve implemented a few more bonuses the player can collect – fast, slow, freeze, reverse- and there a few more of them to come. The players now score points – and persisting those points across levels required significant refactoring of the code. Fonts can now be rendered in different colours, and I’ve added simple support for proportional fonts.

Most of that time though was lost because I swapped to Ubuntu on my laptop, and I couldn’t get DirectX emulation working! Fortunately Ubuntu 10.10 resolved the issue and I’ve been able to continue. I’ve also jumped to XNA 4

The core game is now done, unless I want to add more bonuses; but for now I’m going to concentrate on adding the menu screen and allowing the players to enable/disable game options. The title screen could do with some love too.

Finally I need to add some music and sound effects. I’d love to score the game myself but not sure I have the tools, or that my fellow commuters would appreciate the noise (note to self: buy better headphones).

If I want to release the game for Win7 mobile, I need to work on touch screen (or accelerometer) controls. That will affect what bonuses I implement. Currently swipe/tilt sideways and tap to fire would work well, but I’m not sure about directional shot (flick at an angle?), repair bricks (swipe down?) etc…

Thoughts are turning to the next venture. Could be a simple Bejewelled-style puzzler (something quick for the Win7 phone); maybe a top-down tile game (Get In The Ring PC?); or perhaps I just go for the puzzle-platformer. Not sure…


#Nokia: build a phone for a loyal customer

Dear Nokia,

I’ve been a loyal customer since the late 90s. I have fond memories of my first phone, a 9000i Communicator. It was the size and weight of a Sky+ remote control. Oh how my friends laughed. But I knew they were wrong. My phone had a keyboard. I could TELNET on it, something they couldn’t even dream of, and there was even a passable browser. It had what at the time felt like a huge, high resolution screen. It was the future in a box, and I loved it.

Over the next few years I had several Communicators, each slicker and faster than the last. It was more than a phone, it was a mobile communications device. Email on the move, imagine that! The menu system was fantasic and the phones never crashed; they were miles better than anything the competition could come up with.

Unfortunately the communicators got expensive and the range was discontinued, and I fell out of love with phones that had moving parts – the hinge went on my 9000i several times and needed repairs. So I had a few years with average simple Nokias – never a problem, but nothing inspiring.

I loved my N80 when I got it, but it seems just weeks later the N95 was released. I had to wait 18 long months before I could get my hands on one. The N96 was just about to launch but I didn’t care, I had to have the N95 (a decision I’m still happy with). I loved that phone for 2 whole years, easily the class of the field with its superb camera, acres of memory for MP3s and videos, tolerable web browser (although I did end up using Opera). Selling it was a sad day in my life.

But by the middle of 2009 it was clear that the N95 didn’t really cut it any more. The iPhone had been out showing the world what a phone could be, and I’d had a work Blackberry for long enough to know how good email and connectivity should be. I have to admit I wasn’t blown away by the options from Nokia, although for a short while my deepest desire was for an N97; contract expiry couldn’t come soon enough.

But then, the news that should have been game-changing: the N900. A true Linux ‘phone’ – no, not a phone, a mini computer. A machine with a decent screen and keyboard. Real multi-tasking. X-terminals! Firefox web browser! This would be the phone to end all phones. I had to have it.

But it didn’t come out in September as promised. Or October… Eventually, mine arrived in December, amid rumours of non-functional microphones, USB chargers/data ports falling out, and poor battery life.

Forunately my hardware was fine, except for the battery life. Barely 6 hours just sitting doing nothing with the screen off – God help you if you wanted to listen to music or use the Wi-Fi. But it was feature-rich, everything worked, and I could fit more stuff on it than I could dream of. It had more space than my aging home PC, and the web browser was almost as fast. I loved it.

For about 2 weeks.

The battery life was irritating but manageable. What is unforgiveable is that the phone is basically stillborn. Barely out of the wrapper, Nokia dropped support for the Maemo operating system, thus killing off applications development interest. What interesting apps there are, require command-line hackery and dangerous kernel patches. It’s linux yes, but it’s like linux from the mid-90s, with all the danger and risk that entailed… Not the modern Ubuntu-class experience you’d expect.

Irritating features of the phone, like only having 5 levels of screen brightness in a display capable of far better, became even more annoying when Nokia refuse to consider improving the functionality or even enable porting of older 3rd party Maemo brightness apps to the N900. It lacks even the most basic features such as ring-tones personalisable per contact, no support for MMS, and has just 2 profiles, one of which is Silent, and you can’t add more. WTF? Maybe that was going to be a feature released later, but Maemo is dead, so we’re all SOL.

What kind of flagship phone has no features, no development, no future? What kind of company tempts its loyal fans into a technological cul-de-sac and then abandons them there?

iPhone killer? Don’t be absurd. Now I’m stuck with this dead end device until Christmas 2011 when my contract expires. I feel cheated, taken advantage of, embarrased to have raved about this phone to my friends.

So Nokia, I challenge you: build me a phone that is worthy of my loyalty. A phone clearly the class of the field like the N95 was when it launched. A phone with the battery life and connectivity of a Blackberry, with the features, applications and support – long term support – of the iPhone. A phone that I can use to browse the web, run popular applications built by professionals and launched simultaneously with RIM/Apple versions, use command-line ssh to get into a server to fix it when I’m on the train, whilst listening to my thousand-CD equivalent MP3 collection, still with space for a season’s worth of Doctor Who downloaded from iPlayer. A phone that acts as a WiFi hub for my other devices without having to patch the kernel or run the battery down in 2 hours.

You have 12 months. Don’t disappoint me. I really don’t want to end such a long term committed relationship, but you’ve let me down really badly this time. Don’t do it again.

The Gravity of the situation

More work on the game. Added black/white holes which cause the shots to bend around the screen. This necessitated rewriting all the movement/velocity/acceleration code to use floating-point arithmetic – anathema based on my 20-years-out-of-date experiences on the Atari ST, but PCs can do gazillions of those calcuations per frame. Still not quite used to the fact that I don’t have to optimise the hell out of the main game loop. No excuses for being a sloppy coder obviously, but a lot of the old worries simply don’t apply any more.

InterScaptre with black/white holes

InterScaptre with black/white holes

If a shot is swallowed into the black hole, it gets spat out of the white hole. The ‘reach’ of the holes is infinite, and operates according to the inverse square law. However I do have to force the maximum shot velocity at 6 pixels/update, otherwise they can leap over the bricks. Thank you for self-normalising vectors!

This has a few interesting repercussions. Firstly, the bat’s maximum velocity is 8, so they move faster than the shots – so maybe it’s too easy to catch a shot. Secondly this means that the shot’s velocity isn’t changed by the black/white holes, only their direction. Which means that ‘c’ is 6 in my game and the bats move faster than light… 😉

I’ve also started work on the AI for the computer player. At the moment this is very simple: move towards the closest incoming shot. Unfortunately, that makes the computer almost unbeatable with just 2 shots on the screen – maybe when we’re both firing that will change.

The upshot of all this is that I think I need to make the bricks larger, so that the shots can move faster. Either that or I have to start doing some serious mathematics to calculate whether a shot would have passed through a brick since the last update… it’s been a long time sice A-level maths and calculating intersections between vectors…

Play the game

Basic gameplay now done too – moving bats, centre bat, firing shots, shot bouncing off obstacles, shots destroying bricks, and shots running off the screen winning the round:

InterSceptre In-game screenshot

InterSceptre In-game screenshot

Trouble is, now I’ve run out of old C++ code to convert – so the real work starts here!

On the game: Title Screen

It lives! It lives!

Screenshot of InterSceptre Title Screen

Screenshot of InterSceptre Title Screen

It looks more impressive in the flesh with those bars of colour spinning around the logo.

This screenshot comes to you courtesy of Paint Shop Pro v3 (in which the original graphics were created a decade ago), XNA, and GIMP (which I now use for image editing – so far, adding the transparent masking to the logo).

So, title screen almost complete, this is the point at which traditionally I’d give up on a game and move onto the next thing. That’s because, traditionally, getting this far would have taken weeks and something more interesting would have cropped up in the meantime. I think I might have a bit more staying power this time around… let’s see!

[Update] Couldn’t resist a few extra tweaks: added Spritext font rendering, and made the logo slightly translucent, the way I’d always wanted it. God bless alpha channels.

InterSceptre title screen, with translucency and byline

InterSceptre title screen, with translucency and byline

Back on the gaming trail

A lifetime ago, I used to write computer games on my Atari ST. Then I went to university, got a girlfriend, got a job, and suddenly I didn’t have the time any more. I didn’t think I missed it much; now and then I’d get a bit nostalgic, but I’d moved on.

Then last week my old sparring partner showed me XNA.

I’d played with DirectX back in the late 90s. It was a horrible blend of Windows ugliness and C syntax, full of explicit casts and pointers. I’d put a couple of demos together, wrote my Masters thesis in it, and got some crude lightsourcing going, but basically it was back to the same old problem: no time. Certainly when most of the time was spent fighting incompatible Windows APIs. Even simple things like co-ordinates were represented differently…

So when I saw Ben’s shoot-em-up, and that it was basically 50 lines of code on top of some standard boilerplate, the bug bit me again. And bit me hard. Especially when you find out that XNA offers (for a fee) the ability to upload your game to XBox 360 Marketplace, and manage the revenue share for you.

Upshot: I’ve spent the last 2 days of commuting time converting my last project from C++ into C#. Watch this space for in-game screenshots.

I’m not usually a Windows Fanboi. This time last week I was on the verge of wiping my laptop and putting Ubuntu on it. No longer.

#F1 Bahrain Grand Prix 2010

Oh no. Is that really what I’ve been waiting for all winter? Can we just give the title to Alonso now please, and not have to sit through another 40 hours of that mindless tedium?

Ever since refuelling was introduced I’ve been convinced it should be banned. It’s too dangerous, and it artificially splits the race into 3 sprints. It didn’t reward the intelligent smooth driver. Trouble is, now we have heavy cars and no-one dares risk ruining their tyres; result: over-caution. Finishing the race on fumes but still 5 seconds off qualifying pace? At that rate surely it’s worth pitting for fresh rubber 7 laps from the end, and shooting past everyone (Spa 08 style)?

Where were the promised 1.8 second pit stops? Even Red Bull took at least 4 seconds, and as for Virgin they may as well have changed the oil too, they were so slow.

McLaren seem hopelessly outpaced by Ferrari. Williams show some promise. Renault and Sauber disappointed. At least the new teams didn’t become mobile road-blocks, instead they dutifully broke down before they could be lapped. What a joke. Come back Dave Richards, all is forgiven.

And please for the love of God, someone tell Legard not to keep reading out the top 10 every lap as if it’s supposed to be exciting – particularly when Martin is in the middle of saying something I might actually want to hear. Jonathan: the positions are almost constantly scrolling across the screen. Please go back to radio where your talents will be better appreciated, by insomniacs if no-one else. Dare I say where are you, James Allen?!

Maybe it’s just the track. Significantly hotter than pre-season testing it must have caused problems for the teams. Circuit still looks really dull, a splash of paint in the run-off areas hasn’t helped much, if anything it highlights the blandness of the desert location.

Impressed: Alonso, Hamilton, Rosberg, Barichello
Disappointed: Hulkenberg, Schumacher, Button

Bring on Oz. Maybe a few safety cars will liven things up a bit.