Waterfall Game Development

Here’s a recent quote by Anna Marsh on Games Brief:

The key thing is that documentation produced needs to focus on being a practical manual for the team to work on, minus any marketing gloss. To make a comparison with architecture: During the planning phases of a building an architect might prepare Photoshop visualisations with happy pedestrians and sunny skies to show the public and financiers what the final building will look like. But they’ll also prepare far more precise blue prints, plans and technical documents for the actual builders.

Later in the article:

The more experienced the designer writing the documentation, (probably) the less changes you’ll need to make in development.

Humans look for ways to simplify things, often creating models in order to help them achieve things without being destroyed/distracted/confused by the complexity of an undertaking or a system.

Continue reading

Game AI and vectors using GLKit

Some famous game developer whose name I cannot remember (sorry about that whoever you are), said recently at a conference; that the AI of your game “enemies” can be a major part of the success and differentiation of a game. I don’t think you can instantly create great AI, it takes a lot of work, and for me its still “work in progress”.

So, I’ve been working on AI lately with the help of this excellent book as a reference.

This book is really good, not only for AI but also for anything to do with game movement.
Reading this book, suddenly made vector and matrix calculations make sense. And once they make sense its hard to use normal trigonometry again.

Below are some macro’s I’ve built with the help of the book.

Continue reading

Digital Content and Value Creation

This post was catalysed by a recent meet of the Creative Farm by The Untitled Studio : Creative Farm

As creators of digital content we are often beset with the issue of no one (including ourselves) understanding the real value of what we produce.

The first big issue

I believe that part of the problem comes from the fact that digital content can be created anywhere in the world. So those of us in certain nations who have to pay 20 times the rent than those in other nations, are often competing for the same jobs. Thus some of us can undercut the others by a huge amount.

Continue reading

One of the Things I learned from Swipe Conference

Matthew Magain at UX mastery recently wrote a blog post called 10 Things I Learned From Swipe Conference 2012/.

I thought it was really worth reading because there were some insights there that I had not received.

I’m going to write about one of his lessons, primarily because I received such a different insight to him.

Continue reading

One More Thing Conference 2012

Last Friday and Saturday I went to the One More Thing Conference in Melbourne. The conference targeted being indie and becoming successful as an indie, which contrasts with the Swipe conference, which is more about specific design or development stuff.

The conference was well organised and run, with fantastic speakers, all of whom came from overseas.

I went to the mini-conf “code” and the main conference the next day (there was also a design mini-conf on Friday morning).

All comments below are coloured by my particular/peculiar viewpoints, and I’ve kept one or two great insights to myself, to think further on.

Continue reading

Particle systems in IOS Game X

This is part six of a series on making iOS games.


With hundreds or thousands of particles on the screen, a particle effect is a great way to bring your frame rate precipitously down. There are so many different aspects of the particle engine that can effect performance.

Michael Daley has a whole chapter on this (see resources below – and he is right – its a big time sink).

I started off just extending the normal sprite classes which I created in the game template (which I talked about in the last post in this series), and then gradually moved to including more and more optimisations.

I (like everyone else) pre-create a number of particle engines, so that the expensive operation of memory allocation does not have to happen during the game, more as a precaution, than something I’ve rigorously tested with the profiler in Instruments.

Point sprites

Point sprites are a common thing to use with particles effects, to try an optimise things. With each particle as a point sprite you dont need to pass as much data to OpenGL, theoretically 1/6 of the data, since you are only passing one vertex per sprite, not two triangles.
In order to use point sprites you need to set the point size in the traditional vertex shader. I couldn’t see any docs on how to manage the point size in the GLKit base effect – this would be something like:  


in the normal OpenGL ES 2.0 vertex shader.
So I experimented a bit and created a particle engine using the usual OpenGL ES 2.0 vertex and fragment shaders to do point sprites, and the same (as the game template in the previous post) GLKit base effect for the other sprites such as the player, background tiles etc.

Continue reading

The iOS Game Template extras

This is part five of a series on making iOS games.

Continuing on from last week, this post describes some of the non OpenGL parts of my iOS game template, and then finishes with some discoveries.

Centre of the universe

Since the player is the centre of the universe in my game, I can apply one translation to all my sprites.

Here is the simple translation I do:

