<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2025-04-20T21:16:12+00:00</updated><id>/feed.xml</id><title type="html">Sean Barton - Game Developer</title><subtitle>I&apos;m Sean Barton, a game developer working in Austin, Texas. I aim to make game development more manageable and enjoyable.</subtitle><entry><title type="html">Aseprite2Unity Now Available</title><link href="/intro-ase2unity.html" rel="alternate" type="text/html" title="Aseprite2Unity Now Available" /><published>2019-01-02T00:00:00+00:00</published><updated>2019-01-02T00:00:00+00:00</updated><id>/intro-ase2unity</id><content type="html" xml:base="/intro-ase2unity.html"><![CDATA[<p><img class="u-full-width" alt="Aseprite2Unity" src="assets/images/ase2unity-banner.png" /></p>

<p><strong>Happy New Year 2019!</strong> Over the holidays I got back into my hobby projects and put something together that others may find useful.
Yesterday, I made it available for the public under the pay-what-you-want-or-free model.</p>

<p>I love Unity but working with the built-in sprite and animation editors has long been an annoyance for me. 
So, I took what I consider to be the best 2D sprite authoring tool (<a href="https://www.aseprite.org/">Aseprite</a>) and created a scripted importer for it.</p>

<!--more-->

<p>My latest tool, <a href="aseprite2unity.html">Aseprite2Unity</a>, drills into <code class="language-plaintext highlighter-rouge">.ase</code> or <code class="language-plaintext highlighter-rouge">.aseprite</code> files and creates sprites and animation clips automatically.
The resulting prefab is ready to go with <a href="https://docs.unity3d.com/Manual/class-SpriteRenderer.html">SpriteRenderer</a> and <a href="https://docs.unity3d.com/Manual/class-Animator.html">Animator</a> components filled out.</p>

<p>You can download and learn more about this tool <a href="aseprite2unity.html">on the Aseprite2Unity page</a>. <strong>Enjoy!</strong></p>

<p><img class="u-full-width" alt="Mega Dad frames" src="assets/images/mega-dad-strip.png" /></p>]]></content><author><name>seanba</name></author><category term="Aseprite2Unity" /><category term="Unity" /><category term="Aseprite" /><summary type="html"><![CDATA[Happy New Year 2019! Over the holidays I got back into my hobby projects and put something together that others may find useful. Yesterday, I made it available for the public under the pay-what-you-want-or-free model. I love Unity but working with the built-in sprite and animation editors has long been an annoyance for me. So, I took what I consider to be the best 2D sprite authoring tool (Aseprite) and created a scripted importer for it.]]></summary></entry><entry><title type="html">Introducing SuperTiled2Unity</title><link href="/intro-super.html" rel="alternate" type="text/html" title="Introducing SuperTiled2Unity" /><published>2018-10-31T00:00:00+00:00</published><updated>2018-10-31T00:00:00+00:00</updated><id>/intro-super</id><content type="html" xml:base="/intro-super.html"><![CDATA[<p><img class="u-full-width" alt="SuperTiled2Unity" src="assets/images/st2u-bar-wide.png" /></p>

<p><strong>Tiled2Unity is dead.</strong> Long live <a href="supertiled2unity.html">SuperTiled2Unity</a>. <!--more--></p>

<p>Since May of 2014, Tiled2Unity has been a popular piece of software, mostly 
due to <a href="https://www.mapeditor.org/">Tiled Map Editor</a> being an essential 2D authoring tool and because Unity has been slow to support tile-based assets.</p>

<p>However, in the past year I’ve accumulated <strong>significant fatigue with further Tiled2Unity development</strong> due to these factors:</p>

<ul>
  <li>The external Tiled2Unity exporter (a C# <a href="https://en.wikipedia.org/wiki/Windows_Forms">Windows Forms</a> application) was a huge pain to support for both Windows and Mac.</li>
  <li>A small subset of Mac users kept running into crashes I wasn’t able to resolve involing managed wrappers of native graphic libraries.</li>
  <li><a href="introducing-tiled2unitylite.html">Tiled2UnityLite</a> never took hold as a viable solution for Linux users.</li>
  <li>Tiled files were external to Unity which made debugging difficult. (Users often had maps, tilesets, and textures all over the place which made sharing a pain.)</li>
  <li>Graphical seams was an ongoing drain on support and <a href="https://tiled2unity.readthedocs.io/en/latest/fixing-seams/">the fix for these artifacts</a> was unsatisfying.</li>
  <li>Unity support for tiles and tilemaps was maturing, thereby deprecating Tiled2Unity (which uses <a href="https://en.wikipedia.org/wiki/Wavefront_.obj_file">Wavefront object meshes</a>).</li>
</ul>

<p>For a time I had decided to toss Tiled2Unity to the side but have you tried using Unity as tilemap editor? I think it’s a bit of a mess.
Further, I’ve built up a lot of Tiled data that I didn’t want to recreate in Unity’s editing environment.</p>

<p>So instead <strong>I’ve recreated Tiled2Unity from the ground up</strong> taking advantage of new Unity features
such as <a href="https://docs.unity3d.com/Manual/ScriptedImporters.html">Scripted Importers</a> and <a href="https://docs.unity3d.com/Manual/Tilemap.html">Tilemaps</a>.
The result is SuperTiled2Unity which is now ready for public consumption.</p>

<p><strong>But beware:</strong> This is an early release. Even Unity considers their new classes as experimental and subject to change.</p>

<h4 id="supertiled2unity-improvements">SuperTiled2Unity Improvements</h4>

<p>Starting over with a Tiled importer allowed me to resolve these issues:</p>

<ul>
  <li><strong>No more external exporter.</strong> Tiled files are now treated as true Unity assets that are automatically imported into prefabs as you make changes in Tiled.</li>
  <li><strong>Support for all platforms.</strong> Running everything in the Unity Editor puts Windows, Mac OS, and Linux users on an even playing field.</li>
  <li><strong>Seams fixed once and for all.</strong> Tiles are grouped into a texture atlas during import and padded appropriately so that mathematical imprecision with UV coordinates does not lead to these annoying artifacts.</li>
  <li><strong>New Unity classes supported.</strong> The Tilemap class is a welcome addition to Unity. No more meshes!</li>
</ul>

<p>SuperTiled2Unity strives to <strong>compliment all Tiled features</strong> including isometric or hexagonal maps, colliders, flipped tiles, animated tiles, templates, objects, groups, etc..
If a feature is missing <a href="https://github.com/Seanba/SuperTiled2Unity/issues">let me know</a> and I’ll try to support it.</p>

<p>SuperTiled2Unity is <a href="SuperTiled2Unity">distributed as a single Unity package</a>. <strong>And, yes, it is free</strong> but <a href="donate">dontations are always apprecated</a>.</p>

<p>I also encourage everyone to make a contribution towards <a href="https://www.patreon.com/bjorn/overview">further Tiled Map Editor development</a>.
Thorbjørn Lindeijer has put years of effort into Tiled. It’s a great program that he easily could have charged real money for. <strong>Please give him your support.</strong></p>

<p><strong>Thanks and enjoy!</strong></p>

<p><img class="u-full-width" alt="SuperTiled2Unity" src="assets/images/overhead-in-unity.png" /></p>]]></content><author><name>seanba</name></author><category term="SuperTiled2Unity" /><category term="Unity" /><category term="Tiled" /><summary type="html"><![CDATA[Tiled2Unity is dead. Long live SuperTiled2Unity.]]></summary></entry><entry><title type="html">Object Type Support Added to Tiled2Unity</title><link href="/object-type-support.html" rel="alternate" type="text/html" title="Object Type Support Added to Tiled2Unity" /><published>2016-04-17T13:07:39+00:00</published><updated>2016-04-17T13:07:39+00:00</updated><id>/object-type-support</id><content type="html" xml:base="/object-type-support.html"><![CDATA[<p>This is an update I’ve been waiting awhile for. Recently, <a href="http://forum.mapeditor.org/t/tiled-0-16-0-released/1206">Tiled has been updated</a> with better support for Object Types.</p>

<div id="attachment_1186" style="width: 463px" class="wp-caption alignnone">
  <img class="size-full wp-image-1186" src="/assets/wp-content/uploads/2016/04/tiled-obj-type-ed.png" alt="Tiled Object Types Editor" width="453" height="325" srcset="/assets/wp-content/uploads/2016/04/tiled-obj-type-ed.png 453w, /assets/wp-content/uploads/2016/04/tiled-obj-type-ed-300x215.png 300w" sizes="(max-width: 453px) 100vw, 453px" />
  
  <p class="wp-caption-text">
    The new Object Types Editor in Tiled allows you create type templates with default properties. With Tiled2Unity 1.0.5.0 these types can automatically be broken up into distinct collision &#8220;layers&#8221;. Default properties can also be passed on to custom importers in Tiled2Unity.
  </p>
</div>

<p>Additionally, the Tile Collision Editor now allows you to set properties on an Object Group or Collision basis.</p>

<div id="attachment_1189" style="width: 595px" class="wp-caption alignnone">
  <img class="size-full wp-image-1189" src="/assets/wp-content/uploads/2016/04/col-ed.gif" alt="Improved Tile Collision Editor" width="585" height="389" />
  
  <p class="wp-caption-text">
    With the new Tile Collision Editor you can assign types to each rectangle, polygon, or polyline collider you add to a tile. You can even have collisions of different types on any tile.
  </p>
</div>

<p><strong>What doess this mean for Tiled2Unity?</strong> With earlier versions of the utility it could be cumbersome to manage the different collision types you have on your map. For example, say you had a map in Tiled that contained three different collision types …</p>

<p><img class="alignnone size-full wp-image-1197" src="/assets/wp-content/uploads/2016/04/cutman-level-part.png" alt="Single Tiled Layer with 3 Different Collider Types" width="512" height="480" srcset="/assets/wp-content/uploads/2016/04/cutman-level-part.png 512w, /assets/wp-content/uploads/2016/04/cutman-level-part-300x281.png 300w" sizes="(max-width: 512px) 100vw, 512px" /></p>

<p>Even though all these tiles could be easily placed on the same Tiled layer you would be forced to put them into separate layers, each with a <code class="language-plaintext highlighter-rouge">unity:layer</code> custom property on them, in order for them to be exported to Unity as separate <code class="language-plaintext highlighter-rouge">Default</code>, <code class="language-plaintext highlighter-rouge">Ladders</code>, and <code class="language-plaintext highlighter-rouge">Spikes</code> collision objects.</p>

<p>Now, with the latest Tiled and Tiled2Unity, you can simply create new types in the Object Types Editor …</p>

<div id="attachment_1203" style="width: 408px" class="wp-caption alignnone">
  <img class="size-full wp-image-1203" src="/assets/wp-content/uploads/2016/04/tiled-adding-collision-types.png" alt="Adding Object Types in Tiled" width="398" height="280" srcset="/assets/wp-content/uploads/2016/04/tiled-adding-collision-types.png 398w, /assets/wp-content/uploads/2016/04/tiled-adding-collision-types-300x211.png 300w" sizes="(max-width: 398px) 100vw, 398px" />
  
  <p class="wp-caption-text">
    Here I'm adding new object types for the kinds of colliders I'm interested in (Default, Ladders, and Spikes). The exported TMX map will result in a prefab that breaks out collider objects into these categories.
  </p>
</div>

<p>… and use those types in the Tile Collision Editor …</p>

<div id="attachment_1204" style="width: 482px" class="wp-caption alignnone">
  <img class="size-full wp-image-1204" src="/assets/wp-content/uploads/2016/04/tiled-using-types-in-collision-editor.png" alt="Setting Type in Collision Editor " width="472" height="412" srcset="/assets/wp-content/uploads/2016/04/tiled-using-types-in-collision-editor.png 472w, /assets/wp-content/uploads/2016/04/tiled-using-types-in-collision-editor-300x262.png 300w" sizes="(max-width: 472px) 100vw, 472px" />
  
  <p class="wp-caption-text">
    Through the Collision Editor we can select the ladder tile and add a collider that uses the Ladders type. Now I can use that tile on any Tile Layer and let the export process do the rest.
  </p>
</div>

<p>… and the collision tiles will be combined into <code class="language-plaintext highlighter-rouge">PolygonCollider2d</code> objects of the same type for you automatically …</p>

<div id="attachment_1205" style="width: 599px" class="wp-caption alignnone">
  <img class="size-full wp-image-1205" src="/assets/wp-content/uploads/2016/04/previewer-multiple-collision-layers.png" alt="Preview Using Object Type Colors" width="589" height="557" srcset="/assets/wp-content/uploads/2016/04/previewer-multiple-collision-layers.png 589w, /assets/wp-content/uploads/2016/04/previewer-multiple-collision-layers-300x284.png 300w" sizes="(max-width: 589px) 100vw, 589px" />
  
  <p class="wp-caption-text">
    Here you can see how the tiles are combined with other colliders of the same type. Note you will need to make Tiled2Unity aware of your Object Types XML file in order to use the same color scheme you set in Tiled.
  </p>
</div>

<p>This is done without the need for a custom <code class="language-plaintext highlighter-rouge">unity:layer</code> property. Note that the <code class="language-plaintext highlighter-rouge">unity:layer</code> property is still obeyed however if used. This is useful if you have a special Tile Layer that you want to force into a particular collision type.</p>

<p>Note that in order to see the collision type colors in the previewer that you will need to point Tiled2Unity to an Object Types XML file. I suggest you export that file (from the Object Types Editor in Tiled) to the same folder you keep your maps in and keep it updated.</p>

<div id="attachment_1206" style="width: 636px" class="wp-caption alignnone">
  <img class="size-full wp-image-1206" src="/assets/wp-content/uploads/2016/04/t2u-object-types-xml.png" alt="Object Types XML in Tiled2Unity" width="626" height="472" srcset="/assets/wp-content/uploads/2016/04/t2u-object-types-xml.png 626w, /assets/wp-content/uploads/2016/04/t2u-object-types-xml-300x226.png 300w" sizes="(max-width: 626px) 100vw, 626px" />
  
  <p class="wp-caption-text">
    You only need to set the Object Types XML file if you a) Want to see object type colors in the Previewer or b) You have default object property settings you want passed on to custom importers in your Unity project during export.
  </p>
</div>

<h2 id="default-object-type-properties-exported-too">Default Object Type Properties Exported Too</h2>

<p>Many users won’t need to worry about setting the Object Types XML when exporting their Tiled maps. However, if you want default properties to be exported with any Tile Objects to be consumed by a Custom Importer then you will need this setting.</p>

<p><strong>Note:</strong> For Tiled2UnityLite users (Mac and Linux) you will want to pass the path to your Object Types XML as a command line option. For example:</p>

<p><code class="language-plaintext highlighter-rouge">Tiled2UnityLite.cs &lt;span style="color: #333399;"&gt;-o=/Your/Path/To/objecttypes.xml&lt;/span&gt; $TMXPATH $UNITYDIR</code></p>

<p><code class="language-plaintext highlighter-rouge">Tiled2UnityLite.cs &lt;span style="color: #333399;"&gt;--object-type-xml=/Your/Path/To/objecttypes.xml&lt;/span&gt; $TMXPATH $UNITYDIR</code></p>

<h2 id="bug-reports-always-welcome">Bug Reports Always Welcome</h2>

<p>I like to think I do a pretty good job of testing new features added to Tiled2Unity, but, because of reasons, the magnitude of this update is larger than normal. If you experience odd behavior or a fatal crash please send me an email so I can be aware of it.</p>]]></content><author><name>Seanba</name></author><category term="Uncategorized" /><summary type="html"><![CDATA[This is an update I’ve been waiting awhile for. Recently, Tiled has been updated with better support for Object Types.]]></summary></entry><entry><title type="html">Convex Polygon Collider Support in Tiled2Unity</title><link href="/convex-polygons.html" rel="alternate" type="text/html" title="Convex Polygon Collider Support in Tiled2Unity" /><published>2016-02-07T14:48:58+00:00</published><updated>2016-02-07T14:48:58+00:00</updated><id>/convex-polygons</id><content type="html" xml:base="/convex-polygons.html"><![CDATA[<p><img class="alignnone size-full wp-image-1150" src="/assets/wp-content/uploads/2016/02/convex-polygons.png" alt="Convex Polygons" width="640" height="178" srcset="/assets/wp-content/uploads/2016/02/convex-polygons.png 640w, /assets/wp-content/uploads/2016/02/convex-polygons-300x83.png 300w" sizes="(max-width: 640px) 100vw, 640px" /></p>

<p>I’ve said this before but I think the single best feature in Tiled2Unity is the <code class="language-plaintext highlighter-rouge">PolygonCollider2D</code> instances that are created from Tiled layers, where the colliders on each tile are merged into one big polygon. Concave edges? Holes? Not a problem.</p>

<div id="attachment_1154" style="width: 535px" class="wp-caption alignnone">
  <img class="size-full wp-image-1154" src="/assets/wp-content/uploads/2016/02/wbml-concave-holes.png" alt="Wonder Boy in Monster World, Concave Colliders" width="525" height="333" srcset="/assets/wp-content/uploads/2016/02/wbml-concave-holes.png 525w, /assets/wp-content/uploads/2016/02/wbml-concave-holes-300x190.png 300w" sizes="(max-width: 525px) 100vw, 525px" />
  
  <p class="wp-caption-text">
    In this scene from Wonder Boy in Monster World, the room colliders are just one big polygon with concave edges and a hole in the middle. It's a great way to represent the collisions but some code may not work with it.
  </p>
</div>

<p>However, some users would like to use the <code class="language-plaintext highlighter-rouge">PolygonCollider2D</code> instances created by Tiled2Unity and feed them into another Unity script or plugin that performs pathfinding, or real-time lighting, or whatever. The problem is, these other plugins commonly only work with polygons that are convex.</p>

<p>And by the way, if that’s a plugin you <em>bought</em> with actual <em>money</em> from the <a href="https://www.assetstore.unity3d.com/">Unity Asset Store</a> then I think that’s weak sauce. Tell those guys to fix their tools!</p>

<p>But I digress … with the latest Tiled2Unity version you can now set an option to have <strong>only convex polygons exported</strong>.</p>

<p><img class="alignnone size-full wp-image-1157" src="/assets/wp-content/uploads/2016/02/t2u-convex-checkbox.png" alt="Convex Polygon Option" width="572" height="104" srcset="/assets/wp-content/uploads/2016/02/t2u-convex-checkbox.png 572w, /assets/wp-content/uploads/2016/02/t2u-convex-checkbox-300x55.png 300w" sizes="(max-width: 572px) 100vw, 572px" /></p>

<p><strong>Note:</strong> Convex polygon output can be also be set through the <code class="language-plaintext highlighter-rouge">-c</code> or <code class="language-plaintext highlighter-rouge">--convex</code> options for those of you using the command line.</p>

<p>This will increase the number of <code class="language-plaintext highlighter-rouge">PolygonCollider2D</code> components in your Tiled prefabs but through the <a href="https://www8.cs.umu.se/kurser/TDBA77/VT06/algorithms/BOOK/BOOK5/NODE194.HTM">Hertel-Mehlhorn Algorithm</a> I’ve made that number “reasonably” low. For most cases I’d be surprised if there was a noticeable change in performance.</p>

<div id="attachment_1158" style="width: 535px" class="wp-caption alignnone">
  <img class="size-full wp-image-1158" src="/assets/wp-content/uploads/2016/02/wbml-convex.png" alt="Wonder Boy in Monster World, Convex Polygons" width="525" height="333" srcset="/assets/wp-content/uploads/2016/02/wbml-convex.png 525w, /assets/wp-content/uploads/2016/02/wbml-convex-300x190.png 300w" sizes="(max-width: 525px) 100vw, 525px" />
  
  <p class="wp-caption-text">
    With the Convex Polygon Colliders option enabled we have replaced the one &#8220;complex&#8221; polygon with seven convex polygons. This is an increase in prefab complexity but at least we can use it with other scripts that are limited to convex polygons.
  </p>
</div>

<h2 id="different-ways-to-set-convex-polygon-output">Different Ways to Set Convex Polygon Output</h2>

<p>There is some flexibility when it comes to enabling convex polygon exporting:</p>

<ul>
  <li><strong>Tiled2Unity Utility:</strong> Either use the <code class="language-plaintext highlighter-rouge">Convex Polygon Colliders</code> checkbox in the Win32 utility or use the <code class="language-plaintext highlighter-rouge">-c|--convex</code> command line option. This will be the preferred setting for exporting polygons for all maps.</li>
  <li><strong>Tiled Map:</strong> Add a property named <code class="language-plaintext highlighter-rouge">unity:convex</code> to your Map Properties in Tiled set to <code class="language-plaintext highlighter-rouge">true</code> or <code class="language-plaintext highlighter-rouge">false</code>. This will be the preferred setting for all the layers in your map and will override the setting from the Tiled2Unity utility.</li>
  <li><strong>Tiled Layer:</strong> Add the <code class="language-plaintext highlighter-rouge">unity:convex</code> property to your Layer Properties. This will be the final word on how the polygons in your layer will be exported, overriding the map and utility preferences.</li>
</ul>

<p><img class="alignnone size-full wp-image-1160" src="/assets/wp-content/uploads/2016/02/tiled-convex-properties.png" alt="Convex Properties in Tiled Map File" width="555" height="398" srcset="/assets/wp-content/uploads/2016/02/tiled-convex-properties.png 555w, /assets/wp-content/uploads/2016/02/tiled-convex-properties-300x215.png 300w" sizes="(max-width: 555px) 100vw, 555px" /></p>

<p><strong>Make sure to keep these precedence rules in mind.</strong> If you set <code class="language-plaintext highlighter-rouge">unity:convex</code> to <code class="language-plaintext highlighter-rouge">true</code> or <code class="language-plaintext highlighter-rouge">false</code> in a Tiled layer, for instance, then this will always be obeyed, no matter how you “prefer” to export maps in the Tiled2Unity Utility.</p>

<p>As always (and especially with a new feature such as this) you can email me any bugs you come across and I’ll find the spare time to address them. Just be aware a full-time game development which slows me down at times. 🙂</p>

<p><em>Special thanks go to the <a href="https://github.com/zzzzrrr/poly2tri">Poly2Tri contributors</a>. Their polygon triangulation library came in handy for this feature.</em></p>]]></content><author><name>Seanba</name></author><category term="Uncategorized" /><summary type="html"><![CDATA[Tiled2Unity can now export polygons that are strictly convex.]]></summary></entry><entry><title type="html">Introducing Tiled2UnityLite with Support for OSX/Linux</title><link href="/introducing-tiled2unitylite.html" rel="alternate" type="text/html" title="Introducing Tiled2UnityLite with Support for OSX/Linux" /><published>2015-12-31T19:15:17+00:00</published><updated>2015-12-31T19:15:17+00:00</updated><id>/introducing-tiled2unitylite</id><content type="html" xml:base="/introducing-tiled2unitylite.html"><![CDATA[<p><strong>Update:</strong> Tiled2UnityMac is now available (as of version 1.0.7.0) for Mac OS X with a full-fledged GUI.</p>

<p><img class="alignnone size-full wp-image-1071" src="/assets/wp-content/uploads/2015/12/tiled2unitylite.cs_.png" alt="Tiled2UnityLite" width="616" height="372" srcset="/assets/wp-content/uploads/2015/12/tiled2unitylite.cs_.png 616w, /assets/wp-content/uploads/2015/12/tiled2unitylite.cs_-300x181.png 300w" sizes="(max-width: 616px) 100vw, 616px" /></p>

<p><strong>Happy New Year’s Eve!</strong></p>

<p>Over the holidays I decided I was finally going to do <em>something</em> about helping our friends on OSX and Linux systems get Tiled2Unity working within their development environments. I’m now happy to say that a command-line version of Tiled2Unity (named Tiled2UnityLite) is now available that gives any platform running <a href="http://www.mono-project.com/docs/getting-started/install/mac/">Mono</a> and <a href="http://www.csscript.net/">CS-Script</a> the capability of exporting Tiled maps into Unity.</p>

<p><strong>Don’t let the name fool you: </strong> The ‘Lite’ part simply means there is no GUI like in Tiled2Unity proper. You still get the exporting options we’ve been enjoying on Windows for some time now. The only thing you’re <em>really</em> missing is the previewer in the Tiled2Unity GUI but I suspect that feature isn’t used all that much anyhow.</p>

<div id="attachment_1103" style="width: 592px" class="wp-caption alignnone">
  <a href="/assets/wp-content/uploads/2015/12/t2u-previwer-mother-brain.png" rel="attachment wp-att-1103"><img class="size-full wp-image-1103" src="/assets/wp-content/uploads/2015/12/t2u-previwer-mother-brain.png" alt="Tiled2Unity Previewer" width="582" height="353" srcset="/assets/wp-content/uploads/2015/12/t2u-previwer-mother-brain.png 582w, /assets/wp-content/uploads/2015/12/t2u-previwer-mother-brain-300x182.png 300w" sizes="(max-width: 582px) 100vw, 582px" /></a>
  
  <p class="wp-caption-text">
    The Tiled2Unity Previewer takes great screenshots but once your map is set up for rapid edit-and-export it becomes less useful.
  </p>
</div>

<p>A benefit of Tiled2UnityLite is that it is distributed <em>as a single C# file.</em> This makes it useful for making Tiled2UnityLite part of an automated build pipeline as well.</p>

<p>Below I explain how I got Tiled2UnityLite to run from Tiled Map Editor on a MacBook running Yosemite. Eventually, the goal is to have it set up where you <strong>press F5 to automatically export TMX files to Unity</strong>. This can be a (one-time) pain for some depending on how comfortable they are with environment variables and shell scripting. (I’m by no means an OSX power user so if someone comes up with better instructions I’ll be happy to post them.)</p>

<p><strong>The main gist is this</strong>:</p>

<ul>
  <li>Install Mono (Windows users don’t need to do this, nor invoke <code class="language-plaintext highlighter-rouge">mono</code> on the command line)</li>
  <li>Install CS-Script</li>
  <li>Download Tiled2UnityLite.cs</li>
  <li>Run a command from the terminal that runs <code class="language-plaintext highlighter-rouge">Tiled2UnityLite.cs</code> through CS-Script</li>
</ul>

<p>The command should resolve to something like this:</p>

<pre class="brush: plain; title: ; notranslate" title="">mono cscs.exe Tiled2UnityLite.cs YourMap.tmx YourProject/Assets/Tiled2Unity

</pre>

<h2 id="installing-mono">Installing Mono</h2>

<p>Just go to <a href="http://www.mono-project.com/docs/getting-started/install/mac/">the Mono website</a> and follow their instructions. Piece of cake.</p>

<h2 id="installing-cs-script">Installing CS-Script</h2>

<p>CS-Script is a clever utility that allows you to use C# <em>as a scripting language</em>. Time was I used Ruby for all my scripting needs but I find myself writing C# and executing it at runtime through CS-Script more and more now. It’s a great tool — and it’s the key to having Tiled2UnityLite work on systems I hadn’t planned on supporting.</p>

<p>However, I did have some difficultly getting CS-Script running on OSX. This is likely due to my weak sauce Mac-fu but perhaps my instructions will be of help to others anyhow (El Capitan users and others wanting to install CS-Script to a directory of their choosing <strong>see import update below</strong>):</p>

<ul>
  <li>Download CS-Script <a href="http://www.csscript.net/CurrentRelease.html">from their website</a></li>
  <li>Unzip, rename folder from <code class="language-plaintext highlighter-rouge">cs-script</code> to <code class="language-plaintext highlighter-rouge">CS-Script</code> and copy folder to <code class="language-plaintext highlighter-rouge">usr/share/</code>
    <ul>
      <li>The CS-Script executable should be as this location: <code class="language-plaintext highlighter-rouge">/usr/share/CS-Script/cscs.exe</code></li>
    </ul>
  </li>
  <li>Give <code class="language-plaintext highlighter-rouge">usr/share/CS-Script</code> execute and write permissions
    <ul>
      <li>In the terminal: <code class="language-plaintext highlighter-rouge">sudo chmod 777 /usr/share/CS-Script</code></li>
    </ul>
  </li>
</ul>

<p>I also needed to update my <code class="language-plaintext highlighter-rouge">.bash_profile</code> file so that CS-Script was in my PATH:</p>

<pre class="brush: plain; title: ; notranslate" title="">export CSSCRIPT_DIR=/usr/share/CS-Script
export PATH=$PATH:$CSSCRIPT_DIR</pre>

<p>At this point you should be able to run CS-Script from the terminal:</p>
<pre class="brush: plain; title: ; notranslate" title="">mono $CSSCRIPT_DIR/cscs.exe -v

C# Script execution engine. Version 3.9.20.0.
Copyright (C) 2004-2014 Oleg Shilo. www.csscript.net

   CLR:            4.0.30319.17020
   System:         Unix 14.0.0.0
   Architecture:   x86
   Home dir:       /usr/share/CS-Script
</pre>

<p>With that achieved we’re ready to run C# files as a script.</p>

<p><span style="color: #ff0000;"><strong>Update for El Capitan users:</strong></span> The directions above won’t exactly work because El Capitan does not allow write access to <code class="language-plaintext highlighter-rouge">/usr/share</code>. Try these modified steps as a work-around:</p>

<ul>
  <li>Install CS-Script to this location instead: <code class="language-plaintext highlighter-rouge">/usr/local/CS-Script</code></li>
  <li>Add this to your .bash_profile: <code class="language-plaintext highlighter-rouge">export css_nuget=/usr/local/CS-Script/nuget</code></li>
  <li>(Actually, these directions should allow you to install CS-Script anywhere.)</li>
</ul>

<h2 id="download-and-run-tiled2unitylite">Download and Run Tiled2UnityLite</h2>

<p>You can download Tiled2UnityLite from the <a href="/tiled2unity/">Tiled2Unity download page</a> as a separate zip. This zip contains two files:</p>

<ul>
  <li><code class="language-plaintext highlighter-rouge">Tiled2Unity.unityproject</code> - Include this package in your Unity project.</li>
  <li><code class="language-plaintext highlighter-rouge">Tiled2UnityLite.cs</code> - The C# file that contains all the Tiled2Unity source, all 10,000+ lines of it, with all the Windows-specific stuff excised out.</li>
</ul>

<p>Go to the directory you’ve unzipped Tiled2UnityLite.cs to and run the help command on our script.</p>

<pre class="brush: plain; title: ; notranslate" title="">mono $CSSCRIPT_DIR/cscs.exe Tiled2UnityLite.cs --help

Tiled2UnityLite Utility, Version: 1.0.1.0
Usage: Tiled2UnityLite [OPTIONS]+ TMXPATH [UNITYDIR]
Example: Tiled2UnityLite -s=0.01 MyTiledMap.tmx ../../MyUnityProject/Assets/Tiled2Unity

Options:
  -s, --scale=VALUE          Scale the output vertices by a value.
                               A value of 0.01 is popular for many Unity 
                               projects that use 'Pixels Per Unit' of 100 for 
                               sprites.
                               Default is 1 (no scaling).
  -t, --texel-bias=VALUE     Bias for texel sampling.
                               Texels are offset by 1 / value.
                               Default value is 8192.
                                A value of 0 means no bias.
  -v, --verbose              Print verbose messages.
  -h, --help                 Display this help message.

Prefab object properties (set in TMX file for each layer/object)
  unity:sortingLayerName
  unity:sortingOrder
  unity:layer
  unity:tag
  unity:scale
  unity:isTrigger
  unity:ignore (value = [false|true|collision|visual])
  unity:resource
  (Other properties are exported for custom scripting in your Unity project)
</pre>

<p>Once your environment is configured to run Tiled2UnityLite like this then you are ready to export Tiled maps directly from Tiled Map Editor into your Unity project using the Execute Command GUI.</p>

<p><img class="alignnone size-full wp-image-1089" src="/assets/wp-content/uploads/2015/12/tiled-mac-commands.png" alt="Tiled Command Editor" width="620" height="193" srcset="/assets/wp-content/uploads/2015/12/tiled-mac-commands.png 620w, /assets/wp-content/uploads/2015/12/tiled-mac-commands-300x93.png 300w" sizes="(max-width: 620px) 100vw, 620px" /></p>

<pre class="brush: plain; title: ; notranslate" title="">/bin/sh /MyPath/tiled2unitylite.sh %mapfile /MyProject/Assets/Tiled2Unity
</pre>

<p>You’ll notice I decided to run a shell script from Tiled when exporting to Unity. I’ll explain that a bit below but for now the command I use in Tiled is broken up into a number of parts:</p>

<ol>
  <li><code class="language-plaintext highlighter-rouge">/bin/sh</code> This tells the operating system we’ll be running a shell script.</li>
  <li><code class="language-plaintext highlighter-rouge">/My/Path/tiled2unitylite.sh</code> This is the path to the shell script that will be running Tiled2UnityLite.cs through CS-Script with the arguments that follow. I use a shell script because I need a bit of help controlling the environment variables of the system (they are different when you launch an app as opposed to using the terminal).</li>
  <li><code class="language-plaintext highlighter-rouge">%mapfile</code> Tiled will replace this with the full path of the TMX file currently in focus.</li>
  <li><code class="language-plaintext highlighter-rouge">/MyProject/Assets/Tiled2Unity</code> The path to the Tiled2Unity folder in the Unity project you want to export to.</li>
</ol>

<p>The <code class="language-plaintext highlighter-rouge">tiled2unitylite.sh</code> shell script is pretty standard fare:</p>

<pre class="brush: bash; title: ; notranslate" title="">#!/bin/sh

THIS_DIR=`dirname $0`
pushd $THIS_DIR &gt; /dev/null 2&gt;&amp;1

CSSCRIPT_DIR=/usr/share/CS-Script
mono $CSSCRIPT_DIR/cscs.exe -nl Tiled2UnityLite.cs "$@" &amp;&gt; tiled2unitylite.log

popd &gt; /dev/null 2&lt;&amp;1</pre>

<p>You’ll note that I’m redirecting the output from <code class="language-plaintext highlighter-rouge">Tiled2UnityLite.cs</code> into a <code class="language-plaintext highlighter-rouge">tiled2unitylite.log</code> file (<em>Quick note: You will have to create this log file before running the script</em>). This helps me track down any errors that may be reported. I use the the <code class="language-plaintext highlighter-rouge">tail</code> command in another terminal so that I can track export progress in real time.</p>

<pre class="brush: plain; title: ; notranslate" title="">tail -f tiled2unitylite.log</pre>

<p>With everything finally configured I’m able to, on a Mac, press F5 to export a Tiled map into Unity. Here’s a quick example from one of my most cherished memories in gaming history that old school gamers will quickly recognize.</p>

<div id="attachment_1097" style="width: 630px" class="wp-caption alignnone">
  <a href="/assets/wp-content/uploads/2015/12/mother-brain-tiled.png" rel="attachment wp-att-1097"><img class="size-full wp-image-1097" src="/assets/wp-content/uploads/2015/12/mother-brain-tiled.png" alt="Mother Brain Lair in Tiled" width="620" srcset="/assets/wp-content/uploads/2015/12/mother-brain-tiled.png 1090w, /assets/wp-content/uploads/2015/12/mother-brain-tiled-300x165.png 300w, /assets/wp-content/uploads/2015/12/mother-brain-tiled-768x423.png 768w, /assets/wp-content/uploads/2015/12/mother-brain-tiled-1024x564.png 1024w" sizes="(max-width: 1090px) 100vw, 1090px" /></a>
  
  <p class="wp-caption-text">
    In Tiled, I can press F5 to execute a command on the currently loaded map. In this example that command will export the map, through Tiled2UnityLite, to my Unity project.
  </p>
</div>

<div id="attachment_1098" style="width: 630px" class="wp-caption alignnone">
  <a href="/assets/wp-content/uploads/2015/12/mother-brain-unity.png" rel="attachment wp-att-1098"><img class="size-full wp-image-1098" src="/assets/wp-content/uploads/2015/12/mother-brain-unity.png" alt="Mother Brain Lair - Unity" width="620" srcset="/assets/wp-content/uploads/2015/12/mother-brain-unity.png 1371w, /assets/wp-content/uploads/2015/12/mother-brain-unity-300x163.png 300w, /assets/wp-content/uploads/2015/12/mother-brain-unity-768x418.png 768w, /assets/wp-content/uploads/2015/12/mother-brain-unity-1024x557.png 1024w" sizes="(max-width: 1371px) 100vw, 1371px" /></a>
  
  <p class="wp-caption-text">
    Once exported to Unity, I can put the constructed prefab into my scene. As you can see, the tile layers and colliders have been successfully imported.
  </p>
</div>

<h2 id="now-accepting-donations-for-tiled2unity-development">Now Accepting Donations for Tiled2Unity Development</h2>

<p>Perhaps this is hard to believe but pleased Tiled2Unity users do ask if they could thank me for this tool by making a small monetary contribution. In the past I’ve asked them to support the <a href="https://www.patreon.com/bjorn?ty=h">Tiled Map Editor Patreon</a> instead (<strong>which is still a priority, support that first!</strong>) but I do believe that Tiled2Unity has now matured into a valuable piece of software. <strong>Tiled2Unity will always be free</strong> but if you’d like to send a small gift my way <a href="/donate/">I will accept it</a> with pride and appreciation.</p>

<p>And on a personal note, with the new year just a few hours away, I wish you all an enjoyable and <em>productive</em> 2016. Have fun and keep working on your game.</p>]]></content><author><name>Seanba</name></author><category term="Uncategorized" /><summary type="html"><![CDATA[Update: Tiled2UnityMac is now available (as of version 1.0.7.0) for Mac OS X with a full-fledged GUI.]]></summary></entry><entry><title type="html">Improved Animations and Tile Objects in Tiled2Unity</title><link href="/animations-and-tile-objects.html" rel="alternate" type="text/html" title="Improved Animations and Tile Objects in Tiled2Unity" /><published>2015-12-26T21:26:01+00:00</published><updated>2015-12-26T21:26:01+00:00</updated><id>/animations-and-tile-objects</id><content type="html" xml:base="/animations-and-tile-objects.html"><![CDATA[<p>Hi there and Happy Holidays. I got some glorious free time this Christmas break to finalize a couple of improvements I’ve been working on for Tiled2Unity.</p>

<p>As always, you can find the <a href="/tiled2unity/">latest version of Tiled2Unity here</a>.</p>

<h2 id="tile-animation-performance">Tile Animation Performance</h2>

<p>I’ve long been embarrassed at how I had originally supported tile animations from <a href="http://www.mapeditor.org/">Tiled Map Editor</a>. It was a hack that manipulated vertex data at runtime which was a) slow and b) caused garbage collection spikes as vertex and index buffers were be allocated on the fly. Tiled2Unity now controls animation through enabling and disabling <code class="language-plaintext highlighter-rouge">MeshRenderer</code> instances. It’s cheap and simple.</p>

