Saturday, September 13, 2014

Keeping on Keeping on

Working with Unity has been a great experience, and the initial learning curve has not been as bad as I thought it might.  I am not much of a blogger, but I have continued to stay focused on getting Shattered Throne finished.  It is looking great (I have a handful of display items I want to clean up before posting any images).

This weekend I checked in my 400th revision to the source code.  The campaign is fully written and I have had a few good friends that have provided some valuable early testing feedback.  As preparation for this last test release, I added in the ability to submit player feedback and collect game stats to a server.  Getting feedback can be difficult, so it is always important to make it as easy as possible.

This experience showed me that adding server calls to a Unity game was painless.  As such, a couple weeks ago I ventured into a new area with hesitant steps, adding Async online multiplayer to Shattered Throne.  I have been very hesitant because this means supporting a server (I am one person with a full time job, game programming is just a hobby) and also because of horror stories such as this:

I have the goal of submitting Shattered Throne into Steam Greenlight, and I know one of the first questions I will receive, "Can we play this against other players online?"  It is a very valid question for a Strategy Game.  As of right now, the answer is yes, it is possible to play Shattered Throne against other players via Async Online games.

The current near future plan right now is to put the finishing touches on the multiplayer aspect, fix issues brought up by current play test reports, and then it will be time to expand the play testing.  If you have any interest in playtesting (PC, Mac, or Linux) please drop me a line: checkmarkgames [at] gmail [dot] com

Sunday, December 15, 2013

Unity sanity check

The last several months have seen me subsequently looking for new work and then settling down into a new position.  As such, work on game development was slow to non existent.  I originally hoped to release Shattered Throne onto XBLIG this summer, but that window has obviously come and gone.

Also during that time, two key things happened.  The first was the release of the Xbox One and the exit of XBLIG Community Games.  I really wanted to get Shattered Throne submitted well before this happened, but alas, it just didn't work out.  As such, one of the primary reasons for working in XNA has expired.

Seeing this on the horizon a while back, I had been keeping a pulse on the Unity game engine, seeing it as a likely engine to use in my next project.  And it was in early November that the second key event took place, one I had been eagerly awaiting, Unity released its own build in 2D support.

So one event was a disappointment, the other exciting.  One small lesson I have learned in being a hobbyist game developer, is that you need to keep excited in order to keep moving forward.  So I gave in and played around with the new Unity release.  First following a nice pong tutorial, and the next jumping in and trying to puzzle out a tower defense game (which my son had designed on paper).

Feeling pretty good about Unity, what it could do, and how to use it, I gave myself a short quest, spend 2 weeks moving Shattered Throne to Unity, and see how far I could get.  It was the obvious question that had been in the back of my mind after all.  I was very nervous however, as Shattered Throne has been in my head for many years, and inevitably started and stopped on each new platform/engine that struck my fancy.  I was so close to release, had put my own money into art assets, I could not afford to start over.

But I could not let it go, so I gave myself two weeks.  Prove I could reuse a lot of what I had already written, or realize I would have to basically start over.

Things started out on the right foot.  I had been very good in keeping my presentation and game engine layer separate, and within 3 hours, I had the entire game engine data objects and gameplay engine moved over and compiling in Unity.  Nothing was hooked up to the display or player controls, but I had all the pathfinding, rewind, gamestate management, levels, unit and map data, combat calculations, game systems and AI sitting there, ready to be used.

Then I started work on the game play display.  In the simple act of putting the map display together, I realized that the new Unity 2D tools were not going to work out for me.  While Unity has a really good automatic sprite sheet splitter built in, there seems to be no way to switch sprite images within these multi-sprites from within code.  Such as when building a map from data loaded from disk....

Sure, it is possible to create a prefab for every terrain type, and then assemble a map from those, but this would end up being a large number of prefabs when all the water edge and corner transition overlays were counted.  Also I was likely to have the same issue with the Units themselves.

Some research led me to the 2D Toolkit.  Turns out it has been updated to work with the new built in 2D unity objects, and still provides additional value, such as Sprite Atlasing (automatically assembling individual images into a single texture to reduce draw calls), a built in Tilemap object, and ability to dynamically change sprite images in code.  I made the purchase, and have been very pleased with the results.  The author is extremely responsive on his forums, answering questions from users extremely quick.

So the two weeks are gone...what is the end result?

Things have worked out quite well.  The game is mostly playable, there are still some rough or missing animations and effects, but you can move and attack with the units.  Also a few button hookups away from Ending a turn and undoing actions.  I had planned on redoing all the ingame menus and screens (such as building units) anyways, so I will not be losing time redoing those elements, and they will likely come together quicker due to the built in support such elements have in Unity, as well as the NGUI toolkit, which I purchased when it was on sale for a song.

So for now, I will continue to work in Unity, at least for the near future.  I must say that there is some relief in not worrying about getting it finished before XBLIG completely evaporates.  Using Unity also opens up several additional platforms, such as Linux, Mac, iOS, and PS4 which I am all interested in.  Of course, the biggest hurdle on releasing to additional environments is testing, which is already a difficult task to undertake with just a PC release.