GLKMatrix4 modelViewMatrix = GLKMatrix4MakeTranslation(bounds.size.width * 0.5 - player->location.x, bounds.size.height * 0.5 - player->location.y, -6.0f);
spriteEffect.transform.modelviewMatrix = modelViewMatrix;

The z coordinate is arbitrary number – maybe I’ll use the z later at some stage.


Properties were great for memory management pre ARC – now of course ARC takes care of that, however in non games I still do tend to use only properties to access ivars. In a game I often do the opposite, I access the ivar directly, I try to avoid message passing. It can significantly deteriorate performance. With operations that are happening hundreds of times per second, messages (properties or methods), can hammer down the frame rate (I guess I could have my cake and eat it too, that is performance and classes by using C++. I don’t like C++, so I am not going to do that). Of course there is always a balance between performance and ease of use, so for my player sprite and monsters, I tend to use classes and instance methods, but for particles I use structs and functions.

Continue reading

The iOS Game Template setup

This is part four of a series on making iOS games.


A little while ago, I created a fairly generic OpenGL ES 2.0 game template (Xcode project) for a 2D game. It used standard vertex and fragment shaders. For this project I wanted to use GLKit effects, a GLKViewController (and it’s view) and storyboards.

So I used Ray Wenderlich’s excellent digital book “iOS 5 by Tutorials” to come up to speed. http://www.raywenderlich.com/store/ios-5-by-tutorials. Chapter 8&9 are the ones.

Ray’s tutorials will give you a good grounding in OpenGL for iOS 5, if you need that grounding. A bit OpenGL background might make this blog piece more interesting, because I won’t be explaining a lot of basic OpenGL things much (eg things like quads, shaders, vertexes, vertex structs, buffers etc).

In addition, Ray just recently came out with another tutorial on his excellent site which expands some on his previous OpenGL tutorials: http://www.raywenderlich.com/9743/how-to-create-a-simple-2d-iphone-game-with-opengl-es-2-0-and-glkit-part-1 and http://www.raywenderlich.com/9776/how;g-to-create-a-simple-2d-iphone-game-with-opengl-es-2-0-and-glkit-part-2.

Worth reading before reading the rest of this post

More challenging stuff

After setting up the initial story board, GLKViewController and GLKView, the next step for me was to add VAOs and VBOs (both of which Ray avoids in his most recent post).
Its fairly easy.

Here is my main VBO/VAO setup:

glGenVertexArraysOES(1, &vertexArray);

glGenBuffers(1, &vertexBuffer);
glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer);
glBufferData(GL_ARRAY_BUFFER,spriteCount * 4 * sizeof(SmallVertex), vertices,GL_DYNAMIC_DRAW);

glGenBuffers(1, &indexBuffer);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer);
glBufferData(GL_ELEMENT_ARRAY_BUFFER,spriteCount * 6 * sizeof(GLushort), indices,GL_STATIC_DRAW);

glVertexAttribPointer(GLKVertexAttribPosition, 2, GL_SHORT, GL_FALSE,sizeof(SmallVertex), (const GLvoid *) offsetof(SmallVertex, Position));
glVertexAttribPointer(GLKVertexAttribColor, 4, GL_UNSIGNED_BYTE, GL_FALSE,sizeof(SmallVertex), (const GLvoid *) offsetof(SmallVertex, Color));
glVertexAttribPointer(GLKVertexAttribTexCoord0, 2, GL_FLOAT,GL_FALSE, sizeof(SmallVertex),(const GLvoid *) offsetof(SmallVertex, TexCoord));


One can scale the base case and just do hundreds of draw calls (each draw call with its own setup) – one for each sprite/image, but that might get slow, even if you packaged up into different VBOs/VAOs. If you had really complex shapes (3D models), you might have them in different draw calls because the shaders might make your scaling and transformations easier. The number of separate moving objects might be relatively low in a scene.

I just went straight to batching.

Continue reading

iOS Game X Technology

This is part three of a series on making iOS games.

I needed to decide on which technology to use in the game and a put down initial ideas on how elements in the game are to be structured.

Graphics Technology

I could write the game visuals using:

  1. UIKit
  2. Core Animation
  3. Third Party Framework
  4. OpenGL

1 and 2 are generally too slow for the 2D action game I am making (although I believe Core Animation is surprisingly fast and can handle hundreds of animating views on the screen).

My view on the third party issues is outlined below in a Napkin. I chose number four: OpenGL.

Continue reading