<p>I’ve added a new scene to the <a href="/megadadadventures/.html">Mega Dad example suite</a> that shows off tile animations while revisiting our old NES friend, <a href="https://en.wikipedia.org/wiki/Mega_Man_2">Mega Man 2</a>.</p>

<div id="attachment_1009" style="width: 522px" class="wp-caption alignnone">
  <img class="size-full wp-image-1009" src="/assets/wp-content/uploads/2015/12/flashman-animated.gif" alt="Here I've recreated Flashman's lair from Mega Man 2. The tile animations were made in Tiled and are exported to Unity without any additional work needed. It's meant to be quick and easy." width="512" height="448" />
  
  <p class="wp-caption-text">
    Here I've recreated Flashman's lair from Mega Man 2. The tile animations were made in Tiled and are exported to Unity without any additional work needed. It's meant to be quick and easy.
  </p>
</div>

<p><strong>Note:</strong> You can find this example (and others) <a href="https://github.com/Seanba/Tiled2Unity-MegaDad">on GitHub</a> to see how I use Tiled2Unity. All examples have been upgraded to the latest version of Tile2Unity.</p>

<h2 id="tile-objects-now-supported">Tile Objects Now Supported</h2>

<p>Sometimes you want a single tile placed in your map without the hassle of having it as part of a Tile Layer. These Tile Objects were being exported as a simple transform (no visual tile) with earlier versions of Tiled2Unity. Now they are fully supported.</p>

