Posts

Showing posts with the label books

Flash game development book ideas

I've been mulling over the idea of writing some kind of book or eBook in the future. Rather than being a set of example games like most Flash games books seem to be, it would arm you with the techniques to create your own games, so when you are stuck on a specific topic it is quick to look up.

The book would be almost completely source-code based (with plenty of comments). There would be almost no "waffle" sections of description. It would be more of a look-up (or copy-paste!) technique reference than a traditional "blah-blah-blah" book. Due to this format I think it would be better as an ebook than a dead-tree book. What do you guys think about that?

Anyway, here are my topic ideas. Could you please let me know if there's anything that should or shouldn't be in there?

Input
- Keyboard input and control (from scratch and using Gamepad library)
- Mouse input and control

View
- Top down (+2D Camera)
- Side-on (+parallax)
- Zelda style (+Depth sorting)
- 3D third person (using Away3D)
- 3D first person (using Away3D)
- Mini-map / radar

Rendering
- Blitting
- Using DisplayObjects efficiently

Maths
- Useful maths
- Vector maths

Security
- Site-locking a game

Game engine
- Time steps (basic, deltaTime, fix your timestep)
- Game loop (and pausing)
- Entity systems (inheritance-based, and component-based)
- Object pooling

Collision detection and Reaction
- Circle-circle
- Square-square
- Square-circle
- Line-line
- Line-square
- Line-circle
- Separating axis
- Using hitTestPoint
- Using bitmapdata getPixel
- Using bitmapdata hitTest
- Collision reaction for platform games (player and projectile)
- Collision reaction for top-down games (player and projectile)

Physics
- Top-down car physics
- Platform physics
- Projectile physics
- Using a 3rd party physics engine (Nape)

Environments
- Tile-based techniques
- Using Flash as a level editor - parsing etc
- Creating an in-game level-editor.
- Procedural level generation

Animation
- Bones animation
- MovieClip animations
- Creating your own simple tweening system (+ easing, springs)
- Using a 3rd party tweening engine in-game (TweenMax)
- Sprites sheet / image sequence animations

Audio
- Creating a reusable sound manager
- playing sounds and music
- mute button / volume controls

Gameplay
- Scoring, achievements and saving your game.
- RPG characters - inventory, stats, health, buffs/debuffs.
- Weapon management

User Interface
- HUD
- level select menu
- Main menu
- Shop

Away3D 3.6 Essentials – Book Review

Ok, so here’s a book I definitely can recommend! ;-) Away3D 3.6 Essentials by Matthew Casperson (published by Packt) is a really great introduction to creating 3D content in Flash with the free and open source Away3D library.



