Bootstrapping to a Game Developer

This is a summary of the process of developing the game Kondrian.
battle2
You can see more on Kondrian here, or on iTunes here

Intro the indie

Half the world’s developers seem to be indie game developers, but I think there is a difference between developers who are already game developers who move to developing games on iOS, and those developers who are already developing on iOS and move into game development.

Based on the current number of games appearing in the store daily (148apps as many as 140 per day), there is a lot of game development going on.
Many of these seem to have been created by indie game developers, obviously indie game developers don’t need an introduction.

I however am coming from a different angle than most developers, a seasoned non game developer with a lot of experience on iOS, shipping my first ‘real’ iOS game (I’m not counting a kid’s game I wrote for a client because that was primarily UIKit and CoreAnimation, and much simpler).

Continue reading

Kondrian summary

Development summary for Kondrian

  • its Universal,
  • its written in Objective C (no C++),
  • home grown graphics engine (apart from the GLK* and OpenGL ES),
  • uses OpenGL ES 2.0, VBOs, VAOs and many other OpenGL ES 2.0 goodies,
  • uses GLKit, a GLKViewController and GLView – but uses standard OpenGL ES 2.0 shaders (just because they seemed slightly faster),
  • Continue reading

Drawing lines in OpenGL

(with the help of GLKit)

There are many ways to do this, its often used in paint programs.

Philip Rideout’s iPhone 3D Programming has a way to do it in C++, but its hard to abstract the method from the code.

There is a nice article written here which gives the method I used.
In my case the lines are temporary exhaust lines – so I don’t need to bake the lines into a texture as the above solution does.

The method just draws line segments from point to point as rectangles. Each line segment is a sprite which is rendered which ever way you render your OpenGL sprites.

Here is a picture of a ship emitting an exhaust – that uses the code below – the ship is moving very fast – so the sharp angles don’t matter so much.

swoop pic

And below is the code I wrote to do the lines:

Continue reading

A potpourri of iOS game programming lessons 

The development of my game Kondrian is coming to an end.
title_big_iphone@2x

Here is a miscellany of what I think we’re useful lessons, each too small to warrant a blog post:

  • Each of the levels in Kondrian can be 100 x 100 tiles wide. It’s simple enough  to only draw the tiles when they are on screen, but I also created a scheme a bit like UITableviewCells in a UITableview in order to conserve memory. There are in fact only about 200 tiles (depending on whether its an iPhone or iPad) created, and they are reused when they go off screen. Reusing usually involves giving the tiles the appropriate texture for a tile potentially appearing onscreen in the direction that the player is moving.
  • All sprites (and the vertices, indices, VBOs VAs) are created at startup.
    When a sprite is needed it is de-queued and enabled, only enabled sprites are updated and drawn. No on the fly malloc-ing or creation of gl buffers.
  • 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