Thursday, 28 October 2010

Lovely, lovely Friends of ED were kind enough to send me a copy of AdvancED Game Design with Flash by Rex Van Der Spuy. Just because they gave me free stuff, it doesn’t mean I’m going to give this book an easy ride though! This book has lots of good things and a few not so good things, as I will describe.

Let’s start by getting one thing out of the way – this book has almost nothing to do with game design. There is no mention of game design (as I understand the term) until Chapter 7, where Rex gives a few pages of good advice. The other 700 or so pages of the book are about game programming/development/architecture. (To be clear, my understanding of "game design" is: deciding what happens in your game and tuning the game mechanics to make them fun).

The best thing about this book is that it is very comprehensive, covering pretty much every hurdle you will meet when building a Flash game, including an extensive looks at collision detection, which is probably one of the hardest parts of game development if you aren’t using an engine like Unity3D, Box2D or Flixel. There is an explanation of many alternative methods such as bitmap collisions (including destructible bitmaps!), axis-aligned bounding box (AABB), circle, line and “separating axis theorem” for more complex shapes. It also shows you how to do “spatial hashing” which is a “broad-phase” technique for reducing the number of collision checks you need to do, which is very useful. Unfortunately it doesn’t include the “quad-tree” technique, which is the one I need to get my head around at the moment.

Another section you may find useful is the analysis of blitting. I think the benefits of blitting are a bit exaggerated, but this book takes a very even-handed approach, explaining when they will be useful and when they won’t. It also includes some benchmarks and shows you how to make your own, which you should ALWAYS do if you are making “optimisations”. Don’t believe a word that Rex, myself or anyone else tells you about optimisation without testing it yourself!

I’m not a huge fan of how the author organises his code. He’s gone for an MVC approach throughout the book, and even though this is a road I’ve been down myself many times, it’s not one that I would currently recommend (for the record, I favour a game object composition approach like you get in Unity3D). In general the code style is decent, with well named variables and plenty of comments. There are some places where the code could have been made both faster and more readable by greater type safety and less use of the dynamic properties on objects, movieclips and arrays. There are some places where variables are not well-named, for example calling a function “ln()” rather than “leftNormal()”. In the age of auto-completion there is really no need for abbreviated function names, but this book is by a long way not the only place you will find them.

Here is my most major criticism the book: for physics/movement Rex is using his own vector and “verlet” techniques, and I am dubious about both. I’m not an expert on integrators, but I’m very skeptical that Rex’s approach really is verlet at all. It seems to me that he’s using the standard Euler technique that most Flash developers use, but just storing his data in a different way. I would love to be wrong about this one, so if anyone has read the book and has a good understanding of verlet, please leave a comment. The vector class the book uses is also non-standard. The usual implementation of a vector has just an x and y position, and some methods to manipulate it such as add, multiply, divide, rotate, dot-product etc. The book’s vector class has these methods, but it stores two sets of x and y values – a start point and an end point. It all still works fine, it’s just not how it’s normally done.

On points like this I find it very difficult to draw the line between what is just differences in style and what would be considered “best practice”. As I already knew most of the information covered in the book it’s easy for me to worry too much about things I just do a bit differently. If you have never used these techniques, any implementation will be very useful to know. Ultimately, if it gets the job done, then it’s fine, and Rex’s implementation definitely gets the job done.

Some other useful explanations in the book include playing sounds, pathfinding (including a really good explanation of A*) and a full tile-based platform game engine. After my talk at Flash on the beach I had many requests for my source code, but as all my demos were built on my non-open-source game engine, I couldn’t share them. I would happily recommend this book to any of those people as it includes the vast majority of the code you need to make any of the demos I showed, including driving games and platform games.

Overall, I think that if want to do some more advanced Flash games and you don’t know where to start, this book would be a great place.

Friday, 15 October 2010

Another shout-out for people in Cornwall - do not miss the first meeting of Cornwall digital meetup group on Wednesday 20th October 2010 at Blue Bar in Porthtowan, details are at: http://www.meetup.com/Cornwall-Digital/

