Logo of the Unity Engine

IslandWar in Unity

I decided to give an old project of mine another try. Back in 2007, after I finished my freeware game Ball Race, I ventured forth to create my first indie title, IslandWar. This is what gave rise to a lot of the classes that can now be found in my Nuclex Framework, including the GUI system that I originally wanted to avoid because I knew it would sidetrack me.

Well, combine some procrastination with a beginning burnout (at the end of 2009 I was certain that I never wanted to work with computers again) and the game was left on hold indefinitely. In the meantime, someone else even published an iPhone game by that title with a very similar concept, so that means I’ll have to find a new title if I ever publish this game.

Unity 3D Logo

Since I originally started working on IslandWar in XNA 1.0 Refresh, several XNA versions have come and gone and Unity, which I already reviewed favorably in 2007 has now gained Windows authoring support (it originally was MacOS-only) and sports a free basic edition. So given the choice between updating all of the game’s code to XNA 4.0 and SunBurn or porting it to Unity, I decided to give Unity a try.

So these are my first steps in Unity. Try not to laugh too hard :)

Give me some Water

IslandWar is about two island states at war with each other. The battles take place two islands at a time and involve bringing all kinds of ballistic weapons to bear on each other, so I needed a suitable water surface. Turns out Unity already has some great-looking water in its standard assets package, but it’s circular.

So to rectify that situation, I located the asset in my project directory and fired up Autodesk FBX Converter to convert it into a format Blender understands:

Autodesk FBX Converter with Unity's standard water plane mesh loaded

Collada always has issues, to I picked Wavefront and voila, the mesh could be loaded in Blender without a hitch:

Screenshot of Unity's default circular water plane imported into Blender

I worked some magic by duplicating, then mirroring the water mesh, then adding some intermediate vertices until I ended up two connected circles in a shape that resembles a chainsaw blade (and would be ideal for two islands in the ocean with camera paths from one to the other):

Screenshot of the water plane extended into two connected circles like a chainsaw blade

As I found out, Unity will use any .blend file placed in its Asset directory as-is, without requiring me to convert it back into an FBX file. That is pretty cool!

Here’s the final result in Unity:

Unity editor with default water effect now using the elongated water plane

After some further tests, this may have been an exercise in futility as the water shader provided by unity doesn’t even seem to use texture coordinates, so I could have just scaled the default circular water into an ellipse. But I already learned a bit about Unity’s asset pipeline and how prefabs work (a truly excellent idea — sort of the prototype pattern on steroids!).