On the road again – Germany, London, Amsterdam, Denmark, USA

flickr/hellogeri

After opening the excellent DiBi in Newcastle, I’ve got a fairly crazy couple of months to get through – I’m really going to have to learn to say no… 🙂

First there’s BTPlay in Cologne, Germany, there may be a few tickets left so get in touch if you want to come.

State of the Browser – April 28

Moving on to next Saturday, where I’m doing a lightning session at the London Web Standards’ State of the Browser event. I’ll be live coding some 3D particles and then seeing which browser can handle the most. It’s a completely arbitrary competition of course, and it’ll probably be totally unfair. Fun!

SourceDevCon – May 3-4

After a successful launch in Croatia, Grgur and his team are bringing this web dev conference to London. He’s even managed to get Douglas Crockford to come along, so that’s great, you know, if you wanted to ask about semi-colons.

Mobilism – May 10-11

This is PPK‘s mobile web development conference and after a sell out last year, they’ve moved to the larger (and gorgeous) Tuschinski theatre in Amsterdam. The speaker list is excellent. But for my presentation I’m going to be trying some brand new things with PixelPhones.

Reasons to be Appy – May 29

The first of John Davey’s rebranded “Reasons” conferences, this is a fun short and affordable one day event in London with excellent speakers such as Brendan Dawes and Keiichi Matsuda.

Following that, there’s the Multimedia Teachers’ conference in Denmark, the Eyeo Festival and Reasons in New York. More information coming soon.

Gotcha! Fake MMO Asteroids April fool :)

Haven’t most April fools jokes got a bit silly lately? They’re more just funny than actually fooling you. This year, I thought I’d raise the bar with a completely fake MMO Asteroids, but I could never imagine so many of you would be taken in. I’m so sorry.

It all started around a year ago. There’s an example on my CreativeJS course where circular particles exert a little force on each other and they wander around rather pleasingly. An attendee decided to make them triangular and point in the direction that they’re moving in and voila! A system of circling, avoiding, flocking AI bots emerged.

All I had to add was some basic collision detection, bullets, and despite the simple behaviour rules, it was very pleasing, and very convincing. So I thought I’d make it more obvious – I added a “kill mode” that kicks in after a random time – surely you’ll realise it’s fake when every single other ship turns on you and mows you down? But instead, many assumed it was anti-spam or AI bots gone wrong.

Many amazing comments followed on twitter, most really impressed, a couple a little dismayed that everyone was picking on them. I couldn’t help but feel sorry for Ekene Ijeoma who simply tweeted ‘help’ as all the other ships turned on him. (It’s his screen shot in the header).

But some suspicion emerged. Kudos to Jon Schall who was the first commenter on the post. But even Jon didn’t quite realise it was an April fools for a while (he blames lack of coffee).

There was a steady stream of traffic during the day, but things really took off in the evening when it made it to the top of Hacker News. The comment thread started in awe, then confusion, and then anger as people realised it was fake.

I must admit that it made me giggle reading the thread as various theories emerge. The “kill mode” starts randomly, and yet many thought that their actions were somehow triggering it. Someone suggested clearing their cookies to reset the weird occurrences. But of course, one or two figured out that you could pull your network cable out and the game still worked fine. 🙂

The sad truth is that if it was real, it probably wouldn’t be as dynamic or as much fun, and there’d certainly be fewer players. Rob Hawkes has made in-roads with Rawkets, but making it reliable, scaleable, and most of all fun is a huge challenge. Maybe I’ll try it for real some day and find out (not that I’ll ever be able to convince you that it’s real from now on…)

It’s been great fun, a fascinating experiment, and I hope you had fun. And if you were taken in, I really hope you see the funny side. The only question is, how will I get you next year..? 🙂

[UPDATE] just thought I’d add this highly amusing thread from OverClockers

Node.js experiment: MMO Asteroids

I’ve had my eye on Node.js for a while now so I jumped at the chance to attend Remy’s excellent workshop a couple of weeks ago. Most people associate node with websockets but actually node is a hugely versatile platform capable of running powerful servers and web-apps.

That said, anyone who knows me will know that I’m fascinated by real-time multi-player games (remember my Lunar Lander trails?) so the first thing I’ve done is put together a little demo to test out the MMO capabilities of the node.js socket server. It’s a Asteroids-esque space shooter, with one rocket per person, use the cursor keys to fly, and space to fire.

Synchronisation

It’s a very early prototype, I’m still working on the system to keep all the ships in sync, so you might see some strange movement. I haven’t tested it with that many connections yet so it’ll be interesting to see how well it holds up under fire – please spread the word so I can help to test how it scales up!

There’s been some interest this week with Mozilla’s BrowserQuest (also based on node.js) and that uses a point and click to move mechanism. This is a classic way to reduce the amount of bandwidth and it gets around latency issues, as each move is just a single message to and from the server.

Dead reckoning

It’s much much harder to create a system with free movement and collisions, as all the data the server gets for each player is already out of date. I use a primitive form of ‘dead-reckoning’. As well as the position data, I also send the server the current velocity and a time stamp.

The data for each player is sent to the browser, along with the time-stamp and velocity. It’s then up to each client to smooth out that motion, and predict where each ship should be now, if the player carried on along that trajectory. Of course this is quite an inaccurate system, and I’m still refining the algorithm

Security

Any in-browser game is fundamentally hack-able. That’s why I’ve set up an ‘authoritative server’ system. Although the browser updates all the physics for the player, the server authenticates the ships movement to make sure there’s no funny business! The collision detection is performed locally and then the damage is verified and reported by the server.

Node.js

I’ve been really impressed by the performance and accessibility of node, apparently the V8 JS engine that powers it is can in some cases be 30% of the speed of native compiled C++ code. And there have been huge advantages in using the same JS code on the server and client. I’m looking forward to seeing how well it scales.

Next steps

It’s a really early demo, and I have lots more work to do, but please test out the mechanism, and let me know how the synchronisation and dead reckoning feels. There may still be the odd glitch. I’ll be keeping an eye on it over the next couple of days so I’m sure there’ll be the odd drop-out. Let me know how it works for you!

Play MMOsteroids

[UPDATE] yes, yes check the date. Full confession.