For a brief time in the summer of 2008 I was the golden-boy of Flash 3D after my team at Bloc launched the Papervision-powered game/transmedia experiential play-node called Meta4orce, which I documented to launch my new blog. While my experience and high google ranking for the term “papervision developer” (#2 – boom!) earned me a couple more PV3D gigs, it all tailed off by the end of 2009. The fact that the Papervision3D team pretty-much abandoned development and moved on to new projects didn’t help, but there was also a sense that the novelty of 3D Flash content was wearing off (especially with such jaw-dropping competition as Unity3D’s island demo).

But 3D Flash content was not in fact dead, and the Away3D engine very ably filled the gap left by the demise of Papervision. I never kept up with developments in the Away3D world, so this book was a great re-introduction. So what I have I learned? Well one nice thing to see is that many of the techniques I had to manually create in my Papervision3D work are actually integrated into the Away3D engine itself. This includes things like:
  • level-of-detail (LOD) model-swapping, so that when objects are far away they use a simpler mesh.
  • flat sprites and multi-directional sprites like you see in Doom and Duke Nukem 3D.
  • splitting objects into individual layers and display objects, to solve triangle-sorting issues when a model sits on top of the ground.
  • skyboxes.
  • isometric camera.
  • depth of field effects using sequences of sprites at different levels of blur.
Matthew’s book gives a good explanation of the theory behind these techniques (and many more – the book is incredibly thorough and comprehensive), as well as how to apply them using Away3D. I also learned a bit of general 3D theory about things like UV mapping, triangle Z-sorting and effects like normal mapping and bump mapping. On the whole, though, this book is very much a practical manual of how to use each of Away3D’s features. If I have any criticism, it is that there’s not too much there that you couldn’t get through scouring the documentation and source code, and it doesn’t ever pulled together all the strands to make one amazing demo at the end. That’s up you to go off and do yourself I guess. One really nice addition is that this book does document Away3D’s bugs and offers work-arounds, which could well prevent you from pulling your hair out a few times.

Reading Away3D 3.6 Essentials has really re-opened my interest in Flash 3D, and I think I’m going to do a few experiments with Away3D in its current form, so that when the hardware accelerated magic of Stage3D and Away3D v4 hit Flash, I’m not playing catch-up.

AdvancED Game Design with Flash – Book Review

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.


Unity Game Development Essentials - Book Review


The publishers of Unity Game Development Essentials, Packt, were kind enough to send me a review copy of the book at the end of last year, but I have been so stupidly busy I didn't have much time to read the book let alone post my review. I had originally planned to only read the book while sat in front of Unity so that I could work along with the tutorials, but again time got me so I ended up just reading it on the train. As it turned out this didn't actually cause any problems, and I managed to turn an unproductive commute into some very productive learning time.

The book is basically one long tutorial that shows you how to make a tropical island, set up a first-person camera to walk around it, and create some interaction with the environment, such as collecting objects, opening doors and (don't ask me why) throwing coconuts. Between this book, Unity3d.com's tropical paradise demo and Offroad Velociraptor Safari, you will be forgiven for thinking Unity can only make games set on tropical islands. I assure you this is not true.

Going through these kinds of tutorials is not how I normally learn a technology. My normal approach is to just fire up the editor and start hacking code until something moves on the screen - as I did with Unity last year. However, I have to say that for Unity, which is a very unique, graphical interface driven technology, the approach of going through tutorials is actually better. I learned many techniques from the book (e.g. using the terrain editor, setting up the skybox) that aren't immediately obvious from just poking around the IDE.

The book is meant for a wide audience, including designers, and the code is quite basic, and not necessarily the most "correct" way of working if you're coming from the world of design patterns, MVC frameworks etc. However, I don't see this as an issue, as if you know a better way of doing things it will be trivial for you to refactor the code to meet your needs. The caveat, however, is that the code is all JavaScript, and many Flash guys will be more inclined to take the C# route, despite the obvious similarities between AS3 and Unity's implementation of JavaScript.

The book's main drawback is that at the end of it you haven't really made a "game" in the sense that I understand it. You've made a kind of interactive environment with some coconut throwing. The book's main benefit, however, is that it gives you a nice introduction to all the facets of Unity, from terrain, cameras, physics and prefabs to adding a user interface and menu. Many parts of the book are written just for people coming from Flash, and if that's you, you will definitely be able to go off and make your first game after reading it. Overall, if you're just getting into Unity I think this is a great place to start.

The Essential Guide To Flash Games... infomercial?!

Just wow. For a couple of months I spent many of my evenings writing the "technical review" for "The Essential Guide to Flash Games" a new book about programming games with AS3, by Jeff Fulton and Steve Fulton, aka 8bitrocket. Which basically means Jeff and Steve wrote it, and I marked their homework. I'm still waiting for my copy to arrive from the publisher, but now I really can't wait, because there's a full-on infomercial?!? This is freakin' awesome...



http://www.youtube.com/watch?v=T4WXmv-JtAY&feature=player_embedded

I learned some neat new tricks from Jeff and Steve, and I also added some of my own suggestions, so you've got at least 3 brains worth of knowledge right there. More about the book at 8bitrocket: http://www.8bitrocket.com/book/