<div id="attachment_1013" style="width: 219px" class="wp-caption alignnone">
  <img class="size-full wp-image-1013" src="/assets/wp-content/uploads/2015/12/tiled-object-layer.png" alt="Tiled Object Layer" width="209" height="142" />
  
  <p class="wp-caption-text">
    Object Layers are a good way to add extra, level-specific images and tags to your map without managing a whole Tile Layer.
  </p>
</div>

<div class="mceTemp">
</div>

<div id="attachment_1023" style="width: 360px" class="wp-caption alignnone">
  <img class="size-full wp-image-1023" src="/assets/wp-content/uploads/2015/12/tiled-insert-tile-object.png" alt="Tile Object" width="350" height="94" srcset="/assets/wp-content/uploads/2015/12/tiled-insert-tile-object.png 350w, /assets/wp-content/uploads/2015/12/tiled-insert-tile-object-300x81.png 300w" sizes="(max-width: 350px) 100vw, 350px" />
  
  <p class="wp-caption-text">
    Objects are generally exported as colliders by Tiled2Unity but the Tile Object is a special type that lets you place a single tile anywhere in your map. Colliders on that Tile Object are also exported.
  </p>
</div>

<h2 id="some-caveats">Some Caveats</h2>

<p>This was a significant change to Tiled2Unity compared to earlier updates. Here are some things to be aware of:</p>

