It’s been over a week since my last update and according to my rules I’m supposed to do at least one of these per week. Since my last update I have:

  • Improved/refactored a bunch of my Tiled map importer code
  • Converted all my levels (there’s only 11 so far) over to the TMX map format
  • Added a more interesting end of level dialog that shows bugs killed and all the food you kept safe GIF2
  • Made changes/improvements to the virtual joystick controls for mobile
  • Refactored some of my UI code into what I think is a pretty good re-usable mobile dialog class for Unity’s UI
  • Made many changes to my core Unity3d library code
  • Many bug fixes
  • Installed El Capitan and the newest XCode on my MAC mini
  • Got all my expired iOS certificates and other assorted Apple obstacles cleaned up
  • Got a build of the game up and running on an iPhone
  • Ripped out the Ludum Dare quality “sound system” script stuff and integrated Audio Toolkit into the project
  • Found a nice SerializableDictionary implementation complete with a property drawer from spacepuppy’s Unity framework
  • Found a great free 32×32 outdoor tileset and spent far too much time slicing and dicing it into something I’m not even sure I’ll be able to use.
  • Went off on a tangent and updated my Paint .NET animation plugin with a UI redesign and another option for outputting an animation strip. I haven’t officially released the changes yet.paintNet-anim-helper-updates

Things I still need to get done:

  • Redo any sound effects I don’t like, make new ones for some stuff that doesn’t have a sound
  • Do something with the current little musical pieces. Throw them out, redo them, or something. I’m not quite sure what to do about this one yet.
  • I think I want to implement some sort of scoring system that gives you points for bugs killed and some sort of bonus multiplier for each piece of food you get into a basket before the level is completed.
  • I’ve been thinking about letting the player poison food so that when bugs (except for roaches) try to pick it up, they get poisoned and die. This should impose some sort of tradeoff for the player i.e. the player looses a bonus multiplier or pays some points to do this because he is essentially ruining a piece of the food he is trying to protect
  • Make the player’s health persist between levels
  • Add something to let the player heal
  • I think I would like a high score list. I though about using Google’s Play Games Plugin for Unity but it doesn’t work for PC/Mac/Linux. I want to have something like dreamlo’s free leaderboard but running on my own server. I wonder if I have time to implement it…

 

If you’ve been around game development for any length of time, you have probably heard of the Tiled Map Editor.  It is a great open-source editor that supports orthogonal, isometric, and hexagonal maps. I’ve been eyeing it for a while and considered using it for HackBotZ but ended up settling on Ogmo Editor instead. That was a while back, and since then I’ve moved to Unity3d which does not natively support loading Tiled maps. I looked around a bit and found a lovely Tiled2Unity framework but it does not support loading Tiled maps at run-time. Instead, you import your Tiled maps into the editor and it makes prefabs of them. I however want the ability to simply open up a map in Tiled, change it, run the game and have the changes just show up. With that in mind, I began the process of coming up with some code that would parse a native Tiled .tmx format into some data structures I could work with.  The .tmx format is really just an xml file with specific elements to describe map configurations, so I started on Saturday to write some simple C# to parse it. I had things going pretty well until I hit the data section of the layer element that describes exactly which tiles go where. There are several tile layer formats supported for this data : base-64 uncompressed, base-64 zlib compressed, base-64 gzip compressed, CSV, and XML.  I took one of the example maps that comes with Tiled and changed the format to CSV, then XML, then the compressed formats.  The difference in file size, as you might imagine, is significant. CSV and XML formatting make the files much too large for my purposes.   I could have compressed the whole file, but that would not allow me to edit it in Tiled without decompressing it, so I set about looking into the two base-64 encoded compressed formats.  Unfortunately, my cross-platform solution for compression in Unity3d, 7-zip’s LZMA SDK, does not support either gzip or zlib compression.  I didn’t want to write compression/decompression code (although it would have been fun), so on Sunday night, I set about looking around for some C# implementations of either gzip or zlib. I found a few but ended up settling, at least for now, on ZLIB .NET which has a BSD license. When compiled, you end up with a 64kB dll that will compress/decompress zlib data. I will probably go back later and setup my 7zip helper shim to work with either library but for now it all works rather nicely. By Monday afternoon I had a solution that would pull in a .tmx file, parse it, and instantiate tiles in the correct locations in Unity3d.

tiled
Level 1 of Buggers recreated in the Tiled map editor
unity3d
Level 1 of Buggers loaded from the level1.tmx Tiled file

 

The next thing to do is refactor the game code for buggers to utilize a single unity3d scene instead of loading a scene for each level, and that along with modifications/fixes to my Tiled loader is what I will be working on today.

If you haven’t read my previous blog post I suggest you do so. This month’s game will be a remake of a game called Buggers! which I did for Ludum Dare 26.  My plan is to convert the existing code over to my new framework, update the graphics, add joystick support, more game play elements, a high score list, more levels, and investigate a 2-player mode. This month is a bit of an exception since I started working on this remake before I came up with the idea of 6 games in 6 months on 5 platforms (6-6-5). My first commit of the new Buggers was Jan 26, but I think I started work on it around Jan 24 or so. I have done a first pass at updating the graphics and have already ported most of the old code to my new framework. Here is a before/after comparison graphically:

Buggers-pre-remake
The original Buggers
Buggers! Remake
Buggers! Now in color!

As you can see in the remake screenshot, I’ve also started working on getting some controls ready for a mobile version. I was fiddling with different ways to implement touch controls and only today settled on using Unity’s Cross Platform Input package with a few tweaks (check out this video for a tutorial).   One of the things I worked on for quite a while for my previous two commercial releases (Terra Forma and Roboticon) was UI sizing/scaling.  I’m hoping to get the same or better results with less complicated code and setup. So far things are looking OK, but I have yet to test on any of my Android devices proper or on iOS/Mac in general.  I’ve added “check UI scaling/sizing” to my monthly todo list so I’ll be looking into it more.  Hopefully I can find a set of general practices that will make the UI scaling/sizing easier each time I do a new game. Until tomorrow…

Social media & sharing icons powered by UltimatelySocial