Tuesday, 12 October 2010

Ok this is a pretty niche post, so as soon as you answer no to any of these criteria, you can happily stop reading! If you live in Devon or Cornwall, and are into game design, development, art, music, interactivity or any other related field you can now hang out with kindred spirits, have a beer and get excited about making games. There is a new monthly meetup in Plymouth starting 1st of November 2010. The guys from the awesome Mutant Labs and Remode studios will be there, so will Korash who organises the Extended Play games festival, along with a bunch of students and of course me! You can sign up to it on Facebook http://www.facebook.com/event.php?eid=109217385808574 - or if you hate facebook that much, just email me and I'll send you the details when they are finalised. If you live in Cornwall I will be driving up so I can even give 4 people a lift. You now have no excuse not to go!

My main session seemed to go very well, although I’m gutted for all the people who couldn’t get in because it was so packed. The demos from the session are already available at DullDudeGames.com/game-designer and I’m going to add a transcript of what I said and my slides very shortly. If you were an attendee there should be a video at some point, although I didn’t see any cameras so maybe it’s just a screen cast or something. It was my first full session at a big conference, and definitely an item ticked on my bucket list. I’m mega grateful to conference organiser John Davey for putting me up there, and Pokemon Trainer Seb-Lee Delisle for being my hype-man for the last 2 years. Without Seb, probably nobody would know who I am. He’s also a bloody ruddy nice bloke.

As happens at every talk I give (will they never learn!), some people asked me afterwards if I would share the source code from my talk. The demos are built on my work-in-progress game engine, so I can’t share the source to the games without also including the game-engine, which for business reasons I am not able to do, although a big chunk of it is already open-sourced in my Gamepad library.

The funny thing about geeks is, even when I do a session about design – purely the creative decision making side of games – geeks still just want to look under the hood! The main feedback was that people wanted to know the maths for the car handling physics, so I’m going to turn that into a tutorial and post that here on my blog. Also, if you’re more into the wizard stuff, I have the full source for a different Zelda-style wizard game that I made a while ago, that I am going to give away here too.

Slightly weirder was my last minute addition to the “jam throwdown” on the terrifying main stage. I was only asked to do it the night before, and had planned to show my complete greatest hits from the last 11 years of my work. Not having a chance to rehearse, I didn’t know that this was actually impossible, so what the attendees got was about the first 5 years, which was loads of terrible, daft lo-fi experimental Flash stuff and a few games. It seemed like people got the joke, but I did have a small bout of paranoia that everyone hated me straight after. Do not underestimate the social paranoia appearing at conferences can give you! I have had some nice feedback about the slot on twitter since though, so I feel ok about it now. People were probably just being nice, but thank you, I appreciate it!

Even though I’m just a geek talking about geeky stuff, it’s really hard not to get a bit of a rush from making a whole auditorium of people laugh or go “oooh”. I wonder whether this is why people like Hoss Gifford and Brendan Dawes pack their sessions with jokes? I don’t think I got into speaking as a back door into stand-up comedy, but to be honest I have no idea why I did want to get into it. Certainly a large part of me finds the whole experience completely harrowing. What is “speaking” or being a “speaker”? Why do it? What is it for? I have genuinely no idea.

That’s enough about me though, what about all the talented speakers? Well it was a slightly strange one for me. For one thing, since last time I have become even more focussed on game development, and there wasn’t much representation for gamedev, so there weren’t many sessions that apply directly to what I do day-to-day. From the queue outside my talk and Jon Howard’s (excellent) session, there’s obviously a lot of pent-up demand for it among attendees. Maybe next year John could try to book some Flash gaming luminaries like Dan Cook or Adam Atatomic? I’ll definitely suggest it to him.

I want to word this next bit very carefully so that I don’t offend any of the amazing speakers who I saw and spoke to during the conference, and who are all some of the most talented and inspirational people you will meet in this industry. Here goes then: basically what I’ve noticed is that not every speaker can inspire you as much the second and third time you see as they do the first time you see them. Even though everyone updates their material regularly with new work, nobody has an unlimited supply of mind-blowingness. Ideas that are revolutionary when you first see them get synthesised into the way you see the world. The same idea can never inspire you again in the same way it did the first time. This is no reflection on the talent of the speaker, it’s just the nature of ideas.

