Train Defense 2‎ > ‎

Train Defense 2 begins... with a port to Unity 3D

posted Jul 6, 2012, 4:13 AM by James Podesta   [ updated Jul 6, 2012, 9:48 AM ]
So... its been a while but I've finally found some time to start work on Train Defense 2. I've learnt a lot from the Train Defense project and have some great ideas and improvements planed for a sequel. I won't divulge too much in the first post, but probably drop details along the way.

The first newsworthy item is that I will be doing Train Defense 2 in Unity3D.  While I'm happy with the performance of my own engine, being able to push around 200+ enemies with shadows and toon rendering on a iPad#1,  its been a pain trying to support Mac and PC releases and I'm not in any position to support Android or Web releases.  Unity will let me publish on all platforms instantly.

Also, I am really digging working with C#.  Its such a cleaner language than C++. I was worried about performance and garbage collection but some initial tests have had great responses. There's also been a number of hit iOS games released through Unity  (Shadowgun, Ski Safari, Heroes Call)  so I'm fairly confident I won't hit any roadblocks in development.

First thing is first, I needed to test if Unity could actually handle the large number of enemies that Train defense needs, and with 3 passes per enemy, thats a fair few draw calls for iOS to handle. I'm happy to announce that my first tests have shown unity handling nearly 200 units at 60fps using my shaders. It also seems to drop frames gracefully after exceeding the limit.

Next I needed to port all my models to Unity.  I've switched file formats from XML to SHAD,  which is a more human readable format as it has no brackets and just uses indents for scope. I wrote a quick converter to write the XML file out as SHAD and here is the results.  I've still got a couple of rotations to fix but its nearly there.

TrainDefense 2 - Prototype 001