iPod Train Simulator

It’s been too long since I last posted something about my software projects, so I want to give an overview here. First of all, Hubschrauber is going along nicely, although I haven’t done much work on it lately. Instead there’s something different that has no name yet, but just might turn out to be interesting.

Currently it shows a gray screen, several UI elements and a blue locomotive

It’s a railroad simulator for iPhone and iPod touch. Some basic functionality already works. To do something more interesting, I decided to write a level editor, and that turned out to be trouble.

You can see a Mac OS X window with a landscape, which has yellow stripes over a background formed out of random Mac OS X user interface elements

I’m trying to make all texture editing go via the GPU, but I get incorrect values somewhere. Accessing video RAM that you shouldn’t access is always fun, since you never know whether you get a crash (which might involve the entire computer), some artifacts or, like here, contents of various windows on the screen.

My default solution for this would be to go bug hunting with Apple’s OpenGL Profiler, a free and useful tool for analyzing how your application uses OpenGL and what it does wrong. The problem: It does not work.

Since Mac OS X 10.5 Leopard, the Cocoa development environment supports a garbage collector. This means that I don’t have to think about RAM (normal, not GPU RAM) at all, I just use it and when I’m done someone will notice and take care. That works well and has been the default in other languages for some time already, but all code in a program has to support it. OpenGL-Profiler loads new code into the program to do it’s work, and that code is not GC-compatible, resulting in odd crashes.

If I don’t find the problem soonish, I guess I’ll have to switch the entire level editor back to manual memory management just so I can debug it better. And what did we learn from that? Never use the garbage collector in applications that make any non-trivial use of OpenGL.

Written on April 2nd, 2009 at 10:17 pm

1 Comments

  1. Posted 30 August 2010

    Florian Königsrainer

    Ich bin ganz gespannt auf den eisenbahn simulator für iPod Touch und wenn es rauskommt lad ich mir es sofort runter egal wie teuer aber ich bin so ein großer eisenbahnfan und hab ein mac und hab nur eine handvoll eisenbahnspiele gefunden aber nicht in 3d !!!! Also bitte verat wie das programm heist und ich lad es im app store herunter !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

New comments can no longer be posted because it got to annoying to fight all the spam.