And this is why I loved the elevator pitch so much. Twenty speakers from completely different disciplines blasting you with as much information as they can get into a 3 minute slot. I know from experience that each 3 minute speech has many hours, if not days and even weeks of preparation go into it. This shows through massively and you get exposed to more new ideas in this session than any other. Someone tweeted that speakers collect elevator pitchers like Pokemon. I kind of played Pokemon Trainer a bit this year, encouraging Andreas, Jasper and Tom to do the pitch. This reflects very well on how I choose my friends, because my Pokemon were easily 3 of the best in the whole session.

Andreas presented his DDConsole aka DoomsdayConsole which is a runtime tracing/hacking/debugging/tweaking console for Flash, inspired by the ones you find in games like Quake. It’s completely open source and completely ace. Through some wicked 8-bit graphics and animation, Tom presented his awesome sound effects generator AS3sfxr with such style that he also managed to subconsciously teach you how to do the creative side of sound design.

Jasper showed us all why Unity3D is the crown prince of 3D game engines by building his slide-deck as an Incpetion/Matrix inspired fly-through of a city falling into place. Nobody loves Unity as much as this guy. He’s thinking about it most the time. He’s probably thinking about it right now. What he didn’t tell you during his slot was that he taught himself to model in Maya just to make his presentation. And you’d never have noticed it, because his models looked awesome. I could tell that Jasper enjoyed the experience because I spoke to him after and he had a crazy look in his eye like someone who had just discovered crack. Anyways, if you went to the conference, please vote for these guys on your feedback form, they’re ace.

The stand-out session of the conference had to be Seb’s “What the flux?” There’s been a lot of mud thrown back and forth this year between Flash developers, HTML5/web standards advocates, and of course Apple, and Seb has spent a lot of time trying out these various competing technologies. He presented a some home truths that I don’t think everyone was ready to hear, but presented it a way that was optimistic, pragmatic and tried to build bridges. He had video interviews with some smart people from both camps, which he cut in with some political slogans, a game show skit and some jokes. I don’t actually agree with him that JavaScript and HTML5 are anywhere near ready to move into the immersive/experiential/flashy uses of Flash, but on everything else he was about right. He did point out that Flash is still the mofo daddy for web games.

Grant Skinner showed some cool physical device experiments like using Android phones as controllers for 8 player Asteroids and even as accelerator pedals for Scalextric. Also there was some marital aid hacking which raised a few eyebrows. In Grant’s session I began experimenting with starting rounds of applause, my first attempt failing and making it seem as if I was slow clapping, which was quite an amusing little moment that he dealt with like the pro he is. After that the audience really got into it, and through my further efforts I managed to increase the numbers of rounds of applause in all sessions I went to by at least a factor of 2 for the rest of the day. This is great for the atmosphere of the conference. If everyone is showing appreciation of a good speaker it actually increases the speaker’s confidence and makes for a better session. Towards the end of the conference I noticed an annoying trend that people were only clapping videos and not any other type of work that was shown. This is really silly and completely unfair on speakers who do different kinds of work, e.g. INTERACTIVE STUFF.

Other highlights were surrealist animator Cyriak Harris, design legend Stefan Sagmeister and designer/director Nando Costa who made this year’s amazing title sequence, which is frankly the sexiest form in which my name has ever been written. Watch it and see why. Nando showed some wicked film work he’d done with Modest Mouse (who I love) as well as other portfolio stuff. I chatted with Nando later about life in Portland and he’s a thoroughly nice bloke. I am now 1 degree of Kevin Bacon away from Modest Mouse which is a nice thought, although completely pointless.

I am completely exhausted now, so I’m going to get back to normality for the rest of the year, and take my Zero to Game Designer in 60 Minutes talk on the road in the new year. Thanks so much to everyone I met for being so supportive!