<ul>
  <li><strong>Unity 4.x support has been removed.</strong> Sorry, but supporting older versions of Unity has become unwieldy. For what it’s worth, Sony and Microsoft (and I suspect Nintendo too) are phasing out support for Unity 4.x as well.</li>
  <li><strong>Prefab <code class="language-plaintext highlighter-rouge">GameObject</code> heirarchy has been changed.</strong> In order to better support animations and object rotation and scaling I have changed how Tiled2Unity prefabs are constructed. You may have some scripts that were taking for granted a particular parent-child relationship that will need to be updated. (I recommend using tags to avoid issues like this in the future, not just when using Tiled2Unity, but as a general rule.)</li>
</ul>

<div class="orange-box" style="margin-bottom: 1em;">
  <strong>Reminder</strong>: Tiled Map Editor has been totally free for years now. Please consider contributing to <a title="Tiled Map Editor on Patreon" href="https://www.patreon.com/bjorn" rel="Tiled Map Editor on Patreon">Thorbjorn Lindeijer’s Patreon</a> for continued <a title="Tiled Map Editor" href="http://www.mapeditor.org/" rel="Tiled Map Editor">Tiled Map Editor</a> support.
</div>]]></content><author><name>Seanba</name></author><category term="Uncategorized" /><summary type="html"><![CDATA[Hi there and Happy Holidays. I got some glorious free time this Christmas break to finalize a couple of improvements I’ve been working on for Tiled2Unity.]]></summary></entry><entry><title type="html">Retrieving Tile Information at Runtime with Tiled2Unity</title><link href="/getting-tile-information.html" rel="alternate" type="text/html" title="Retrieving Tile Information at Runtime with Tiled2Unity" /><published>2015-09-20T11:44:36+00:00</published><updated>2015-09-20T11:44:36+00:00</updated><id>/getting-tile-information</id><content type="html" xml:base="/getting-tile-information.html"><![CDATA[<p>If you are building a strategy or RPG style game then there’s a strong chance that you need to get at specific information about each tile placed in the world. Unlike platformers, where tiles are decoration, each tile is an important part of your game logic. In this post I’ll show you two techniques to easily add such support to your Tiled2Unity projects.</p>

<p>Which approach you take will depend on the specific needs of your game measured against performance and memory usage. In my opinion, a good rule of thumb is to ask if your game is more like <a href="https://en.wikipedia.org/wiki/Advance_Wars">Advance Wars</a> and <a href="https://en.wikipedia.org/wiki/Fire_Emblem_(video_game)">Fire Emblem</a> (use <code class="language-plaintext highlighter-rouge">GameObject</code> approach) or more like <a href="https://en.wikipedia.org/wiki/Final_Fantasy">Final Fantasy</a> and <a href="https://en.wikipedia.org/wiki/Dragon_Quest">Dragon Warrior</a> (use <code class="language-plaintext highlighter-rouge">PolygonCollider2D</code> approach).</p>

<h2 id="tiled-automapping-feature">Tiled Automapping Feature</h2>

<p>Both approaches make use of the powerful, yet regrettably arcane, <a href="https://github.com/bjorn/tiled/wiki/Automapping">automapping capabilities of Tiled</a>. I recommend boning up on this feature as a prerequisite, and not just for this exercise. You will likely use this feature extensively once you understand how to create automapping rules for your Tiled maps.</p>

<p><strong>Note:</strong> If you’re having a hard time figuring out how to use automapping, <a href="https://www.youtube.com/watch?v=UUi0lD1pxyQ">I found this video to be helpful</a> in making sense of it all. It’s 10 minutes well spent.</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/UUi0lD1pxyQ" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe>

<h2 id="example-projectfiles">Example Project Files</h2>

<p>Tiled map files and C# source used in these examples is <a href="https://github.com/Seanba/Tiled2Unity-TileInfoExample">available on GitHub</a> as a Unity project that you can run and experiment with yourself.</p>

<h2 id="tileobject-approach-strategy-games">TileObject Approach (Strategy Games)</h2>

<p>Turn-based strategy and board game style games typically require each tile on a map to be a central part of the gaming logic. Each tile instance, although similar to others of the same “type” has to know where it is on the board as well as manage other game state (say, which units are standing on it, or how it influences other tiles or sprites around it). This is best handled in Unity by having each separate tile be associated with a <code class="language-plaintext highlighter-rouge">GameObject</code> made up of <code class="language-plaintext highlighter-rouge">Component</code>s unique to the game you are making.</p>

<p>To achieve this we’ll have our Tiled map automatically generate <code class="language-plaintext highlighter-rouge">Tile Object</code>s that, when imported, are consumed by a custom importer script. During this custom import step we will attach <code class="language-plaintext highlighter-rouge">GameObject</code>s to our map prefab that is simply placed into a scene to do it’s job.</p>

<p>For this example I’ll use Fire Emblem as inspiration. Here’s the map from the first chapter of that game in Tiled:</p>

<p><a href="/assets/wp-content/uploads/2015/09/fe-chapter-1.png"><img class="alignnone size-full wp-image-959" src="/assets/wp-content/uploads/2015/09/fe-chapter-1.png" alt="Fire Emblem (GBA)" width="489" height="330" srcset="/assets/wp-content/uploads/2015/09/fe-chapter-1.png 489w, /assets/wp-content/uploads/2015/09/fe-chapter-1-300x202.png 300w" sizes="(max-width: 489px) 100vw, 489px" /></a></p>

<p>For now, I’ll focus on the trees. What we want to do in Tiled is set up a rule that will place an object with custom properties on it in an output layer every time it sees a tree tile as input:</p>

<div id="attachment_961" style="width: 510px" class="wp-caption alignnone">
  <a href="/assets/wp-content/uploads/2015/09/fe-rule-diagram.png"><img class="size-full wp-image-961" src="/assets/wp-content/uploads/2015/09/fe-rule-diagram.png" alt="Rule for tree file" width="500" height="175" srcset="/assets/wp-content/uploads/2015/09/fe-rule-diagram.png 500w, /assets/wp-content/uploads/2015/09/fe-rule-diagram-300x105.png 300w" sizes="(max-width: 500px) 100vw, 500px" /></a>
  
  <p class="wp-caption-text">
    Working with automapping rules in Tiled at first can seem tricky. See fe-rules.tmx in the example files to see how I'm setting up rules for the Fire Emblem example.
  </p>
</div>

<p>Applying that rule you can see how a <code class="language-plaintext highlighter-rouge">Tiled Object</code> was placed upon every tree tile in the map:</p>

<div id="attachment_965" style="width: 500px" class="wp-caption alignnone">
  <img class="size-full wp-image-965" src="/assets/wp-content/uploads/2015/09/fe-chapter-1-objects.png" alt="Tiled Objects added to map" width="490" height="330" srcset="/assets/wp-content/uploads/2015/09/fe-chapter-1-objects.png 490w, /assets/wp-content/uploads/2015/09/fe-chapter-1-objects-300x202.png 300w" sizes="(max-width: 490px) 100vw, 490px" />
  
  <p class="wp-caption-text">
    Once our automapping rule is created we see that objects are automatically added to our map.
  </p>
</div>

<p>Upon export into our Unity project, those objects are added to the map prefab as Unity <code class="language-plaintext highlighter-rouge">GameObject</code>s. There isn’t much to them originally besides a <code class="language-plaintext highlighter-rouge">BoxCollider2D</code> so that’s where our custom import script will come in.</p>

<pre class="brush: csharp; title: ; notranslate" title="">[Tiled2Unity.CustomTiledImporter]
public class CustomImporter_StrategyTiles : Tiled2Unity.ICustomTiledImporter
{
    public void HandleCustomProperties(GameObject gameObject,
        IDictionary&lt;string, string&gt; customProperties)
    {
        if (customProperties.ContainsKey("Terrain"))
        {
            // Add the terrain tile game object
            StrategyTile tile = gameObject.AddComponent&lt;StrategyTile&gt;();
            tile.TileType = customProperties["Terrain"];
            tile.TileNote = customProperties["Note"];
        }
    }

    public void CustomizePrefab(GameObject prefab)
    {
        // Do nothing
    }
}
</pre>

<p>The <code class="language-plaintext highlighter-rouge">CustomImporter_StrategyTiles.HandleCustomProperties</code> method is invoked for every <code class="language-plaintext highlighter-rouge">Tiled Object</code> in our map file. As you can see from the code above we are looking for the custom properties we’ve added to our Tiled map and, once found, we shove them into a custom component to be used by our game.</p>

<p>After filling out our automapping rules for all other tile types (mountains, water, grass, etc..) and re-exporting we now have a prefab, fully constructed by Tiled2Unity, that has unique data associated with every tile. In the example provided, I simply do a raycast off of mouse button click to find out which tile we’ve “selected”. I also keep a count of how many times you’ve clicked on that tile to demonstrate that game state is kept on a per-tile basis.</p>

<div id="attachment_972" style="width: 514px" class="wp-caption alignnone">
  <img class="size-full wp-image-972" src="/assets/wp-content/uploads/2015/09/fe-chapter-1-unity.png" alt="Fire Emblem tiles in Unity" width="504" height="343" srcset="/assets/wp-content/uploads/2015/09/fe-chapter-1-unity.png 504w, /assets/wp-content/uploads/2015/09/fe-chapter-1-unity-300x204.png 300w" sizes="(max-width: 504px) 100vw, 504px" />
  
  <p class="wp-caption-text">
    In the example demo, you can click on any tile and see what game state data is associated with it. Here, the game state is simply the number of times each tile has been selected.
  </p>
</div>

<p><strong>Word of warning</strong>: Keep in mind that in this example we are (automatically) creating an object for every single tile placed in Tiled. This works well for games with smaller maps where you’ll have on the order of several hundred such objects. However, for larger maps the number of game objects in your scene could easily affect memory and performance. Remember that a 256×256 map will have 65,536 such objects which is likely too much complexity for Unity projects.</p>

<h2 id="polygoncollider2d-approach-rpg-games">PolygonCollider2D Approach (RPG Games)</h2>

<p>In RPG style games we are often more concerned by the “type” of tile our player is standing on as opposed to the exact tile instance. (In other words, we want to know if the player is in a forest, but we don’t care about a specific tree.)</p>

<p>This is a great job for the polygon colliders that Tiled2Unity creates from the Tile Collision Editor in Tiled. However, polygon colliders are created on a per-layer basis and it’s a total pain in the ass to have to manage separate layers for each type of tile we may have in our game.</p>

<p>Again, this is where automapping can help us and in this case the mapping rules are dead simple. All we need to do is take every tile from a single input layer and output the <em>exact same tile</em> to a particular output layer — one for each type of tile.</p>

<div id="attachment_981" style="width: 202px" class="wp-caption alignnone">
  <img class="size-full wp-image-981" src="/assets/wp-content/uploads/2015/09/dw-all.png" alt="Working layer" width="192" height="192" srcset="/assets/wp-content/uploads/2015/09/dw-all.png 192w, /assets/wp-content/uploads/2015/09/dw-all-150x150.png 150w" sizes="(max-width: 192px) 100vw, 192px" />
  
  <p class="wp-caption-text">
    Our working layer is the only layer we need to manipulate in Tiled. However, it is exported as one big collision. We can't tell if we collide against water or mountain or grass tiles.
  </p>
</div>

<p> </p>

<div id="attachment_985" style="width: 597px" class="wp-caption alignnone">
  <img class="size-full wp-image-985" src="/assets/wp-content/uploads/2015/09/dw-outputs.png" alt="Output layers" width="587" height="192" srcset="/assets/wp-content/uploads/2015/09/dw-outputs.png 587w, /assets/wp-content/uploads/2015/09/dw-outputs-300x98.png 300w" sizes="(max-width: 587px) 100vw, 587px" />
  
  <p class="wp-caption-text">
    By setting up rules to automatically create output layers for each tile type we can export the map with separate colliders for each type of tile in our game.
  </p>
</div>

<p>Setting up our rules this way allows us to work in only one layer and have all the output layers created for us automatically. The example contains part of the Dragon Warrior overworld (Charlock Island) with the polygon colliders set up for each tile type. We just do a raycast from the mouse position to see what kind of tile we selected.</p>

<div id="attachment_986" style="width: 522px" class="wp-caption alignnone">
  <a href="/assets/wp-content/uploads/2015/09/unity-dw.png"><img class="size-full wp-image-986" src="/assets/wp-content/uploads/2015/09/unity-dw.png" alt="Dragon Warrior example" width="512" height="448" srcset="/assets/wp-content/uploads/2015/09/unity-dw.png 512w, /assets/wp-content/uploads/2015/09/unity-dw-300x263.png 300w" sizes="(max-width: 512px) 100vw, 512px" /></a>
  
  <p class="wp-caption-text">
    In the Dragon Warrior example we can select which type of tile we are interested in.
  </p>
</div>

<p>You can see how this would work for a proper RPG style game, giving you the ability to spawn monsters that belong to a particular type of terrain. You get the added bonus of having collision detection for parts of the world you want to keep your character out of. (Also note we don’t need custom importer scripts for this example.)</p>

<h2 id="cant-there-be-an-easier-way">Can’t There Be An Easier Way?</h2>

<p>All things considered? I don’t think so. I often get requests from developers that “<em>just want to get a tile</em>” at runtime thinking that data should be right there waiting for us. I see two problems with that:</p>

<ol>
  <li><strong>Maps grow with quadratic complexity.</strong> One of the chief benefits of Tiled2Unity is the simplicity of minimal meshes and polygon collider objects that are made to work with Unity.  Managing objects on a per-tile basis, <em>for all Tiled2Unity users</em>, would undo that.</li>
  <li><strong>What would per-Tile information look like anyhow?</strong> In my mind, there is no way to make a general, one-size-fits-all offering for this. All data in Tiled is text but when we consume it in our game it must be in a format that makes sense for our specific application.</li>
</ol>

<p>Having said that, with some clever use of features already available to us and maybe a little tool-side scripting you should be able to make Tiled and Tiled2Unity work for you in ways that are unique to your game development needs.</p>]]></content><author><name>Seanba</name></author><category term="Uncategorized" /><summary type="html"><![CDATA[If you are building a strategy or RPG style game then there’s a strong chance that you need to get at specific information about each tile placed in the world. Unlike platformers, where tiles are decoration, each tile is an important part of your game logic. In this post I’ll show you two techniques to easily add such support to your Tiled2Unity projects.]]></summary></entry><entry><title type="html">Better Control of Tiled2Unity Files in Your Unity Project</title><link href="/tiled2unity-files.html" rel="alternate" type="text/html" title="Better Control of Tiled2Unity Files in Your Unity Project" /><published>2015-06-07T14:25:26+00:00</published><updated>2015-06-07T14:25:26+00:00</updated><id>/tiled2unity-files</id><content type="html" xml:base="/tiled2unity-files.html"><![CDATA[<p>Version 0.9.11.0 of Tiled2Unity has just been added to the <a href="/tiled2unity/">Tiled2Unity Download Page</a>. This build contains a couple of new features for power-users.</p>

<h2 id="you-can-now-put-tiled2unity-anywhere-in-your-unity-project">You Can Now Put Tiled2Unity Anywhere In Your Unity Project</h2>

<p>I had originally hardcoded all the scripts that build a prefab from Tiled2Unity to exist at the <code class="language-plaintext highlighter-rouge">Assets/Tiled2Unity</code> directory. However, many developers prefer to gather all third-party libraries in a common location and I totally can’t blame them for wanting to put Tiled2Unity in a location like <code class="language-plaintext highlighter-rouge">Assets/Scripts/ThirdParty/Tiled2Unity</code> along with everything else. That is now supported with the latest build of Tiled2Unity.</p>

<p><strong>One caveat</strong>: I had to change the way the Tiled2Unity exporter is made aware of your Unity project in order to export the right files to the right location. You will now have to explicitly select your Tiled2Unity scripts location in your Unity project instead of just selecting the project root folder. This is done by finding the <code class="language-plaintext highlighter-rouge">Assets/Your/Path/To/Tiled2Unity/Tiled2Unity.export.txt</code> file in your Unity project.</p>

<div id="attachment_936" style="width: 610px" class="wp-caption alignnone">
  <img class="size-full wp-image-936" src="/assets/wp-content/uploads/2015/06/t2u-export-to.png" alt="Tiled2Unity Exporting" width="600" height="480" srcset="/assets/wp-content/uploads/2015/06/t2u-export-to.png 600w, /assets/wp-content/uploads/2015/06/t2u-export-to-300x240.png 300w" sizes="(max-width: 600px) 100vw, 600px" />
  
  <p class="wp-caption-text">
    The &#8220;Export To ...&#8221; button allows you to choose where to export Tiled maps within your Unity project.
  </p>
</div>

<p>Each install of Tiled2Unity in Unity contains an export marker file that must be selected as the export destination.</p>

<div id="attachment_937" style="width: 635px" class="wp-caption alignnone">
  <a href="/assets/wp-content/uploads/2015/06/t2u-open-file-dialog.png"><img class="size-full wp-image-937" src="/assets/wp-content/uploads/2015/06/t2u-open-file-dialog.png" alt="Tiled2Unity Export Open File Dialog" width="625" height="434" srcset="/assets/wp-content/uploads/2015/06/t2u-open-file-dialog.png 625w, /assets/wp-content/uploads/2015/06/t2u-open-file-dialog-300x208.png 300w" sizes="(max-width: 625px) 100vw, 625px" /></a>
  
  <p class="wp-caption-text">
    You will need to traverse into your Unity project to find the Tiled2Unity/Tiled2Unity.export.txt file. This will instruct the Tiled2Unity exporter where all the textures, materials, meshes, and prefabs will be created for use in your Unity project.
  </p>
</div>

<p>This is just a tiny bit more complicated than earlier builds of Tiled2Unity but I think the trade-off is worth it. Tiled2Unity will remember your last export destination so you won’t have to select this every time you export a Tiled map into your project.</p>

<h2 id="marktiled-maps-as-resources-for-object-instantiation">Mark Tiled Maps as Resources For Object Instantiation</h2>

<p>Most Tiled2Unity users will simply drop a Tiled2Unity generated prefab into their scene but some developers may want to instantiate a map prefab through script. However, Unity forces developers to place such assets in a <code class="language-plaintext highlighter-rouge">Resources</code> folder. This meant users would need to export a Tiled map into Unity then move the generated prefab into another folder by hand — which breaks automation.</p>

<p>With the latest version of Tiled2Unity you can mark a Tiled map with the <code class="language-plaintext highlighter-rouge">unity:resource</code> property like so …</p>

<div id="attachment_938" style="width: 315px" class="wp-caption alignnone">
  <img class="size-full wp-image-938" src="/assets/wp-content/uploads/2015/06/tiled-unity-resource.png" alt="Map Property unity:resource" width="305" height="331" srcset="/assets/wp-content/uploads/2015/06/tiled-unity-resource.png 305w, /assets/wp-content/uploads/2015/06/tiled-unity-resource-276x300.png 276w" sizes="(max-width: 305px) 100vw, 305px" />
  
  <p class="wp-caption-text">
    Add a custom property with the name unity:resource (set value of True) to mark the map as a Unity resource. This will allow you to instantiate the map prefab via script.
  </p>
</div>

<p>Normally, Tiled map prefabs are constructed in the <code class="language-plaintext highlighter-rouge">.../Tiled2Unity/Prefabs</code> folder but with the <code class="language-plaintext highlighter-rouge">unity:resource</code> property they will reside in <code class="language-plaintext highlighter-rouge">.../Tiled2Unity/Prefabs/Resources</code> instead. With this you can easily instantiate the prefab in realtime via a Unity script, for example …</p>

<div class="language-c# highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">using</span> <span class="nn">System.Collections</span><span class="p">;</span>

<span class="k">public</span> <span class="k">class</span> <span class="nc">MapCreator</span> <span class="p">:</span> <span class="n">MonoBehaviour</span>
<span class="p">{</span>
    <span class="k">void</span> <span class="nf">Start</span><span class="p">()</span>
    <span class="p">{</span>
        <span class="n">UnityEngine</span><span class="p">.</span><span class="n">Object</span> <span class="n">prefab</span> <span class="p">=</span> <span class="n">Resources</span><span class="p">.</span><span class="nf">Load</span><span class="p">(</span><span class="s">"MyTiledMapPrefab"</span><span class="p">);</span>
        <span class="n">GameObject</span><span class="p">.</span><span class="nf">Instantiate</span><span class="p">(</span><span class="n">prefab</span><span class="p">);</span>
    <span class="p">}</span>
<span class="p">}</span>
</code></pre></div></div>

<p>Developers employing some kind of procedural generated content scheme should find that useful.</p>

<h2 id="added-potential-bonus-win32-specific-code-removed">Added Potential Bonus: Win32 Specific Code Removed</h2>

<p>With this latest build I have gone through and removed all dependencies on unmanaged Win32 code (the old export dialog was a big offender). The Tiled2Unity exporter still doesn’t officially support any non-Windows platform but people wanting to make Mac or Linux versions run via Mono should have an easier time at it now.</p>

<div class="orange-box" style="margin-bottom: 1em;">
  <strong>Reminder</strong>: Tiled Map Editor has been totally free for years now. Please consider contributing to <a title="Tiled Map Editor on Patreon" href="https://www.patreon.com/bjorn" rel="Tiled Map Editor on Patreon">Thorbjorn Lindeijer’s Patreon</a> for continued <a title="Tiled Map Editor" href="http://www.mapeditor.org/" rel="Tiled Map Editor">Tiled Map Editor</a> support.
</div>]]></content><author><name>Seanba</name></author><category term="Uncategorized" /><summary type="html"><![CDATA[Version 0.9.11.0 of Tiled2Unity has just been added to the Tiled2Unity Download Page. This build contains a couple of new features for power-users.]]></summary></entry><entry><title type="html">Isometric and Hexagonal Map Support in Tiled2Unity</title><link href="/iso-hex-maps.html" rel="alternate" type="text/html" title="Isometric and Hexagonal Map Support in Tiled2Unity" /><published>2015-05-22T00:21:22+00:00</published><updated>2015-05-22T00:21:22+00:00</updated><id>/iso-hex-maps</id><content type="html" xml:base="/iso-hex-maps.html"><![CDATA[<p><img title="Isometric and Hexagonal Maps in Tiled2Unity" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Isometric and Hexagonal Maps in Tiled2Unity" src="/assets/wp-content/uploads/2015/05/unity-iso-map.png" width="640" height="240" /></p>

<p><em>(Note: Isometric artwork is</em> <a title="Outside Tileset (Isometric)" href="http://opengameart.org/content/isometric-64x64-outside-tileset" rel="Outside Tileset (Isometric)"><em>attributed to Yar</em></a> <em>via</em> <a title="OpenGameArt.Org" href="http://opengameart.org/" rel="OpenGameArt.Org"><em>OpenGameArt.org</em></a><em>)</em></p>

<p>Since <strong>Tiled2Unity’s</strong> release I’ve held firm on not supporting isometric maps due to two reasons:</p>

<ol>
  <li>The game developers of days gone were limited to square tilesets and depended on artwork to give the illusion of their view whether it be top-down, side-view, 2.5D, whatever. Isometric (and hexagonal) were no different – you just bake the effect into the pixels.</li>
  <li>It’s a pain in the ass to implement.</li>
</ol>

<p>However, my inbox tells me my fellow developers would really like to export their isometric maps to <a title="Unity" href="https://unity3d.com/" rel="Unity">Unity</a> with the same relative ease that their orthographic brothers and sisters enjoy. Also, I couldn’t go on pretending Tiled2Unity was the perfect companion app to <a title="Tiled Map Editor" href="http://www.mapeditor.org/" rel="Tiled Map Editor">Tiled</a> for Unity developers when a major feature was not being supported.</p>

<h2 id="tiled2unity-isometric-and-hexagonal-maps">Tiled2Unity: Isometric and Hexagonal Maps</h2>

<p>If you download the <a title="Tiled2Unity Download Page" href="/Tiled2Unity/" rel="Tiled2Unity Download Page">latest version of Tiled2Unity</a> you will find support for the following map types (in addition to orthographic):</p>

<ul>
  <li>Isometric</li>
  <li>Isometric Staggered</li>
  <li>Hexagonal (including <a title="Hexagonal Coordinate Systems" href="http://www.redblobgames.com/grids/hexagons/#coordinates" rel="Hexagonal Coordinate Systems">all 4 variations</a> of the coordinate system)</li>
</ul>

<p>That’s every map type that Tiled is capable of creating right now, and, just like with orthographic maps, you can export collision objects into your Unity projects.</p>

<p><a href="/assets/wp-content/uploads/2015/05/t2u-iso-preview.png"><img title="Isometric Preview (with collisions)" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Isometric Preview (with collisions)" src="/assets/wp-content/uploads/2015/05/t2u-iso-preview_thumb.png" width="285" height="194" /></a></p>

<p><img title="Hexagonal Preview (with collisions)" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Hexagonal Preview (with collisions)" src="/assets/wp-content/uploads/2015/05/t2u-hex-preview.png" width="285" height="274" /></p>

<p><em>(Note: Hexagonal artwork is attributed to</em> <a title="Steffen from TilemapKit" href="http://tilemapkit.com/author/steffen/" rel="Steffen from TilemapKit"><em>Steffen</em></a> <em>via</em> <a title="TilemapKit" href="http://tilemapkit.com/2015/05/create-hexagonal-tilemaps-in-tiled/" rel="TilemapKit"><em>TilemapKit</em></a><em>)</em></p>

<h2 id="object-colliders-in-isometric-mode">Object Colliders in Isometric Mode</h2>

<p>The isometric map mode in Tiled skews your collision objects so that rectangles becomes parallelograms and circles become ellipses. This complicates things a bit for us in Unity.</p>

<p><a href="/assets/wp-content/uploads/2015/05/tiled-object-shapes-iso.png"><img title="Object Shapes in Isometric Mode" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Object Shapes in Isometric Mode" src="/assets/wp-content/uploads/2015/05/tiled-object-shapes-iso_thumb.png" width="437" height="233" /></a></p>

<p>For all other map types (including isometric staggered) the rectangle object will be exported as a <code class="language-plaintext highlighter-rouge">BoxCollider2D</code> and the circle a <code class="language-plaintext highlighter-rouge">CircleCollider2D</code>. Easy.</p>

<p>For the isometric map type the rectangle will be exported as a <code class="language-plaintext highlighter-rouge">PolygonCollider2D</code> and will keep the shape as displayed in the image above. <strong>The circle, however, will be lost</strong>. Note that ellipses with uneven width and height have never been supported in Tiled2Unity due to the lack of an <code class="language-plaintext highlighter-rouge">EllipseCollider2D</code> in Unity. Now that the circle in the example above is <em>really</em> an ellipse it falls into that category. Sorry, no cheap circle collisions here. If you really need a circle collider I suggest you go with an isometric staggered map instead.</p>

<h2 id="beware-of-visual-seams">Beware of Visual Seams</h2>

<p>Depending on how your isometric and hexagonal tilesets are authored you may see a lot of visual seams in your Unity project with some camera settings and shaders.</p>

<p>Here’s an example of an 8×8 isometric tile …</p>

<p><img title="Single 8x8 Isometric Tile" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Single 8x8 Isometric Tile" src="/assets/wp-content/uploads/2015/05/iso-single-tile.png" width="128" height="128" /></p>

<p>… and how you’d expect tiles like this to be rendered together …</p>

<p><img title="Isometric Tiles Grouped Together (expected)" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Isometric Tiles Grouped Together (expected)" src="/assets/wp-content/uploads/2015/05/iso-group-expected.png" width="270" height="254" /></p>

<p>However, due to mathematical imprecision with the texture sampler you may end up with something that looks like this under certain conditions …</p>

<p><img title="Isometric Tiles with Seams" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Isometric Tiles with Seams" src="/assets/wp-content/uploads/2015/05/iso-group-seams.png" width="274" height="258" /></p>

<p>The best way to avoid this is to add extra pixels that bleed outside the isometric shape …</p>

<p><img title="Bleed Out Tiles to Avoid Seams" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Bleed Out Tiles to Avoid Seams" src="/assets/wp-content/uploads/2015/05/iso-single-tile-bleed.png" width="160" height="160" /></p>

<p>Generally, those extra pixels will be overlapped by the “proper” pixels of a neighboring tile but in the case where the texture sampling goes a bit out of bounds you’ll be covered.</p>

<p><img title="Isometric Tiles With No Seams" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Isometric Tiles With No Seams" src="/assets/wp-content/uploads/2015/05/iso-group-no-seams.png" width="274" height="258" /></p>

<p><strong>Important Note:</strong> Do no increase the size of your tiles in Tiled to make up for those extra pixels. That’s what the <code class="language-plaintext highlighter-rouge">margin</code> setting is for in your tileset<strong>.</strong> Even though the “bleeding” tiles above may now be 10×10, they are really 8×8 tiles with 1 pixel margins.</p>

<h2 id="what-if-youve-found-a-bug">What if You’ve Found a Bug?</h2>

<p>I generally don’t work with isometric or hexagonal maps so at this time I can’t say this tech is too battle tested. If you’ve found an issue you can always leave a comment below or <a href="mailto:sean@seanba.com">email me</a>. I’m a <a title="About me" href="/about/" rel="About me">fulltime game developer</a> by day and a hobbyist programmer by night so keep in mind I can’t always reply right away.</p>

<h2 id="please-support-tiled-on-patreon">Please Support Tiled on Patreon</h2>

<p>I talk about this a lot because I know from Tiled2Unity alone that there is <em>a lot</em> of enthusiasm out there for Thorbjørn Lindeijer’s work with <a title="Tiled Map Editor" href="http://www.mapeditor.org/" rel="Tiled Map Editor">Tiled Map Editor</a>. It is difficult to support the game development community as well as he has with a career and a family so please consider pledging to <a title="Support Bjorn on Patreon" href="https://www.patreon.com/bjorn?ty=h" rel="Support Bjorn on Patreon">Bjørn’s Patreon</a> in hopes of <strong>making Tiled even better</strong> his new fulltime job.</p>

<p>Even a couple of dollars each month adds up quickly so please join me in helping Bjørn reach his goal.</p>

<p><a title="Support Tiled on Patreon" href="https://www.patreon.com/bjorn?ty=h" rel="Support Tiled on Patreon"><img title="Tiled on Patreon" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Tiled on Patreon" src="/assets/wp-content/uploads/2015/05/tiled-on-patreon.png" width="640" height="133" /></a></p>]]></content><author><name>Seanba</name></author><category term="Uncategorized" /><summary type="html"><![CDATA[Tiled2Unity now supports exporting Isometric and Hexagonal maps into your Unity projects.]]></summary></entry><entry><title type="html">Review a Great Game Day: Zanac (NES)</title><link href="/raggd-zanac.html" rel="alternate" type="text/html" title="Review a Great Game Day: Zanac (NES)" /><published>2015-04-07T23:51:29+00:00</published><updated>2015-04-07T23:51:29+00:00</updated><id>/raggd-zanac</id><content type="html" xml:base="/raggd-zanac.html"><![CDATA[<p><a title="Zanac" href="http://en.wikipedia.org/wiki/Zanac" rel="Zanac"><img title="Zanac" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Zanac" src="/assets/wp-content/uploads/2015/04/zanac-bar.png" width="640" height="120" /></a></p>

<p><em><strong>Note</strong>: It’s April 8th again which means my friends at <a title="1 More Castle" href="http://1morecastle.com/" rel="1 More Castle">1 More Castle</a> are hosting <a title="Review A Great Game Day" href="http://reviewagreatgameday.com/" rel="Review A Great Game Day">Review A Great Game Day</a>. I love this as I feel our hobby and craft can always use more positive energy (especially this past year, ffs) so I’m happy to contribute my own review and honor a game I’ve loved for almost 30 years.</em></p>

<h2 id="zanac-game-review">Zanac Game Review</h2>

<div class="review-box">
  <p>
    <strong><a href="/assets/wp-content/uploads/2015/04/zanac-title.png"><img title="Zanac (NES)" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="zanac-title" src="/assets/wp-content/uploads/2015/04/zanac-title_thumb.png" width="183" height="160" /></a>Title:</strong> Zanac <br /><strong>Developer:</strong> Compile <br /><strong>Publisher:</strong> Pony Inc. <br /><strong>Platform:</strong> Nintendo Entertainment System <br /><strong>Release:</strong> 1987 <br /><strong>Genre:</strong> Shoot ‘Em Up (SHMUP)
  </p>
</div>

<p>It’s no secret to people that know me that I love the 1980s. What other decade can compare culturally to the one that gave us <strong>Tears for Fears</strong>, <strong>Back to the Future</strong>, <strong>ThunderCats</strong>, and the <strong>Nintendo Entertainment System</strong>? Granted, my children have a good argument in <strong>My Little Pony: Friendship is Magic</strong> representing their generation well but what if you want to experience <a title="Transformers: The Movie" href="http://en.wikipedia.org/wiki/The_Transformers:_The_Movie" rel="Transformers: The Movie">a good Transformers movie</a> for once? Sorry kids, you need the 80s for that. (<em>‘Til all are one!</em>)</p>

<p>One throwback from the 80s that we don’t see emulated often these days is the SHMUP game. There are a ton of titles from that time and genre that are awesome from <a title="Xevious" href="http://en.wikipedia.org/wiki/Xevious" rel="Xevious">Xevious</a> to <a title="1943: The Battle of Midway" href="http://en.wikipedia.org/wiki/1943:_The_Battle_of_Midway" rel="1943: The Battle of Midway">1943: The Battle of Midway</a> and the ever-popular <a title="R-Type" href="http://en.wikipedia.org/wiki/R-Type" rel="R-Type">R-Type</a> and <a title="Gradius" href="http://en.wikipedia.org/wiki/Gradius_(video_game)" rel="Gradius">Gradius</a> franchises – but there is one game that I consider the very best on any platform: <strong>Zanac.</strong></p>

<p><a title="Zanac" href="http://en.wikipedia.org/wiki/Zanac" rel="Zanac"><img title="Zanac box art" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Zanac box art" src="/assets/wp-content/uploads/2015/04/zanac-box-art.png" width="251" height="352" /></a></p>

<p>(Zanac’s box art alone makes the game worthy of commemoration.)</p>

<h2 id="the-best-of-shmup-gaming">The Best of SHMUP Gaming</h2>

<p>When it comes to what we love most about the mindless fun in SHMUPs, Zanac has everything going for it.</p>

<p><img title="Zanac in action" class="sba-align-left" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; padding-right: 0px; border-top-width: 0px" border="0" alt="Zanac in action" src="/assets/wp-content/uploads/2015/04/zanac-ss1.png" width="256" height="240" />First of all, <strong>Zanac is fast</strong>, and I mean blistering. At times the background scrolls by faster in this game then anything I’ve yet to play. Most game developers now do their best to keep the action running at a steady 30 frames per second – a difficult task given the increased complexity of video games today.</p>

<p>But Zanac keeps a steady 60 fps throughout. I’ve been playing the game for decades now I’ve yet to detect any slowdown. The programmers at <a title="Compile (Game Developer)" href="http://en.wikipedia.org/wiki/Compile_(publisher)" rel="Compile (Game Developer)">Compile</a> were wizards of their time.</p>

<p><strong>Zanac also does a great job at pacing</strong>. I love how the background scrolling slows down at times (and even stops for boss battles) to give the player a bit of a break from the speed and enjoy the pixelated graphics. This range in movement makes the hectic parts even that more punctuated. It’s perfect.</p>

<p>The weapon power-ups are a lot of fun too and with a few exceptions (more below) each of the 8 special weapon types are useful for a particular style of play or type of enemy or environment – although most players will likely stick with one fully powered-up special weapon and stick with it throughout the game (<a title="Special Weapon 7" href="http://strategywiki.org/wiki/Zanac/Special_Weapons#Tile_7_-_High_Speed" rel="Special Weapon 7">Special Weapon 7</a> seems to be the favorite for most gamers).</p>

<p><a title="Special Weapon 7" href="http://strategywiki.org/wiki/Zanac/Special_Weapons#Tile_7_-_High_Speed" rel="Special Weapon 7"><img title="Special Weapon 7" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Special Weapon 7" src="/assets/wp-content/uploads/2015/04/Zanac_Special7_diagram.png" width="240" height="240" /></a></p>

<p>The developers at Compile took a clever approach to “boss monsters” in the way of fortresses that are made of smaller, reusable parts grouped together into some construct. As a developer I love it when games repurpose assets in a way that doesn’t feel repetitive. In Zanac, each fortress encounter feels unique even though they are essentially made of the same elements.</p>

<p><a href="/assets/wp-content/uploads/2015/04/zanac-fortresses.png"><img title="Fortresses in Zanac" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Fortresses in Zanac" src="/assets/wp-content/uploads/2015/04/zanac-fortresses_thumb.png" width="514" height="482" /></a></p>

<p><strong>And oh my god the music in Zanac is fantastic!</strong> Each piece of music is super catchy and fits in with the fast-paced sci-fi shooter action masterfully. I have the soundtrack on my iPod and there isn’t a week that goes buy that I don’t listen to it. It’s so good.</p>

<h2 id="an-added-twist-that-is-almost-perfect">An Added Twist that is Almost Perfect</h2>

<p>Zanac is also well known for it’s adaptive artificial intelligence that scales the difficulty based on your skill and/or aggression — at least in theory. This can be a useful feature as the game won’t be as punishing if you lose a ship and have to respawn with base weapons.</p>

<p>Where this doesn’t quite work is some special weapons automatically crank up the difficulty when you acquire them. The <a title="Special Weapon 2" href="http://strategywiki.org/wiki/Zanac/Special_Weapons#Tile_2_-_Field_Shutter" rel="Special Weapon 2">Special Weapon 2</a> (shield) is the worst offender that instantly brings about waves of the most powerful enemies in the game if you equip it. This essentially makes that power-up useless and it’s a real drag if you should accidently pick it up – something that is easy enough to do given the frantic pace of the game.</p>

<p>However, this feature does make each play session a bit different than last, adding to replay value. And, <strong>I love the way Compile wrote this feature into the fiction of the game</strong>: Humanity is at war with “The System”, whose adaptive A.I. would easily destroy a fleet a fighters. Hence, the need for a single pilot to infiltrate and destroy. (Hey, it’s from the 80s.)</p>

<h2 id="a-forgotten-game-and-genre-worth-revisiting">A Forgotten Game (and Genre) Worth Revisiting</h2>

<p>We seem to be living in a golden age of classic styled video games with titles like <a title="Retro City Rampage" href="http://en.wikipedia.org/wiki/Retro_City_Rampage" rel="Retro City Rampage">Retro City Rampage</a>, <a title="Shovel Knight" href="http://en.wikipedia.org/wiki/Shovel_Knight" rel="Shovel Knight">Shovel Knight</a>, and now <a title="Axiom Verge" href="http://en.wikipedia.org/wiki/Axiom_Verge" rel="Axiom Verge">Axiom Verge</a> scratching the itch left behind by the 8-bit and 16-bit glory days. It’s a great time to be a gamer and even better for a developer making these types of games with modern hardware. I only wish that SHMUPs would get a bit of the attention that seems reserved for <a title="Metroidvania" href="http://en.wikipedia.org/wiki/Metroidvania" rel="Metroidvania">Metroidvania</a> style games.</p>

<p>Should someone out there decide to revisit SHMUP games I hope they give Zanac a serious look. <strong>I consider it to be the most essential game of the genre</strong><strong>.</strong></p>

<p>(And yes, I’m totally aware of Konami’s <a title="Life Force" href="http://en.wikipedia.org/wiki/Salamander_%28video_game%29" rel="Life Force">Life Force</a>. It rocks! I just think Zanac is a bit better.)</p>]]></content><author><name>Seanba</name></author><category term="Uncategorized" /><summary type="html"><![CDATA[My Review a Great Game Day entry focuses on the most essential SHMUP of the NES platform: Zanac]]></summary></entry></feed>