Game Development Category
31st May 2011
After publishing my review of the recent Flash Game Development by Example book (in which my complaints were validated by similar reviews from Iain and Rasmus) I received a number of questions both by email and on Twitter asking me books what I would recommend.
The first thing I’ll say is that I don’t believe there are ANY good books that teach you how to code in AS3 by using game development as the means.
There are some excellent AS3 books, and some excellent game development ones, but all those that have tried to combine the two end up either skipping vital AS3 details, or build such basic games you don’t really learn anything about game development in the process.
Before I begin however this is important: Obviously I have not read every book there is on AS3. So my recommendations here can only be based on the books I have read and value. If you’re the author of a book not listed, that you think should be, send me a review copy. Here’s my list with links to the publishers sites (and no cheesy affiliate links!)
Learning ActionScript 3 by Rich Shupe, O’Reilly
I strongly suggest the excellent “Learning ActionScript 3.0” by Rich Shupe and Zevan Rosser. Even if you’ve been coding in AS3 for a while there are things this book can teach you. It leaves virtually no stone unturned. Read this from cover to cover and you will have touched on every aspect of AS3 you need. From the way events propagate, to text handling, bitmap filters and display list management it’s comprehensive and clearly written. The only issue is that the contents are a bit dry. By this I mean you’ll never actually create anything fun while reading this, and you won’t learn a thing about game structure. But to sink your teeth into AS3 they don’t come much better than this. The 2nd edition was published at the end of 2010 incorporating Flash platform changes that entails, so if you do seek out a 2nd hand copy, make sure it’s a recent one.
I used to recommend Essential ActionScript 3 by Colin Moock (also by O’Reilly) but the freshness of content in this book kicks it one level higher.
ActionScript 3.0 Cookbook, O’Reilly
I’m a big fan of the O’Reilly cookbooks. They come into their own when you’re starting to learn a language and have the basics down – but just need to know in which package to look to find the solution to a given problem. For example if you want to know how to load an XML file you can just pick-up the cookbook and look for that in the index. The code examples are concise and well written, and coming from a variety of authors seems to help make them more relevant. It’s a really vital book. Yes you can Google, but if you are learning a language there is no way for you to evaluate how well written (or correct!) a Googled blog post is for example. The only issue I have with this book is that it hasn’t been updated since 2008. It was however the way I learnt AS3 (used with the Essential AS3 book).
Foundation ActionScript 3 Animation: Making Things Move! by Keith Peters, Friends of Ed
This is a brilliant book. There’s no other way to put it. It starts off with a great crash course in AS3 (take note authors, this is the correct way to do it) and then dives in to, well.. making things move! Making them properly move. None of this Flash IDE timeline stuff, but actual real physics that you can use in real games. And it’s not complicated physics either. It starts off very gently and then keeps layering it up. Bouncing, friction, gravity, velocity. Throwing objects with the mouse, collision, springs, the works. There is even a little chapter on faux 3D (which to be honest feels shoe-horned in, and isn’t very relevant today). You will learn both good structured AS3 AND very useful game development techniques from this book, which is why it’s essential reading. The only down side is that it hasn’t been updated for a while. There is a follow-up book (Advanced Animation) but it’s not as easy to get in to and feels a little more “edge case” in its application. Still a fascinating read though.
With the above 3 books I honestly believe you can go from knowing nothing at all about AS3, to having touched all the important aspects of it, and even built some really cool things in the process. Use them in combination with a framework like Flixel and suddenly a LOT of the way Flixel does things will make a great deal more sense to you. Equally if you stumble across a piece of source code online you’ll have a much better idea if you’re looking at quality code or a piece of blog filler.
Advanced ActionScript 3 with Design Patterns by Joey Lott, Adobe Press
This was recommend by both Iain Lobb and Damien Altron. Be sure you get the correct book as there is a very similar titled book published by O’Reilly. The one you want is published by Adobe Press. The first half deals with general AS3 practises and the second half the use of design patterns. From the comments I’ve read it appears it’s very well researched and written.
I will follow-up this post with one listing my favourite AS3 Game Development books shortly. But really, get the language down first. Then make games. Not the other way around.
25th May 2011
Emanuele Feronato is a familiar name to anyone who’s ever searched for something to do with Flash game development on Google. The tutorials he publishes on his blog are as ubiquitous as the platform itself. They provide nuggets of code usually meaty enough to accomplish the task at hand. Be it creating a Match-3 knock-off, a landscape generator or showcasing a new library. The complexity never really leaves the shallow end of the pool, which I suspect is the main reason beginners flock to his site.
But with a book you leave the safety zone of “this is just enough” behind. When people have put down good money, the expectation levels are rightly higher. So it was with intrigue that I started reading Flash Game Development by Example. It covers the creation of 9 games across 300+ pages, which is an average of 30 pages each. Probably 28 more than he uses on his web site I was curious what this extra space would provide.
The first game we make is Concentration or “Pairs”, the classic card game. Everything is done in the Flash IDE at a size of 550 x 400, and it leads you step-by-step through creating an FLA, creating your Main.as, entering a trace statement to prove it compiles and then explaining what imports and packages are. The explanation for the Sprite package for example is “This class allows us to display graphics”. That’s true, and while I’m not expecting a detailed explanation at this level I did expect a little more. Emanuele then starts creating the game, kicking off with a loop to make an Array of 20 tiles. Every single line of code is explained – rapidly jumping through AS3 syntax as it goes. It’s as if the single line of source “for (var i:uint=0; i<NUMBER_OF_TILES; i++)” caused Emanuele to stop and realise he had better explain what a uint, a constant and a for loop is before he can carry on.
The problem with this approach is you forget what it was you were building as you try to deal with a rapid onslaught of new information. And it doesn’t let-up. By page 19 the game is dealing with adding a Fisher-Yates shuffle algorithm. A quick trip back to the Flash IDE creates some tiles, and more code starts displaying them and adding event listeners for clicks. By page 31 you’re deep in the realm of indexOf Array checks, event.currentTarget magic value access and modulo operations. Nearly every line of code is still being explained but the pace is borderline frantic. And just like that, it ends. The game is complete, a few homework assignments are given to you and we’re on to Chapter 2.
Chapter 2 is about building Minesweeper. So multi-dimensional arrays and iterative scanning for mines. It also contains probably my favourite quote in the whole book:
“Just think about a function like a mad witch. You give her some strange stuff such as bat wings and lizard tails, and after making something mysterious she gives you a potion to turn someone into a frog. The great thing is once you’ve made your functions (witch) you don’t need to know how they do the magic anymore.”
However this is a bit of code taken from the function it teaches you to make:
15th Feb 2011
A month or so ago David Fox contacted me asking if I’d be willing to submit a 60-second recording, answering the question “What makes or breaks a great flash game?“. Apparently 59 other speakers were also on-board. So I figured with those kind of odds at least the listeners could have a giggle at my “speech” and move onto something more inspiring. So I agreed.
David put a butt-load of work into the event. Collecting all the samples, organising everything and putting the site together. And today it’s finally all live! You can listen to some great snippets from the likes of Adam Saltsman, Tom Fulp, Edmund McMillen, Rob James, Stephen Harris and a load more. And when you’ve exhausted all of their brilliance you’ll find me. Apologies in advance for sounding like a teenager sniffing glue. You’d never have guessed my Dad was a radio DJ and my Mum a singer. Voice talent skipped my generation (I got the geek strain instead, so a fair trade)
Hopefully David will run the event again, with a new question and maybe another set of 60 speakers, as the concept is a great one. And of course thanks to Ilija for pixelating me. I think. (I do actually have a neck tho!)
Find everything you need at http://www.flashmindmeld.com/
17th Jan 2011
Today our Google Nexus One developer handset arrived at work. We bought it to do some prototype work with the Flash CS 5.5 pre-release (AIR 2.6) to allow for a much quicker development work flow. Due to the obvious Adobe NDA I can’t talk about the 5.5 feature set, but what I can say is what a complete and utter ball-ache it was to get the phone working on Windows 7, and how I finally got around it, in the hope that one day this may save some other poor sod from wasting hours like I did.
Plug your Nexus One into a Windows 7 PC and it won’t work. The device drivers install and then fail. So you can’t mount it and USB debugging doesn’t do anything (obviously).
The USB drivers aren’t Windows 7 compatible!
1) You need to download the Android SDK for Windows and install it. I used the r08 release as it was the most current at the time of writing. It’s available from http://developer.android.com/sdk/
2) Once installed run the SDK Manager and let it do all the Updates that it requires. When finished click on Available packages on the left and then expand the Third party Add-ons entry on the right. Below this you’ll see Google Inc. add-ones. Expand that and lo and behold is the Google Usb Driver package (at the time of writing it’s revision 4). Tick it and click Install Selected. When complete you should see it on the Installed packages list:
3) Now go into the Computer Management app. In Windows 7 you can right-click your Computer icon on your Desktop and pick “Manage”. You need administrator level permissions to do this. Pick Device Manager on the left and you should see your Nexus One listed under “Other devices” on the right,with a little yellow alert sign over the icon:
4) Right-click the Nexus One entry and pick Install Driver. It will ask if you wish to Search for the driver or Browse for it. Naturally you need to browse for it. Point it at the google-usb_driver folder that is now inside your Android SDK folder. The location of this will vary from PC to PC, but I’m hoping you know where you unzipped it all
The driver will now install. I did this with the phone connected and it didn’t seem to complain at all.
At the end of the process you should see this:
Click Close and the Device Manager will refresh. Voila! We can haz Nexuses:
From this point on you mount the phone and access it like a normal USB stick. It will make your life in Flash a whole lot easier now too! No more crappy slow emulators
The small tests I’ve run on the phone so far look promising. Speed is still a bit of an issue, but I believe we can get around that with some clever optimisation and planning. There’s a good beginners guide written by Terry Paton on the Mochi web site.
11th Jan 2011
I had been hearing rumours of this new language for some months. Now and again I’d pick up chatter on Twitter that Mark Sibly, author of the Blitz 3D and Blitz Max development software, was working on something new. Something quite special. After reading several more tweets about it I finally cracked and decided to take a look. And what I’ve seen impresses the heck out of me.
Monkey is a free and open programming language. But what is most exciting is that it’s truly cross-platform. The target platforms that should be available from launch include HTML5, XNA, Android, Native GL, iPhone and, yes, Flash. This means the exact same code will compile across all of those platforms, using their native SDKs (Xcode, Flex SDK, etc) which will should make them perform extremely well.
Monkey itself will be a simple but powerful core language only, with no platform specific baggage such as 2D or IO. Those are added in with modules. Mark has said there will be a module called mojo which will be a lightweight 2D module, but the real aim is to keep it as compact as possible.
Given that Blitz was used mostly for creating games it’s not surprising that Mark has said a simple game modules will be released. And of course the community can release their own modules to take the language in whatever direction they want.
At the moment there’s no real way to write one set of code that will execute across multiple platforms like this. Unity can handle some of them, but not all. Flash also can handle some of them, but certainly not all, and some of those it does handle have significant performance issues. It’s very similar to how haXe works, but with a far “friendlier” looking syntax. And knowing Mark I’m sure plenty of game specific modules will start coming forth, as Blitz has a significant game development community behind it.
Those of you who know my past may find it amusing that I’m blogging about a Blitz product To understand read on …
A Short Game Dev History Lesson
From 2003 to 2007 I worked for a company called The Game Creators (TGC). They created a programming language called DarkBASIC (DB), and later DarkBASIC Professional (DBPro). Our biggest competitor at the time was a language called Blitz Basic (BB), which then evolved into Blitz3D and ultimately BlitzMax. I was involved in the DarkBASIC community long before joining TGC in 2003, and back then there was genuine rivalry between the DB and BB camps. As the software evolved and new versions came out, so it became more and more intense. Coders from one camp would try and out-code those in another. Disinformation was rife.
By the time I was in charge of building the TGC web sites and forum, we had to actually instigate a ban on the “flaming” of Blitz products, as it was just getting too messy. Blitz developers would flood the forum with various bits of rubbish, and the opposite happened. It was very school play ground. Being a DarkBASIC fan boy, and then employee, I would vehemently defend the product. Of course I know and respect the TGC team and am good friends with several of them. But all of this was many years ago now, and I no longer feel like a traitor for exploring this new Blitz Research product
Both DarkBASIC and Blitz really did put game making tools into the hands of anyone who wanted them, without the complexity of DirectX / OpenGL. Back then there was no such thing as Unity. GameMaker was very embryonic, and other similar software extremely expensive or restricted with insane licenses or noob styled IDEs. DarkBASIC and Blitz really opened up a new market and blazed the trail.
Time waits for no technology
However it’s safe to say that neither products have really changed much in the past 5 years. Yet technology hasn’t let up one bit. Although both still have strong and active communities they have both ignored the tidal shift that is happening in both indie game dev and the platforms upon which games are now enjoyed. Unity has come from nowhere and stolen a huge percentage of their markets. HTML5 gains traction with every new browser release, and Flash has gone from being a random curio of a Netscape plugin to one of the largest platforms in the world.
Today we’ve got mobile platforms galore: iOS, Android, Symbian and RIM. XNA, WiiWare and DSiWare open consoles to us that traditionally have been locked behind closed doors. Even new platforms such as Kindle should not be ignored. And of course the ever present giant that is Facebook gaming (be it via HTML5 or Flash). Today gaming platforms are everywhere, and there are literally millions of connected and active users to tap into as well as the PC and Mac markets.
As an indie game dev on Flash I know my games will be enjoyed by millions of players. When I make a game, I make it to be played. My Flash games see more plays per day than my Windows games had downloads in their whole lifetime. But even I acknowledge that Flash isn’t the best way to be making games if I want to be truly cross platform. It’s performance on iOS is lacklustre at best. Android is lot better but still requires a hefty 16MB AIR install before a user can get off the ground, as well as having a hugely fragmented list of mobile devices to support. And forget about Symbian, XNA, Wii, Windows Mobile 7, etc.
DarkBASIC vs. Blitz – Round 3
So why does Monkey excite me? I think mainly because of the heritage from which this language comes. Hindsight is a wonderful thing. I’m a significantly more experienced developer now, and I realise just what an excellent language Blitz was. Especially the incredible performance it achieved on the hardware of the era. So I don’t doubt that it’s going to do the same again.
But things are never quite that simple – and interestingly The Game Creators counter-attack by announcing their new App Game Kit which claims you can “write once, deploy to everything”. It will include 2D game specific functions and a built-in physics engine. This is very different to the approach Monkey is taking which is keep the core as tight and fast as possible, and then extend on-top of that. But from a game developers point of view, AGK on paper has more appeal already. Of course the proof is in the pudding.
I wonder if new battle lines will be drawn in the sand for these two products? I always felt like Blitz had the superior tech, but TGC had excellent marketing and community management (something I worked very hard to create and foster for them!) and to this day they still do. Blitz lack this, and it’s not something to be ignored in this age when communication with customers is king. Will pure tech alone win this round? Will Blitz hire someone good at marketing? Time will tell. But it will be exciting to see what happens in 2011. And of course no-one can forget the elephant in the room that is Unity.
For more information about Monkey you need to follow Marks blog at: http://marksibly.blogspot.com/
You can see an example of a Monkey coded Flash game in this blog entry.
And here is a video showing Monkey running on a mobile device.
Details about AGK are limited at the moment, but can be found on the AGK teaser site, where you can sign-up to be notified when it launches. It’s also worth subscribing to the free TGC monthly newsletter, which will carry the latest AGK news as well as lots of other great indie game content. Fun fact: I started the newsletter and was the editor of every issue until I left in 2007, it will reach the 100th issue this year, which is awesome
The Game Creators range of software can be found on their main site.
Is true cross-platform development even possible?
Of course true cross-platform development is something of a holy grail. I don’t believe that any software will ever truly provide it, because there are so many device specific things that get in the way. Preparing graphical assets (especially for 2D games) is not the same between say a tablet running Android and a Nokia running Symbian. Device IO, resolutions and speed will always be factors.
This makes me feel that you will need to custom tweak your game for every platform, no matter what language you used to code it in the first place. Of course the least amount of changes you have to make, the better.
Whatever way you look at it though, 2011 is an exciting year for game developers. Our market is expanding by millions of devices each month. And when it comes to development everyone seems to want to make our lives easier.
Adobe, your move.
All about Photon Storm and our
HTML5 game development services
Filter our Content
- Cool Links
- Flash Game Dev Tips
- Game Development
- Geek Shopping
- In the Media
- Phaser 3