Archive for July 4th, 2009|Daily archive page

C++ on the iPhone: Djinn Engine

EDIT: I would like to point out that below, when mentioning “Mike” … I forgot to plug his website.. whoops! In any rate, he has a few great tutorials (in video form) located: … HIGHLY recommend you check them out if you’re using Obj-C on the iPhone.

Hello everyone! I have been reading through your emails and appreciate all the letters. One question I kept asking myself with this project was “Do I want to make the engine open source?” My decision came apparent when I realized that this engine, although it will be used for my iPhone games, was first and foremost a learning experience for me and a tool that I used in order to become a better programmer.

So here I am, with a working copy of the Djinn Engine, and I have decided to make the project ‘open source.’ Before I upload the source to a SVN however, I want to ask the communities opinion on what they want to see?

The engine works, but it is crude. Currently in the engine is the following:

TestGame – I’ve been using this as a static unit testing for the engine

Actor System – Handles any actors in the game. Started by using the Angel Engine as template

Animation System – Animation Manager used for stopping, starting, and updating various animation playlists.

Game Screen Management – A C++ version of the Screen Controller tutorial from below.

Serializable objects – All objects (Characters, particle effects, etc) will be serialized in .dat files for dynamic loading. This way they do not need to be hard coded into the engine.

Input management (single touch only) – A C++ version of the input manager tutorial below.

Particle System – Using Mike’s tutorial as a starting point, dynamic particle system that includes a controller, effect, and various emitters for every particle effect. The one i currently have been using is “fire”

OpenAL Sound Support (have not put in OGG support yet, plan to) – Also using Mike’s tutorials as a staging point, this is an OpenAL sound engine that currently only works with sound effects… I want to add OGG support in the future.

File Management – pass in the asset name of a file, and a pointer to the object you wish to unserialize, and the file manager will take care of the rest.

Random Number Generation – … does just what it says it will do :)

Modified version of Apples Texture2D for C++ (will need to revamp this)

Math Utilities class (IE: Clamp, Min / Max, Abs, Lerp, etc etc)

and a couple of other things. Keep in mind, this is a 2D engine! So… iPhone community… We have a few choices before this thing goes Open Source. I will continue working on it, adding things that will meet my needs (keeping in mind, this will be the engine I am using for my iPhone Game) and I figure if I need a feature, maybe the community could use it as well. Should I just release it “as is” right now and continue working on it while you all can get your hands on it and modify it depending on what you need? Should I clean it up a bit, so its easier to understand when you’re reading through the code? or should I wait til the engine is pretty much done and release it then?

Let me know either via comment or email what you wish, and we’ll make it happen. I’ll have to work on some documentation, especially for the crude object serialization haha.. but that shouldn’t be too hard to do. Let me know what you think, and for the few of us who actually enjoy C++ on the iPhone, lets make it happen!