<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>T-machine.org</title>
	<atom:link href="https://new.t-machine.org/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>https://new.t-machine.org</link>
	<description>Hi, I&#039;m Adam. Email me about: CTOs, Mobile/iOS, Project Management, and Development</description>
	<lastBuildDate>Sun, 04 Apr 2021 13:17:32 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.3</generator>
	<item>
		<title>Protected: How to use AssemblyDefinitions with DLLs in Unity 2019 through 2021</title>
		<link>https://new.t-machine.org/index.php/2021/04/04/how-to-use-assemblydefinitions-with-dlls-in-unity-2019-through-2021/</link>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Sun, 04 Apr 2021 13:17:32 +0000</pubDate>
				<guid isPermaLink="false">http://t-machine.org/?p=3966</guid>

					<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
										<content:encoded><![CDATA[<form action="https://t-machine.org/wp-login.php?action=postpass" class="post-password-form" method="post">
<p>This content is password protected. To view it please enter your password below:</p>
<p><label for="pwbox-3966">Password: <input name="post_password" id="pwbox-3966" type="password" spellcheck="false" size="20" /></label> <input type="submit" name="Submit" value="Enter" /></p>
</form>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>C#/Unity trick: reduce boilerplate code by using &#8216;using {..}&#8217;</title>
		<link>https://new.t-machine.org/index.php/2021/01/28/advanced-c-unity-trick-reduce-boilerplate-code-by-using-using/</link>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Thu, 28 Jan 2021 12:22:02 +0000</pubDate>
				<guid isPermaLink="false">http://t-machine.org/?p=3957</guid>

					<description><![CDATA[I'd like more people to know and use this. It works beautifully for any situation where you have multiple lines of code that must stay together, but which have to remain separate - e.g. an API that requires you to call "manager.Begin();" ... then your own code, then ... "manager.End();"]]></description>
										<content:encoded><![CDATA[
<p>I&#8217;ve been using this technique for a year or so and it&#8217;s awesome. Sadly it&#8217;s not something you&#8217;d ever find unless you knew to look for it, but I&#8217;d like more people to know and use this. It works beautifully for any situation where you have multiple lines of code that must stay together, but which have to remain separate &#8211; e.g. an API that requires you to call &#8220;manager.Begin();&#8221; &#8230; then your own code, then &#8230; &#8220;manager.End();&#8221;</p>



<p>We&#8217;re going to commandeer the &#8220;using&#8221; keyword for something it wasn&#8217;t originally designed for but which is a 100% legal use of it.</p>



<h2 class="wp-block-heading">Have you ever needed to do this in C#?</h2>



<p>In Unity there are some very common examples of this problem, most famously in the old GUI.* API (which is finally, slowly, being replaced by UIToolkit &#8211; but there&#8217;s a lot of GUI.* code still in live games).</p>



<pre class="wp-block-syntaxhighlighter-code">GUILayout.BeginVertical();
GUILayout.Label( "Options" );
if( GUI.Button( "Option1" ) )
{
   Process1();
}
if( GUI.Button( "Option2" ) )
{
   Process 2();
}
GUILayout.BeginHorizontal();
GUILayout.Space( 20 );
GUILayout.BeginHorizontal();
GUILayout.Label( "[advanced]" );
if( GUILayout.Button( "Option3" ) )
{
   Process3();
}
... and now I have to remember which order to EndHorizontal, EndVertical, and how many times for each</pre>



<p>This is a very simple example and yet already it&#8217;s both timeconsuming to type all those &#8220;GUI.EndHorizontal/EndVertical&#8221; (the IDE cannot autocomplete them for you because it has no idea what you want here) and also highly error-prone.</p>



<h3 class="wp-block-heading">Problems: Code together &#8230; but apart</h3>



<p>It&#8217;s annoying trying to remember all the bits you&#8217;ve Begin&#8217;d but not yet End&#8217;d, but the real problem comes when you need to edit that code, inserting another piece of embedded horizontal layout halfway down.</p>



<p>Or when you copy/past a chunk of it and try to re-use it elsewhere.</p>



<p>You might try to be smart and move this stuff to a method call, but … that quick becomes painful for two reasons:</p>



<ol><li>You need to generate method calls and insert them in your sourcecode based on context. You can do that, but now you&#8217;re having to pass-around functionpointers, it&#8217;s no longer a simple method.</li><li>You don&#8217;t know which order they&#8217;ll happen in, or how many times, so now you also need to create a stack object to keep track of this. You also have to implement all the cases of Exceptions etc and making sure the stack unwindws correctly, and &#8230; and &#8230; </li></ol>



<h2 class="wp-block-heading">Solution: IDisposable / using{}</h2>



<p>C# has a nice little feature that fixes all of this. It converts my code above into:</p>



<pre class="wp-block-syntaxhighlighter-code">using( new Vertical() )
{
   GUILayout.Label( "Options" );
   if( GUI.Button( "Option1" ) )
   {
      Process1();
   }
   if( GUI.Button( "Option2" ) )
   {
      Process 2();
   }
   using( new Horizontal() );
   {
      GUILayout.Space( 20 );
      using( new Horizontal() );
      {
         GUILayout.Label( "[advanced]" );
         if( GUILayout.Button( "Option3" ) )
         {
            Process3();
         }
      }
   }
}</pre>



<p>Two things have happened here:</p>



<ul><li>Improvement 1: We never have to remember to End() anything!</li><li>Improvement 2: All code is now surrounded in {braces} making it much easier to read, and to edit safely!</li></ul>



<p>Both of them are side-effects of IDisposable/using.</p>



<h3 class="wp-block-heading">How to implement it</h3>



<p>You have to create a class that holds the magic code. In the GUILayout.BeginHorizontal example I made a class &#8220;Horizontal&#8221;. This class has to <a href="https://docs.microsoft.com/en-us/dotnet/api/system.idisposable.dispose?redirectedfrom=MSDN&amp;view=net-5.0#System_IDisposable_Dispose">implement Microsoft&#8217;s IDisposable interface &#8211; and there&#8217;s plenty of docs online for how to do this</a>, it&#8217;s quite easy. Here&#8217;s a simple example:</p>



<pre class="wp-block-syntaxhighlighter-code">class Horizontal : System.IDisposable
{
   public Horizontal()
   {
      GUILayout.BeginHorizontal();
   }

   public void Dispose() // but read WARNING below
   {
      GUILayout.EndHorizontal();
   }
}</pre>



<p>The way that &#8220;using&#8221; is implemented by Microsoft is:</p>



<ol><li>The object is created as normal (when you call &#8216;new&#8217; in &#8220;using( new Horizontal();&#8221;)</li><li>The code in braces runs as normal</li><li>When the close brace is encountered, MS destroys the temporary object you created</li><li>&#8230;which has the side effect of calling &#8220;Dispose&#8221; on that object</li><li>All of this is managed for you, and copes well with exceptions etc</li></ol>



<h3 class="wp-block-heading">WARNING: the simple example isn&#8217;t quite correct</h3>



<p>If you subclass your Horizontal object this may start to go wrong because of how Dispose works. This is documented on MS&#8217;s official pages, but the simple explanation is that &#8220;Dispose&#8221; can be called more than once on the same object (when they&#8217;re subclassed), so you need to add some code to ignore the extra calls. Here&#8217;s the classic example:</p>



<pre class="wp-block-syntaxhighlighter-code">class Horizontal : System.IDisposable
{
   public Horizontal()
   {
      GUILayout.BeginHorizontal();
   }

   public void Dispose() // perfect example
   {
      Dispose(true);
      GC.SuppressFinalize(this);   
   }
   protected virtual void Dispose(bool disposing)
   {
      if (!_disposed)
      {
        if (disposing) 
        {
            GUILayout.EndHorizontal();
        }

        // Indicate that the instance has been disposed.
        _disposed = true;   
      }
   }
}</pre>



<h3 class="wp-block-heading">Performance optimization: ZERO garbage-collection!</h3>



<p>If you care about performance then you typically want to make your core methods non-allocating. Creating temporary objects like in the above examples has no effect most of the time &#8211; but if you ever use it on a core method that you call tens of thousands of times a frame (note: anything less than tens of thousands and you probably won&#8217;t notice, unless your game is very performance-heavy) it&#8217;ll start to create enough garbage that GC becomes a problem.</p>



<p>We can fix that, and get rid of the double-dispose problem, by converting it to a struct.</p>



<p>Unfortunately &#8230; C# doesn&#8217;t allow structs to have a zero-argument constructor, so we have to add at least one fake parameter to make this work. In most cases there&#8217;s some obvious parameter you can think of that improves your implementation. e.g. here I&#8217;ve added the same optional param that GUI.BeginHorizontal has:</p>



<pre class="wp-block-syntaxhighlighter-code">struct Horizontal : System.IDisposable
{
   public Horizontal( params GUILayoutOption[] options )
   {
      GUILayout.BeginHorizontal( options );
   }

   public void Dispose() // but reading WARNING below
   {
      GUILayout.EndHorizontal();
   }
}</pre>



<p></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>2020: Installing Jupyter for private notebooks/labs</title>
		<link>https://new.t-machine.org/index.php/2020/12/14/2020-installing-jupyter-for-private-notebooks-labs/</link>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Mon, 14 Dec 2020 01:26:50 +0000</pubDate>
				<guid isPermaLink="false">http://t-machine.org/?p=3953</guid>

					<description><![CDATA[<!-- wp:paragraph -->
<p>To save myself an hour next time I need to install JupyterLab (the latest 2020 version of Jupyter) here's a step-by-step install from scratch on self-hosted AWS, warts-and-all. Key points:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><li>We want to use jupyter-lab instead of the legacy jupyter-notebook</li><li>The notebooks/labs must be private, it's absurd to think otherwise</li><li>We want online / cloud access to our work</li><li>We want the minimum of effort to install and get working with Jupyter</li><li>We want the minimum complexity to maintain the installation</li></ul>
<!-- /wp:list -->]]></description>
										<content:encoded><![CDATA[
<p>To save myself an hour next time I need to install JupyterLab (the latest 2020 version of Jupyter) here&#8217;s a step-by-step install from scratch on self-hosted AWS, warts-and-all. Key points:</p>



<ul><li>We want to use jupyter-lab instead of the legacy jupyter-notebook</li><li>The notebooks/labs must be private, it&#8217;s absurd to think otherwise</li><li>We want online / cloud access to our work</li><li>We want the minimum of effort to install and get working with Jupyter</li><li>We want the minimum complexity to maintain the installation</li></ul>



<h2 class="wp-block-heading">Core investigations + conclusions</h2>



<h3 class="wp-block-heading">Hosting: Use AWS</h3>



<p>I researched many sources of 3rd-party hosting for Jupyter and they all &#8230; well, sucked. There was a great article on free hosting &#8211; but all of those forced your private data to be placed in public for anyone/everyone to take.</p>



<p>I looked at the ones that had private &#8220;upgrades&#8221; available from their free/public tier, but they came with intensely complicated procedures (e.g. you lose access to all your data) and confusing and difficult pricing (mostly designed for ML programmers, but irrelevant to people not doing ML).</p>



<p>Finally I went through the most widely-referenced &#8220;Jupyter hosting&#8221; companies I found via Google and forums posts and reddit etc etc. Some of these looked good, but nearly all of them were running either legacy Jupyter (which was superceded 2 years ago!) or their own custom &#8220;this isn&#8217;t jupyter, it&#8217;s a thing-that-is-a-bit-like-jupyter, missing core features, with our own proprietary changes&#8221; which is  undesirable. Poster-child there was Google who &#8211; yet again &#8211; created a pointlessly proprietary system that you&#8217;re locked into, and which has a high probabilty Google will shut it down and delete all your data with no upgrade option (as they are currently doing multiple times a year :)).</p>



<p>Eventually I came back to self-hosting: how hard would this be? There are multiple guides on this, both from 3rd parties (some of them broken/incorrect with key steps missing) and from the official Jupyter website. Custom instructions were provided for AWS which was a good sign (along with GCE, Microsoft cloud, etc) Reading through the instructions they were essentially:</p>



<blockquote class="wp-block-quote"><p>&#8220;Steps 1-20: Setup a new AWS default cloud instance (identical to all AWS hosting.<br>Steps 21-25: Do a couple of Jupyter-specific post-install steps&#8221;</p></blockquote>



<p>…with the vast majority of the setup work being AWS (which isn&#8217;t a great install process, but if you&#8217;ve used AWS you&#8217;ve already done this many many times and are comfortable with it), self-hosting seemed the best way forwards.</p>



<h3 class="wp-block-heading">AWS: tiers and options</h3>



<p>Confusingly there&#8217;s two branches of Jupyter self-hosting: Jupyter and JupyterHub. The latter is a multi-users-working-on-one-machine with each having their own loing username and personal password, with private or semi-private notebooks etc. For myself as a single user that was overkill &#8211; although the install instructions were even simpler than the main Jupyter (ironically).</p>



<p>None of the install guides were detailed (or useful) in their advice on picking an AWS instance, apart from the JupyterHub one. With some digging on reddit it turns out that 100MB or so of RAM should be more than enough for running notebooks, with &#8220;as much more as the size of data you intend to hold in RAM&#8221;. If you&#8217;re coding very lazily you might try loading massive source data into RAM but … we&#8217;re sensible programmers, we don&#8217;t do that.</p>



<pre class="wp-block-verse">Summary: The smallest AWS instance - t2.nano - works fine with 0.5GB RAM, and the (2020) minimum EBS disk of 8GB SSD.</pre>



<p>(If you hit the RAM limit: spin down your AWS instance, replace it with a t2.micro, attach the EBS to the new AWS, then spin it up again. This is exactly what cloud hosting was invented for! It&#8217;s easy, so no need to worry about it here)</p>



<h3 class="wp-block-heading">UPDATE:</h3>



<p>Jupyter doesn&#8217;t need much RAM.</p>



<p>But node.js &#8211; which a lot of UI-related Jupyter plygins rely on &#8211; requires gigabytes of RAM to work at all, and it crashes with useless error messages rather than handle its own errors.</p>



<p>It&#8217;s quite eye-opening how bad node.js code is (I believe this isn&#8217;t node.js itself, rather it&#8217;s an ecosystem and habits of people who write node.js apps &#8211; there&#8217;s nothing wrong with their choices, but they&#8217;ve prioritised embedding other people&#8217;s code they don&#8217;t understand (and mostly don&#8217;t need) rather than spend a few minutes writing simple code themselves. The net result is that if you want to install (or even reconfigure :() any of the JavaScript related plugins (which is all of the UI ones) then you&#8217;ll need to temporarily boost your AWS instance to a larger instance each time, and then downgrade it after the upgrade. 2GB RAM is recommended for node.js. To be clear: for actually using Jupyter, 200MB is more than enough &#8211; i.e. node.js alone requires 10x as much RAM as the entire system you&#8217;re running!</p>



<h3 class="wp-block-heading">AWS install summary</h3>



<p>If you&#8217;ve created EC2 instances before, the short version here is:</p>



<ul><li>A small EC2 instance</li><li>Running standard ubuntu (18.04 or 20.04 as of this writing)</li><li>A security-group which unblocks SSH (for manual install tasks) + one port (for web access)</li></ul>



<p>Traditionally a lot of people unblock port 8888 but there appears to be no reason for this other than installation being done by people who don&#8217;t really know what they&#8217;re doing with web server configs. A bit like the node.js setup &#8211; people copying random pieces of instructions without actually reading them. In months of usage, I&#8217;ve found no ports need to be unblocked (why create a security hole when you don&#8217;t need to?).</p>



<h2 class="wp-block-heading">Jupyter initial install</h2>



<p>Installing Jupyter core is straightforward … and broken in ubuntu 18.04 (the main ubuntu release when I did this in early 2020, unless you&#8217;ve upgraded to 20.04 already). By default it will fail to install &#8211; this appears to involve known bugs, but the workarounds are so quick to do that no-one is in a rush to fix it. I&#8217;m assuming that in ubuntu 20.04 it&#8217;s been fixed.</p>



<h3 class="wp-block-heading">Step 1: Update Ubuntu</h3>



<p>Do your apt updates etc (I prefer to use aptitude for all apt management so I can see what&#8217;s happening and make more informed choices about versions etc &#8211; for me it&#8217;s hitting &#8216;u&#8217; and let aptitude do it automatically).</p>



<h3 class="wp-block-heading">Step 2: install jupyter</h3>



<p>The apt is named &#8216;jupyter&#8217; and should automatically bring in all the required modules, python3, pip, etc. It should also setup a basic install of jupyter with Python notebooks enabled etc. The magic of debian/apt!</p>



<h3 class="wp-block-heading">Step 3: install the python parts of Jupyter (specifically: JupyterLab)</h3>



<p>Here&#8217;s where it goes python-y and stops working. Unfortunately Ubuntu does not (yet) have an apt for JupyterLab that actually works &#8211; and it has to be installed over the top of a legacy Jupyter installation (that we already have thanks to parts 1 and 2).</p>



<p>What follows is all standard for python developers, nothing new. But if you&#8217;re not a python developer &#8230;  You have to &#8220;install&#8221; jupyterlab by using python&#8217;s in-built self-management systems, which aren&#8217;t as good as the OS ones. No more apt for you :(. For extra pain: python wants you to jump through hoops to keep multiple copies of itself on the system &#8211; because the packages aren&#8217;t managed well enough for the OS to use python and for you to use it at the same time.</p>



<p>In my case: I have a dedicated server that is doing nothing but running Jupyter and I have no intention of upgrading python on one without upgrading the other. I was happy to use a single Python install, and avoid a lot of problems and confusion. Worst case if one does something weird in a future release I&#8217;ll simply wipe the server and re-install &#8211; we&#8217;re in the decades of commodity cloud computring, and re-installing OS&#8217;s in seconds, not hours.</p>



<p>In theory (from the docs), you run:</p>



<pre class="wp-block-preformatted">pip3 install jupyterlab</pre>



<p>In practice, that:</p>



<ul><li>Installs it in a hidden folder buried inside the home-directory of the current user</li><li>Fails to install it correctly: it cannot work</li><li>Leaves a different version of Jupyter on the system that is missing the new features</li></ul>



<p>FAIL. Maybe related to the expectation that you have multiple Python installs &#8211; but I wasn&#8217;t going to mess around with that added complexity only to discover that it was broken anyway (if it doesn&#8217;t work out of the box, I don&#8217;t trust it to work out of a more complex box&#8230;).</p>



<p>The nearest I found to an official workaround appears to be: update your linux user&#8217;s PATH to make it preferentially run the hidden-secret-silently-mis-installed version of Jupyter. Do that and everything appears to work fine. Or … just remember to always type</p>



<pre class="wp-block-preformatted">/home/ubuntu/.local/bin/jupyter</pre>



<p>everywhere that you would normally have typed:</p>



<pre class="wp-block-preformatted">jupyter</pre>



<h3 class="wp-block-heading">Step 4: configure jupyter to work correctly</h3>



<p>Out of the box Jupyter won&#8217;t work on a server: it&#8217;s been deliberately designed to fail even if you correctly installed it (this is not a bad thing: it&#8217;s designed to be idiot-proof for people who install on their personal laptop). To make it run as a server you can either mess around wasting time doing ssh-tunneling (why? WHY??!! Why have so many online guides told people to do this? Blind leading the blind, it seems…).</p>



<p>&#8230;Or: you can simply enable the server mode :), which works fine and is easier to setup (and cleaner).</p>



<p>But at first: you cannot do that. Out of the box jupyter can&#8217;t even be configured: it&#8217;s missing it&#8217;s own config file. Fortunately it has a &#8216;feature&#8217; where you can get it to auto-create the config file (why it doesn&#8217;t do this as part of installation I have no idea), but it&#8217;ll be placed somewhere super-annoying:</p>



<pre class="wp-block-preformatted">jupyter notebook --generate-config</pre>



<p>…and helpfully it&#8217;ll immediately tell you where it created it, probably:</p>



<pre class="wp-block-preformatted">/home/ubuntu/.jupyter/jupyter_notebook_config.py</pre>



<p>As per this stackoverflow answer (<a href="https://stackoverflow.com/a/43500232/153422">https://stackoverflow.com/a/43500232/153422</a>) you only need to change two lines to enable server mode. One line allows server access, and the other says &#8220;listen on all IP addresses&#8221;. You can find the commented-out lines in the file and uncomment them + change their values, or you can just copy/paste the values from that SO answer into the bottom of the file.</p>



<p>While you&#8217;re there, it&#8217;s worth changing the default values / inserting:</p>



<pre class="wp-block-preformatted">c.NotebookApp.open_browser = False<br>c.NotebookApp.port = 8888 (whatever you unblocked in AWS security group)</pre>



<h3 class="wp-block-heading">Step 5: run Jupyter-lab and login for the first time</h3>



<p>To run jupyter-lab you need something like this:</p>



<pre class="wp-block-preformatted">~/.local/bin/jupyter-lab</pre>



<p>Three things now happen:</p>



<ol><li>Jupyter is up and running and spits out lots of info to the command-line. Check it for errors &#8211; there shouldn&#8217;t be any</li><li>It specifically tells you which IP addresses it&#8217;s listening on.</li><li>It gives you a magic, temporary, token to login with.</li></ol>



<p>The IP address list is wrong, but … at least it will show you that it&#8217;s listening to more than just localhost and 127.0.0.1 (if it&#8217;s only listening to them then you failed to edit the config properly).</p>



<p>It tries to guess the info using OS lookups, but they did it naively and they did it wrong: they will fetch private addresses that don&#8217;t exist, instead of the public ones. But if you&#8217;ve used AWS before you know how to get the public IP and/or public DNS from your EC2 management console (in AWS management console, select the EC2 instance, and click on the &#8220;Connect&#8221; button and you get a popup telling you exactly how).</p>



<p>So use the correct IP/DNS, go directly to that server / port address (ignore the ?token rubbish that the jupyter commandline app wanted you to use). You&#8217;ll get a login page where you can copy/paste the token from the commandline output and immediately login.</p>



<p><strong>Or, better: </strong>jupyter&#8217;s login page helpfully gives you the option here to use the temporary token to generate a password you can use in future instead.</p>



<h3 class="wp-block-heading">Step 6: Switch to TLS/HTTPS (make the web-browser connection secure)</h3>



<p>Don&#8217;t self-sign, self-signing is being aggressively blocked by web-browser vendors (Google, Mozilla, Apple, etc) &#8211; again: ignore the bad advice and articles written by Jupyter users who don&#8217;t know what they&#8217;re doing. Instead use the free LetsEncrypt service for industry-standard automatically renewing signed certificates that you can fire-and-forget.</p>



<p>Follow the jupyter main docs directly:</p>



<p><a href="https://jupyter-notebook.readthedocs.io/en/stable/public_server.html#using-lets-encrypt">https://jupyter-notebook.readthedocs.io/en/stable/public_server.html#using-lets-encrypt</a></p>



<h3 class="wp-block-heading">Step 7 (final!): make Jupyter run as a service</h3>



<p>This part shows how poorly this python app is integrated with the host OS &#8211; Jupyter doesn&#8217;t run as a service. You have to manually convert it into one.</p>



<p>Most people do this the brutally simple way: either run the command line with ampersand (i.e. linux&#8217;s &#8220;run-in-background but if you lose your ssh connection it might die&#8221;) or run it with &#8216;screen&#8217; (linux&#8217;s more advanced multi-tasking app that makes it easy to re-access later and will survive even if you lose SSH connection or logout of ubuntu).</p>



<p>Much much better would be to convert it into a full ubuntu service &#8211; I googled the latest recommended instructions for this and followed them, but sadly I didn&#8217;t save the URL. It depends slightly whether you used new-style ubuntu (with systemd) or legacy (init) &#8211; but creating new ubuntu services is very common and quite easy to do so I&#8217;ll leave that for you to Google and find your preferred approach :).</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Unity UI &#8211; making Scrollview work perfectly WITHOUT ContentSizeFitter</title>
		<link>https://new.t-machine.org/index.php/2020/04/08/unity-ui-making-scrollview-work-perfectly-without-contentsizefitter/</link>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Wed, 08 Apr 2020 02:30:34 +0000</pubDate>
				<guid isPermaLink="false">http://t-machine.org/?p=3944</guid>

					<description><![CDATA[I&#8217;ve always found ContentSizeFitter a source of great hope &#8230; and bitter disappointment: often it&#8217;s the only way to &#8220;solve&#8221; a problem in UnityUI, but half the time when you try it messes up your UI and breaks the UnityEditor Undo function. You have to delete your UI elements and rebuild them from scratch :(. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I&#8217;ve always found ContentSizeFitter a source of great hope &#8230; and bitter disappointment: often it&#8217;s the only way to &#8220;solve&#8221; a problem in UnityUI, but half the time when you try it messes up your UI and breaks the UnityEditor Undo function. You have to delete your UI elements and rebuild them from scratch :(.<br />
<!--  more --><br />
Unity&#8217;s own staff have pointed out on the forums that it only works in limited scenarios (some of what we think of as bugs they&#8217;ve explained as side-effects of Unity&#8217;s built-in layout algorithms, which make it &#8220;impossible&#8221; to expand content to fit. That&#8217;s not entirely true, since Flexbox4Unity is able to do all of these, and it&#8217;s embedded inside the Unity system :), but I agree the core Unity layout alogirithm isn&#8217;t great).</p>
<p>CSS/Flexbox has a much better layout algorithm (and a free, open-source, speification that anyone can implement). In the Flexbox4Unity plugin, this works nicely, and auto-resizing / size-to-fit UIScrollviews just happen &#8220;for free&#8221;, every time, no problems. I&#8217;ve posted a guide for setting up UIScrollviews this way inside Unity: <a href="http://flexbox4unity.com/2020/04/08/guide-automatically-resize-uiscrollview/">http://flexbox4unity.com/2020/04/08/guide-automatically-resize-uiscrollview/</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Simple template for Asset Store revenues</title>
		<link>https://new.t-machine.org/index.php/2020/01/13/simple-template-for-asset-store-revenues/</link>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Mon, 13 Jan 2020 14:09:11 +0000</pubDate>
				<guid isPermaLink="false">http://t-machine.org/?p=3938</guid>

					<description><![CDATA[My simple OpenOffice spreadsheet for tracking Unity Asset Store revenues per-asset. http://t-machine.org/wp-content/uploads/UnityAssetStoreRevenues-Template.ods Usage/setup instructions included on the first page (scroll down). To fill in the data, I use a script that scrapes the Unity publisher portal. But for short periods of time, you can easily fill this in by hand. My script needs some cleanup [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>My simple OpenOffice spreadsheet for tracking Unity Asset Store revenues per-asset.</p>
<p><a href="http://t-machine.org/wp-content/uploads/UnityAssetStoreRevenues-Template.ods">http://t-machine.org/wp-content/uploads/UnityAssetStoreRevenues-Template.ods</a></p>
<p>Usage/setup instructions included on the first page (scroll down).</p>
<p>To fill in the data, I use a script that scrapes the Unity publisher portal. But for short periods of time, you can easily fill this in by hand. My script needs some cleanup before I share it &#8211; some recent changes to the Unity webpage broke it and I haven&#8217;t updated it yet.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Speed-up Unity2019 Terrains by a factor of 20x using Buffer.BlockCopy</title>
		<link>https://new.t-machine.org/index.php/2019/12/07/speed-up-unity2019-terrains-by-a-factor-of-20x-using-buffer-blockcopy/</link>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Sat, 07 Dec 2019 21:44:23 +0000</pubDate>
				<guid isPermaLink="false">http://t-machine.org/?p=3922</guid>

					<description><![CDATA[Unity Terrain is a good Terrain renderer, but the API&#8217;s behind it are famously badly documented and rather clunky (most of the documentation still hasn&#8217;t been written, almost 10 years after it was launched). At Unite this year they were showing-off some of the &#8220;new Terrain&#8221; features/tools, all of which were aimed at artists, and [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Unity Terrain is a good Terrain renderer, but the API&#8217;s behind it are famously badly documented and rather clunky (most of the documentation still hasn&#8217;t been written, almost 10 years after it was launched). At Unite this year they were showing-off some of the &#8220;new Terrain&#8221; features/tools, all of which were aimed at artists, and look great.</p>
<p>But what about the Terrain itself? Unity 2019.2 and 2019.3 still have the ponderous old API and it seems we&#8217;re stuck with it for at least another few years. Today I found and fixed an issue in my custom Terrain-tools that took our Editor rendering from &lt; 4 FPS back to normal realtime speeds.</p>
<p>The secret is to use Unity&#8217;s required float[,,] arrays (which Microsoft only partially supports in C#) but plug the gap in C# which causes them to be slow when interacting with Unity&#8217;s Serializer (which fires 6 times per frame in the Editor, magnifiying any slowdown considerably!)</p>
<p>NB: As far as I can tell, you cannot fix the Unity &#8220;serialize 6 times even if it&#8217;s not needed, where only 1 would have been fine&#8221; issue, because the methods to do that only exist on Custom EditorWindows, and not on Custom Inspectors. But it&#8217;s bad practice to be slowing-down the serializer anyway, so I&#8217;m happy with fixing MY code to run fast, and then stop worrying about the Unity Serialization layers being inefficient.</p>
<h2>The problem: float[,,] isn&#8217;t supported by Unity</h2>
<p>Unity requires you to use float[,,] for textures/splats/alphamaps on their terrain.</p>
<p>However, Unity has never supported multi-dimensional arrays in their engine (this is finally getting fixed sometime in 2020, I believe, with the new Serializer). So your data gets wiped every frame. Thats a pain when making Terrain-editing scripts.</p>
<p>The workaround is to implement Unity&#8217;s ISerializationCallbackReceiver interface, and provide the missing code that Unity doesn&#8217;t (i.e. serialize a float[,,]). The standard way of doing this is something like:</p>
<blockquote><p>
NB: I&#8217;m only showing half of the serialize/deserialize here, just to illustrate the point</p></blockquote>
<p>[code language=&#8221;csharp&#8221;]<br />
void ISerializationCallbackReceiver.OnAfterDeserialize()<br />
{<br />
deltas = new float[_Serialize_2D_Length0, _Serialize_2D_Length1, _Serialize_2D_Length2];</p>
<p>/** NB: iterate in C#&#8217;s internal storage order for [,,] */<br />
for (int i0 = 0; i0 &amp;lt; _Serialize_2D_Length0; i0++)<br />
for (int i1 = 0; i1 &amp;lt; _Serialize_2D_Length1; i1++)<br />
for( int i2 = 0; i2 &amp;lt; _Serialize_2D_Length2; i2++ )<br />
deltas[i0,i1,i2] = _Serialize_1DArray[i0 * _Serialize_2D_Length1 * _Serialize_2D_Length2<br />
+ i1 * _Serialize_2D_Length2<br />
+ i2];<br />
}<br />
}<br />
[/code]</p>
<p>&#8230;which retrieves every cell in the float[,,] from a cell in a private float[] (which Unity DOES support and will auto-serialize for you).</p>
<p>The problem is that C# for-loops are extremely slow when used like this, simply because of the scale of the operation. For a typical Unity terrain, you&#8217;re copying up to 4096 x 4096 samples (your splatmap) with anywhere from 5 to 10 values for each. Each value is a 4-byte 32-bit float.</p>
<p>i.e. 4k x 4k x 10 x 4 == 640 MB of data</p>
<p>&#8230;which destroys your 100+ FPS frame-time, taking it to 1 FPS or worse.</p>
<p>You need to copy this data in a single call, not in 640,000,000 separate method calls.</p>
<p>But &#8230; how?</p>
<h2>Array.Copy() to the rescue!</h2>
<p>It doesn&#8217;t work. You can compile your C# class, and then the C# runtime will cry when you try to execute it:</p>
<blockquote><p>
RankException: Only single dimension arrays are supported here.</p></blockquote>
<p>Bummer. In theory, Array.Copy() would have solved the problem &#8211; this is literally what it was designed for: bulk copying of large arrays without the overhead of doing millions of tiny copy-calls.</p>
<h2>Try again &#8230; Buffer.BlockCopy()</h2>
<p>Fortunately there&#8217;s another method in C# core that steps-in and saves us. I often find that when C# ties your hands behind your back, the reason it hasn&#8217;t been changed/updated/improved is that there&#8217;s a lesser-known behind-the-scenes low-level method that you can (ab)use to achieve what you need, and the language maintainers recommend you do that instead of them updating the mainstream stuff. Fair enough!</p>
<p>The one caveat with BlockCopy is that you need to tell it the size in bytes that you&#8217;re copying NOT the number of array items.</p>
<p>i.e.: [code language=&#8221;csharp&#8221;]Array.Copy( from, 0, to, 0, length )[/code]<br />
becomes: [code language=&#8221;csharp&#8221;]Buffer.BlockCopy( from, 0, to, 0, 4 * length ) // if copying float, or int, or any of the other 32bit primitives[/code]</p>
<h2>20x faster Terrain data handling</h2>
<p>The modified serialization callback becomes:</p>
<p>[code language=&#8221;csharp&#8221;]<br />
void ISerializationCallbackReceiver.OnAfterDeserialize()<br />
{<br />
deltas = new float[_Serialize_2D_Length0, _Serialize_2D_Length1, _Serialize_2D_Length2];</p>
<p>int bytesPerFloat = 4;<br />
Buffer.BlockCopy( _Serialize_2D, 0, deltas, 0, bytesPerFloat * deltas.GetLength( 0 ) * deltas.GetLength( 1 )*deltas.GetLength( 2 ) );<br />
}<br />
}<br />
[/code]</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Improving the Unity AssetStore: what I&#8217;d like to see in 2020</title>
		<link>https://new.t-machine.org/index.php/2019/11/26/improving-the-unity-assetstore-what-id-like-to-see-in-2020/</link>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Tue, 26 Nov 2019 18:54:38 +0000</pubDate>
				<guid isPermaLink="false">http://t-machine.org/?p=3918</guid>

					<description><![CDATA[One of Unity3D&#8217;s greatest successes has been the Asset Store. Bursting to life 9 years ago, initially sounding a lot like an optimistic clone of Apple&#8217;s 2-year-old App Store (and boasting the same 70%/30% revenue share), it turned out to be so much more. But Unity still struggles to figure out what it should look [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>One of Unity3D&#8217;s greatest successes has been the Asset Store. Bursting to life 9 years ago, initially sounding a lot like an optimistic clone of Apple&#8217;s 2-year-old App Store (and boasting the same 70%/30% revenue share), it turned out to be so much more.</p>
<p>But Unity still struggles to figure out what it should look like and how it should work for users/purchasers. The raw content is the biggest determinant of the store&#8217;s success, but closely followed by the browsing and discovery experience &#8211; which have hardly improved at all (and in some ways have gone backwards) over this past decade.</p>
<p>Based on hundreds of purchases, and having launched and maintained some small assets on the store myself over the past 5 years, here&#8217;s what I&#8217;d like to see now.</p>
<h2>The A-test for Unity Assets</h2>
<p>Every asset-purchase page should have a section that answers the critical, machine-answerable, fully 100% automatable questions that matter to purchasers. There is no excuse to miss this out &#8211; these make a huge difference both to users, and to authors, and to Unity itself: they massively reduce the amount of refund requests, and increase the purchase volume due to increased buyer-confidence.</p>
<p>How well do your assets score on these? If you&#8217;re an author, do you publish all this information up-front (some do &#8211; their Full Description on the asset page is long and scrolly)</p>
<h3>Art Assets</h3>
<ul>
<li>Min/avg/max verts per model in package</li>
<li>Top 3 shaders in package, with number of models that use each</li>
<li>Min/avg/max texture sizes in package</li>
<li>Total number of materials with unassigned textures/colors vs fully assigned</li>
<li>Total number of materials using Standard shader with Albedo, Metallic, Normal, Roughness maps assigned</li>
<li>Total number of models with LODs vs number of models without LODs</li>
<li>Min/Max LOD levels for models with at least one LOD</li>
<li>Number of prefabs in package that have same prefix-name as an FBX/model file</li>
</ul>
<h3>Code Assets</h3>
<ul>
<li>Number of files that include source code (C#) vs number without source code</li>
<li>Number of (Unity official) Unit-tests in package</li>
<li>(one line for each Unity version): Num Errors, Num Warnings, when installing the project</li>
<li>(one line for each Unity version): Num Errors, Num Warnings, when opening the marked demo-scene</li>
<li>(one line for each Unity version): Num Errors, Num Warnings, when pressing play in the marked demo-scene</li>
<li>(one line for each Unity version): Number of Unit tests passed, number failed</li>
</ul>
<h3>All Assets</h3>
<ul>
<li>Number of demo scenes in package</li>
<li>PDF documentation in package</li>
<li>Time since Author&#8217;s last edit of package (upload)</li>
<li>Time since Author&#8217;s last discussion of package (meta files + comment threads)</li>
</ul>
<h2>Self-reported / author-tagged info</h2>
<p>All the above was easily automatable by Unity (Apart from &#8220;issue reports&#8221;, which Unity keeps private, I&#8217;ve written scripts myself that do all of them!)</p>
<p>What happens when we extend the Asset Store Publisher Upload tool to let authors add extra info that Unity can then collate and publish? Well&#8230;</p>
<h3>Art Assets &#8211; author controlled</h3>
<ul>
<li>Render-pipelines supported: Default?, URP?, HDRP? (tickboxes)</li>
<li>Player platforms compatible: Windows, PS, XB, VR, iOS, Android, WebGL (tickboxes: &#8220;compatible&#8221; means &#8220;author expects it to work, but isn&#8217;t actively testing that platform &#8211; it may not work out of the box&#8221;)</li>
<li>Player platforms supported: Windows, PS, XB, VR, iOS, Android, WebGL (tickboxes: &#8220;supported&#8221; means &#8220;author actively tests on this platform and promises it will work out of the box (or fixed very rapidly)&#8221;)</li>
</ul>
<h2>Nice-to-have&#8217;s only Unity can provide</h2>
<ul>
<li>Ask-the-author question box on purchase page (SO MANY TIMES people need to check if an asset supports X or Y, or ask the author if they include something, and Unity still provides no way for the purchaser to do this)<br />
&#8230;with answered-questions automatically appearing for all to see (just like Amazon has done for the past 15+ years)</li>
<li>Number of reported issues per Unity version (OR: star-rating per unity version)</li>
<li>Number of refund requests (successful + unsuccessful) by Unity version and/or package version</li>
</ul>
<h2>2020 future-looking awesome &#8220;make everyone rich&#8221; features</h2>
<ul>
<li>When author uploads the asset, choose a Demo scene that will be auto-built as a WebGL build and embedded in Asset Store page (if build succeeds)</li>
</ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Google&#8217;s struggles with UX design, 2019 edition</title>
		<link>https://new.t-machine.org/index.php/2019/09/30/googles-struggles-with-ux-design-2019-edition/</link>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Mon, 30 Sep 2019 12:58:30 +0000</pubDate>
				<guid isPermaLink="false">http://t-machine.org/?p=3900</guid>

					<description><![CDATA[I witnessed three basic flaws in latest Android this week &#8211; all of them redolent of bad UX design on Google&#8217;s part &#8211; and surprising in an almost 10 years old OS (none of them are new features). e.g. I tried to take a screenshot of an app that I needed for a receipt for [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I witnessed three basic flaws in latest Android this week &#8211; all of them redolent of bad UX design on Google&#8217;s part &#8211; and surprising in an almost 10 years old OS (none of them are new features).<br />
<span id="more-3900"></span></p>
<p>e.g. I tried to take a screenshot of an app that I needed for a receipt for expenses &#8211; and the app&#8217;s authors had blocked all screenshots on all parts of their app. They used a Google-sanctioned feature of the OS because, it seems, they are afraid of competitors &#8220;copying&#8221; their graphical design. I ended up having to use a second phone to photo my screen [Facepalm]. (Google&#8217;s attitude with Android seems to be crystallising around: You do not own your phone; we own your phone).</p>
<p>e.g. This week I arrived an hour early for a meeting because the Android version of Google Calendar got confused over timezones (again). (I now write the TIME for every meeting in the title of the meeting if it&#8217;s been put in Google Calendar, but when other people create the meeting I don&#8217;t always have edit access.</p>
<p>(Which is a strange flaw in gCal: it&#8217;s in my calendar, my personal/private calendar, but I&#8217;m not allowed to edit, fix, change, or annotate it. I tried recently with one, and it sent an email to the organizer saying I&#8217;d cancelled their meeting (after it had already sent one saying I&#8217;d accepted the meeting) &#8211; and Google didn&#8217;t inform me, didn&#8217;t give a warning, didn&#8217;t give a popup, didn&#8217;t email me. I got a panicked reply from the organizer asking why I&#8217;d cancelled at the last minute (I hadn&#8217;t cancelled it &#8211; Google inferred that!). None of this seems to happen with corporate G-Suite, but it seems the personal/mobile edition of Google Calendar is still buggy.)</p>
<p>e.g. today someone asked &#8220;how to get rid of the annoying alarm clock icon that WILL NOT GO AWAY!&#8221; on Android.</p>
<p>It turns out Google allows apps to put icons in the notifications bar, but doesn&#8217;t require there to be notification &#8230; giving the user no way to know which app put it there, or why. There are dozens of forum threads about people begging for help getting rid of the icon. e.g. even as recent as the Pixel: <a href="https://support.google.com/pixelphone/thread/1448787?hl=en">https://support.google.com/pixelphone/thread/1448787?hl=en</a>. The solution is &#8220;simple&#8221;: open every single app on your device, go through every possible screen, and hope that you find one that has an alarm set (Although it might not call it that!).</p>
<p>Hmm.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Brief update for 2018</title>
		<link>https://new.t-machine.org/index.php/2018/10/04/brief-update-for-2018/</link>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Thu, 04 Oct 2018 09:32:52 +0000</pubDate>
				<guid isPermaLink="false">http://t-machine.org/?p=3893</guid>

					<description><![CDATA[So &#8230; you may notice the site disappeared for some time, and now it&#8217;s back all images are missing. This is down to three things: MariaDB&#8217;s supporters put a nasty little poison-pill into the Debian OS that blocks MySQL DBs from working once triggered, to try and force everyone onto Maria. My online backup setup [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>So &#8230; you may notice the site disappeared for some time, and now it&#8217;s back all images are missing. This is down to three things:<br />
<span id="more-3893"></span></p>
<ul>
<li> MariaDB&#8217;s supporters put a nasty little poison-pill into the Debian OS that blocks MySQL DBs from working once triggered, to try and force everyone onto Maria.
<li> My online backup setup couldn&#8217;t cope with the > 1GB of images + videos I had embedded in this blog over the years, so I was manually doing full backups of images every year or so.
<li> In an emergency (needed a particular version of OS X to run something for work, at very short notice) I wiped the hard drive with my local backup of images.
</ul>
<p>MariaDB&#8217;s poison-pill damaged the OS so badly that I had to do a complete wipe + re-install the OS. I couldn&#8217;t unfuck the packages. I had complete backups of all configuration, and recent backups of the DB contents (although I lost about 5 or 10 blog posts, spread across my various blogs, maybe 2 or 3 each). Maria refuses to come online with the fully up-to-date backups I had from MySQL (double yay for how crappy this Maria thing is &#8230; although this is an inherited bug from MySQL itself, it&#8217;s always had major problems with restoring databases by any means other than text dump, which in my haste I forgot), and after a few days of work, I gave up trying to fix it.</p>
<p>The last two items were temporary hiccups (I was in the process of setting up and testing a new multi-gigabyte backup system when I ran the automatic update for Debian). The first item, the root cause of what happened &#8230; my opinions there are quite salty. Yay for politics in OpenSource being more important than preserving users&#8217; data!</p>
<p>(the poison-pill was a virtual package that if you tried to do upgrades to MySQL would insert itself and break your OS&#8217;s packages. The idea appears to have been: &#8220;Many people won&#8217;t realise that MySQL is no longer politically free, and is now owned by Oracle, and that the MySQL original team have abandoned it to make a new rival! So &#8230; let&#8217;s stop people from accidentally continuing to use Oracle-owned software!&#8221;.</p>
<p><strong>In principle, I agree with that idea</strong>: I hadn&#8217;t noticed the spat in MySQL world, and was only vaguely aware of MariaDB. It was good to be informed that something odd was going on in MySQL. HOWEVER &#8230; their choice of a dangerous and ultimately (in my case, at least) destructive bomb in the OS was extremely bad form, and frankly unforgivable: it violates one of the basic trusts of Debian, built up over decades.</p>
<p>Incidentally &#8230; a spat that I <strong>have</strong> noticed is the splintering of Debian, with a substantial bunch of the maintainers dumping it and making a &#8220;new&#8221; Debian thing that&#8217;s supposedly true to Debian&#8217;s roots. That upset me, but switching was going to be very expensive (I&#8217;ve investigated it a couple of times). However, the Maria incident strikes me as exactly the kind of &#8220;screw Debian&#8217;s reputation; let&#8217;s abuse our influence!&#8221; attitude that those guys were complaining about. I guess it&#8217;s time to more aggressively dump Debian &#8211; certainly for all new installs!</p>
<p>Don&#8217;t you just hate it when people come along and shit on the shoulders of giants? :)</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>#unity3d #missingdocs: CanvasRenderer.SetMesh() &#8211; making it work (mostly)</title>
		<link>https://new.t-machine.org/index.php/2016/07/09/unity3d-missingdocs-canvasrenderer-setmesh-making-it-work-mostly/</link>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Sat, 09 Jul 2016 10:21:29 +0000</pubDate>
				<category><![CDATA[Unity3D]]></category>
		<category><![CDATA[Unity3D-tips]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3884</guid>

					<description><![CDATA[This once-obscure method, that &#8211; I guess &#8211; is the low-level call used by most of the new Unity GUI &#8230; is now the only way of drawing meshes in GUIs. The previous options have been removed, with brief comments telling you to use .SetMesh instead. Half of the DrawMesh / DrawMeshNow methods have also [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>This once-obscure method, that &#8211; I guess &#8211; is the low-level call used by most of the new Unity GUI &#8230; is now the only way of drawing meshes in GUIs. The previous options have been removed, with brief comments telling you to use .SetMesh instead. Half of the DrawMesh / DrawMeshNow methods have also been removed (no explanation given in docs), which were my other go-to approach.</p>
<p>Unfortunately, no-one has documented SetMesh, and it has significant bugs, and breaks with core Unity conventions. This makes it rather difficult to use. Here&#8217;s the docs I&#8217;ve worked out by trial and error&#8230;</p>
<p><span id="more-3884"></span></p>
<h2>CanvasRenderer.SetMesh</h2>
<p>The minimum for this method to work is:</p>
<ol>
<li>A Canvas in mode &#8220;Screenspace: Camera&#8221;
<li>A child object with:
<ol>
<li>A mesh (that must be hundreds of meters wide/tall)
<li>A material (see below. Not optional!)
<li>A CanvasRenderer</ol>
</ol>
<h3>Usage</h3>
<p>Mesh bounds are ignored; if CanvasRenderer had been designed to render meshes to canvases, it would use this method &#8211; but as noted above, I believe it was designed for something completely different: it&#8217;s a low-level helped method rathe than a user-facing API method.</p>
<p>Instead, your mesh will be rendered at the Canvas&#8217;s own pixels/meter scaling (a scale of 1 meter = 1 pixel by default). In the Editor, this will make it appear very large, but it will render correctly on your cameras.</p>
<h3>Current bugs</h3>
<p>CanvasRenderer frequently deletes the mesh, but has no method (public or private) to detect when the Mesh has been deleted so you can re-create it. It <b>deletes when you enter or exit play mode</b>, but after that it seems to leave it alone. There is a hidden delegate inside the class that appears to let you react to this &#8211; but it&#8217;s not public and I don&#8217;t know how to use it (yet).</p>
<p>Unlike all rendering elsewhere in Unity, if there is no material, this method will silently fail, and <b>will NOT render a magenta</b> object. This makes debugging misleading and difficult.</p>
<p>In &#8220;Screenspace: Overlay&#8221; mode it seems to be <b>broken</b>; not only does nothing render, but it doesn&#8217;t even render in the Editor, suggesting to me that it&#8217;s disabled. I couldn&#8217;t find a combination that worked.</p>
<p>You <b>cannot set/add a material to this object using standard</b> Unity approach, instead you must first alter the value of materialCount to the number of materials you intend to have on the mesh, or it will crash. The docs tell you to use a non-existent method &#8211; don&#8217;t worry, simply alter the property directly (this works).</p>
<p>EnableRectClipping <b>doesn&#8217;t work</b> at all &#8211; this is a serious problem if you&#8217;re using this method to draw 3D objects inside a 2D layout-managed GUI. As mentioned above, I think it was either never intended to be used, or there was a mixup and people forgot that it&#8217;s a low-level method, and not an API method.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>What one #unity3d private class should be made public? @shawnwhite</title>
		<link>https://new.t-machine.org/index.php/2016/06/30/3873/</link>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Thu, 30 Jun 2016 11:04:14 +0000</pubDate>
				<category><![CDATA[Unity3D]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3873</guid>

					<description><![CDATA[Shawn asked on Twitter: If there were one internal class/method/field in the UnityEditor namespace you would want exposed properly, what would it be? #unity3d &#8212; Shawn White (@ShawnWhite) June 29, 2016 We only get to pick ONE? :). How do we decide? There&#8217;s two ways to slice this. There&#8217;s &#8220;private APIs that would hugely benefit [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Shawn <a href="https://twitter.com/ShawnWhite/status/748084675722231808">asked on Twitter</a>:</p>
<blockquote class="twitter-tweet" data-lang="en">
<p lang="en" dir="ltr">If there were one internal class/method/field in the UnityEditor namespace you would want exposed properly, what would it be? <a href="https://twitter.com/hashtag/unity3d?src=hash">#unity3d</a></p>
<p>&mdash; Shawn White (@ShawnWhite) <a href="https://twitter.com/ShawnWhite/status/748084675722231808">June 29, 2016</a></p></blockquote>
<p><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script></p>
<p>We only get to pick ONE? :).</p>
<h2>How do we decide?</h2>
<p>There&#8217;s two ways to slice this. There&#8217;s &#8220;private APIs that would hugely benefit us / our projects / everyone&#8217;s projects / 3rd party code that I use (e.g. other people&#8217;s Asset Store plugins I buy/use)&#8221;. We can judge that largely by looking at what private API&#8217;s I&#8217;ve hacked access to, or decompiled, or rewritten from scratch.</p>
<p>Then there&#8217;s &#8220;what CAN&#8217;T I access / hack / replace?&#8221;. That&#8217;s a harder question, but leads to the truly massive wins, I suspect.</p>
<h2>Stuff I&#8217;ve hacked access to</h2>
<h3>The Project/Hierarchy/Scene/Inspector panels</h3>
<p>So, for instance, I made <a href="http://t-machine.org/index.php/2015/06/09/use-ctrl-shift-n-to-create-new-scripts-in-unity-project-window-fast/">this (free) little editor extension that lets you create new things (scripts, materials, &#8230; folders) from the keyboard</a>, instead of having to click tiny buttons every time.</p>
<p>There are no public API&#8217;s for this; that&#8217;s a tragedy. Most of these Unity panels haven&#8217;t been improved for many years, and are a long way behind the standard with Unity&#8217;s other improvements. They &#8220;work&#8221;, but don&#8217;t &#8220;shine&#8221;.</p>
<p>What could I do with this?</p>
<p>Well &#8230; a few studios I know have completely rewritten the Scene Hierarchy panel, so that:</p>
<ul>
<li>it does colour-coding of the names of each gameobject
<li>clicking a prefab selects both the prefab and any related prefabs, or vice versa, or hilights them
<li>added (obvious) new right-click options that are missing from default Unity Editor
<li>automated some of the major problems in Unity&#8217;s idea of &#8220;parenting&#8221; (parenting isn&#8217;t always safe to do; you can enforce / protect this with a custom scene hierarchy)
<li>made it put an &#8220;error&#8221; icon next to each gameobject that is affected by a current error.
<li>&#8230;etc
</ul>
<p>All massively useful stuff that helps hour-to-hour development, reducing dev time and cost.</p>
<p>It&#8217;s all &#8220;possible&#8221; right now by writing lots of horribly ugly and longwinded boilerplae code, and using the antiquated Editor GUI API.</p>
<p>But to make it play nicely with the rest of Unity requires also hacking Unity API&#8217;s for the various panels/windows, and detecting popups (and adding your own popup classes, since Unity keeps most of theirs private), and detecting drags that started in one panel but moved to another, detecting context-sensitive stuff that is not exposed by current API&#8217;s, &#8230; etc.</p>
<h3>A better List editor</h3>
<p>The built-in sub-editor (like a PropertyDrawer &#8211; see below) is very basic &#8211; really a &#8220;version 0.1&#8221; interface.</p>
<p>There is <a href="http://va.lent.in/interesting-things-in-unity-4-5-you-probably-didnt-know-about/">a much nicer one, that does what most Unity developers need</a> &#8211; but it&#8217;s private and buggy (last time I tried, it corrupted underlying data. That&#8217;s presumably why it&#8217;s still private?)</p>
<p><img decoding="async" src="http://va.lent.in/content/images/2014/Jun/list.gif"/></p>
<blockquote class="twitter-tweet" data-conversation="none" data-lang="en">
<p lang="en" dir="ltr"><a href="https://twitter.com/ShawnWhite">@ShawnWhite</a>  The re-orderable, nicely rendered, editable List. (but <a href="https://twitter.com/AngryAnt">@AngryAnt</a>&#39;s is definitely a top-3 too)</p>
<p>&mdash; Adam Martin (@t_machine_org) <a href="https://twitter.com/t_machine_org/status/748395961660092416">June 30, 2016</a></p></blockquote>
<p><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script></p>
<h3>Editor co-routines</h3>
<p>Co-routines <em>work perfectly in the Editor</em>. (EDIT: thanks to ShawnWhite for the info): Unity doesn&#8217;t use co-routines outside of runtime; what appears to use them is OS-provided multi-threading. Strangely, when using that, I haven&#8217;t seen any of Unity&#8217;s ERRORs that are usually triggered by accessing the Unity not-threadsafe code from other threads &#8211; something weird happening in the OS?</p>
<p>Why doesn&#8217;t Unity support co-routines in the Editor?</p>
<p>I&#8217;ve no idea. There are many people who&#8217;ve re-implemented co-routines in editor, exactly as per Unity&#8217;s runtime co-routines. As a bonus, you end up with a much better co-routine: you can fix the missing features. But there&#8217;s some strange edge-cases, e.g. when Unity is reloading assemblies (which it does every time you save any source file), for a few seconds it presents a corrupt data view to any running code, and you if start running a co-routine in that time, it will do some very odd things.</p>
<p>Unity recently exposed some API&#8217;s to detect if Unity was in the middle of those reloads, but last time I tried it I couldn&#8217;t 100% reliably avoid them. An official implementation of Unity&#8217;s own co-routine code, that was automatically paused by Unity&#8217;s own reload-script code, would neatly fix this.</p>
<p>Until we have something like that, we&#8217;re forced to write two copies of every algorithm (C# doesn&#8217;t allow co-routine code to be run as a non-co-routine) so we can test in Editor, do level editing, debug and improve runtime features, etc &#8230; which is silly.</p>
<h2>Stuff I CANNOT hack into/around</h2>
<h3>Serialization</h3>
<p>Unity is the only engine I&#8217;ve worked with where the core data structures and transformations are opaque, hidden, can&#8217;t be extended, can&#8217;t be debugged. Tragically: also has many missing features, bugs, and serious performance issues.</p>
<p>There are good reasons for why this remains in such a bad state (It&#8217;s hard to fix. Meanwhile &#8230; it sort-of works, enough to write games in &#8211; you just have to occasionally write a lot of bad code, have to rewrite some ported libraries, have to know a lot of Unity-specific voodoo, etc).</p>
<p>But if it were exposed &#8211; we could (I would start on it tomorrow!) fix most of the problems. I&#8217;ve done proof-of-concepts with some terrifying hackery that show it&#8217;s possible &#8211; and a lot of the architecture is well explored, other ways it can be implemented, that could be given to developers as options (some would work better for your game, others might not; but you could pick and choose).</p>
<p>It&#8217;s too much to ask for (it intersects so much of the engine, and it would unleash a horror of potential bugs and crashes), but my number 1:</p>
<blockquote class="twitter-tweet" data-conversation="none" data-lang="en">
<p lang="en" dir="ltr"><a href="https://twitter.com/AngryAnt">@AngryAnt</a> <a href="https://twitter.com/ShawnWhite">@ShawnWhite</a> **No. 1**: (but I know we won&#39;t get it ;)) Serialization. No more opaqued, invisible, non-extensible, broken types&#8230;</p>
<p>&mdash; Adam Martin (@t_machine_org) <a href="https://twitter.com/t_machine_org/status/748396221333647361">June 30, 2016</a></p></blockquote>
<p><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script></p>
<h3>Callbacks for ALL core Unity methods</h3>
<p>This sounds small but would have positive impact on a lot of projects.</p>
<p>c.f. my <a href="http://t-machine.org/index.php/2015/06/25/unity3d-missing-docs-editorwindow-lifecycle/">reverse-engineered callback diagram for EditorWindow in Unity</a>:</p>
<p><img decoding="async" src="http://t-machine.org/wp-content/uploads/Docs-UnityEditorWindow.png" width="50%"/></p>
<p>&#8230;but we have the same problems for MonoBehaviour, for GameObject, etc. Not only are lifecycles poorly documented, but they&#8217;re inconsistent and &#8211; in multiple places (c.f. above diagram &#8220;Open Different Scene&#8221;) &#8211; they&#8217;re not even deterministic! It&#8217;s <em>random</em> what methods the Editor will call at all, let alone &#8220;when&#8221;.</p>
<p>Under the hood there must be reliable points for doing these callbacks &#8230; somewhere.</p>
<h3>Undo</h3>
<p>Undo <em>has never worked in Unity</em>. The worst stuff I narrowed down to ultra-simple demos that Unity&#8217;s own code was broken, I&#8217;ve logged bugs and Unity fixed them &#8211; but the current system is a horrible mess, much too hard to use. Many methods only randomly do what they&#8217;re supposed to, and there&#8217;s no way to debug it, because the internals are hidden.</p>
<p>If Unity exposed the actual, genuine, underlying state-change points, we could correctly implement editor extensions that support Undo 100%. I&#8217;d be happy to also use them to write an Asset that implements &#8220;easy to use Undo&#8221;, based on how other platforms have implemented it (e.g. Apple&#8217;s design of NSDocument is pretty clear and sensible, based on lists of Change Events).</p>
<p>Unity could then make &#8220;Undo that works&#8221; a <strong>mandatory requirement</strong> on the Asset Store. Currently it&#8217;s listed as mandatory, but no Asset has ever been checked for it (so far as I can tell).</p>
<p>Not least because Unity&#8217;s own code has had such problems supporting it!</p>
<h3>PropertyDrawer: doesn&#8217;t quite do what it claims to (yet)</h3>
<p>Recall what I said above: most of the Editor GUI/UX itself &#8220;hasn&#8217;t been improved for many years&#8221;. Unity made it user-extensible/replaceable many years ago &#8211; so in theory you could update / replace whatever you want. There&#8217;s a huge amount we&#8217;ve been able to update and customise (although it&#8217;s very expensive in coding time, due to a lack of modern GUI API&#8217;s, sometimes it&#8217;s well worth it).</p>
<p>But you can only replace the Inspector for a particular Component/MonoBehaviour. You cannot say &#8220;I want to replace the Inspector for GameObject&#8217;s that have Components X Y Z&#8221;.</p>
<p>Worse, if you wanted to replace e.g. the part of the Inspector that automatically draws a Vector &#8230; you can&#8217;t. </p>
<p>Unity had a great idea to solve one of these: Property Drawers. These would let you customise the rendering of sub-parts of an Inspector &#8211; the rendering of individual labels for member variables, list items etc.</p>
<p>IN THEORY this would let you write your own list-renderer that would work everywhere, and make lists very easy to use in the Editor &#8211; but only write the code once.</p>
<p>IN PRACTICE it was only implemented in a very basic way, and most of the things you want to use it for are blocked / inactive. There is NO WAY to fix this in user code.</p>
<p>(well, actually there is &#8230; c.f. <a href="http://t-machine.org/index.php/2015/01/03/unity3d-plugin-review-advanced-inspector/"my review of custom Inspectors: if you DELETE ALL UNITY CODE and rewrite ALL inspectors, you can re-implement PropertyDrawer to fulfil the original intent</a>. But this is a horrendous amount of work &#8211; AI&#8217;s author did a Herculean task! &#8211; and means you&#8217;ll never the benefit of future Unity UX / GUI updates, if there are any).</p>
<p>So: big upvote for exposing more of PropertyDrawer</p>
<blockquote class="twitter-tweet" data-lang="en">
<p lang="en" dir="ltr"><a href="https://twitter.com/ShawnWhite">@ShawnWhite</a> Inheriting / extending built-in editors and drawers.</p>
<p>&mdash; Emil Johansen (@AngryAnt) <a href="https://twitter.com/AngryAnt/status/748291842970619905">June 29, 2016</a></p></blockquote>
<p><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to fix: upgrading Apache to 2.4 / PHP 7 breaks WordPress</title>
		<link>https://new.t-machine.org/index.php/2016/06/24/how-to-fix-upgrading-apache-to-2-4-php-7-breaks-wordpress/</link>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Fri, 24 Jun 2016 15:19:01 +0000</pubDate>
				<category><![CDATA[server admin]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3869</guid>

					<description><![CDATA[WordPress had a critical update recently, and I got tonnes of emails (one from each blog I run) demanding I upgrade NOW. So I did, and upgraded Apache to latest while I was at it. Oh dear. All sites offline. First: Unable to connect &#8230;then, when I fixed Apache, I got: &#8220;Your PHP installation appears [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>WordPress had a critical update recently, and I got tonnes of emails (one from each blog I run) demanding I upgrade NOW. So I did, and upgraded Apache to latest while I was at it.</p>
<p>Oh dear. All sites offline. First:</p>
<blockquote><p>
Unable to connect
</p></blockquote>
<p>&#8230;then, when I fixed Apache, I got:</p>
<blockquote><p>
&#8220;Your PHP installation appears to be missing the MySQL extension which is required by WordPress.&#8221;
</p></blockquote>
<p>What happened, and how do I fix it?</p>
<h2>Apache 2.4 upgrade is a bit dodgy in Debian</h2>
<p>The Powers That Be decided to mess around with core parts of the config files. The right thing to do would have been to add some interactive part in the upgrade script that said: &#8220;By the way, I&#8217;ve made all your websites broken and inaccessible, because they need to be in a new subfolder. Shall I move them for you?&#8221;</p>
<p><a href="http://askubuntu.com/a/452060">Here&#8217;s the reason and the quick-fix too</a></p>
<h2>Apache 2.4 brings in PHP 7.0, replacing PHP 5</h2>
<p>PHP 5 is old, very old. Historically, PHP has also been managed in a fairly shoddy manner, very cavalier with regards to upgrades, compatibility, safety, security.</p>
<p>So &#8230; the standard way to run PHP is to have a separate folder on your server for each &#8220;version&#8221; of PHP. <em>Everyone does this; PHP is so crappy that you have little alternative</em>.</p>
<p>But this also means that when Debian &#8220;upgrades&#8221; to PHP7, there is no warning that the new config file &#8211; speciic to PHP7 &#8211; has been created and <strong>ignores the existing config file</strong></p>
<p>This is wrong in all ways, but it&#8217;s forced upon linux user by the crapness of PHP. If PHP weren&#8217;t so crap, we&#8217;d have a single global PHP config file &#8211; /etc/php/config.ini &#8211; and maybe small override files per version. But nooooooo &#8211; can&#8217;t do that! PHP is far too crap.</p>
<p>(did I say PHP is crap yet? Decent language, great for what it was meant for &#8211; but the (mis)management over the years is truckloads of #facepalm)</p>
<p>So, instead, you need to copy your PHP5 ini over the top of your PHP 7 ini &#8211; or at least &#8220;diff&#8221; them, find the things that are &#8220;off by default&#8221; in PHP 7 but must be &#8220;on&#8221; &#8230; e.g. MySQL!</p>
<p>Enable them, e.g. change this:</p>
<p>[bash]<br />
;extension=php_mysqli.dll<br />
[/bash]</p>
<p>to this:</p>
<p>[bash]<br />
extension=php_mysqli.dll<br />
[/bash]</p>
<p>&#8230;and restart Apache. Suddenly WordPress is back online!</p>
<p>[bash]<br />
/etc/init.d/apache2 restart<br />
[/bash]</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>WordPress plugin: insert link to latest post (in category) on your menu</title>
		<link>https://new.t-machine.org/index.php/2016/05/19/wordpress-plugin-insert-link-to-latest-post-in-category-on-your-menu/</link>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Thu, 19 May 2016 16:15:32 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[programming]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3866</guid>

					<description><![CDATA[Instructions: Copy/paste this into your functions.php (TODO: convert it to a standalone php file, and make it into a plygin you can activte/deactivate) Create a new menu item of type &#8220;custom URL&#8221; Make your URL &#8220;http://#latestpost:category_name&#8221; where &#8220;category_name&#8221; is the name of the category whose latest post you want to link to Make the name [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Instructions:</p>
<ol>
<li>Copy/paste this into your functions.php (TODO: convert it to a standalone php file, and make it into a plygin you can activte/deactivate)
<li>Create a new menu item of type &#8220;custom URL&#8221;
<li>Make your URL &#8220;http://#latestpost:category_name&#8221;
<ul>
<li>where &#8220;category_name&#8221; is the name of the category whose latest post you want to link to
</ul>
<li>Make the name whatver you want to appear on the menu
<li>Profit!
</ol>
<p>Based on an idea (with some upgrading + bugfixes for latest WordPress in 2016) from <a href="http://www.viper007bond.com/2011/09/20/code-snippet-add-a-link-to-latest-post-to-wordpress-nav-menu/">http://www.viper007bond.com/2011/09/20/code-snippet-add-a-link-to-latest-post-to-wordpress-nav-menu/</a></p>
<p>[php]<br />
/** Adam: add support for putting &#8216;latest post in category X&#8217; to menu: */<br />
// Front end only, don&#8217;t hack on the settings page<br />
if ( ! is_admin() ) {<br />
    // Hook in early to modify the menu<br />
    // This is before the CSS &quot;selected&quot; classes are calculated<br />
    add_filter( &#8216;wp_get_nav_menu_items&#8217;, &#8216;replace_placeholder_nav_menu_item_with_latest_post&#8217;, 10, 3 );<br />
}</p>
<p>// Replaces a custom URL placeholder with the URL to the latest post<br />
function replace_placeholder_nav_menu_item_with_latest_post( $items, $menu, $args ) {</p>
<p>        $key = &#8216;http://#latestpost:&#8217;;</p>
<p>    // Loop through the menu items looking for placeholder(s)<br />
    foreach ( $items as $item ) {</p>
<p>        // Is this the placeholder we&#8217;re looking for?<br />
        if ( 0 === strpos( $item-&gt;url, $key ) )<br />
        {</p>
<p>        $catname = substr( $item-&gt;url, strlen($key) );<br />
        // Get the latest post<br />
        $latestpost = get_posts( array(<br />
            &#8216;posts_per_page&#8217; =&gt; 1,<br />
                &#8216;category_name&#8217; =&gt; $catname<br />
        ) );</p>
<p>        if ( empty( $latestpost ) )<br />
            continue;</p>
<p>        // Replace the placeholder with the real URL<br />
        $item-&gt;url = get_permalink( $latestpost[0]-&gt;ID );<br />
        }<br />
    }</p>
<p>    // Return the modified (or maybe unmodified) menu items array<br />
    return $items;<br />
}<br />
[/php]</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Better than Civ6? Bookmarkable links for Civ4 mod: Master Of Mana sources</title>
		<link>https://new.t-machine.org/index.php/2016/05/14/better-than-civ6-bookmarkable-links-for-civ4-mod-master-of-mana-sources/</link>
					<comments>https://new.t-machine.org/index.php/2016/05/14/better-than-civ6-bookmarkable-links-for-civ4-mod-master-of-mana-sources/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Sat, 14 May 2016 12:55:34 +0000</pubDate>
				<category><![CDATA[games design]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3861</guid>

					<description><![CDATA[Master of Mana was a great game &#8211; much better than Civ5, and from what we&#8217;ve seen of Civ6, Firaxis is still playing catch-up in a few areas :). The author has disappeared, and his website has been taken over by scammers (not even going to link it), but the community has kept going the [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Master of Mana was a great game &#8211; much better than Civ5, and from what we&#8217;ve seen of Civ6, Firaxis is still playing catch-up in a few areas :).</p>
<p>The author has disappeared, and his website has been taken over by scammers (not even going to link it), but the community has kept going the SourceForge-hosted copy of the source and continues to update it. The files are ordered confusingly (inherited from previous projects, and Civ4 itself, which was mainly shipped as a commercial game, not as a moddable game!). Here&#8217;s a few key links to find interesting / useful game-design gems:</p>
<ul>
<li><a href="https://sourceforge.net/p/masterofmana/code/HEAD/tree/Xtended/Assets/Modules/NormalModules/Xtended/">Folder with the XML files from community&#8217;s updated Civs, Techs, Units &#8212; all the game stats</a>
<li><a href="https://sourceforge.net/p/masterofmana/code/HEAD/tree/Source/">Folder with all the C/C++ source code</a> (only needed for major game-changing mod features)
<li><a href="https://sourceforge.net/p/masterofmana/code/HEAD/tree/Assets/Python/Wildmana/Civs/">Folder with most/all the custom Python scripts for the MoM civilizations</a> (i.e. where 95% of Master of Mana is implemented)
<li><a href="https://sourceforge.net/p/masterofmana/code/HEAD/tree/Assets/XML/Civilizations/CIV4CivilizationInfos.xml#l202">Base definitions of all the customized Civilizations</a> (Their starting techs, their heroes, the units they start with, which units they can/cannot build or have special versions of, etc)
<li><a href="https://sourceforge.net/p/masterofmana/code/HEAD/tree/Assets/XML/Buildings/CIV4BuildingInfos.xml#">Definitions of all the special buildable city-buildings in the game</a>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2016/05/14/better-than-civ6-bookmarkable-links-for-civ4-mod-master-of-mana-sources/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>The age-old question of Civ games: Roads and rivers in center of tiles, or edges?</title>
		<link>https://new.t-machine.org/index.php/2016/04/18/the-age-old-question-of-civ-games-roads-and-rivers-in-center-of-tiles-or-edges/</link>
					<comments>https://new.t-machine.org/index.php/2016/04/18/the-age-old-question-of-civ-games-roads-and-rivers-in-center-of-tiles-or-edges/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Mon, 18 Apr 2016 21:43:33 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3853</guid>

					<description><![CDATA[Centers of tiles Edges of tiles Pros and cons Centers gives you STRAIGHT things (on a hex grid, it&#8217;s the only way to get straights!) Roman Roads Canals Large rivers Edges gives you meandering things (on a hex grid, centers only give wiggles at very large scale) River valleys Realistic medieval roads Modern roads in [&#8230;]]]></description>
										<content:encoded><![CDATA[<table>
<tr>
<th>Centers of tiles</th>
<th>Edges of tiles</th>
</tr>
<tr>
<td>
<a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-18-at-22.31.21.png" rel="attachment wp-att-3854"><img fetchpriority="high" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-18-at-22.31.21-300x245.png" alt="Screen Shot 2016-04-18 at 22.31.21" width="300" height="245" class="alignnone size-medium wp-image-3854" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-18-at-22.31.21-300x245.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-18-at-22.31.21-150x122.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-18-at-22.31.21-768x627.png 768w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-18-at-22.31.21-1024x836.png 1024w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-18-at-22.31.21-624x509.png 624w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-18-at-22.31.21.png 1076w" sizes="(max-width: 300px) 100vw, 300px" /></a>
</td>
<td>
<p><a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-18-at-22.31.10.png" rel="attachment wp-att-3855"><img decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-18-at-22.31.10-300x245.png" alt="Screen Shot 2016-04-18 at 22.31.10" width="300" height="245" class="alignnone size-medium wp-image-3855" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-18-at-22.31.10-300x245.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-18-at-22.31.10-150x122.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-18-at-22.31.10-768x627.png 768w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-18-at-22.31.10-1024x835.png 1024w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-18-at-22.31.10-624x509.png 624w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-18-at-22.31.10.png 1075w" sizes="(max-width: 300px) 100vw, 300px" /></a>
</td>
</tr>
</table>
<h2>Pros and cons</h2>
<ul>
<li>Centers gives you STRAIGHT things (on a hex grid, it&#8217;s the only way to get straights!)
<ul>
<li>Roman Roads
<li>Canals
<li>Large rivers
</ul>
<li>Edges gives you meandering things (on a hex grid, centers only give wiggles at very large scale)
<ul>
<li>River valleys
<li>Realistic medieval roads
<li>Modern roads in mountains and hills (tend to wiggle crazily)
</ul>
<li>Movement is simplified with centers: If you&#8217;re on the tile, you&#8217;re on the road/river
<li>Inhibition of movement is simplified with edges: Civilization games have traditionally given a move penalty AND a combat penalty to any tile-to-tile move that crosses an edge containing a river
</ul>
<h2>My leanings&#8230;</h2>
<p>One thing in particular that struck me from looking at the pictures:</p>
<blockquote><p>
Straight roads look so terrible that every single Civilization game since Civ1 has artifically wiggled them when rendering!
</p></blockquote>
<p>In particular, with 3D games (Civ4, Civ5 especially) this actively damages gameplay &#8211; it&#8217;s much too hard for the player to see at a glance which tiles are connected by roads, and to what extent. So much so that they cry-out for a &#8220;disable the wiggling effect on road-rendering&#8221; setting.</p>
<p>Also: I&#8217;m happpy to solve the &#8220;movement&#8221; problem by saying that if you&#8217;re in a tile that borders a road or a river, you are assumed to be &#8220;on&#8221; that road/river, with special-case handling under the hood that handles cases where two roads/rivers border the same tile. It increases the connectedness &#8220;for free&#8221; &#8211; but that&#8217;s how Civ games tend to do it anyway: encourage the player to put roads everywhere!</p>
<p>Thoughts on a postcard&#8230;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2016/04/18/the-age-old-question-of-civ-games-roads-and-rivers-in-center-of-tiles-or-edges/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>#unity3d remove yellow warnings you don&#8217;t need #unitytips</title>
		<link>https://new.t-machine.org/index.php/2016/04/16/unity3d-remove-yellow-warnings-you-dont-need-unitytips/</link>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Sat, 16 Apr 2016 11:18:20 +0000</pubDate>
				<category><![CDATA[Unity3D-tips]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3845</guid>

					<description><![CDATA[Warnings are very, very important in any compiled language: they tell you that the computer has checked your code and realised you &#8220;probably&#8221; created a bug; they even tell you something about what the bug might be. ..but the computer isn&#8217;t sure &#8211; if it could be sure, it would be a compiler Error (in [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-16-at-11.48.08.png" alt="Screen Shot 2016-04-16 at 11.48.08" width="766" height="130" class="aligncenter size-full wp-image-3846" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-16-at-11.48.08.png 766w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-16-at-11.48.08-150x25.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-16-at-11.48.08-300x51.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-16-at-11.48.08-624x106.png 624w" sizes="(max-width: 766px) 100vw, 766px" /></p>
<p>Warnings are very, very important in any compiled language: they tell you that the computer has checked your code and realised you &#8220;probably&#8221; created a bug; they even tell you something about what the bug might be.</p>
<p>..but the computer isn&#8217;t sure &#8211; if it could be sure, it would be a compiler Error (in red). So (in Unity) it&#8217;s yellow, and &#8220;optional&#8221;. But in those cases where it&#8217;s not a bug &#8211; and you know it! &#8211; it&#8217;s very annoying. Most IDE&#8217;s let you turn them on and off, Unity doesn&#8217;t &#8230; here&#8217;s how to fix it.<br />
<span id="more-3845"></span></p>
<p>NB: the global Disable technique can be used for a lot more, e.g. custom project-wide #defines &#8211; more info here: <a href="http://forum.unity3d.com/threads/how-to-set-project-wide-pragma-directives-with-javascript.71445/">Unity Forum thread on SMCS etc</a></p>
<h2>Check you really want to do this</h2>
<p>If you know what you&#8217;re doing with compiler warnings, skip this section.</p>
<p>Everyone else: think carefully. A warning usually means one of the following:</p>
<ul>
<li>You have a half-written class/algorithm you&#8217;re still working on, so there are bits of unused code, etc. NOT A BUG.
<li>You&#8217;re using the programming language in an unusual way. MIGHT BE A BUG
<ol>
<li>If the abuse is accidental: PROBABLY A BUG
<li>If the abuse is deliberate, expert-level: NOT A BUG
</ol>
<li>You typo&#8217;d a variable name, but accidentally wrote the name of a different variable. SERIOUS, MAJOR BUG
</ul>
<p>(especially note that last one: this is the worst kind of bug, one which you can look at 100 times and never see anything &#8220;wrong&#8221;, and which the computer will say is syntactically correct!)</p>
<p>So &#8230; even though many warnings are &#8220;wrong&#8221; (there&#8217;s no bug, and you know it), many of them are &#8220;right&#8221; and are your last line of defence against some of the nastiest bugs. Treat every warning on a case-by-case basis!</p>
<h2>Option 1: Disable a warning EVERYWHERE</h2>
<p>As an experienced C/C++/etc programmer, this is most useful to me. I write code like this:</p>
<p>[csharp]<br />
public void MethodBlah( int param )<br />
{<br />
    if( param &lt; 1 )<br />
        ; // PopupDialog( &quot;Spammy in-game message I want when debugging this algorithm&quot; );<br />
    else<br />
    {<br />
       // &#8230;<br />
    }<br />
}<br />
[/csharp]</p>
<p>In line 4, the shorthand &#8220;; //&#8221; lets you enable/disable a line of code with 4 keystrokes, using a built-in feature of C and all C-based languages. With modern IDE&#8217;s, there are usually better ways of doing this, but this serves as a small practical example.</p>
<p>This triggers a warning in Unity console:</p>
<p><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-16-at-12.00.28.png" alt="Screen Shot 2016-04-16 at 12.00.28" width="763" height="34" class="aligncenter size-full wp-image-3847" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-16-at-12.00.28.png 763w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-16-at-12.00.28-150x7.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-16-at-12.00.28-300x13.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-16-at-12.00.28-624x28.png 624w" sizes="(max-width: 763px) 100vw, 763px" /></p>
<p>In this case, we want to disable it EVERYWHERE; it&#8217;s a deliberate technique I&#8217;m using, so I don&#8217;t need (or want) the warning. I thought about consequences of the warning: it&#8217;s afraid you accidentally put a semi-colon on the same line as the &#8220;if&#8221; statement. It&#8217;s been almost 15 years since I last made that mistake; I&#8217;m confident I won&#8217;t make it again any time soon.</p>
<ol>
<li>Create a file &#8220;smcs.rsp&#8221;
<li>Save it in the Assets folder of your project
<li>Put one line per warning you want to suppress (see below)
<li>Modify any source file, and Unity will live reload and honour your new setting
</ol>
<p>Contents of smcs.rsp:</p>
<blockquote><p>
-nowarn: 1234
</p></blockquote>
<p>&#8220;1234&#8221; has to be the number that appeared in the Warning message in Unity console &#8211; in my case, at the end we have:</p>
<p><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-16-at-12.03.30.png" alt="Screen Shot 2016-04-16 at 12.03.30" width="139" height="35" class="aligncenter size-full wp-image-3848" /></p>
<p>&#8230;so I put in my file:</p>
<blockquote><p>
-nowarn:0642
</p></blockquote>
<p><em>NB: this only works for game-scripts. To do the same for Editor scripts, you use a different file &#8211; gmcs.rsp</em></p>
<h2>Option2: Disable a warning in ONE FILE only</h2>
<p>For instance &#8230; you&#8217;re working on a new game-feature, and tweaking it. You have a bunch of variables you are tweaking, sometimes using them in the code, sometimes not. You get this annoying warning:</p>
<p><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-16-at-12.05.01.png" alt="Screen Shot 2016-04-16 at 12.05.01" width="906" height="30" class="aligncenter size-full wp-image-3849" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-16-at-12.05.01.png 906w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-16-at-12.05.01-150x5.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-16-at-12.05.01-300x10.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-16-at-12.05.01-768x25.png 768w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-16-at-12.05.01-624x21.png 624w" sizes="(max-width: 906px) 100vw, 906px" /></p>
<p>&#8230;for this ONE FILE ONLY, you want to ignore that particular warning. When you&#8217;ve finished your long tweaking sessions, you&#8217;ll re-instate that warning.</p>
<ol>
<li>Go to the very top of your file
<li>Add one #pragma line for each warning you want to disable (see below)
</ol>
<blockquote><p>
#pragma warning disable 1234
</p></blockquote>
<p>&#8230;again, the number is whatever number appeared in the Unity console after the letters &#8220;CS&#8221;. In my case: 0219</p>
<h2>Option 3: Disable a warning for a SINGLE LINE OF CODE</h2>
<p>(&#8230;or for a block of code)</p>
<p>This works the same as Option 2, except:</p>
<ol>
<li>Find the line(s) you want to ignore the warning(s) in
<li>Before the first line, add one #pragma warning <strong>dis</strong>able for each warning
<li>After the last line, add one #pragma warning <strong>en</strong>able for each warning
</ol>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Simple #civ5 clone in Unity: hexes, movement, unit selection</title>
		<link>https://new.t-machine.org/index.php/2016/04/11/simple-civ5-clone-in-unity-hexes-movement-unit-selection/</link>
					<comments>https://new.t-machine.org/index.php/2016/04/11/simple-civ5-clone-in-unity-hexes-movement-unit-selection/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Mon, 11 Apr 2016 22:11:10 +0000</pubDate>
				<category><![CDATA[games design]]></category>
		<category><![CDATA[Unity3D]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3838</guid>

					<description><![CDATA[Current features commit 26eafb7865965fd5ef5ee3ad4863f00acf8d10a2 Generates hexes landscapes, with heights (Civ5 bored me by being flat-McFlat-in-flatland) Every hex is selectable, using custom fix for Unity&#8217;s broken mouse-click handler (see below) Any object sitting on landscape is selectable (ditto) Selected units move if you click any of the adjacent hexes (shown using f-ugly green arrows on screenshot) [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2>Current features</h2>
<p>commit 26eafb7865965fd5ef5ee3ad4863f00acf8d10a2</p>
<ul>
<li>Generates hexes landscapes, <em>with heights</em> (Civ5 bored me by being flat-McFlat-in-flatland)
<li>Every hex is selectable, using custom fix for Unity&#8217;s broken mouse-click handler (see below)
<li>Any object sitting on landscape is selectable (ditto)
<li>Selected units move if you click any of the adjacent hexes (shown using f-ugly green arrows on screenshot)
</ul>
<p>The green &#8220;you can move here&#8221; arrows look like spider-legs at the moment. #TotalFail. Next build I&#8217;m going to delete them (despite having spent ages tweaking the procgen mesh generation for them, sigh) and do something based on wireframe cages, I think.</p>
<p><a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-11-at-22.59.25.png" rel="attachment wp-att-3839"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-11-at-22.59.25.png" alt="Screen Shot 2016-04-11 at 22.59.25" width="1396" height="901" class="aligncenter size-full wp-image-3839" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-11-at-22.59.25.png 1396w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-11-at-22.59.25-150x97.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-11-at-22.59.25-300x194.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-11-at-22.59.25-768x496.png 768w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-11-at-22.59.25-1024x661.png 1024w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-04-11-at-22.59.25-624x403.png 624w" sizes="(max-width: 1396px) 100vw, 1396px" /></a></p>
<h2>Techniques</h2>
<h3>Hexes</h3>
<p>I started with simple prototyping around hexes, but soon found that it&#8217;s worth investing the time to implement all the primitives in Amit&#8217;s page on Hexagon grids for games: <a href="http://www.redblobgames.com/grids/hexagons/">http://www.redblobgames.com/grids/hexagons/</a></p>
<p>In practice, especially the ability to create a class that lets you do &#8220;setHex( HexCoord location, GameObject[] items )&#8221; and &#8220;getContentsOfHex( HexCoord location )&#8221; and things like &#8220;getNeighboursOf&#8221; &#8230; is very rapidly essential.</p>
<h3>Mouse clicks in Unity</h3>
<p>IMHO: work pretty badly. They require the physics engine, which &#8211; by definition &#8211; returns the WRONG answer when you ask &#8220;what did I click on?&#8221; (it randomises the answer every click!). They also fundamentally oppose Unity&#8217;s own core design (from the Editor: when you click any element of a prefab, it selects the prefab).</p>
<p>So I wrote my own &#8220;better mouse handler&#8221; that fixes all that. When you click in scene, it automatically propagates up the tree, finds any listeners, informs them what was clicked, and lets you write good, clean code. Unlike the Unity built-in version.</p>
<h3>Procedural meshes for arrows</h3>
<p>With hindsight, I should have just modelled these in blender. But I thought: I want a sinusoidal curve arrow; how hard can it be? I may want to animate it later, by destroying/adding points &#8211; that would be a lot of work with Unity&#8217;s partial animation system (it&#8217;s great for humanoids, less great for geometry) &#8211; but animating points in a mesh from C# code is super-easy.</p>
<p>In the end, I spent way too long tweaking the look, and on having 2-sided polygons that broke the Unity5 Standard shader by being too thin (on the plus side: I now know what that mistake looks like, and I&#8217;ll recognize it in future Unity projets. It has a very peculiar, unexpected, look to it).</p>
<p>I should have just made them in Blender, and &#8211; if I got as far as wanting to animate them &#8211; re-modelled in source code later (or found a &#8220;convert blender file to C vertices array&#8221; script, of which I&#8217;m sure there are hundreds on the web. Doh!</p>
<p>#lessonLearned.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2016/04/11/simple-civ5-clone-in-unity-hexes-movement-unit-selection/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Office suites (Word, Excel, Apple, Google) in 2016: Power-user experience</title>
		<link>https://new.t-machine.org/index.php/2016/04/10/office-suites-word-excel-apple-google-in-2016-power-user-experience/</link>
					<comments>https://new.t-machine.org/index.php/2016/04/10/office-suites-word-excel-apple-google-in-2016-power-user-experience/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Sun, 10 Apr 2016 13:29:31 +0000</pubDate>
				<category><![CDATA[advocacy]]></category>
		<category><![CDATA[fixing your desktop]]></category>
		<category><![CDATA[project management]]></category>
		<category><![CDATA[startup advice]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3836</guid>

					<description><![CDATA[Every week, I have to use six different Office Software Suites: At school: Microsoft Office 2013 At university: Microsoft Office 365 At work: OpenOffice At home: LibreOffice Everywhere: Apple Keynote Everywhere: Google Docs As an expert computer user (former SysAdmin), I&#8217;m often asked for help by people with non-computing backgrounds. When they see how many [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Every week, I have to use six different Office Software Suites:</p>
<ol>
<li>At school: Microsoft Office 2013
<li>At university: Microsoft Office 365
<li>At work: OpenOffice
<li>At home: LibreOffice
<li>Everywhere: Apple Keynote
<li>Everywhere: Google Docs
</ol>
<p>As an expert computer user (former SysAdmin), I&#8217;m often asked for help by people with non-computing backgrounds. When they see how many different suites I&#8217;m using, they&#8217;re &#8230; surprised, to say the least. Here&#8217;s a quick snapshot of what and why.<br />
<span id="more-3836"></span></p>
<h2>My history</h2>
<p>I&#8217;ve been using Office since Excel version 2.0 (which ran from the command-line).</p>
<p>In the late 1990&#8217;s, I worked as a temp secretary, and saw a lot of offices at different companies. Office 95 was the last serious improvement we saw in Microsoft&#8217;s software. Everything since then has added features of dubious value. Microsoft had to justify regular $500 upgrade fees per person. It wasn&#8217;t until 2000&#8217;s that StarOffice/OpenOffice made significant inroads in giving businesses a viable, cheap/free, alternative.</p>
<h2>Operating System</h2>
<p>No matter what Microsoft marketing tells you, there has never been a fully-working, up-to-date version of Microsoft Office for Apple computers. Is this Microsoft&#8217;s fault? Apple&#8217;s? Both &#8211; probably. If you have Macs anywhere in your business, you cannot afford to go Microsoft-only.</p>
<h2>Office 2013 for Windows</h2>
<p>I hate having to teach lessons where children fall to pieces trying to use the absurdly badly-designed UI and UX.</p>
<p>I hate being asked &#8220;but WHY is that button not where it should be?&#8221;, &#8220;WHY can&#8217;t I click over here, when normally I can?&#8221; &#8230; because usually the only true answer is &#8220;because a Manager at Microsoft had to justify their salary by moving it from where you expected, and there was nowhere good for it to go&#8221;. With older children, you can give them some honesty; the younger ones lack the ability to deal with such nuance.</p>
<p>But UK schools have been forced into a very bad contract with Microsoft, thanks to some very bad decisions by successive UK goverments (both Labout and Conservative). The docs are public &#8211; Microsoft effectively extorts tens of millions of dollars a year from UK schools and teachers, to no net benefit.</p>
<p>(if Bill Gates really wanted to improve education, he could start by cancelling Microsoft&#8217;s immoral long-term contracts with schools)</p>
<h2>OpenOffice</h2>
<p>Free, open-source. Politically neutral, not owned by any major American company with selfish aims.</p>
<p>On Mac, this is the most reliable, least buggy, fastest implementation of Office.</p>
<p>It is MUCH faster than Microsoft&#8217;s official (latest tested with Office 2013 last year, extensively). It is also MUCH less buggy &#8211; frequently opening and fixing files that were authored in Office 2013, and Office 2013 then corrupted and could no longer open!</p>
<p>However, many of the lead authors jumped-ship to LibreOffice, and maintenance + feature improvements lag behind LO.</p>
<h2>LibreOffice</h2>
<p>Free, open-source. In theory, has every feature of OpenOffice &#8211; started from same source code.</p>
<p>In practice, on Mac: more buggy, with much worse UX (many icons that in OO are very clear have become absurd abstract monstrosities in LO. First rule &#8211; &#8220;User must be able to understand icon at a glance&#8221; &#8211; often fails).</p>
<p>HOWEVER: has MUCH better support for opening the files created by latest Microsoft versions. Microsoft keeps adding features and non-backwards-compatible bits. OO doesn&#8217;t (can&#8217;t?) keep up, but LO does.</p>
<p>Sadly: &#8220;better&#8221; does not always mean &#8220;good enough&#8221;. E.g. 2015/2016 versions: if you edit a Word .docx in LO, and check the printing setup, then open in Word &#8230; the printing and layout is usually wrong by 10-20%. This makes your 1 page document 1-and-a-bit pages. Your 2-side document is now 2.3 sides &#8230; stuff like this is a signifcant problem for doc-sharing.</p>
<h2>Office 365</h2>
<p>Office 365 is Microsoft&#8217;s panic-move because Google Docs was destroying them in the market.</p>
<p>I have to use it because many UK schools and Universities have been seduced into adopting it, for &#8220;free or almost free&#8221; (trouble lurks behind that word &#8220;almost&#8221;).</p>
<p>It sucks &#8211; not because its badly written; I suspect it&#8217;s extremely well written, but the original idea was absurd. Don&#8217;t use it for anything if you can avoid it &#8211; unlike Google Docs, its very slow and buggy. I suspect because it tries to implement <em>every single feature of old Microsoft Office</em> in the web browser &#8211; and that&#8217;s a lot of code, much of it outdated and slow.</p>
<h2>Keynote</h2>
<p>Keynote is Apple&#8217;s presentation software. PowerPoint 2016 is getting close in some areas, but my laptop is running the 10-years-ago version of Keynote, and Powerpoint hasn&#8217;t caught up yet!</p>
<p>Any presentation I write &#8211; even when it has to be delivered on PowerPoint on a Windows machine &#8211; is significantly faster to write in Keynote, export to PowerPoint, open in PowerPoint, fix up incompatibilities &#8230; than to write in PowerPoint.</p>
<p>(NB: I&#8217;ve been using PowerPoint for almost 20 years, and Keynote for a little over 10 years; I am fairly productive in both. But keynote wins time and again &#8211; better UX!)</p>
<h2>Google Docs</h2>
<p>Originally free, then free and paid, and now &#8230; who knows?</p>
<p>Google keeps making scary noises here &#8211; e.g. Google Docs officially no longer exists; we&#8217;re supposed to say &#8220;Google Drive&#8221; (because Drive is unpopular, and Google Marketing is trying to prop it up). How long will Docs live on?</p>
<p>Most companies and schools I see mostly use just one part of Docs: the spreadsheets. Faster than any online Excel, and much more user-friendly, with live editing by multiple people. Excellent!</p>
<p>It&#8217;s missing many of Excel&#8217;s features &#8211; most of the advanced stuff &#8211; so it is no replacement for some. But for most people, doing ordinary work, it&#8217;s &#8220;what you need and no more&#8221;.</p>
<h2>Conclusion</h2>
<p>The era of monolithic Office Suite software is clearly over; we&#8217;re mixing-and-matching based on use-case.</p>
<p>From memory, the era never truly existed &#8211; it was conceived as a marketing/sales scam to lock-in businesses to one proprietary platform (difficult to do, but smart; Microsoft deserved to make billions out of that). It&#8217;s taken a decade or two to undo the damage that Microsoft did to the world of people who use computers to do &#8220;work&#8221;, but we&#8217;re there.</p>
<p>So &#8230; don&#8217;t be afraid to mix and match. Do learn what the lowest common multiple is for each file-format &#8211; for instance, an Office 95 doc can be opened by anything, anywhere, usually with zero corruption and bugs, whereas a docx is much less global. A .CSV file is universal, suppored not just by software, but understood by webservers and apps, but a .xlsx is not.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2016/04/10/office-suites-word-excel-apple-google-in-2016-power-user-experience/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>What makes a great #Unity3d asset? Which do you recommend?</title>
		<link>https://new.t-machine.org/index.php/2016/04/07/what-makes-a-great-unity3d-asset-which-do-you-recommend/</link>
					<comments>https://new.t-machine.org/index.php/2016/04/07/what-makes-a-great-unity3d-asset-which-do-you-recommend/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Thu, 07 Apr 2016 14:33:23 +0000</pubDate>
				<category><![CDATA[Unity3D]]></category>
		<category><![CDATA[Unity3D-tips]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3833</guid>

					<description><![CDATA[Unity is still the only major game-engine with an effective, established Asset Store. This is an enormous benefit to game developers &#8211; but do you feel you&#8217;re making full use of it? I&#8217;ve bought and used hundreds of Unity plugins, models, scripts, etc from 3rd parties. I&#8217;ve found some amazing things that transformed my development. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Unity is still the only major game-engine with an effective, established Asset Store. This is an enormous benefit to game developers &#8211; but do you feel you&#8217;re making full use of it?</p>
<p>I&#8217;ve bought and used hundreds of Unity plugins, models, scripts, etc from 3rd parties. I&#8217;ve found some amazing things that transformed my development.</p>
<blockquote><p>
<strong>TL;DR: please share your recommended assets using this form: <a href="http://goo.gl/forms/G3vddOdRL3">http://goo.gl/forms/G3vddOdRL3</a></strong>
</p></blockquote>
<h2>Things we want to improve</h2>
<p>This is a shortlist; if you&#8217;ve got areas you want to improve, please add a comment.<br />
<span id="more-3833"></span></p>
<h3>Challenge 1: Value</h3>
<p>Quality is immensely variable &#8211; there are no standards on pricing. So sometimes you get an asset worth $30 and it&#8217;s free (amazingly). Other times you pay $30 and the asset is so poorly supported, and badly written, that you feel it&#8217;s not worth anything at all.</p>
<p>Unity has an excellent refund policy: basically, if you feel you were mis-sold, you get a quick, easy refund. (allegedly &#8211; I&#8217;ve never tried to get it, but I know others who have, and said it went fine).</p>
<h3>Challenge 2: Quality</h3>
<p>The Asset Store lets you see a few screenshots and a very hard-to-read description, along with optional customer short-reviews. But we&#8217;re an audience of experts! We can write &#8211; and we need &#8211; detailed, expert reviews.</p>
<h3>Challenge 3: Comparison</h3>
<p>Most things have 20 or more competing solutions on the Asset Store, but when you&#8217;re looking at one, you can&#8217;t see any of the others (unless they randomly appear on the listing). Most of the time, an asset is &#8220;almost but not quite right&#8221;, and you need direct competitors you can compare to.</p>
<p>Bonus: if this happened more, we&#8217;d see more competition-driven improvements to assets.</p>
<h3>Challenge 4: Compatibility</h3>
<p>Many assets are incompatible with common / standard assets. They shouldn&#8217;t be. But with no-one holding the authors to account, there&#8217;s no reason for them to change this.</p>
<p>On the other hand, many assets claim compatibility with each other, which boosts their sales. So compatibility guides should help everyone.</p>
<h3>Challenge 5: Discovery</h3>
<p>How do you know what to look for when you don&#8217;t know what exists?</p>
<p>For instance, some of the major bugs in Unity that are too niche for Unity to fix &#8230; have easily-purchasable assets that fully fix the problem. If you only knew this, you would have a better, more stable Unity.</p>
<h3>Challenge 6: UX / GUI / Usability</h3>
<p>Unity puts (almost) no limits on the usability of assets. This is great for freedom. But it&#8217;s bad for long-term development. Often you install an asset are immediately lost: how am I supposed to use this thing? Does it have a GUI? Or not? Where do I click?</p>
<p>It&#8217;s often a problem for 3D models (many are packaged incorrectly), and for editor-extensions (MANY of them have major bugs eg. no support for Undo, or they corrupt when moving stuff between scenes, or &#8230; etc).</p>
<p>What would help enormously is some standardization that asset authors can apply, and users know and know how to use.</p>
<h2>What can we do about it?</h2>
<p>My plan has a couple of stages:</p>
<ol>
<li>Compile a list of &#8220;best of the asset store&#8221;
<li>Solicit reviews of everything on the list, and peer-review them for accuracy/impartiality
<li>Create &#8220;best practices&#8221; standards for authors to follow
<li>Hilight assets that adopt the best-practices
<li>Start small, scale it by pushing out to Unity community to grow
</ol>
<h3>Step 1: Share your favourite Asset-store assets!</h3>
<p>Here&#8217;s a google form for sharing your favourites. NB: this will combine all the repeat recommendations for the same asset. If you add something someone else has added you&#8217;re effectively voting it to the top:</p>
<p><a href="http://goo.gl/forms/G3vddOdRL3">http://goo.gl/forms/G3vddOdRL3</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2016/04/07/what-makes-a-great-unity3d-asset-which-do-you-recommend/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Which languages need Entity Systems libraries right now?</title>
		<link>https://new.t-machine.org/index.php/2016/03/25/which-languages-need-entity-systems-libraries-right-now/</link>
					<comments>https://new.t-machine.org/index.php/2016/03/25/which-languages-need-entity-systems-libraries-right-now/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Fri, 25 Mar 2016 20:50:55 +0000</pubDate>
				<category><![CDATA[entity systems]]></category>
		<category><![CDATA[games industry]]></category>
		<category><![CDATA[programming]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3828</guid>

					<description><![CDATA[A few months ago I ran a survey to find out which programming-languages people were using with Entity Systems: https://docs.google.com/forms/d/18JF6uCHI0nZ1-Yel76uZzL1UfFMI21QvDlcnXSGXSHo/viewform I&#8217;m about to publish a Patreon article on Entity Systems (here if you want to support me), but I wanted to put something up on my blog at the same time, so here&#8217;s a quick [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>A few months ago I ran a survey to find out which programming-languages people were using with Entity Systems:</p>
<p><a href="https://docs.google.com/forms/d/18JF6uCHI0nZ1-Yel76uZzL1UfFMI21QvDlcnXSGXSHo/viewform">https://docs.google.com/forms/d/18JF6uCHI0nZ1-Yel76uZzL1UfFMI21QvDlcnXSGXSHo/viewform</a></p>
<p>I&#8217;m about to publish a Patreon article on Entity Systems (<a href="http://www.patreon.com/tmachine">here if you want to support me</a>), but I wanted to put something up on my blog at the same time, so here&#8217;s a quick look at the stats.<br />
<span id="more-3828"></span></p>
<h2>Overview</h2>
<p>So far we&#8217;ve had 203 responses, with at least one respondent for each language I included as an option (taken from the 50 most popular langauges globally):</p>
<p><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-25-at-20.16.56.png" alt="Screen Shot 2016-03-25 at 20.16.56" width="479" height="742" class="aligncenter size-full wp-image-3829" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-25-at-20.16.56.png 479w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-25-at-20.16.56-97x150.png 97w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-25-at-20.16.56-194x300.png 194w" sizes="(max-width: 479px) 100vw, 479px" /></p>
<p>Most respondents ticked 3-5 languages as their &#8220;I&#8217;m competent in this language&#8221;, suggesting quite experienced programmers.</p>
<h3>Cleaning the data</h3>
<p>Pascal/Delphi. Hmm. I could not find any Entity Systems libraries written in Pascal, and the only game-engines I could find were extremely niche and/or hadn&#8217;t seen a release for several years. I don&#8217;t know where these votes came from, so I pulled them out into a separate spreadsheet, and looked at them in more detail:</p>
<p><a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-25-at-20.19.21.png" rel="attachment wp-att-3830"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-25-at-20.19.21-1024x500.png" alt="Screen Shot 2016-03-25 at 20.19.21" width="625" height="305" class="aligncenter size-large wp-image-3830" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-25-at-20.19.21-1024x500.png 1024w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-25-at-20.19.21-150x73.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-25-at-20.19.21-300x147.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-25-at-20.19.21-768x375.png 768w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-25-at-20.19.21-624x305.png 624w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-25-at-20.19.21.png 1644w" sizes="(max-width: 625px) 100vw, 625px" /></a></p>
<p><strong>Summary:</strong> the people who ticked Pascal pretty much ignored the rest of the form and simply ticked &#8220;Pascal for everything!&#8221;. They generally claimed not to know any other languages, unlike the other respondents.</p>
<p>I&#8217;m assuming there&#8217;s some kind of tech in a Delphi library somewhere that&#8217;s called &#8220;Entity system&#8221;, but which means something very different from what we&#8217;re talking about here. The words are pretty generic, so that wouldn&#8217;t surprise me (if you know of one, please comment &#8211; I googled a few times but didn&#8217;t find anything substantial. But bear in mind Google hides results they think you won&#8217;t like, so it may be easy for others to see).</p>
<p>Personally, I&#8217;m ignoring most of the Pascal responses.</p>
<h2>Hilights</h2>
<h3>Everyone knows C++, C#, Java, and C</h3>
<p>This is reassuring: Java is the biggest commercial language today, and I expect systems-level (i.e. game-dev) professional programmers to know it.</p>
<p>Likewise, C++ is the biggest commercial language in gamedev, and I expect all mainstream (non-mobile, non-web) gamedev programmers to know it.</p>
<p>C# was a surprise &#8211; but I strongly suspect Unity is single-handedly responsible for this.</p>
<p>C &#8230; suggests to me that most respondents are veteran programmers, who&#8217;ve been programming for at least 15 years. Anyone around that long would have learnt C; anyone who&#8217;s been programming 10 years or less is unlikely to have encountered C, as C++ had pretty much wiped it out for new commercial development by then.</p>
<h3>Web languages are well represented, albeit less than mainstream gamedev</h3>
<p>We see a bit of Ruby, PHP, lots of JS.</p>
<p>Two big presences are Python and JS. Python is the new kid on the block, and Javascript is/was unheard-of in most gamedev. I suspect JS is here because of <a href="http://twitter.com/richard_lord">@richard_lord</a> and his popular <a href="http://www.richardlord.net/blog/introducing-ash">Ash framework for ActionScript</a>, which seems to have been popular among web-background people. Both ex-AS coders &#8211; who naturally moved sideways to JS as Flash/AS began to fade &#8211; and JS coders looking for a framework to port from a similar language.</p>
<h3>Most usage of ES is happening in C#</h3>
<p>Although half of all respondents know Java, C++, and/or C# &#8230; only 8% use ES&#8217;s with Java, 15% with C++, and 25% (The winner!) with C#.</p>
<h3>C# and C++ desperately need Entity Systems</h3>
<p>(Bear in mind there are many open-source implementations in C#, and many MANY in C++)</p>
<p>C++ is especially desperate if we consider how few people are using them already vs actually want to be using them.</p>
<p>For the C++ users, I suspect Unreal is part of the problem: with no meaningful support for languages other than C++, and no modern Entity System that I&#8217;m aware of, it might explain the pent-up demand for a C++ solution. Otherwise, I would guess it&#8217;s a lot of people with home-grown C++ game-engines who haven&#8217;t the time/resource to convert to an ES yet.</p>
<p><strong>Side note:</strong> the small group of Unreal Blueprints users all seem to want an Entity System in Blueprints. The sample size is too small to be significant (4 people right now), but it&#8217;s enough to suggest polling Unreal users in particular and seeing what response you get.</p>
<h3>Current game-engines run in narrow range of langs; devs want much broader range</h3>
<p>The game-engines used by respondents overwhelmingly support the classic, old, low-level languages (C, C++) and the biggest commercial modern languages (C#, Java).</p>
<p>&#8230;but the langs people wish they supported are vastly more diverse, with demand in particular for Swift, Rust, and Lua.</p>
<h2>Conclusions going forwards</h2>
<p>TL;DR: If you&#8217;re writing about Entity Systems, put your example code in <em>any of</em> C, C#, C++, Java, or Javascript &#8211; almost all developers will be happy reading and effortlessly using/porting that code.</p>
<p>If you&#8217;re making a new Entity System, and you want to make a significant success, aim for C++ and/or C#.</p>
<p>(although NB: I suspect that a skew towards responses from Unity devs has inflated the C# number a little; to be on the safe side, I&#8217;d lean towards C++ for a new engine, if I were you)</p>
<h3>Followups&#8230;</h3>
<p>I&#8217;ll leave the survey open. If anyone wants to promote it, and see if we can get a bigger number of replies (1,000 devs would be nice!), the URL is here:</p>
<p><a href="https://docs.google.com/forms/d/18JF6uCHI0nZ1-Yel76uZzL1UfFMI21QvDlcnXSGXSHo/viewform">https://docs.google.com/forms/d/18JF6uCHI0nZ1-Yel76uZzL1UfFMI21QvDlcnXSGXSHo/viewform</a></p>
<p>The form-results are free and open to anyone to view here:</p>
<p><a href="https://docs.google.com/forms/d/18JF6uCHI0nZ1-Yel76uZzL1UfFMI21QvDlcnXSGXSHo/viewanalytics">https://docs.google.com/forms/d/18JF6uCHI0nZ1-Yel76uZzL1UfFMI21QvDlcnXSGXSHo/viewanalytics</a></p>
<p>And, of course, I&#8217;ll be using some of this in my upcoming Patreon articles on detailed Entity System design and development. After this survey, I&#8217;m inclined to push harder on producing a decent implementation for Unity, supplied as a C# libary that can also be imported to other engines:</p>
<p><a href="http://www.patreon.com/tmachine">http://www.patreon.com/tmachine</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2016/03/25/which-languages-need-entity-systems-libraries-right-now/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>LFG: I&#8217;m looking for CTO/TechDirector/Head of Mobile/Consulting roles in CA, TX, London, and Asia</title>
		<link>https://new.t-machine.org/index.php/2016/03/25/lfg-im-looking-for-ctotechdirectorhead-of-mobileconsulting-roles-in-ca-tx-london-and-asia/</link>
					<comments>https://new.t-machine.org/index.php/2016/03/25/lfg-im-looking-for-ctotechdirectorhead-of-mobileconsulting-roles-in-ca-tx-london-and-asia/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Fri, 25 Mar 2016 14:31:37 +0000</pubDate>
				<category><![CDATA[entrepreneurship]]></category>
		<category><![CDATA[games industry]]></category>
		<category><![CDATA[marketing and PR]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[project management]]></category>
		<category><![CDATA[recruiting]]></category>
		<category><![CDATA[startup advice]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3824</guid>

					<description><![CDATA[TL;DR: experienced CEO/CTO/TechDirector with long background in programming, sales, and business management (Corporate, iPhone/Android, Games, Education) looking for strategic roles in USA, UK, and Asia. After a year-out to do a post-graduate degree in Education, I&#8217;m looking for something new and exciting to do next. My primary goal is to boost a company or team [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><em>TL;DR: experienced CEO/CTO/TechDirector with long background in programming, sales, and business management (Corporate, iPhone/Android, Games, Education) looking for strategic roles in USA, UK, and Asia.</em></p>
<p>After a year-out to do a post-graduate degree in Education, I&#8217;m looking for something new and exciting to do next. My primary goal is to boost a company or team rapidly and show significant outcomes &#8211; increased revenue or other KPI&#8217;s &#8211; either through Consulting or full/part-time senior leadership.<br />
<span id="more-3824"></span></p>
<p>Things I&#8217;m particularly interested in right now:</p>
<ul>
<li>VR &#8211; my DK2 sits on my desk glaring at me, wondering why I don&#8217;t play with it any more. &#8220;I&#8217;ve been too busy with non-VR work!&#8221;, I cry.
<li>Android, iOS &#8211; I&#8217;ve shipped dozens of apps. I&#8217;ve designed some, programmed some, project-managed some, and been an emergency &#8220;fixer&#8221; brought in to help established teams.
<li>Computer games &#8211; I&#8217;ve played well over 2,000 games. And I&#8217;ve written game-engines, libraries, tutorials, unlaunched indie games, published AAA games, MMOs &#8211; bits of everything.
<li>China and Korea &#8211; many years ago I studied basic Chinese (Mandarin) and Korean/Hangul; I would love an excuse to become fluent in either.
<li>San Francisco / Bay Area &#8211; I&#8217;ve visited dozens of times for conferences, meetings, holidays, etc, but never lived there. I had non-negotiable ties to London. But &#8230; now I&#8217;m free to relocate and travel.
</ul>
<p>Ways I can help your company:</p>
<ul>
<li>Creating a thriving company-culture from the ground-up, especially a tech-friendly and tech-respecting culture that works across non-tech divisions
<li>Identifying your strategic problems, finding high-level solutions, and organizing and motivating teams to work on them
<li>Identifying immediate problems, finding &#8220;what can we do TODAY?&#8221; solutions, and executing on them rapidly and effectively.
<li>Talk technically to tech teams, commercially to marketing teams, and pragmatically to ops and finance teams
<li>Build massive empathy with developer-communities, engaging frequently and effectively both with individuals and teams
<li>Educate and enthuse C-level management and senior management on how to better exploit tech within their own spheres, and how to interface better with tech teams
<li>Public engagements &#8211; pitch-meetings, conference talks, client/account-management, sales support, etc.
</ul>
<p>Miscellaneous qualifications:</p>
<ul>
<li>Certified ScrumMaster
<li>Degree in Computer Science (Cambridge University)
<li>BCS Scholar (British Computer Society)
<li>Fluent in many programming languages
<li>StackOverflow score of 20,000+
<li>Patented server technology for scalable SaaS-style backends
<li>Contributed chapters to two books on Game Programming
</ul>
<p>CV available on request &#8211; or have a look at my LinkedIn for basic career history. Email address: adam.m.s.martin @ gmail</p>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2016/03/25/lfg-im-looking-for-ctotechdirectorhead-of-mobileconsulting-roles-in-ca-tx-london-and-asia/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Trying to paint an in-editor Mesh in #unity3d: harder than you&#8217;d expect</title>
		<link>https://new.t-machine.org/index.php/2016/03/13/trying-to-paint-a-mesh-in-unity3d-so-hard-it-makes-you-hate-unity/</link>
					<comments>https://new.t-machine.org/index.php/2016/03/13/trying-to-paint-a-mesh-in-unity3d-so-hard-it-makes-you-hate-unity/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Sun, 13 Mar 2016 12:17:58 +0000</pubDate>
				<category><![CDATA[Unity3D]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3803</guid>

					<description><![CDATA[A modest desire The red pyramid in this image is a custom handle (3D) that you can grab, drag, and move around the screen. When it touches another GameObject, it finds any Sockets on that object, and attempts to rotate + move + scale the first object so that they connect together, like magnets. &#8230;these [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2>A modest desire</h2>
<p>The red pyramid in this image is a custom handle (3D) that you can grab, drag, and move around the screen. When it touches another GameObject, it finds any Sockets on that object, and attempts to rotate + move + scale the first object so that they connect together, like magnets.</p>
<p><a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-13-at-11.20.55.png" rel="attachment wp-att-3804"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-13-at-11.20.55.png" alt="Screen Shot 2016-03-13 at 11.20.55" width="382" height="342" class="aligncenter size-full wp-image-3804" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-13-at-11.20.55.png 382w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-13-at-11.20.55-150x134.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-13-at-11.20.55-300x269.png 300w" sizes="(max-width: 382px) 100vw, 382px" /></a><br />
<span id="more-3803"></span></p>
<p>&#8230;these things are so useful I quickly end up adding many to each GameObject. I have different sizes and &#8220;types&#8221; (type A can only connect to other type A, etc) &#8211; each with a different mesh (Pyramid, Cube, Sphere, squiggle &#8230; whatever). But Unity has a weak Hierarchy View, and it&#8217;s very hard to see which is which:</p>
<p><a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-13-at-11.23.56.png" rel="attachment wp-att-3805"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-13-at-11.23.56.png" alt="Screen Shot 2016-03-13 at 11.23.56" width="385" height="148" class="aligncenter size-full wp-image-3805" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-13-at-11.23.56.png 385w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-13-at-11.23.56-150x58.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-13-at-11.23.56-300x115.png 300w" sizes="(max-width: 385px) 100vw, 385px" /></a></p>
<p>This is a 5+ years old problem in Unity. Their API for is private, making it hard for 3rd parties to fix it. I&#8217;ve hacked bits of it myself, but the hacks have often broken in successive versions of Unity, and need constant refreshing &#8211; they are not a robust solution.</p>
<p>So, I wanted to make a Custom Inspector (Unity allows these to be customized, and gives full control to the developer, although the API&#8217;s for it are poor) that would render each and give a preview icon of the custom meshes (where the white squares are in this image):</p>
<p><a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-13-at-11.20.45.png" rel="attachment wp-att-3806"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-13-at-11.20.45.png" alt="Screen Shot 2016-03-13 at 11.20.45" width="411" height="182" class="aligncenter size-full wp-image-3806" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-13-at-11.20.45.png 411w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-13-at-11.20.45-150x66.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-13-at-11.20.45-300x133.png 300w" sizes="(max-width: 411px) 100vw, 411px" /></a></p>
<h2>Summary: Display a thumbnail of the mesh for each object, in the Inspector</h2>
<p>This is a 3D engine, with a 2D mode (which is still 3D, but has hundreds of extra classes to facilitate 2D game dev). It was customizable almost from Day 0, and &#8220;customization&#8221; is one of the biggest current selling points &#8211; c.f. the Asset Store, from which Unity makes vast amounts of money.</p>
<p>So: we expect that &#8220;render a simple mesh and display it next to the text saying the object&#8217;s name&#8221; should be easy, right?</p>
<p>Let&#8217;s go on a little journey&#8230;</p>
<h2>Problem 1: How to make that pyramid?</h2>
<p>Unity does not allow developers to make clickable 3D objects in the Editor.</p>
<p>There are a bunch of ugly, pre-made 2D only &#8220;handles&#8221; you are given, and one of them can be customized (through a torturous process of specifying matrices) into making arbitrary rectangles appear in 2D, with no lighting, and breaking the 3D positions of the Scene.</p>
<p>I was using that up until now. It&#8217;s ugly, but it works fine. Surprisingly, there&#8217;s not even a &#8220;drawTriangle&#8221; command. The common workaround seems to be: find the largely undocumented Graphics.DrawMesh&#8230;() methods, use trial-and-error to discover that one of them (only one!) works, and use that to draw a Mesh here.</p>
<h2>Problem 2: How is that pyramid clickable?</h2>
<p>I got the mesh drawing. This took a while &#8230; but what&#8217;ll really flubble your goat is when you try to make it clickable, draggable. As far as I can tell, Unity has no support for clickable meshes or objects.</p>
<p>There&#8217;s huge support in-game, but in-Editor it vaniehs. Their click-detection is almost entirely physics-based, but in the Editor they have to disable the Physics engine, otherwise editing would be a nightmare. Imagine: you&#8217;d try to move things, and the physics would bounce them back, or block them, or send them flying.</p>
<p>Some of physics is enabled &#8211; the basic collision-detection. But you cannot use this to do Editor features: if you did, the physics for the editor features would interfere with the physics for the game, or become part of it. Unity does not currently allow running multiple physics simulations in parallel. IIRC it&#8217;s a feature of the middleware they&#8217;re using, but they&#8217;ve disabled that feature.</p>
<p>The basic elements of interaction in 3D are therefore mostly missing in Editor: Collision detection, Mouse over, Mouse clicks, etc. There are some old bits of legacy code for some of these, but they&#8217;ve not been maintained in many years, and are no longer (or never were) included in the main documentation.</p>
<h3>Back to Basics: Problem 2.1: Unity has no Triangle class</h3>
<p>Workaround: create a &#8220;has the mouse clicked this triangle?&#8221; routine, and apply it to every triangle in the mesh. Use this to build-up a working &#8220;click and drag a mesh&#8221; routine.</p>
<p>Obviously, being a 3D engine, Unity will have a method &#8220;Triangle.ContainsPoint( Vector2 )&#8221;. Right?</p>
<p>Wrong. You have to write your own. Or use Google &#8211; unfortunately the first two I tried had bugs (which is disappointing; this is a very well-known/solved problem in Computer Graphics). I fixed the maths, did some tweaking, and it worked fine.</p>
<p>OK. Now we have a mesh that renders in Editor, and is clickable and draggable in Editor. Finally we can add the preview to the Inspector.</p>
<h2>Problem 3: Unity&#8217;s &#8220;click mouse button&#8221; API is undocumented</h2>
<p>Now you hit problems with mouse control. Unity has a good (albeit non-extensible) system for this &#8211; but the smart person who wrote it didn&#8217;t bother documenting how it works, and it&#8217;s non-trivial. Without documentation, almost no-one knows how to use it, and after many attempts, most give up and use something lower quality they hack together. c.f. any Google search on &#8220;Unity scene view mouse clicks&#8221;.</p>
<p>It took me months to reverse-engineer it, partly by decompiling the Unity libraries and partly through intelligent guess work based on previous game engines I worked on. I&#8217;ve met a few others who&#8217;ve done the same, but none who found it especially quick or easy. </p>
<p>Since 2015, some of this system is now pseudo documented, e.g. via some good Unity blog posts. But those aren&#8217;t linked-to from anywhere, and you have to work quite hard to find them (I don&#8217;t have the links any more; when I tried a quick search to find them, I drew a blank).</p>
<h2>Problem 4: Unity&#8217;s mousePosition.y has been broken for 5 years</h2>
<p>This core feature &#8211; the y-position of the mouse &#8211; has been broken for so long that everyone has now hardcoded their games to workaround it. I suspect Unity has decided: &#8220;We cannot fix it, it MUST remain broken.&#8221;</p>
<p>IMHO it would be fairly easy to fix: create a new global API call that returns the mouse-position (NB: There is no such API call in Unity today; there are two obscure calls in different places, one that only works in game, one that works in game AND in editor, and they return incompatible values).</p>
<p>Workaround: take the y-position, multiply by -1, add it to the Sceneview height. But not the camera&#8217;s height (as advised by most websites and forum posts) &#8211; Sceneview has a magic height that is 5 to 25 pixels <em>different, and it varies over time</em> from the Scene View Camera height. Hmm.</p>
<h2>Problem 5: Unity has no GUI system for the Editor</h2>
<p>After 2 years of promising a modern GUI API, Unity finally published (almost 2 years ago) a reasonable new GUI by hiring the author of the main 3rd party GUI-replacement for Unity.</p>
<p>A few years ago, Unity crop rebranded the nasty, end-of-life, old GUI as &#8220;the legacy GUI&#8221; and brushed it under the carpet (with good reason). Sadly, despite the marketing department&#8217;s claims, it&#8217;s very much not legacy: it&#8217;s the only GUI you can use in Editor.</p>
<h2>Problem 6: I already drew a mesh; can&#8217;t I do the same again?</h2>
<p>I said the Graphics.DrawMesh&#8230;() methods were undocumented, and only one works (in that context). But when you try to use them in the Inspector, they both silently fail.</p>
<p>Since there&#8217;s no documentation, there&#8217;s no way of knowing if this is hardcoded, or if it does in fact work, but requires a secret method call first, or a pre-multiplication on your arguments, or &#8230; or &#8230; etc. Something that only Unity staff know about.</p>
<p>UPDATE: <a href="https://twitter.com/snlehton">Sampsa sent me some code on twitter</a> which gets DrawMeshNow working using some GL calls:</p>
<p><img decoding="async" src="https://pbs.twimg.com/media/CdgZy3vUkAA8wEx.jpg:large"/></p>
<h2>Problem 7: Unity often blocks/disables procedural content</h2>
<p>BUT WAIT!</p>
<p>There is a library call for rendering thumbnails of meshes, and it is used widely throughout Unity. </p>
<p>Ah, except &#8230; As a developer, you are blocked from using it on user-generated content.</p>
<p>You are also banned on using it on content generated by scripts: you can create a Mesh in script, but you can&#8217;t use this library call on it. The library call is hardcoded to only work on things that are compiled as part of the Build.</p>
<p>If I were to make a bad Plugin, that could only use a pre-made set of meshes, this would be fine [*]. But I want users to make custom meshes (that are easier to use with their own games) and scripted-meshes (that adapt based on context, making it many times easier to build large, complex games), etc.</p>
<p>I hit this limitation of Unity depressingly often. Many core features of Unity have the same or similar restriction: they are disabled both for runtime (procedural content in-game) and for developers working live with procedural gen (who do many things in script).</p>
<p>[*] = (actually, it wouldn&#8217;t be fine. It would <em>work</em>, but still be a little ugly, because Unity doesn&#8217;t let plugin authors bundle their meshes. My meshes would pollute every game-project that used them. You see this a lot in plugins, random things dumped into your project, because the plugin author cannot stop Unity from spamming your project with them)</p>
<h2>&#8230;at which point, I gave up and wrote this blog post</h2>
<p>I&#8217;ve decided I&#8217;ll do what most people do:</p>
<ol>
<li>Give in.
<li>Make my Plugin worse (delete features and code I&#8217;d already implemented)
<li>&#8230;so that it&#8217;ll work with Unity
</ol>
<p>When <a href="http://forum.unity3d.com/threads/released-snap-and-plug-join-anything-to-anything.268490/">the next version of Snap-and-Plug</a> goes live, and meshes can&#8217;t be customized in code, and can&#8217;t be reactive &#8230; you&#8217;ll know why.</p>
<h1>Conclusion: I hate extending Unity</h1>
<p>You&#8217;ll read this, be glad it wasn&#8217;t you that wasted hours banging your head against these brick walls, and move on. I have now battered through the pain, and I&#8217;ve decided on my workaround.</p>
<p>But next time you buy a Unity Asset Store plugin, and find yourself disappointed that it crashes, or works strangely, or doesn&#8217;t have a great GUI &#8230; instead of hating on the author(s), consider this: maybe &#8211; just maybe &#8211; it&#8217;s not their fault. Unity has a lot of work to do in cleaning-up their Editor/Plugin/Developer API&#8217;s&#8230;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2016/03/13/trying-to-paint-a-mesh-in-unity3d-so-hard-it-makes-you-hate-unity/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Improved interactive GUI for Snap-and-Plug (glue/vertex snapping for complex objects in #Unity3d) #screenshotsaturday</title>
		<link>https://new.t-machine.org/index.php/2016/03/12/improved-interactive-gui-for-snap-and-plug-gluevertex-snapping-for-complex-objects-in-unity3d-screenshotsaturday/</link>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Sat, 12 Mar 2016 20:52:26 +0000</pubDate>
				<category><![CDATA[games design]]></category>
		<category><![CDATA[Unity3D]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3796</guid>

					<description><![CDATA[Some screenshots from today&#8217;s improvements. I&#8217;m moving gradually towards releasing version 2. Shortlist of changes/improvements below&#8230; From this mess &#8230; to this: Building some odd machines to test it works: Features and fixes recently added Use shaded, materialed meshes for in-editor handles, instead of flat ugly rectangles and tris Click/tap a socket&#8217;s handle to directly [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Some screenshots from today&#8217;s improvements. I&#8217;m moving gradually towards releasing version 2. Shortlist of changes/improvements below&#8230;</p>
<table>
<tr>
<th colspan="2">From this mess &#8230; to this:</th>
</tr>
<tr>
<td>
<a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-14.59.24.png" rel="attachment wp-att-3797"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-14.59.24-300x257.png" alt="Screen Shot 2016-03-12 at 14.59.24" width="300" height="257" class="alignnone size-medium wp-image-3797" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-14.59.24-300x257.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-14.59.24-150x129.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-14.59.24-624x535.png 624w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-14.59.24.png 669w" sizes="(max-width: 300px) 100vw, 300px" /></a>
</td>
<td>
<a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-20.43.32.png" rel="attachment wp-att-3798"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-20.43.32.png" alt="Screen Shot 2016-03-12 at 20.43.32" width="420" height="398" class="alignnone size-full wp-image-3798" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-20.43.32.png 420w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-20.43.32-150x142.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-20.43.32-300x284.png 300w" sizes="(max-width: 420px) 100vw, 420px" /></a></td>
</tr>
</table>
<table>
<tr>
<th colspan="2">Building some odd machines to test it works:</th>
</tr>
<tr>
<td>
<a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-15.00.21.png" rel="attachment wp-att-3800"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-15.00.21-300x125.png" alt="Screen Shot 2016-03-12 at 15.00.21" width="300" height="125" class="alignnone size-medium wp-image-3800" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-15.00.21-300x125.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-15.00.21-150x62.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-15.00.21-768x319.png 768w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-15.00.21-1024x425.png 1024w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-15.00.21-624x259.png 624w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-15.00.21.png 1252w" sizes="(max-width: 300px) 100vw, 300px" /></a>
</td>
<td>
<a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-19.50.44.png" rel="attachment wp-att-3801"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-19.50.44-300x246.png" alt="Screen Shot 2016-03-12 at 19.50.44" width="300" height="246" class="alignnone size-medium wp-image-3801" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-19.50.44-300x246.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-19.50.44-150x123.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-19.50.44-768x629.png 768w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-19.50.44-624x511.png 624w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-03-12-at-19.50.44.png 810w" sizes="(max-width: 300px) 100vw, 300px" /></a>
</td>
</tr>
</table>
<h3>Features and fixes recently added</h3>
<ul>
<li>Use shaded, materialed meshes for in-editor handles, instead of flat ugly rectangles and tris
<li>Click/tap a socket&#8217;s handle to directly select it in the Scene view
<li>Meshes are resized to fit the user-selected &#8220;socket size&#8221; variable
<li>Only handles that are facing you are rendered; HUGE improvement for complex levels/machines/buildings/etc
<li>Only handles you can see are clickable/draggable; HUGE improvement for complex scenes (where accidental clicks happened too often!)
</ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>An easy &#8220;solution&#8221; to the pre-owned games problem that&#8217;s destroying #gamedev</title>
		<link>https://new.t-machine.org/index.php/2016/02/25/an-easy-solution-to-the-pre-owned-games-problem-thats-destroying-gamedev/</link>
					<comments>https://new.t-machine.org/index.php/2016/02/25/an-easy-solution-to-the-pre-owned-games-problem-thats-destroying-gamedev/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Thu, 25 Feb 2016 16:34:28 +0000</pubDate>
				<category><![CDATA[games industry]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3793</guid>

					<description><![CDATA[In case you weren&#8217;t aware, in a nutshell: Dev writes game, gets share of profits when sold Publisher manufactures game ($10 loss) Publisher sells game to retailer at $30 ($20 profit) Retailer sells game to public at $60 ($30 profit) &#8230;then some of the retailers spotted a flaw in the system, and started doing this: [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In case you weren&#8217;t aware, in a nutshell:</p>
<ul>
<li>Dev writes game, gets share of profits when sold
<li>Publisher manufactures game ($10 loss)
<li>Publisher sells game to retailer at $30 ($20 profit)
<li>Retailer sells game to public at $60 ($30 profit)
</ul>
<p><span id="more-3793"></span></p>
<p>&#8230;then some of the retailers spotted a flaw in the system, and started doing this:</p>
<ul>
<li>All the above, BUT:
<li>Retailer buys game back from Consumer at $10 ($10 loss)
<li>Retailer sells game to new Consumer at $55 ($45 profit)
<li>Instead of &#8220;selling&#8221; 100,000 copies of the game (giving money to gamedev), retailer &#8220;sells&#8221; 1,000 copies of the game, and then buys/resells it 99,000 times
<li>NET RESULT: Publishers add crap that consumers hate &#8211; e.g. pay-for DLC &#8211; and more developers go out of business than before
</ul>
<h2>A simple solution&#8230;</h2>
<p>Serious question: why aren&#8217;t publishers offering to buy-back used games for $x%, giving both cash and (say) free DLC for other games?</p>
<p>Having thought about this, it seems the reason game-retailers et al are causing problems is because they have zero competition in the re-purchasing market; this allows them to re-purchase at prices lower than they pay for the original copy.</p>
<p>Take that away from them, and &#8230; problem solved.</p>
<p>No?</p>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2016/02/25/an-easy-solution-to-the-pre-owned-games-problem-thats-destroying-gamedev/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Making a night-vision shader for animals in #unity3d</title>
		<link>https://new.t-machine.org/index.php/2016/01/19/making-a-night-vision-shader-for-animals-in-unity3d/</link>
					<comments>https://new.t-machine.org/index.php/2016/01/19/making-a-night-vision-shader-for-animals-in-unity3d/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Tue, 19 Jan 2016 04:08:29 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3781</guid>

					<description><![CDATA[In the FPS roguelike I&#8217;ve been working on, a core feature is that each ability modifies how you interact with the world &#8211; you see things differently, you move differently, etc. Night Vision I&#8217;m working on a tiny level demo to show some of my ideas together. I want one character that can see in [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In the FPS roguelike I&#8217;ve been working on, a core feature is that each ability modifies how you interact with the world &#8211; you see things differently, you move differently, etc.</p>
<h2>Night Vision</h2>
<p>I&#8217;m working on a tiny level demo to show some of my ideas together. I want one character that can see in the dark, something like the &#8220;InfraVision&#8221; of D&amp;D.</p>
<p>Spec:</p>
<ul>
<li>Character can see independent of the existence of lights in scene
<li>Vision is imperfect, significantly weaker than daylight vision, in terms of details, colours, etc
<li>Vision enables easy location + identification of other creatures
</ul>
<h2>Screenshots</h2>
<p>Here&#8217;s my orc (a test avatar I already had) sitting on top of a building:</p>
<p><a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.23.56.png"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.23.56-1024x894.png" alt="Screen Shot 2016-01-19 at 03.23.56" width="625" height="546" class="aligncenter size-large wp-image-3782" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.23.56-1024x894.png 1024w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.23.56-150x131.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.23.56-300x262.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.23.56-624x545.png 624w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.23.56.png 1107w" sizes="(max-width: 625px) 100vw, 625px" /></a></p>
<h3>Step 1: cancel the lighting</h3>
<p>We use Unity&#8217;s &#8220;GetComponent<Camera>.SetReplacementShader( Shader, &#8220;&#8221; )&#8221; to change the shader to a simple &#8220;Unlit&#8221; shader (Unity provides a built-in one).</p>
<p>[csharp]<br />
	[ContextMenu(&quot;Enable dark vision&quot;)]<br />
	public Shader shaderDarkVision;</p>
<p>	public void Start()<br />
	{<br />
		if( shaderDarkVision == null )<br />
			shaderDarkVision = Shader.Find(&quot;Unlit/Texture&quot;);<br />
	}<br />
	public void EnableDarkVision()<br />
	{<br />
		GetComponent&lt;Camera&gt;().SetReplacementShader( shaderDarkVision, &quot;&quot; );<br />
	}<br />
[/csharp]</p>
<p><a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.23.45.png"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.23.45-1024x904.png" alt="Screen Shot 2016-01-19 at 03.23.45" width="625" height="552" class="aligncenter size-large wp-image-3783" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.23.45-1024x904.png 1024w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.23.45-150x132.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.23.45-300x265.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.23.45-624x551.png 624w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.23.45.png 1107w" sizes="(max-width: 625px) 100vw, 625px" /></a></p>
<h3>Step2: Add a vignette to nerf it</h3>
<p>I want the DarkVision to be significantly less perfect than daylight vision, so let&#8217;s add a simple vignette (Unity has downloadable examples of this shader in their docs, but I only found it after I&#8217;d got mine working!).</p>
<p>This took me a long time to get working, just to get accurate screen-positions of shader pixels &#8211; so much of Unity&#8217;s semi-proprietary Shader language is still undocumented, after many years. I knew all the maths, and had implemented the effect in OpenGL / GLSL in minutes, but it took an hour or so in Unity. And once it was working, I got sidetracked in tweaking the exact curve of darkness of vignette.</p>
<p><a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.24.22.png"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.24.22-1024x884.png" alt="Screen Shot 2016-01-19 at 03.24.22" width="625" height="540" class="aligncenter size-large wp-image-3784" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.24.22-1024x884.png 1024w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.24.22-150x130.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.24.22-300x259.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.24.22-624x539.png 624w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.24.22.png 1105w" sizes="(max-width: 625px) 100vw, 625px" /></a></p>
<h3>Step3: Convert to grayscale (infravision should be colourblind)</h3>
<p>This was easy &#8211; simply average the r/g/b components of your Color, somethign like:</p>
<p>[c]<br />
avg = (color.r + color.g + color.b ) / 3f;<br />
color = float4( avg, avg, avg, color.a );<br />
[/c]</p>
<p><a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.21.43.png"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.21.43-1024x852.png" alt="Screen Shot 2016-01-19 at 03.21.43" width="625" height="520" class="aligncenter size-large wp-image-3785" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.21.43-1024x852.png 1024w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.21.43-150x125.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.21.43-300x250.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.21.43-624x519.png 624w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.21.43.png 1103w" sizes="(max-width: 625px) 100vw, 625px" /></a></p>
<h3>Step 4: several hours of experimenting with wild effects</h3>
<p>I had some problems with this:</p>
<ol>
<li>It was too easy to see &#8220;everything&#8221;
<li>With no lighting-calcs, it was fugly
<li>With no lighting-calcs, it was VERY hard to do depth-perception. In a complex street, you got lost trying to tell which objects were near, far, blocking your way, or not.
<li>WAY too much detail on the textures is showing through: DarkVision should lose most detail, while keeping overall shapes clear
</ol>
<p>Here&#8217;s some of the things I tried and discarded. Note how the screenshots are from many positions &#8211; I ran around a lot, testing how effective the different shaders were for hunting a quarry (or fleeing an angry mob of AI&#8217;s).</p>
<table>
<tr>
<td><a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-02.57.08.png"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-02.57.08-300x250.png" alt="Screen Shot 2016-01-19 at 02.57.08" width="300" height="250" class="aligncenter size-medium wp-image-3786" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-02.57.08-300x250.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-02.57.08-150x125.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-02.57.08-1024x855.png 1024w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-02.57.08-624x521.png 624w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-02.57.08.png 1109w" sizes="(max-width: 300px) 100vw, 300px" /></a></td>
<td><a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-01.34.27.png"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-01.34.27-300x250.png" alt="Screen Shot 2016-01-19 at 01.34.27" width="300" height="250" class="aligncenter size-medium wp-image-3787" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-01.34.27-300x250.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-01.34.27-150x125.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-01.34.27-1024x852.png 1024w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-01.34.27-624x519.png 624w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-01.34.27.png 1096w" sizes="(max-width: 300px) 100vw, 300px" /></a></td>
<td><a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-02.26.02.png"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-02.26.02-300x276.png" alt="Screen Shot 2016-01-19 at 02.26.02" width="300" height="276" class="aligncenter size-medium wp-image-3788" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-02.26.02-300x276.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-02.26.02-150x138.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-02.26.02-624x575.png 624w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-02.26.02.png 1015w" sizes="(max-width: 300px) 100vw, 300px" /></a></td>
</table>
<h3>Step5: FAILED: use depth-buffer shading</h3>
<p>Unity staff: please write clear, correct, up-to-date documentation on depth-buffering <em>as supported (or not) by your proprietary Shader Lab language</em>, and with clear details on how this works in Unity5, not some hand-waving Unity4-maybe-Unity5-not-sure gumph.</p>
<p>I simply couldn&#8217;t get it to work. Using the proprietary built-in depth-buffer samplers either failed outright (0.5 across the sampler), or gave bizarre results.</p>
<p>Rumours suggest that we have to write 3 shaders: 2 for your proprietary system, and a third where we re-implement depth-buffer access by hand. This seems to me unlikely &#8211; I am sure Unity can handle that for you. This is the kind of feature that Unity&#8217;s ShaderLab does well (but no-one documents, and so it goes under-used by devs).</p>
<p>When you find or reverse-engineer instructions, ShaderLab is excellent. It&#8217;s such a pity that so often &#8230; you can&#8217;t.</p>
<h3>Step6: Combine object-normals with plain greyscale</h3>
<p>Ultimately, I fell back on &#8220;Fine, I&#8217;ll use the most basic bits of Shaders that even Unity can&#8217;t make confusing&#8221; &#8211; object normals. I faked shading Old Skool: each surface is darkened by dot-producting the forwards vector ( which by definition is (0,0,1) after the MVP multiplication stage) with the normal vector. That gives a float from 0 to 1, showing how much the surface is facing towards/away from the viewer.</p>
<p><a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.26.07.png"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.26.07-1024x951.png" alt="Screen Shot 2016-01-19 at 03.26.07" width="625" height="580" class="aligncenter size-large wp-image-3789" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.26.07-1024x951.png 1024w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.26.07-150x139.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.26.07-300x279.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.26.07-624x579.png 624w, https://t-machine.org/wp-content/uploads/Screen-Shot-2016-01-19-at-03.26.07.png 1090w" sizes="(max-width: 625px) 100vw, 625px" /></a></p>
<p>I&#8217;m not delighted with this &#8211; it&#8217;s not quite the effect I was aiming for (I REALLY wanted to wipe more of the diffuse detail, but&#8230;). However, it does work quite nicely, and for now it&#8217;s more than good enough.</p>
<h2>Benefits of final version</h2>
<p>Here&#8217;s why I like it:</p>
<ol>
<li>Runs 100% independently of my main lighting &#8211; I never have to re-write it when changing lighting.
<li>Provides huge advantages at night time, or in low-light situations. More so the less lighting there is
<li>Provides depth-cues to the player, so that running quickly through streets (or tunnels) is still pretty easy to do
<li>Limits the over-powered nature by cutting down peripheral vision
<li>Runs very fast on GPU, despite crappy hand-written shader code (mostly because it doesn&#8217;t use any lighting calculations)
</ol>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2016/01/19/making-a-night-vision-shader-for-animals-in-unity3d/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Survey: which language(s) do you use along with an #entitysystem in #gamedev?</title>
		<link>https://new.t-machine.org/index.php/2016/01/18/survey-which-languages-do-you-use-along-with-an-entitysystem-in-gamedev/</link>
					<comments>https://new.t-machine.org/index.php/2016/01/18/survey-which-languages-do-you-use-along-with-an-entitysystem-in-gamedev/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Mon, 18 Jan 2016 15:25:42 +0000</pubDate>
				<category><![CDATA[entity systems]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3779</guid>

					<description><![CDATA[A lot of us have been looking at alternative engines recently, and for me the biggest challenge is that the intersection between &#8220;game engine I can use easily&#8221; and &#8220;programming language I am willing to use&#8221; is quite small. That got me thinking: if you started a new commercial ES today, what language does your [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>A lot of us have been looking at alternative engines recently, and for me the biggest challenge is that the intersection between &#8220;game engine I can use easily&#8221; and &#8220;programming language I am willing to use&#8221; is quite small.</p>
<p>That got me thinking: if you started a new commercial ES today, what language does your audience want?</p>
<blockquote><p>
<a href="https://docs.google.com/forms/d/18JF6uCHI0nZ1-Yel76uZzL1UfFMI21QvDlcnXSGXSHo/viewform">Short Google form</a>
</p></blockquote>
<p>FYI: I picked the top 10 global languages by popularity, and then cherrypicked from the next 50 or so on <a href="http://sogrady-media.redmonk.com/sogrady/files/2015/07/lang-rank-615-wm.png">http://sogrady-media.redmonk.com/sogrady/files/2015/07/lang-rank-615-wm.png</a> &#8211; favouring ones where I have met people that I know are using them in gamedev today.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2016/01/18/survey-which-languages-do-you-use-along-with-an-entitysystem-in-gamedev/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Support me on Patreon for early access to new Entity Systems articles</title>
		<link>https://new.t-machine.org/index.php/2015/12/12/support-me-on-patreon-for-early-access-to-new-entity-systems-articles/</link>
					<comments>https://new.t-machine.org/index.php/2015/12/12/support-me-on-patreon-for-early-access-to-new-entity-systems-articles/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Sat, 12 Dec 2015 18:17:31 +0000</pubDate>
				<category><![CDATA[entity systems]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3756</guid>

					<description><![CDATA[I love researching and writing about Entity Systems, but it takes me days or weeks to make a single article. I&#8217;ve written almost nothing for the past 18 months because on my current salary I can&#8217;t afford the time off work. So &#8230; now I&#8217;m crowdfunding the long, detailed, in-depth ES articles. This gives me [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I love researching and writing about Entity Systems, but it takes me days or weeks to make a single article. I&#8217;ve written almost nothing for the past 18 months because on my current salary I can&#8217;t afford the time off work.</p>
<p>So &#8230; now I&#8217;m crowdfunding the long, detailed, in-depth ES articles. This gives me a way to spend the time I need to write each one while still paying rent, food, etc.</p>
<p>You don&#8217;t have to sign-up &#8211; I know there&#8217;s lots of people like myself who are in bad financial situations, and I hope all the articles will be made free eventually. But if you&#8217;ve found my ES articles useful, and you want more of them, and you can spare $5 once every couple of months, please do.</p>
<p>You can sign up here: <a href="https://www.patreon.com/tmachine">https://www.patreon.com/tmachine</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2015/12/12/support-me-on-patreon-for-early-access-to-new-entity-systems-articles/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Brief look at obvious #UX mistakes in Civilization 5 (and why you should never buy another Firaxis game)</title>
		<link>https://new.t-machine.org/index.php/2015/11/15/brief-look-at-obvious-ux-mistakes-in-civilization-5-and-why-you-should-never-buy-another-firaxis-game/</link>
					<comments>https://new.t-machine.org/index.php/2015/11/15/brief-look-at-obvious-ux-mistakes-in-civilization-5-and-why-you-should-never-buy-another-firaxis-game/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Sun, 15 Nov 2015 21:08:39 +0000</pubDate>
				<category><![CDATA[games design]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3747</guid>

					<description><![CDATA[Civilization was one of the best games ever designed and shipped. Civ5 is tragic. It&#8217;s one thing to launch a AAA title full of nerfed gameplay and obvious, in-your-face bugs, but quite another to leave them unfixed for years after. It&#8217;s one thing to officially fix your bugs only in pay-for add-ons &#8211; but quite [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Civilization was one of the best games ever designed and shipped. </p>
<p>Civ5 is tragic. It&#8217;s one thing to launch a AAA title full of nerfed gameplay and obvious, in-your-face bugs, but quite another to leave them unfixed for years after. It&#8217;s one thing to officially fix your bugs only in pay-for add-ons &#8211; but quite another to keep those add-ons at full price for years after they released.</p>
<p>Here&#8217;s a quick view of what&#8217;s still broken in Civ5 today, if you buy it direct in the online stores:</p>
<ul>
<li>The game autosaves every 10 or so turns; this has NEVER been correct for Civilization (from memory, the original game used to save every other turn by default (maybe not; running out of disk space was a real concern back then); modern teams at Firaxis seem to be too amateurish to implement this. Civ 4 used to crash so much that putting it on &#8220;save every turn&#8221; was a requirement).
<ul>
<li>No-one at Firaxis should be &#8220;unaware&#8221; of the need for every-turn autosaves
<li>I struggle to think of a rational explanation; best I can think of so far is some weak game-designer thinking that autosaves are &#8220;cheating&#8221;, so they decided to deliberately break the concept so it only half worked.
<li>I haven&#8217;t yet found an easy way to un-break this in civ5. Given how crucial it is to the game, and how it&#8217;s been present in every previous version, it should be in the game-options, but it&#8217;s not. That&#8217;s two bugs for the price of 1!
</ul>
<li>The user-interface for moving units is more broken than in any version of Civ to date. Civ1 had a perfect system (but predated the existence of a mouse on every computer): units moved where you told them by pressing numeric keypad keys. Civ3 and Civ4 had &#8220;automatic&#8221; pathfinding that was badly broken: it often walked your units into 100% certain death for no reason.
<ul>
<li>Civ5 takes this one further: if a unit is selected and you move across another unit, civ5 moves BOTH units, causing double the catastrophe.
<li>This automated action &#8211; that IME is almost NEVER what the player wanted to do, and is extremely destructive, frequently causing game-losing events &#8211; cannot be undone. This breaks the cardinal law of user-interfaces: if you do an automated, un-asked-for, action (which you generally shouldn&#8217;t) &#8230; then you MUST provide an Undo.
</ul>
<li>Civ5 also has a strangely bad algorithm for pathfinding: it generally takes 1-4 seconds to run the algorithm during which time the game lies about the game-rules, and claims that your unit is &#8220;immovable&#8221;.
<ul>
<li>This appears to be a junior programmer discovering &#8220;asynchronous&#8221; coding for the first time in their life, and not realising the obvious side-effects
<li>I have no idea why the algorithm is so insanely slow. It is slowest in a huge game, but even in a tiny game, with nothing happening, and only a tiny game-world, it randomly takes anywhere from no time to 1-2 seconds to &#8220;switch on&#8221;
</ul>
<li>The buttons for &#8220;required&#8221; actions are deliberately placed in the worst-possible positions: the far OPPOSING corners of the screen.
<ul>
<li>This breaks the most basic and obvious guidelines in UX design
<li>For bonus points, the buttons don&#8217;t get larger on large/wide screens. Those buttons are so small and so far away you rarely see them, let alone find it easy to press them
<li>It&#8217;s as if the Firaxis team were out to beers with the misguided team at Microsoft who decided that Windows 8 would rely upon a single &#8220;magic pixel&#8221; to activate core functions, and thought: &#8220;hey, I know how we can really mess-up our players! That impossible-to-hit pixel idea is great! It&#8217;ll make the game so much harder!&#8221;
</ul>
<li>The interactive HUDs giving critical information on the global state of politics, that made Civ4 a significant improvement over previous versions &#8211; and that were extended massively by the community, increasing gameplay without removing any challenge &#8230; have been deleted.
<ul>
<li>The question begs: we know Firaxis has many people who&#8217;ve played the previous civs; how on earth did they forget how critical and popular the dashboards were?
<li>The game is almost unplayable without dashboards. It&#8217;s a waste of time: you have to play solo, or click through a series of menus every single turn simply to find out the current status of your opponents. A massive step backwards in gameplay.
<li>Best explanation I can think of: failed game-design strategy to &#8220;make it more mass-market friendly&#8221;.
</ul>
</ul>
<p>That last point leads into the legion of game-design failures in Civ5. As I understand it, most of the game was &#8220;Designed&#8221; around the idea of dumbing-down: apparently the Youth of Today are so stupid and lazy that they cannot play games that are deep, enjoyable, or interesting. The way to make money is to make games idiot-proof with as few options as possible and no meaningful decisions.</p>
<p>Ironically, this is the exact opposite of what the legions of Civ fans had shown they valued in the Civ franchise, via the overwhelmingly popular mods for civ4. Master of Mana added depth, difference, more depth, more variety, more difference, and yet more depth, across the board. It hacked the tech tree into becoming 5 different tech-trees, all running in parallel (WTF? Oh, yes!) &#8211; and players loved it.</p>
<p>One day, I may write a post on the flow of game design, successes and failures, and the #facepalm that civ3 and civ5 were (between the two of them, both abject failures). Strangely enough &#8230; the two things in civ5 that I remember the community being most afraid of (hexes and 1-unit-per-tile) &#8230; seem to have worked fine. The radical changes were a success; it was all the easy, &#8220;you can&#8217;t possibly screw this up&#8221;, parts that the dev-team screwed up. And that is why I consider civ5 &#8220;tragic&#8221;: they got the hardest bits right, despite the odds &#8230; and tripped over their own shoelaces messing-up the easy bits.</p>
<p>Civ4 had a similar trajectory, with two differences:</p>
<ol>
<li>It appeared to be a legitimate mistake: they didn&#8217;t realise until after shipping how broken their own game was
<li>Within a couple of years, the add-ons were being bundled with the core game for free, or at most five dollars. As they should be: they were mostly re-adding content that had been removed, and fixing launch-bugs, with only a tiny sprinkling of extra content/changes.
</ol>
<p>For Civ5, someone in charge (publisher? studio director?) appears to have decided: &#8220;hey, we shafted the consumers and exploited the franchise well there &#8211; but we could do so much better! Let&#8217;s do it deliberately this time: save money by deliberately shipping incomplete product, then use online market-controls to force everyone to pay 3 times to get a working game! We&#8217;ll be RICH!&#8221;.</p>
<p>In their defence, Firaxis did ship one major content update for free, which was wonderful: they added retina support. That&#8217;s unnecessary (not a bug, retina&#8217;s didn&#8217;t exist when it came out) and nice to have &#8211; but in no way justifies ignoring the rest.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2015/11/15/brief-look-at-obvious-ux-mistakes-in-civilization-5-and-why-you-should-never-buy-another-firaxis-game/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Simple #unity3d bugs and flaws fixed by Entity Systems &#8211; number 1</title>
		<link>https://new.t-machine.org/index.php/2015/10/14/simple-unity3d-bugs-and-flaws-fixed-by-entity-systems-number-1/</link>
					<comments>https://new.t-machine.org/index.php/2015/10/14/simple-unity3d-bugs-and-flaws-fixed-by-entity-systems-number-1/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Wed, 14 Oct 2015 19:46:21 +0000</pubDate>
				<category><![CDATA[entity systems]]></category>
		<category><![CDATA[Unity3D]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3741</guid>

					<description><![CDATA[I periodically write massive long documents detailing all the bugs in Unity that I know, have memorized, and have to workaround on a day-to-day / hour-to-hour basis. But it makes me so angry and frustrated &#8211; so much terrible coding, so little technology-leadership at the company &#8211; that I end up deleting it. Life is [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I periodically write massive long documents detailing all the bugs in Unity that I know, have memorized, and have to workaround on a day-to-day / hour-to-hour basis. But it makes me so angry and frustrated &#8211; so much terrible coding, so little technology-leadership at the company &#8211; that I end up deleting it. Life is too short to be daily reminded how crappy (and yet easy to fix) our tools are.</p>
<p>Then, every 6 months or so, when people ask me for simple examples of how ECS&#8217;s fix Unity, I have to wrack my brains for something simple.</p>
<p>So I&#8217;m going to start blogging simple examples as I run into them, with only enough context for me to understand them. Here&#8217;s the first&#8230;<br />
<span id="more-3741"></span></p>
<h2>Share a trait between AI enemies, and non-AI, unmoving, static objects</h2>
<p>I have blobs that move and eat each other.</p>
<p>Now I want to add food, that cannot move, cannot eat anything, but is edible.</p>
<p>This is impossible in Unity without writing deliberately-bad code, for two reasons:</p>
<ol>
<li> Unity prevents you writing OOP code: Unity corp&#8217;s early programmers were inexperienced at programming, didn&#8217;t really understand C#, and broke it rather than work within it.
<li> Unity does not allow traits to be selectively shared between objects. This is the core feature of all Entity Systems, and shows beautifully why we do NOT accept any claim that &#8220;Unity is an Entity System / Component System / Entity-Component System&#8221;
</ol>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2015/10/14/simple-unity3d-bugs-and-flaws-fixed-by-entity-systems-number-1/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title>BlobBlobBlob screenshots</title>
		<link>https://new.t-machine.org/index.php/2015/10/10/blobblobblob-screenshots/</link>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Sat, 10 Oct 2015 10:26:27 +0000</pubDate>
				<category><![CDATA[computer games]]></category>
		<category><![CDATA[dev-process]]></category>
		<category><![CDATA[games design]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3729</guid>

					<description><![CDATA[New prototype I&#8217;ve been playing around with&#8230;]]></description>
										<content:encoded><![CDATA[<p>New prototype I&#8217;ve been playing around with&#8230;</p>
<p><a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-06-at-23.11.43.png"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-06-at-23.11.43-300x174.png" alt="Screen Shot 2015-10-06 at 23.11.43" width="300" height="174" class="aligncenter size-medium wp-image-3730" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-06-at-23.11.43-300x174.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-06-at-23.11.43-150x87.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-06-at-23.11.43-1024x594.png 1024w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-06-at-23.11.43-624x362.png 624w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-06-at-23.11.43.png 1559w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p><a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-06-at-23.40.22.png"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-06-at-23.40.22-300x182.png" alt="Screen Shot 2015-10-06 at 23.40.22" width="300" height="182" class="aligncenter size-medium wp-image-3731" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-06-at-23.40.22-300x182.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-06-at-23.40.22-150x91.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-06-at-23.40.22-1024x620.png 1024w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-06-at-23.40.22-624x378.png 624w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-06-at-23.40.22.png 1500w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p><a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-06-at-23.57.34.png"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-06-at-23.57.34-300x274.png" alt="Screen Shot 2015-10-06 at 23.57.34" width="300" height="274" class="aligncenter size-medium wp-image-3732" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-06-at-23.57.34-300x274.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-06-at-23.57.34-150x137.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-06-at-23.57.34-1024x934.png 1024w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-06-at-23.57.34-624x569.png 624w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-06-at-23.57.34.png 1428w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p><a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-08-at-19.40.00.png"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-08-at-19.40.00-300x295.png" alt="Screen Shot 2015-10-08 at 19.40.00" width="300" height="295" class="aligncenter size-medium wp-image-3733" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-08-at-19.40.00-300x295.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-08-at-19.40.00-150x147.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-08-at-19.40.00-624x613.png 624w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-08-at-19.40.00.png 764w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p><a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-08-at-19.45.08.png"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-08-at-19.45.08-300x247.png" alt="Screen Shot 2015-10-08 at 19.45.08" width="300" height="247" class="aligncenter size-medium wp-image-3734" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-08-at-19.45.08-300x247.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-08-at-19.45.08-150x123.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-08-at-19.45.08.png 503w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p><a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-08-at-23.11.50.png"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-08-at-23.11.50-300x176.png" alt="Screen Shot 2015-10-08 at 23.11.50" width="300" height="176" class="aligncenter size-medium wp-image-3735" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-08-at-23.11.50-300x176.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-08-at-23.11.50-150x88.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-08-at-23.11.50-1024x601.png 1024w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-08-at-23.11.50-624x366.png 624w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p><a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-09-at-01.26.21.png"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-09-at-01.26.21-300x253.png" alt="Screen Shot 2015-10-09 at 01.26.21" width="300" height="253" class="aligncenter size-medium wp-image-3736" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-09-at-01.26.21-300x253.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-09-at-01.26.21-150x127.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-10-09-at-01.26.21.png 468w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to get an awesome tag-cloud for WordPress</title>
		<link>https://new.t-machine.org/index.php/2015/10/06/how-to-get-an-awesome-tag-cloud-for-wordpress/</link>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Tue, 06 Oct 2015 13:56:33 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[web 2.0]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3727</guid>

					<description><![CDATA[There&#8217;s only a few tag-cloud plugins that still work &#8211; most of them have stopped being supported. The best one I found has super-awesome-multi-colour mode. But by default it&#8217;s disabled, and the config-options don&#8217;t include a way to turn it on. You have to dig in the developer documentation to find out how. ALSO &#8230; [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>There&#8217;s only a few tag-cloud plugins that still work &#8211; most of them have stopped being supported.</p>
<p>The best one I found <a href="https://wordpress.org/plugins/ultimate-tag-cloud-widget/screenshots/">has super-awesome-multi-colour mode</a>. But by default it&#8217;s disabled, and the config-options don&#8217;t include a way to turn it on. You have to dig in the developer documentation to find out how.</p>
<p><img decoding="async" src="https://s.w.org/plugins/ultimate-tag-cloud-widget/screenshot-2.png?r=1260377"/><br />
<span id="more-3727"></span></p>
<p>ALSO &#8230; by default, it uses your theme&#8217;s CSS styles for the cloud. That is a really bad idea &#8211; it disables most of the tag-cloud features (including the &#8220;cloud&#8221; part!). Again, unfixable unless you dig in the dev docs to find the secret command.</p>
<p>For future reference (because I&#8217;m pretty sure I&#8217;ll be using this on other sites soon), here&#8217;s a working PHP snippet you can embed in your Template source (<strong>I hate</strong> that WordPress still has this stupid bug where you can only modify pages by writing new PHP files &#8211; so stupid and unnecessary!) in your Theme folder:</p>
<blockquote><p>
$args = array( &#8220;title&#8221; => &#8220;&#8221;, &#8220;color&#8221; => &#8220;random&#8221;, &#8220;text_transform&#8221; => &#8220;capitalize&#8221;, &#8220;link_italic&#8221; => &#8220;yes&#8221;, &#8220;hover_underline&#8221; => &#8220;yes&#8221;, &#8220;alignment&#8221; => &#8220;center&#8221;, &#8220;link_bg_color&#8221; => &#8220;#DDDDDD&#8221;, &#8220;separator&#8221; => &#8221; &#8211; &#8220;, &#8220;show_title_text&#8221; => 0, &#8220;avoid_theme_styling&#8221; => &#8220;true&#8221;, &#8220;max&#8221; => 50 );</p>
<p>do_utcw( $args );
</p></blockquote>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Unity: the &#8220;real&#8221; version 5 just released (#Unity3d 5.2 fixes many severe issues!)</title>
		<link>https://new.t-machine.org/index.php/2015/09/16/unity-the-real-version-5-just-released-unity3d-5-2-fixes-many-severe-issues/</link>
					<comments>https://new.t-machine.org/index.php/2015/09/16/unity-the-real-version-5-just-released-unity3d-5-2-fixes-many-severe-issues/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Wed, 16 Sep 2015 19:51:33 +0000</pubDate>
				<category><![CDATA[Unity3D]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3721</guid>

					<description><![CDATA[A new version of Unity is now out &#8211; https://unity3d.com/unity/whats-new/unity-5.2 &#8211; and it&#8217;s a doozy. I don&#8217;t normally blog a blow-by-blow account, but this set is particularly interesting. It suggests the tech team has been focussed on fixing many &#8220;critical but un-sexy&#8221; problems. That is a noticeable change in direction from the past few years. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>A new version of Unity is now out &#8211; <a href="https://unity3d.com/unity/whats-new/unity-5.2">https://unity3d.com/unity/whats-new/unity-5.2</a> &#8211; and it&#8217;s a doozy.</p>
<p>I don&#8217;t normally blog a blow-by-blow account, but this set is particularly interesting.</p>
<p>It suggests the tech team has been focussed on fixing many &#8220;critical but un-sexy&#8221; problems. That is a noticeable change in direction from the past few years. Possibly this is a one-off to get Unity 5 working properly.</p>
<p><strong>If you&#8217;re still using Unity 4.x, it is finally safe to move to Unity 5</strong>.</p>
<p>Unity 5 is not a complete replacement for Unity 4 &#8211; there are still major featuers of 4.x that have been removed from Unity 5 and have no upgrade-path &#8211; but it&#8217;s finally production-ready (or very nearly). That &#8230; is big news!</p>
<h1>Hilighted improvements / fixes / changes</h1>
<p>Please note: there will be a lot of negative comments here; that is inevitable, considering most of the change-list is &#8220;things that were broken, or wrongly implemented, or poorly designed &#8211; and are now not&#8221;.</p>
<p>To be clear: I&#8217;m pleased and excited by the overall shape of these changes.</p>
<h2>Graphics: Added CullingGroup API, which allows you to specify a large set of bounding spheres that are integrated into the culling pipeline and subjected to frustum and occlusion culling</h2>
<p>Unity has (amazingly) never had built-in culling accessible by developers, which is almost unheard-of in game-engines. This suggests we&#8217;re getting towards it (although spheres are only a first-approximation for culling, and I wonder how deep the interaction is with Unity&#8217;s pipeline here. I&#8217;d assumed we&#8217;d get access to something more like BSP)</p>
<h2>Application.UnloadLevel. Unloading scenes is now possible while the game is running. References to lightmaps are cleared but you have to call Resources.UnloadUnusedAssets() to actually unload them.</h2>
<p>Scenes in Unity are very much FUBAR as a concept &#8211; they were created by people who had very little understanding of computer-game design and development. Ideally, we&#8217;ll see Unity remove the whole &#8220;Scene&#8221; concept in a future major release, but in the meantime this is a significant step towards reducing their weaknesses, which is good to see.</p>
<h2>Layout elements under a ScrollRect component may not work properly</h2>
<p>No s***, Sherlock! Yeah, most people using Unity&#8217;s &#8220;new GUI&#8221; have found it&#8217;s fundamentally broken in a bunch of places. Good to see Unity working on this, and hilighting some of the issues &#8211; but really they need to create an entire webpage listing &#8220;the following parts are broken, don&#8217;t use them &#8211; or beware if you do&#8221;.</p>
<p>Right now, you tend to waste hours, half-days at a time &#8230; re-discovering known bugs in Unity&#8217;s GUI.</p>
<h2>Scene view picking in linear color space does not work for DX11 when MSAA is used (quality: fantastic)</h2>
<p>If you&#8217;re on Windows and have the highest quality settings, this is lethal: Unity simply doesn&#8217;t work. But it&#8217;s coming in an emergency patch very soon.</p>
<h2>Mecanim: Playable API.</h2>
<p>If this does what I think it does, then it was essential back when Mecanim was released (3 years ago); glad to see it&#8217;s finally here.</p>
<h2>between 5% and 30% lower CPU cost for rendering</h2>
<p>That&#8217;s an enormous speed-up for an engine as old as Unity &#8211; this is big news. Reading between the lines, the speed up is partly a side-effect of them making it a bit more multi-threaded (which became normal for game engines many years ago).</p>
<p>If we thought that was a lot, wait till you see:&#8230;</p>
<h2>Particle rendering optimizations (especially for VR), with speed improvements varying from 15% to 50%</h2>
<p>&#8230; 50% performance improvement! Wow. Name-checking VR here is probably the key item. We keep seeing VR&#8217;s extreme performance-requirements forcing engine-makers to up their game, and dig deep to find perf boosts. The &#8220;minimum&#8221; hardware reqs for basic VR rigs are very high even now, several years after Oculus Rift launched.</p>
<h2>UI now uses multithreaded batching &#038; geometry generation backend</h2>
<p>This was the minimum we expected from the &#8220;new GUI&#8221; when it launched in Unity 4.6 almost a year ago. This fix brings the GUI most of the way towards being &#8220;production ready&#8221; &#8230; ironically, 6 months after Unity changed their website to hide the existence of the &#8220;old (but works) GUI&#8221; and pretend it didn&#8217;t exist.</p>
<h2>Added parameter QueryTriggerInteraction to all physics queries (raycast, spherecast, overlap) to allow any query to override whether or not the query should hit Triggers</h2>
<p>This is patching a MAJOR design bug in core Unity that has plagued Unity for many years. I want to play with this some more, and see how much we can un-**** Unity&#8217;s ****ed ray-casting system using it.</p>
<p>(I don&#8217;t believe any experienced game-developer would have accepted Unity&#8217;s original design here &#8211; it was clearly a terrible approach that would cause never-ending head-aches when making games. It mixed concepts that were very obviously unrelated and distinct)</p>
<h2>Fixed Function shaders work on all platforms now (including consoles)</h2>
<p>This one has been blogged about extensively by some of the graphics team, IIRC.</p>
<p>In my experience, Unity&#8217;s shaders have been OK, with a few that were terrible (e.g. all the Mobile ones), but the framework which holds them has generally been excellent: it&#8217;s isolated us from the pain and suffering of GPU-specific shader bugs. This house-cleaning doesn&#8217;t make much (if any) difference to most of us, but apparently keeps Unity&#8217;s internal code clean in a way that will facilitate rapid changes and improvements going forwards.</p>
<h2>2D Rect Mask</h2>
<p>TL, DR: &#8220;we finally implemented masking properly in the new GUI&#8221;.</p>
<p>See previous comments on the new GUI, and how it&#8217;s getting much closer to production-ready.</p>
<h2>UI: Dropdown control</h2>
<p>Yes, really &#8211; Unity has finally added the &#8220;dropdown&#8221;, which has been a global expectation in UI design for 20+ years (it was made compulsory in web-browsers back in the 1990&#8217;s).</p>
<h2>Editor: Remove legacy Mac OS X corner window resize behaviour</h2>
<p>Apple told devs to remove this &#8230; um &#8230; about 3 or 4 years ago? At first, it was broken (couldn&#8217;t resize windows), then it was annoying (Unity added optional resizing on all edges, but put an illegal resize-hot-corner in bottom right that broke all EditorWindow code, because they made it a private API).</p>
<p>Working around that on Mac &#8230; forced you to mildly break things on Windows.</p>
<p>TL, DR: custom editors (as found in many/most of the best Asset Store plugins) will now be a little less-broken across the board.</p>
<h2>Substance &#8230; All crashes and hangs at build time, level load/change time, playmode entry/exit should be gone</h2>
<p>Yay! I&#8217;ve not been using Substance, but I&#8217;ve met several developers who&#8217;ll be breaking over the champagne over this, given how miserable they&#8217;ve been about crashes and hangs with this in the past.</p>
<h2>CanvasRenderer now takes a Mesh instead of List this allows for the use of imported meshs as part of the UI</h2>
<p>Without this feature, <strong>the new GUI was not usable in most non-trivial games</strong>. It&#8217;s hard to over-estimate the importance of this for declaring the new GUI production-ready.</p>
<h2>Allow sprites to be dragged into scene view in 3d mode</h2>
<p>Small but sweet. It&#8217;s a little thing, but makes a big difference to the frustration level of the user; in my experience, these things are often the real reason why you sacrifice the cost-savings and benefits of your own engine and use something like Unity instead.</p>
<p>i.e.: with your own engine, you can&#8217;t afford the time/money to polish every small interaction; 3rd-party game-engines can shine here, and should take more advantage of it.</p>
<blockquote><p>
I sometimes mention stuff like this as suggesting that Unity&#8217;s senior management team are out-of-touch with their product. Unity&#8217;s early community loved it largely because of small things, but as Unity grew, the company stopped sweating them. I suspect time will eventually tell that was a huge strategic mistake.
</p></blockquote>
<h2>Improved Export Package window (now uses a proper tree view)</h2>
<p>This window <strong>hasn&#8217;t correctly worked for at least three years</strong>; converting it to a &#8220;proper tree view&#8221; might &#8211; finally! &#8211; make the &#8220;Export Package&#8221; function do what it&#8217;s defined to, instead of exporting the wrong things, breaking keyboard and mouse interactions, etc.</p>
<p>(most of the bugs appeared to be a side-effect of the non-maintained, half-implemented, custom tree view code)</p>
<h2>Make sure ObjectField and Object Selector shows icons for game objects and prefabs</h2>
<p>Co-incidentally, I tweeted about this recently: Unity could make their engine noticeably faster to develop with if they provided visual feedback on these fields.</p>
<p>It&#8217;s embarassing, almost shameful, how poor the UX is on these fields today. By the sounds of things, this patch merely makes them &#8220;less crap&#8221;, rather than fixing them &#8211; but the last 5 years has been so awful that any improvement is welcome!</p>
<h2>Selection.selectionChange callback triggered when selection changes</h2>
<p>To call this <strong>&#8220;important&#8221;</strong> is somewhat of an understatement.</p>
<p>Substantial areas of the Editor API&#8217;s are surprisingly poorly maintained by Unity. The bugs undermine people each time they try to use one of Unity&#8217;s overwhelmingly greatest features: its extensibility.</p>
<h2>Graphics: Added a quality setting &#8216;Shadow near plane offset&#8217; to allow working around shadow pancaking artifacts</h2>
<p>If this does what I suspect, it will make it trivial to fix a lot of common, frustrating &#8220;why do my shadows suck? OMG! UNITY SUXXS!!!!&#8221; situations.</p>
<h2>Mecanim Improvements</h2>
<p>SO MANY.</p>
<p>I don&#8217;t use Mecanim: it&#8217;s been slow, clunky, buggy &#8211; and it solved the wrong problems at launch. It felt more like a marketing excuse rather than a developer feature. For me, working x-platform and often on mobile: not very useful.</p>
<p>However, looking at how long the list of fixes is &#8230; it might finally be worth using it. In context of all the other changes we&#8217;re seeing &#8211; maybe production-ready for general use now?</p>
<p>(modulo: the performance. Last time I checked, it was still way too slow for cross-platform games unless you were happy to have a relatively small number of animated objects)</p>
<p>Go check it out! If you&#8217;re a long-time Mecanim user, let us know what you think of this list of changes!</p>
<h2>Now a TerrainData object embedded into a scene (created by script) allows scene objects being selected as tree prefabs</h2>
<p>Unity&#8217;s Terrain system was implemented using a nasty, ugly hack that should never have been used.</p>
<p>As I understand it, that was in itself an attempt to workaround some problems with <strong>the fundamentally broken &#8211; and allegedly &#8220;unfixable&#8221; &#8211; Serialization system that is core to Unity</strong>, but is too much code for anyone to fix (and will be thrown out / fixed / replaced around Unity v6 or v7. Maybe).</p>
<p>This change reeks of a &#8220;workaround to a workaround&#8221;: you can&#8217;t create TerrainData in the scene (which should be the ONLY option!), but you can artifically create one if you write a script to do it for you. Either way, it&#8217;s good news &#8211; TerrainData Assets are a common source of project-corruption, because they&#8217;re abusing a feature that wasn&#8217;t intended for this.</p>
<h1>Stacktrace logging: Allow to log full (native/managed) stack trace when log is printed, the option is available in the console window in top right corner popup menu. </h1>
<p><strong><em>OMGWTFBBQ!!!!!!!!!!!111!11111!!!!11!!!1!</em></strong></p>
<p>I frequently discover major bugs in Unity core; there is never anything I can do about it because Unity strips / deletes all stack traces (in most cases) before outputting anything.</p>
<p>If this fix does what it says on the tin &#8230; WOOOHHHOOOO! &#8230; we can finally workaround Unity crashes (by debugging them!) and give Unity much more detailed and accurate bug-reports (leading to greatly increased chances of them fixing bugs).</p>
<p>Cross those fingers&#8230;</p>
<h2>Fix Cursor</h2>
<p>As I recently tweeted, Unity&#8217;s support for custom mouse-cursors was recently broken. That&#8217;s a huge pain given most games today use custom cursors. Several fixes here, looks like they&#8217;ve cleaned them all up (I hope).</p>
<h2>Fix possible data loss on Windows when renaming folder with locked files</h2>
<p>:O</p>
<h2>Fix occasional recycle bin bypassing when deleting assets on Windows</h2>
<p>:O</p>
<h2>Serialization: Fixed not being able to serialize a field called &#8220;Base&#8221;</h2>
<p>:O</p>
<h2>UI: Stop disabled graphics from blocking raycasts</h2>
<p>If this is what I think it is, it&#8217;s another example of &#8220;should have been fixed before 5.0 was released&#8221; &#8211; but I&#8217;ve had so many problems with the bad system of Unity raycasts that I go out of my way to avoid them anyway.</p>
<h1>Core: Fixed hang when passing large arrays to the Undo system</h1>
<p>Sounds unexciting, but &#8230; I think I&#8217;ve encountered this on some of my projects: unexplained hangs that came out of nowhere and destroyed my ability to keep working on one particular game, related to Undo.</p>
<p>Note: I keep saying this in public: <strong>Unity&#8217;s Undo system simply Does Not Work</strong>, it&#8217;s appallingly buggy. As far as I can tell, the person who originally wrote it had little or no experience of what they were doing, and didn&#8217;t consult the literature to find out how to implement Undo systems correctly.</p>
<p>Some days, I genuinely feel it would be better for everyone if Unity removed the &#8220;ctrl-z&#8221; keyboard combo, because so often when you press those letters you corrupt your game project. A lot of the time, you don&#8217;t notice that Unity has just corrupted your project &#8211; not until much later, and then you don&#8217;t realise that it was Unity&#8217;s broken Undo that caused the corruption. Instead, you blame yourself, or your co-workers. Seriously, it&#8217;s that bad.</p>
<p>(I&#8217;ve stopped bothering logging bugs against it)</p>
<h2>Importing: Changes to scripts are now correctly processed synchronously, fixing a range of issues with scripts relating to asset processing at import time</h2>
<p>Subtle, but &#8230; I suspect this fixes a LOT of bugs we see on larger Unity projects, where you&#8217;re frequently hot-loading complex sets of scripts, assets, inter-related dependencies, custom asset-processors, etc.</p>
<h1>&#8230;the end</h1>
<p>So that&#8217;s it. What do you think? Any other major items you notice in the release notes that will make your life significantly better?</p>
<p>What&#8217;s still broken?</p>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2015/09/16/unity-the-real-version-5-just-released-unity3d-5-2-fixes-many-severe-issues/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>#Unity3d hardware usage + implications &#8211; Summer 2015</title>
		<link>https://new.t-machine.org/index.php/2015/09/02/unity3d-hardware-usage-implications-summer-2015/</link>
					<comments>https://new.t-machine.org/index.php/2015/09/02/unity3d-hardware-usage-implications-summer-2015/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Wed, 02 Sep 2015 08:47:17 +0000</pubDate>
				<category><![CDATA[android]]></category>
		<category><![CDATA[computer games]]></category>
		<category><![CDATA[games design]]></category>
		<category><![CDATA[games industry]]></category>
		<category><![CDATA[games publishing]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[Unity3D]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3714</guid>

					<description><![CDATA[There&#8217;s tonnes of blogs out there, so I only talk about the bits that other people have missed, or were too polite or inexperienced to cover. Often that means I&#8217;m the one pointing out the flaws (most people don&#8217;t want to write bad things. Screw that; ignoring the bad points does you no favours!). Sometimes [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>There&#8217;s tonnes of blogs out there, so I only talk about the bits that other people have missed, or were too polite or inexperienced to cover. Often that means I&#8217;m the one pointing out the flaws (most people don&#8217;t want to write bad things. Screw that; ignoring the bad points does you no favours!).</p>
<p>Sometimes I get to talk about the good bits that &#8211; sadly &#8211; few people have noticed. Here&#8217;s one of those.<br />
<span id="more-3714"></span></p>
<h2>Unity hardware survey</h2>
<p>Every quarter, Unity publishes <a href="http://hwstats.unity3d.com/mobile/">a regular round-up of what hardware people are using to run Unity3D games etc</a> (I normally see it via <a href="http://twitter.com/arasp">@ArasP</a> &#8211; I think he prepares the page each time?). This is hugely important.</p>
<p>There are flaws in Unity that affect us as developers &#8211; both the software (bugs, architectural problems) and the company (tech strategies, documentation ethos). A lot of the time we have to second-guess what has happened (&#8220;why is this bug happening? Can we workaround it?&#8221;) and what will happen (&#8220;how likely is it that Unity will fix it? Will similar bugs happen again in future?&#8221;). We need data to do this extrapolation &#8211; and the hardware survey is a valuable primary source that it&#8217;s worth learning to use.</p>
<p><strong>Thanks, Unity, for publishing this &#8211; don&#8217;t stop! It&#8217;s a great resource for all Unity game developers!</strong></p>
<p>For instance &#8230; if you find a major rendering bug on a hardware platform that you suspect is very expensive to fix, and that platform is 0.001% of the userbase &#8212; you&#8217;re better-off working around it with changes to your game-design, than filing a bug report and waiting for Unity to eventually fix it. With the best will in the world, such a small impact / high cost task is always going to be low on the todo-list, and lose out to the thousands of high-impact / low cost bugfixes they&#8217;re working on instead.</p>
<h2>Mobile: Android is 70% of all gaming phones</h2>
<p>&#8230;and iOS is the remaining 30%.</p>
<h3>Windows Phone?</h3>
<p>What is this &#8220;Windows Phone&#8221; that you speak of?</p>
<p>(building for WP8 on Unity didn&#8217;t work properly last time I tried &#8211; you had to do a bunch of manual fixes to workaround some Microsoft policy on library inclusions. Does anyone care?</p>
<p>It certainly matters &#8211; I refunded someone an asset-store purchase because they were struggling to get WP working, and neither I nor they were 100% if my code was causing the problem &#8211; the WP process was a bit odd. </p>
<p>But does it matter enough? No. I&#8217;d rather do the odd refund / freebie for WP builders than have Unity waste time they could be fixing the big bugs)</p>
<h3>If you have an Android bug on more than one phone</h3>
<p>&#8230;I&#8217;m betting it&#8217;ll get fixed quickly. In practice, most Android bugs are one manufacturer (e.g. Samsung, I&#8217;m lookig at you) or one chipset (e.g. Tegra); if you can show it crosses manufacturers or chipsets = win.</p>
<p>Or if you can show it&#8217;s Android OS version-dependent: there is a large block of users for each version, and aside from the x.0 release, they don&#8217;t shrink much.</p>
<h2>Multi-threading</h2>
<p>5 years ago it was embarassing that Unity was still a hardcoded single-threaded game-engine; today I don&#8217;t even have the words.</p>
<p>Look at that graph: <strong>6%</strong> of <a href="http://hwstats.unity3d.com/mobile/cpu.html">mobile devices</a> and <strong>1%</strong> of <a href="http://hwstats.unity3d.com/pc/cpu.html">desktop devices</a> are single-threaded. Unity can&#8217;t hold out as single-threaded for much longer, surely?</p>
<p>More importantly &#8211; since they have held out so long &#8211; look at the pace of change. In the last 12 months, both mobile (32% -&gt; 47%) and desktop (40% -&gt; 60%) have greatly increased the percentage of devices that have <em>four or more</em> threads.</p>
<p>If the engine didn&#8217;t get a core re-write and become fully threadsafe soon &#8230; it&#8217;d be time to abandon it, I think. I am convinced multi-threading will see big catch-up improvements in Unity in the next 6 months. Unity corp has the courage to roll-out all the non-backwards-compatible changes they do each major release each 12-18 months. I don&#8217;t believe they lack the courage to re-write the core &#8230; e.g. because they&#8217;ve decided it&#8217;s too amazingly expensive.</p>
<p>If they couldn&#8217;t do it, we as game-develoeprs would abandon their engine in favour of a modern one that is not hamstrung.</p>
<h2>Mobile GPUs: a shattered space</h2>
<p>Android fragmentation <em>per se</em> is not a problem &#8211; despite the many naive commentators who love to line up and say &#8220;there&#8217;s over 9,000 different hardware devices!&#8221;. 9,000 isn&#8217;t a problem; 9,000 with equal market-share is a problem.</p>
<p>GPU&#8217;s <a href="http://hwstats.unity3d.com/mobile/gpu.html">are looking like a 4-way race of equivalent shares</a> &#8211; nightmare for developers. And they overlap in very non-predictable ways &#8211; some of the lowest-end devices have hardware specs of the high-end devices. Previously, the ImgTec share was split into multiple radically different abilities &#8211; but they were monotonically better: each was always considerably better than the previous. With ImgTec declining, deciding what rendering-path to use is even less a &#8220;if / then / else&#8221; thing, but more a complex balancing-act of heuristics.</p>
<p>At this point, I&#8217;m thankful that Unity takes care of it for me.</p>
<p>To be fair: Unity&#8217;s mobile performance is usually terrible, but I&#8217;m always grateful that it WORKS at all &#8211; i.e. renders what I expected to see! (that&#8217;s a very valuable point to start from when writing your own usable shaders to replace the Unity ones)</p>
<p>&#8230;But <strong>I haven&#8217;t shipped anything to mobile that uses the new rendering pipeline &#8211; GI etc</strong>. My suspicion &#8211; given all the above, and the modifications to shader development in Unity 5 &#8211; is that we&#8217;ll see mobile render performance on Unity over the next 12-24 months catching-up to be within 20-30% of what it ought to be, across the board. Or it may be there already (that&#8217;s not what I&#8217;ve heard on the grapevine of people doing high-end mobile games, but rumour is rumour &#8211; if you have any published sources on this, please share!)</p>
<p>i.e. &#8220;more than good enough&#8221; for all except the biggest game projects (all of whom are writing their own shaders, and customizing the render pipeline, anyway &#8211; or certainly should be! If you&#8217;re a big project, you should be pushing the tech envelope, not waiting for a game-engine company to do it for you!)</p>
<h2>Windows, &#8230; and DX10</h2>
<p>Can you ship DX10-only assets yet? 27% of end-users say &#8220;no&#8221;. Games may decide to drop that quarter of their sales, but asset-authors (who often take the easy route) still have to support older generations of DX, or get slammed by unhappy purchasers.</p>
<h3>Apple, what happens when you **** on gamers?</h3>
<p>Answer: &#8220;two thirds of them stop using OS X for games&#8221;, maybe?</p>
<p>I don&#8217;t know what&#8217;s caused that drop &#8211; in my experience, most of Apple&#8217;s actions against computer-owners were 2-4 years ago (deliberately selling GPUs that had already been end-of-lifed by the manufacturer, being very slow to update their graphics drivers, making laptops non-fixable, non-upgradeable, etc).</p>
<p>Anyone else know?</p>
<h3>64bit vs 32bit</h3>
<p>Apple went all-in here a long time ago; Microsoft somehow is still carrying 38% of users on 32bit. That would be all the Windows XP users, then.</p>
<p>Why are they still using XP? Guess: a lot of them can&#8217;t upgrade. Many GPU&#8217;s that run most games fine (on medium or low quality settings, but still look great) didn&#8217;t get updated drivers for Windows7 and Windows8. I&#8217;ve got a gaming PC that still runs XP for exactly this reason &#8211; Windows 8 is installed, but without a graphics driver, it&#8217;s impossible to play any games (thanks, AMD! Althought nVidia seems to be equally as bad).</p>
<p>And if you look at the games industry today, &#8220;sales are based on graphical effects&#8221; is no longer the all-encompassing thing it used to be. Graphics are now good enough that often old hardware is fine &#8211; the game studio can focus spending money on story, artistic styling, gameplay, etc.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2015/09/02/unity3d-hardware-usage-implications-summer-2015/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>New #unity3d feature: Virtual Scenes</title>
		<link>https://new.t-machine.org/index.php/2015/07/26/new-unity3d-feature-virtual-scenes/</link>
					<comments>https://new.t-machine.org/index.php/2015/07/26/new-unity3d-feature-virtual-scenes/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Sun, 26 Jul 2015 15:13:43 +0000</pubDate>
				<category><![CDATA[games design]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Unity3D]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3692</guid>

					<description><![CDATA[Unity3D has a great core architecture &#8211; it&#8217;s easy to understand and use. However, it has some significant flaws. One of the recurring problems I run into is that Unity requirs you to have precisely one &#8220;Scene&#8221; at any one time, but often you need to have multiple scenes at the same time. Problem? Yes, [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Unity3D has a great core architecture &#8211; it&#8217;s easy to understand and use. However, it has some significant flaws.</p>
<p>One of the recurring problems I run into is that Unity requirs you to have precisely one &#8220;Scene&#8221; at any one time, but often you need to have multiple scenes at the same time. Problem? Yes, lots&#8230;</p>
<p>Unity 5 has some hacks to make it &#8220;sort-of possible&#8221; to have multiple scenes at once in-Editor.</p>
<p><em>Note: these were <a href="http://blogs.unity3d.com/2014/08/04/multi-scene-editing/">mentioned by Unity corp in August 2014</a>, but aren&#8217;t available to most users yet</em></p>
<p>But they (appear to be) hacks: they help for a fraction of the use-cases. That&#8217;s fine: Unity has 10 years of software written on the assumption there is only one &#8220;Scene&#8221;; that&#8217;s an enormous amount of code to change! But can we do something about this?</p>
<h2>TL;DR: I&#8217;ll put this on the Asset Store</h2>
<p><strong>If you just want a working solution, <a href="http://forum.unity3d.com/threads/virtual-scenes-create-manage-multiple-areas-cameras-in-one-unity-scene-file.345009/">here&#8217;s the Unity Asset store page / support page, new versions will appear here first</a></strong>.</p>
<p>I&#8217;m using it myself on my own projects, and will do some beta testing with other people&#8217;s games. If it works well enough, it&#8217;ll go on Asset Store. I suggest reading this full post anyway &#8211; it&#8217;s an example of how to creatively solve small issues like this in Unity.</p>
<p>(if you&#8217;d like to beta-test this, tweet me @t_machine_org or email me (address at top of page). Unity Corp only let me have 12 beta-testers, so you&#8217;ll need to give me some info about what you&#8217;ll use it for, how soon, how much feedback you&#8217;ll give me, etc! Sorry :( )</p>
<p><span id="more-3692"></span></p>
<h2>Limitations, hard-coded</h2>
<h3>There can be only One!</h3>
<p>Unity has hardcoded there can only be one Scene object. It&#8217;s unbelievably hard to change such decisions (which is why it&#8217;s famously &#8220;terrible OOP design&#8221;, and we tell new programmers: NEVER do this).</p>
<p>So we&#8217;ll have to do everything with Virtual Scenes: things that are like Scenes, but all exist simultaneously inside the same Unity Scene.</p>
<h3>The universe is &#8230; not &#8230; infinite</h3>
<p>Everything in Unity is required to have a position in 3D space. There are two positions: a &#8220;world position&#8221; (labelled &#8220;position&#8221; in code) and &#8220;local-area position&#8221; (labelled &#8220;localPosition&#8221;). In the GUI, Unity displays only the local-area position, and with parenting of objects this is frequently small numbers &#8211; 0.0, or 5.0, or 1.234324, etc.</p>
<p>However, every object also has a global position (calculated by adding the localPosition to the parent-object&#8217;s position), and this position is affected by the maximum size you can hold in a &#8220;float&#8221; &#8211; and more: by the precision.</p>
<p>So, if you place objects at (0,0, 10000000000000) &#8230; you&#8217;ll hit some very odd problems. For examples of what might happen, google MineCraft&#8217;s FarLands (where you&#8217;ve travelled so far from the 3D origin of (0,0,0) that floating-point numbers stop working properly):</p>
<blockquote><p>
&#8220;As the player journeys even deeper into the Far Lands, the effects worsen to the point where the game is unplayable. At X/Z ±32,000,000,[5] block physics stop functioning correctly. Lighting doesn&#8217;t work and the blocks, although they appear to be there, aren&#8217;t solid. If the player tries to walk on these blocks, he or she will fall into the Void. At excessive X/Z positions, world renderer no longer works, or takes incredibly long times and uses most, if not all CPU usage. It then becomes almost impossible to close Minecraft without a task manager.&#8221; &#8211; <a href="http://minecraft.gamepedia.com/Far_Lands">Minecraft Gamepedia wiki</a></p></blockquote>
<h2>Unity features we can leverage</h2>
<h3>Unity layers keep stuff apart</h3>
<p>Unity&#8217; layers system lets you mark things as &#8220;independent, overlapping universes&#8221;. Many missing-features and problems in Unity are officially worked-around using Layers. That&#8217;s good.</p>
<p>Unfortunately, someone hardcoded a tiny limit to the number of layers. As a bonus, the GUI for visualising, using, and debugging them is poor compared to most of core Unity.</p>
<p>So, layers work, but &#8230; a big game may not have any layers to spare. So we need to use them carefully.</p>
<h3>Things in the same scene don&#8217;t necessarily overlap</h3>
<p>In a game-engine, very little you see on screen is actually infinite: there&#8217;s no point. So, in theory:</p>
<ul>
<li>a camera can see infinitely far into the distance
<li>light travels infinitely far, unless blocked by objects
<li>physics calculations affect everything infinitely far into distance
<li>&#8230;etc
</ul>
<p>In practice, your camera has a &#8220;far plane&#8221; (coincidentally: for almost the same reasons to do with floating-point precision as we have with position) &#8230; light usually ignore things that are &#8220;too far away&#8221; (performance optimization) &#8230; physics pre-groups things into &#8220;near enough to worry about&#8221; and &#8220;too far away to care, for now&#8221; (massive performance optimization!).</p>
<h2>Use cases for Virtual Scenes</h2>
<p>Here are some I&#8217;ve run into, and felt myself wanting help with:</p>
<ol>
<li>Using the New GUI / uGUI from Unity 5 into a game, without have stupid giant GUI 10-miles-high messing up your Editor view of the level
<ol>
<li>Unity corp should have made uGUI have its own window for editing; they didn&#8217;t, so can we solve this?</ol>
<li>If a scene has multiple areas &#8211; e.g. a world-map at small scale, and individual towns / houses / dungeons at big scale &#8211; you need it all in the same scene, but physically displaced
<li>When you are embedding a preview-camera into your HUD (or GUI, or even in-scene), Unity&#8217;s implementation of RenderTexture etc requires you to construct a mini-scene somewhere inside the same Scene, but gives you no help or support to do this.
<ul>
<ol>
<li>We want to be able to make a bunch of these &#8220;dioramas&#8221; and switch between them
<li>&#8230;both while editing, and while trying-out different level-designs
</ol>
</ol>
<p>Recurring themes:</p>
<ul>
<li>A lot of the cases involve embedding a camera-pointing-at-some-other-scene into your main Scene
<li>It has to work both in-Editor and in-Game
<li>In Unity, changing &#8220;Scene&#8221; is very very slow and wipes all data in the Editor; this breaks a huge amount of code and makes you write very long, painful, crappy code to workaround it. We want to avoid that and have multiple scenes that live in one Scene
</ul>
<h2>Implementation / Solution</h2>
<p>I&#8217;ve built a system of &#8220;Virtual Scenes&#8221;. The basic idea is that each Virtual Scene is a parent object floating somewhere very far away in the distance. Easy!</p>
<p>Most of the work so far went into adding custom GUI and window that lets you easily add, navigate, right-click move objects to/from virtual-scenes, etc. e.g. &#8230;</p>
<p><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-07-26-at-15.56.37.png" alt="Screen Shot 2015-07-26 at 15.56.37" width="857" height="607" class="aligncenter size-full wp-image-3693" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2015-07-26-at-15.56.37.png 857w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-07-26-at-15.56.37-150x106.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-07-26-at-15.56.37-300x212.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-07-26-at-15.56.37-624x442.png 624w" sizes="(max-width: 857px) 100vw, 857px" /></p>
<p>Features working at the moment:</p>
<ol>
<li>Each Virtual Scene has its own name (can rename whatever you like)
<li>Fully integrated with Unity Editor &#8211; selecting a VirtualScene in Hierarchy selects it in the Scenes Inspector, and vice-versa
<li>You can right-click any GameObject / selected GameObjects and &#8220;move them to a Virtual Scene&#8221;
<li>When moving-to-scene, if things have a parent, they got to the same localPosition in the Virtual Scene; this makes it very easy to organize things in different Virtual Scenes and move them to/from your main Scene
<li>A SceneManager lets you easily find, view, and jump the Editor &#8220;Scene View&#8221; to each one
<li>It also manages and (re-)positions them when needed (if you decide to delete some, add some, change how far &#8220;far away&#8221; is because you made your main Terrain bigger, etc)
<li>They optionally have a &#8220;Scene Camera&#8221; (which is a local version of MainCamera); when you jump to a scene, it takes you to &#8220;looking hrough the Scene Camera&#8221; since that&#8217;s normally what the sub-scene is being used for
<li>Setup is all automatic: if you open the Virtual Scene Manager, it automatically configures itself and adds a Virtual Scenes system to the current Scene &#8212; (this was hard to make work: I found some new bugs in Unity&#8217;s EditorWindow implementation. Sigh)
<li>Everything is serialized correctly within the Unity Scene, using Unity Serialization &#8212; (this was hard to get right, since Unity doesn&#8217;t let you debug their crappy Serializer &#8230; at all :()
</ol>
<p>Features I&#8217;d like to add:</p>
<ul>
<li>NOT IMPLEMENTED YET: automatic managing of Unity layers, so each Virtual Scene exists in a layer of its own. NB: the Layers in Unity suck. You&#8217;ll be limited to a small number of virtual scenes, etc.
<li>NOT IMPLEMENTED YET: exporting / importing Virtual Scenes (SPECIFICALLY: I&#8217;d like to be able to transfer them between Unity Scenes. Unity&#8217;s &#8220;export package&#8221; feature sucks DONKEY, and still has the same major bugs it&#8217;s had for years; I can probably do much, much better)
<li>NOT IMPLEMENTED YET: &#8220;SceneCam&#8221; preview system: show thumbnails of all the scenes, rather than just customised names. This is useful if you have many scenes, but more just for fun and because I think it&#8217;ll look cool :).
</ul>
<h2>Want an email when this goes live in the Asset Store?</h2>
<div style="background: #beb; border: thin gray solid; margin: 5px auto; text-align: center; width: 350px; ">
[smlsubform emailtxt=&#8221;&#8221; showname=&#8221; mailinglist=&#8221;buy-virtualscenes&#8221;]
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2015/07/26/new-unity3d-feature-virtual-scenes/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Writing a #unity3d mini-game &#8230; to help you design a AAA game</title>
		<link>https://new.t-machine.org/index.php/2015/07/20/writing-a-unity3d-mini-game-to-help-you-design-a-aaa-game/</link>
					<comments>https://new.t-machine.org/index.php/2015/07/20/writing-a-unity3d-mini-game-to-help-you-design-a-aaa-game/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Mon, 20 Jul 2015 14:56:19 +0000</pubDate>
				<category><![CDATA[computer games]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[games design]]></category>
		<category><![CDATA[MMOG development]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Unity3D]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3684</guid>

					<description><![CDATA[One of my hobby projects is a testament to the Ultima and Elder Scrolls games &#8211; a massive open-world, where everything you do impacts the world around you. This has long been promised by commercial games &#8211; and it sucks from a gameplay perspective; it&#8217;s just not fun. But a very old ASCII-graphics game, Omega, [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>One of my hobby projects is a testament to the Ultima and Elder Scrolls games &#8211; a massive open-world, where everything you do impacts the world around you. This has long been promised by commercial games &#8211; and it sucks from a gameplay perspective; it&#8217;s just not fun. But a very old ASCII-graphics game, Omega, showed a couple of ways of doing it that delivered on that promise while still being &#8220;fun&#8221; &#8211; very fun! That&#8217;s what I&#8217;m working towards.</p>
<p>It&#8217;s a test-bed for the high-performance Entity System I&#8217;m writing for Unity (<a href="http://t-machine.org/index.php/2015/05/28/2015-talk-progress-on-an-entity-system-for-unity3d/">more info here</a>). I&#8217;m aiming for &#8220;gameplay considerably richer than Skyrim&#8221; with &#8220;graphics about the level of Oblivion&#8221;. To be clear: Oblivion was released almost 10 years ago! To reproduce those graphics today is fairly easy.</p>
<h2>Challenge: Believable Cities that evolve over time</h2>
<p>One of the things I have yet to see in any FPS RPG is believable cities, and more: cities that actually evolve. The nearest I&#8217;ve seen is the beautiful &#8220;large towns&#8221; of the Assassin&#8217;s Creed series (they represent cities, but the distances are way too small).</p>
<p>That doesn&#8217;t cover the &#8220;evolve&#8221; part though &#8211; even the AC cities are 100% static and unchanging. Hand-crafted, and because they cannot change (technical design choice) the player is incapable of altering them. You can&#8217;t burn down blocks, or build a new bridge. You can&#8217;t buy two houses and knock them together.</p>
<p><span style="font-size:larger">Hey, RPG industry, <a href="https://www.youtube.com/results?search_query=minecraft">you can do a lot better!</a></a></p>
<p>This is one of the main new gameplay elements in my design. If all I managed was to take an off-the-shelf-RPG mod and add living, growing cities &#8230; I&#8217;d probably be content. What does this mean, though?<br />
<span id="more-3684"></span></p>
<h2>SubChallenges: &#8220;believable&#8221; cities?</h2>
<p>A few things:</p>
<ol>
<li>Cities are never EVER made of grids, unless you live in a few small enclaves of modern America, and got stuck in a timewarp to the 1950s.
<li>Cities have districts, quarters, etc based on clusters of specialization. Sometimes its based on geography (&#8220;the docks&#8221;) other times on the people who work there (&#8220;the financial district&#8221;), other times on the history of the city itself (&#8220;old town&#8221; &#8211; usually the part of a city which is surrounded by medieval stone walls, embedded inside the modern city. For instance, look at London Wall in the City of London. The old wall is still there!)
<li>When someone important dies: their property gets lost, fought over, split up, goes to various inheritors; the death of a person &#8211; or conversely: someone becoming rich or elected &#8211; changes the districts of the city
<li>Cities GROW. London was for many centuries &#8220;the city north of the river Thames&#8221;. Where&#8217;s the Thames now? Smack-bang in the middle; the city grew along one bank, built bridges, and then exploded onto the other side.
</ol>
<h3>Grids and house-positioning</h3>
<p>In the space of an hour, I made a quick concept test to show what a city might look like to walk around:</p>
<p><iframe loading="lazy" width="560" height="315" src="https://www.youtube.com/embed/pOHReGVgBc8" frameborder="0" allowfullscreen></iframe></p>
<p>(NB: the odd lighting is because I was testing an idea for a hand-held lantern with dynamic lighting. It kind-of works in Unity, but I&#8217;m not 100% happy with it).</p>
<p>Things of note:</p>
<ol>
<li>Many dead-ends. This is normal!
<li>Dead-ends often terminate at a door. Ideally, I believe they should nearly always have a door, or sewer entrance, or well, or &#8230; something INNATELY IMMOVABLE at the end &#8211; in the real world, an alley without a door is liable to get a wall built on the front and converted into a new house/room, annexed to one of the neighbouring houses.
<ul>
<li>In the UK, there are many cities where even the &#8220;immovable&#8221; things got built over. I&#8217;ve lived in houses where a sewer-cover is inside the building because the house was expanded over the top of it. I&#8217;ve also seen houses with indoor-wells (for the same reason: originally outdoors, then the courtyard got covered and became a room).
</ul>
<li>The city is mostly interconnected odd-shaped courtyards, with a sprinkling of broad streets. In short: if it&#8217;s empty, and it&#8217;s not full of street traffic, it gets built-on. But not in a careful, squared-off, mathematical way. No, it gets built using whatever materials are to hand, whatever lengths of wood you own, etc, so that the plans of each building and street get more and more crooked over time.
<li>Hidden alleyways that are hard to spot from a distance, hidden around the corner of a building. Again, in the real world, these are COMMON (how often do you see them in games? Rarely).
<ul>
<li>For a modern example, in the city I live now (Brighton), there&#8217;s a network of things called &#8220;Twittens&#8221;. A Twitten is defined as &#8220;an alleyway that serves as the only route to the front-door of people&#8217;s houses&#8221;. i.e. the houses here cannot be reached at all, except via alleyway. They&#8217;re cute. People like living in them. They are very quiet even in the center of the city on a busy Saturday night &#8211; you can&#8217;t fit many drunken people in an alleyway.</ul>
</ol>
<h3>Geography, Quarters, evolution, growth, adaptation</h3>
<p>Ouch.</p>
<p>This is VERY HARD to simulate using random generation.</p>
<p>It&#8217;s been studied obsessively by western culture &#8211; the growth of towns, cities, families, dynasties, social-groups, etc is probably more of recorded history than anything except &#8220;war&#8221;. So we know an awful lot of observed facts about what gives rise to what, when, and how. But how do you tell a computer that?</p>
<p>The brilliant guys at Introversion Software were, for a while, working on a modern-city generator that took into account both &#8220;geography beneath/beside the city&#8221; and &#8220;specialisation within cities&#8221;. Here&#8217;s a video:</p>
<p><iframe loading="lazy" width="854" height="510" src="https://www.youtube.com/embed/MG41yYBD-rE" frameborder="0" allowfullscreen></iframe></p>
<p>Good, eh?</p>
<p>But I need more than good looks: I need to store this stuff programmatically. Because it&#8217;s core to my game that I can do three things:</p>
<ol>
<li>Implement quests, AI, bonuses, penalties, shop locations, etc that change based on the presence/absence of quarters in the city &#8211; and whether or not the  player has &#8220;discovered&#8221; them yet!
<li>Evolve the city: when the city runs the &#8220;grow city&#8221; algorithm, I need to preserve some quarters, while replacing others. I need to control that, or it will be too chaotic!
<li>When the player changes the city (by being very wealthy and building new houses, or blocking-off streets, etc), I need to be able to programmatically, procedurally, detect this and re-calculate the city districts, and have the computer alter the city around the player&#8217;s actions
</ol>
<h2>Solution: Generative Grammars</h2>
<p>When I read Computer Science at Uni, the lecturers were fond of saying that the two most important things you could learn about programming were &#8220;how to make a compiler&#8221; and &#8220;how to write a new programming language&#8221;. It turns out that when you encounter a really HUGE problem, often the quickest way for a human to solve it is to write a new language that makes it easy to describe, and write a new compiler that lets the computer convert that &#8220;simple&#8221; language into vast amounts of C++ (or whatever) code.</p>
<p>Then you can run a normal compiler on the C++ code, and get your solution.</p>
<p>Using grammars in city-generation <strong>theoretically</strong> solves a lot of the above problems; in practice, it&#8217;s a lot harder than that. Mostly because it&#8217;s hard to decide what level of detail to put in your grammar!</p>
<h3>The simple, most important thing you need to learn: BNF</h3>
<p>If you do any programming at all, <a href="https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_Form">go learn Backus-Naur Form; go do it right now!</a></p>
<p>BNF is a beautifully simple way of representing most of the grammars we encounter in real-world programming. It isn&#8217;t just about programming: it&#8217;s the OFFICIAL way that all internet protocols are described.</p>
<blockquote><p>
e.g. what&#8217;s a valid email address? Can you have an @ symbol? What about spaces? Where can they go? Are you sure? &#8230; the answer is a simple BNF grammar that makes it shockingly easy to answer those questions, without any annoying verbose academic jargon. Yay!
</p></blockquote>
<p>Everyone should learn BNF. Anyway, back to the game&#8230;</p>
<h2>How to decide? ARGH!</h2>
<p>I spent a few weeks making mockups of cities, and transformations that would grow / improve / add detail to them. It&#8217;s tough, but I had some successes using transforms that accepted &#8220;tagged&#8221; polygons and output a new set of &#8220;tagged&#8221; polygons.</p>
<p>But it was quickly clear it would take weeks of work to try an idea and then dismiss it. And since this is a hobby project, that could take me half a year or more per (Failed) idea!</p>
<p>So I needed something smaller.</p>
<p>I decided to do it in 1D first. i.e. a BNF grammar on a simple string. The string reads left-to-right as a profile view of a city.</p>
<blockquote><p>
e.g.: Grass Grass Fields Farm Fields Road Big_Road CityWall GuardHouse Market Houses Houses Castle Houses Merchants Houses CityWall Beach Sea
</p></blockquote>
<p>&#8230;this lets me test ideas for GAME DESIGN (what is a &#8220;fun&#8221; level of detail? how complex do my grammar rules need to be? How many do I need for it to make interesting cities? &#8230; how much is &#8220;too many&#8221; that leads to boring cities?</p>
<p>At first I was visualising it using sentences, but I found that hard to work with as my cities got larger. So &#8230; I added a visual representation at bottom of the screen, using graphics I hand-bastardised using <a href="http://www.lostgarden.com/2007/05/dancs-miraculously-flexible-game.html">Dan&#8217;s free game art at Lost Garden.com</a>.</p>
<p><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-07-20-at-14.45.35.png" alt="Screen Shot 2015-07-20 at 14.45.35" width="960" height="606" class="aligncenter size-full wp-image-3689" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2015-07-20-at-14.45.35.png 960w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-07-20-at-14.45.35-150x95.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-07-20-at-14.45.35-300x189.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-07-20-at-14.45.35-624x394.png 624w" sizes="(max-width: 960px) 100vw, 960px" /></p>
<p>I was having fun with this, but started feeling frustrated there was no point to it, even though I was making lots of mini-cities.</p>
<p>So I realised I could make it into a mini-game. A few hours later, and we have version 0.1 of MiniCity:</p>
<p><span style="color: blue; font-size: large"><a href="http://t-machine.org/files/cityclicker/rogue1citymaker.html">http://t-machine.org/files/cityclicker/rogue1citymaker.html</a> (Unity Webplayer, runs in browser)</a></p>
<h2>It SUCKS &#8211; yes, I know!</h2>
<p>Right now, this is not expected to be fun; I changed the rules a few times, and found some problems I hadn&#8217;t forseen. Then I added and removed some stuff to fix them, and &#8230; ran out of free time. I hit the publish button because I think this is a very interesting idea. Don&#8217;t judge this as a game! It&#8217;s a design-tool, not a game.</p>
<p>BUT &#8230; on future evenings/weekends, this is something I can add to quite quickly. I&#8217;ve already started working on the 2D version: top down view of a city, using arbitrary-shaped polygons instead of bitmap tiles.</p>
<h2>How did I do it?</h2>
<p>In case you&#8217;re interested, I left the actual BNF transformations listed on the buttons. It&#8217;s not written in BNF syntax (sorry!) but if you&#8217;ve looked at BNF, you should easily see what&#8217;s going on.</p>
<p><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-07-20-at-14.45.41.png" alt="Screen Shot 2015-07-20 at 14.45.41" width="355" height="377" class="aligncenter size-full wp-image-3690" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2015-07-20-at-14.45.41.png 355w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-07-20-at-14.45.41-141x150.png 141w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-07-20-at-14.45.41-282x300.png 282w" sizes="(max-width: 355px) 100vw, 355px" /></p>
<p>NB: I started by writing (on whiteboard) the BNF I wanted. Then I implemented that, one rule at a time.</p>
<p>The rules themselves are using Regular Expressions (C#&#8217;s &#8220;Regex&#8221; class), because I spotted that this was a super-fast way for me to get somethign up and running. It will be absolutely useless for the 2D version &#8211; but Regexp&#8217;s are specifically designed to work brilliantly on 1D input (strings).</p>
<p>You should be able to understand what each rule does, and why it works, from looking at the button names.</p>
<h2>Want more?</h2>
<p>This is part of my work on Entity Systems in Unity, and a living, breathing RPG.</p>
<p>If you&#8217;re interested, sign up here (I&#8217;ve sent only 1 email per year so far, but hope to start sending a few more soon. Maybe 3 or 4 a year!).</p>
<div style="background: #beb; border: thin gray solid; margin: 5px auto; text-align: center; width: 350px; ">
[smlsubform emailtxt=&#8221;&#8221; showname=&#8221; mailinglist=&#8221;rogue2015&#8243;]
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2015/07/20/writing-a-unity3d-mini-game-to-help-you-design-a-aaa-game/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Template for #unity3d to test custom procedural game meshes</title>
		<link>https://new.t-machine.org/index.php/2015/07/17/template-for-unity3d-to-test-custom-procedural-game-meshes/</link>
					<comments>https://new.t-machine.org/index.php/2015/07/17/template-for-unity3d-to-test-custom-procedural-game-meshes/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Fri, 17 Jul 2015 18:11:16 +0000</pubDate>
				<category><![CDATA[dev-process]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Unity3D]]></category>
		<category><![CDATA[Unity3D-tips]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3677</guid>

					<description><![CDATA[One of Unity&#8217;s dirty secrets is that (out of the box) it&#8217;s plain awful as a prototyping tool. You can fix that, but it requires quite a lot of work. I&#8217;m going to start publishing my fixes one by one. Here&#8217;s the first: a test-bed for making custom meshes. A very common thing you need [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>One of Unity&#8217;s dirty secrets is that (out of the box) it&#8217;s plain awful as a prototyping tool. You can fix that, but it requires quite a lot of work. I&#8217;m going to start publishing my fixes one by one. Here&#8217;s the first: a test-bed for making custom meshes.<br />
<span id="more-3677"></span></p>
<p>A very common thing you need to during Unity gamedev &#8211; creating and testing algorithms for generating and manipulating meshes &#8211; is a pain. There&#8217;s custom classes and editors and stuff you have to write before you can create a single, basic, mesh.</p>
<p>One of Unity&#8217;s silly failings is that they don&#8217;t allow custom &#8220;new-project&#8221; templates, as if we were stuck in 1980 and hadn&#8217;t learned how to make IDE&#8217;s yet.</p>
<p>I&#8217;ve created a minimal example (should work with all versions of Unity 3.x through 5.x) which automatically creates a single mesh and scales it to fit your camera, and centers it on that camera&#8217;s screen, but positioned on Z=0, so that it doesn&#8217;t get clipped.</p>
<blockquote><p>
This solves 4 or 5 of the most common &#8220;dumb mistakes&#8221; I tend to make when trying to add new Mesh-generation code from scratch to an existing Unity project. Gives me a good starting point for new projects
</p></blockquote>
<h2>Usage</h2>
<p>The tri has center of base at the local origin of the camera, and the tip of the triangle precisely touching the top edge of the screen. This should make it very easy to visually check your meshes are generating at right position/orientation/location.</p>
<p>I&#8217;m assuming you&#8217;ll build your meshes in 2D; nearly all gamedev algorithms work in 2D first and are extrapolated to 3D, so that&#8217;s how I recommend writing and testing them. Once it works in 2D, move your code to a &#8220;real&#8221; game project and start doing the 3D version. This project is simply to get you up and running quickly when prototyping new Mesh-gen ideas.</p>
<p>I&#8217;m also assuming you&#8217;ll deal with material + texture + lighting yourself &#8211; many algorithms don&#8217;t even use textures, either because they&#8217;re using shaders (in which case you&#8217;d want to test UV too, but I&#8217;ve left that out here), or because they&#8217;re raw topology algorithms that don&#8217;t care about rendering.</p>
<p>So &#8230; you&#8217;ll get a pink triangle to start with. If you&#8217;re making custom mesh algorithms, you most certainly should already know how to create and attach materials in code!</p>
<h3>Bonus: won&#8217;t delete data</h3>
<p>There&#8217;s some code in there that each time you re-gen, it automatically gives a new name to next item, and doesn&#8217;t delete the old. You might want to remove that and have it automatically delete the old test data each time. But I erred on the side of caution.</p>
<h3>Installation</h3>
<ol>
<li>Create an empty Unity project. This will have a camera by default (required!)
<li>Select the camera and set it to &#8220;Orthogonal&#8221;
<li>Create a new folder &#8220;Editor&#8221; (required by Unity Corp to workaround absurd bugs in Unity&#8217;s build system)
<li>Create a file in that called &#8220;TestTriGen1.cs&#8221;
<li>Copy/Paste the source into that file
<li>Save the file, go back to Unity.
<li>Wait a few seconds
<li>A menu will appear &#8220;TriGen&#8221;, click the one item in that menu
<li>Click your camera to see the Unity preview: you should see a large pink triangle
</ol>
<h2>Code</h2>
<p>[csharp]<br />
using UnityEngine;<br />
using System.Collections;<br />
using System.Collections.Generic;</p>
<p>using UnityEditor;</p>
<p>public class TestTriGen1 : MonoBehaviour<br />
{</p>
<p>private static TestTriGen1 _ttg;<br />
[MenuItem(&quot;TriGen/TriGen&quot;)]<br />
public static void GenTris()<br />
{<br />
if( _ttg == null)<br />
_ttg = new TestTriGen1();</p>
<p>_ttg.gen();<br />
}</p>
<p>public void gen()<br />
{<br />
Camera camera = Camera.main;<br />
float MeshDiameter = camera.orthographicSize;</p>
<p>		string _parentName = &quot;Gen&#8217;d tris&quot;;<br />
GameObject parent = GameObject.Find( _parentName );<br />
 if( parent == null ) parent = new GameObject( _parentName );</p>
<p>int numChildren = parent.transform.childCount;<br />
GameObject area = new GameObject(&quot;Area &quot;+(1+numChildren));<br />
area.transform.parent = parent.transform;<br />
		area.transform.position = new Vector3( camera.transform.position.x, camera.transform.position.y, 0 );</p>
<p>MeshRenderer mr = area.AddComponent&lt;MeshRenderer&gt;();<br />
MeshFilter mf = area.AddComponent&lt;MeshFilter&gt;();<br />
Mesh m = new Mesh();<br />
mf.mesh = m;</p>
<p>Vector3[] vs = new Vector3[3];<br />
vs[0] = new Vector3(0,1f * MeshDiameter,0);<br />
		vs[1] = new Vector3(0.5f * MeshDiameter,0,0);<br />
		vs[2] = new Vector3(-0.5f * MeshDiameter,0f,0);</p>
<p>		int[] tris = new int[3];<br />
		tris[0] = 0;<br />
		tris[1] = 1;<br />
		tris[2] = 2;</p>
<p>		m.vertices = vs;<br />
		m.triangles = tris;<br />
}<br />
}<br />
[/csharp]</p>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2015/07/17/template-for-unity3d-to-test-custom-procedural-game-meshes/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>#unity3d missing docs: EditorWindow lifecycle</title>
		<link>https://new.t-machine.org/index.php/2015/06/25/unity3d-missing-docs-editorwindow-lifecycle/</link>
					<comments>https://new.t-machine.org/index.php/2015/06/25/unity3d-missing-docs-editorwindow-lifecycle/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Thu, 25 Jun 2015 22:41:43 +0000</pubDate>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[Unity3D]]></category>
		<category><![CDATA[Unity3D-tips]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3671</guid>

					<description><![CDATA[If you do any non-trivial customization of Unity Editor, you&#8217;ll almost certainly extend EditorWindow. But Unity (to date) refuses to tell anyone how to do this legally, or what the contracts you&#8217;re being held to are. Without that, many plugins on the Unity Asset Store are wrong and buggy, and sooner or later accidentally cause [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>If you do any non-trivial customization of Unity Editor, you&#8217;ll almost certainly extend EditorWindow. But Unity (to date) refuses to tell anyone how to do this legally, or what the contracts you&#8217;re being held to are. Without that, many plugins on the Unity Asset Store are wrong and buggy, and sooner or later accidentally cause problems for users.</p>
<p>Their fault? Partly, but I don&#8217;t blame them too much &#8211; rather: Unity&#8217;s fault for failing to document (and failing to test assets before approving them!).</p>
<p>For those of you who aren&#8217;t happy shipping crappy, broken, buggy plugins (And charging for them), here&#8217;s a guide / reference for the lifecycle of EditorWindow. Extra info, explanations, and gotchas welcome!</p>
<p><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Docs-UnityEditorWindow.png" alt="Docs-UnityEditorWindow" class="aligncenter size-full wp-image-3672" width="800" height="1284" srcset="https://t-machine.org/wp-content/uploads/Docs-UnityEditorWindow.png 800w, https://t-machine.org/wp-content/uploads/Docs-UnityEditorWindow-93x150.png 93w, https://t-machine.org/wp-content/uploads/Docs-UnityEditorWindow-187x300.png 187w, https://t-machine.org/wp-content/uploads/Docs-UnityEditorWindow-638x1024.png 638w, https://t-machine.org/wp-content/uploads/Docs-UnityEditorWindow-624x1002.png 624w" sizes="(max-width: 800px) 100vw, 800px" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2015/06/25/unity3d-missing-docs-editorwindow-lifecycle/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>#UX conveying critical info to public via number rating: Food Hygiene Stickers</title>
		<link>https://new.t-machine.org/index.php/2015/06/13/ux-conveying-critical-info-to-public-via-number-rating-food-hygiene-stickers/</link>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Sat, 13 Jun 2015 12:34:19 +0000</pubDate>
				<category><![CDATA[games design]]></category>
		<category><![CDATA[usability]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3662</guid>

					<description><![CDATA[How do you make good UX / GUI to present information to a mass-market audience with widely varying levels of education and attention-span? This is a problem faced all the time by game designers and developers. It&#8217;s one of the most under-appreciated skills of the profession: good game developers know more about &#8220;presenting information and [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>How do you make good UX / GUI to present information to a mass-market audience with widely varying levels of education and attention-span?</p>
<p>This is a problem faced all the time by game designers and developers. It&#8217;s one of the most under-appreciated skills of the profession: good game developers know more about &#8220;presenting information and choices&#8221; than almost anyone else, anywhere. Because games are generally overloaded with info, and the dev teams have to filter that down and present it clearly &#8211; but if they get it wrong, the player&#8217;s in-game character dies, the game is lost, and the game itself tanks commercially. The developers then &#8211; ultimately &#8211; lose their jobs when the studio goes bust.</p>
<p>I&#8217;m going to start looking at non-tech examples of design and UX through the lens of game-design, and see where it goes&#8230;<br />
<span id="more-3662"></span></p>
<h2>Food: a fast way to self-poisoning</h2>
<p>Here&#8217;s an interesting example where information-presentation is high-value/critical, but pervasive and difficult:</p>
<p>In most Western countries, the Governments ensure that all places that sell food publically &#8211; restaurants, cafes, bars, street vendors &#8211; meet or exceed good-health standards according to modern medical understanding.</p>
<p>Great!</p>
<p>But that&#8217;s a complex problem: especially, how do you &#8220;ensure&#8221;? If the food is bad, do you close down the business? The staff lose their jobs, the owners go bankrupt, the public never trusts that brand again? Is it possible for cheap food to continue existing in such a regime &#8211; or would the risk be too high, and all food would become expensive &#8230; ultimately unseating the Government itself (a population that cannot afford to eat is extermely scary to those in power!).</p>
<p>A common approach today is approximately:</p>
<ol>
<li>If it&#8217;s dangerous, shut it down. If a vendor is &#8211; for instance &#8211; infecting ANYONE with food poisoning on a recurring basis: force them to stop selling.
<li>If it&#8217;s merely risky, not poisonous but &#8211; perhaps &#8211; unhealthy: warn them, but let the public decide.
</ol>
<p>How?</p>
<h2>UK&#8217;s 5-point Food Hygiene System</h2>
<p>These stickers are common in UK food places. Almost everywhere has them displayed in the street window, even when the sticker says bad things about the establishment:</p>
<p><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/env_food_hygiene_scores_body.png" alt="env_food_hygiene_scores_body" width="594" height="565" class="aligncenter size-full wp-image-3663" srcset="https://t-machine.org/wp-content/uploads/env_food_hygiene_scores_body.png 594w, https://t-machine.org/wp-content/uploads/env_food_hygiene_scores_body-150x143.png 150w, https://t-machine.org/wp-content/uploads/env_food_hygiene_scores_body-300x285.png 300w" sizes="(max-width: 594px) 100vw, 594px" /></p>
<p>Thanks to the Web, it&#8217;s easy to read about this direct from the UK Government: <a href="http://www.food.gov.uk/multimedia/hygiene-rating-schemes/rating-schemes-faqs-en/fhrs">food.gov.uk &#8211; the official website explaining the scheme</a>.</p>
<blockquote><p>
<em>From the website:</em> &#8220;It’s not easy to judge hygiene standards on appearance alone, so the rating gives you an idea of what’s going on in the kitchen, or behind closed doors. You can check the ratings and use the information to switch to or choose a place with higher standards.<br />
&#8230;<br />
The scheme also encourages businesses to improve hygiene standards.&#8221;
</p></blockquote>
<p>That&#8217;s a huge amount of information &#8211; with enormous repercussions upon getting it wrong &#8211; that has to go out to a highly uninformed (most people don&#8217;t know, don&#8217;t care) mass audience. Let&#8217;s break it down&#8230;</p>
<h3>Colour choice</h3>
<p>The black border is part of the actual stickers:</p>
<p><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-06-13-at-13.08.12.png" alt="Screen Shot 2015-06-13 at 13.08.12" width="280" height="165" class="aligncenter size-full wp-image-3664" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2015-06-13-at-13.08.12.png 280w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-06-13-at-13.08.12-150x88.png 150w" sizes="(max-width: 280px) 100vw, 280px" /></p>
<p>This normally goes on a glass window, so the thick black border helps them stand-out, and makes sure that the pale green background is always in high-contrast to its surroundings.</p>
<p>The green is pretty unpleasant compared to normal Brand colours; I suspect that is deliberate.</p>
<p>Then the black border is re-used for the number-rating itself. So you have a contrast scheme: border &#8211; background &#8211; number. The key info has been isolated and made almost impossible to miss.</p>
<p><strong>The most important info &#8211; the rating out of 5 &#8211; has been made the most visually striking item on the sticker</strong></p>
<h3>Weight</h3>
<p>Let&#8217;s look at a blurred version. This is quick and dirty, but in my experience it normally maps very closely to where people look and what they notice (compared to doing proper eye-tracking studies):</p>
<p><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/blurry-food-sticker-0.png" alt="blurry-food-sticker-0" width="280" height="165" class="aligncenter size-full wp-image-3665" srcset="https://t-machine.org/wp-content/uploads/blurry-food-sticker-0.png 280w, https://t-machine.org/wp-content/uploads/blurry-food-sticker-0-150x88.png 150w" sizes="(max-width: 280px) 100vw, 280px" /></p>
<ol>
<li>The unselected numbers disappear; their &#8220;button shine&#8221; effect causes them to blur themselves out of existence
<li>The selected number remains strongly visible: the pure flat render ensures it always has high contrast and clarity
<li>The thin / narrow lines of the font-face make most of the text disappear. Combined with the thin rule separating the sections, it all takes a back seat to the rating
<ul>
<li>(unlike some provincial ratings I&#8217;ve seen in other Countries, where the local-authority&#8217;s own branded logo takes prominence, making their altruism appear &#8230; questionable)</ul>
<li>The words &#8220;food&#8221; and &#8220;rating&#8221; stand out anyway. Bracketed at the extreme edges of the sticker, and using letters that keep their structure under blurring (compared to the &#8220;hygiene&#8221; word)
<li>The &#8220;tick&#8221; is clearly visible. More on that later.
<li>The numbers take up almost exactly as much weight as the title + rule + tick combined
</ol>
<h3>What am I looking at?</h3>
<p>For the ignorant man-on-the-street (most of us, I think) this is the big question: Whatever; what is this and (why) do I care?</p>
<p>&#8230;once I get that (OK, the title helps a lot, but people skimread a lot), there&#8217;s a few things working all at once to help:</p>
<p><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-06-13-at-13.19.17.png" alt="Screen Shot 2015-06-13 at 13.19.17" width="255" height="147" class="aligncenter size-full wp-image-3666" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2015-06-13-at-13.19.17.png 255w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-06-13-at-13.19.17-150x86.png 150w" sizes="(max-width: 255px) 100vw, 255px" /></p>
<ol>
<li>Instead of a number, you&#8217;re given ALL the numbers, and one of them is VERY clearly &#8220;selected&#8221;; there is no doubt that this is an &#8220;out-of-5&#8221; rating of some kind
<li>&#8230;and that the rating goes 0..5 (not 1..5, nor 1..4, etc)
<li>The tick confirms exactly which rating the establishment has received. With 2-4 this isn&#8217;t a big deal &#8211; but with 1 and 5, where you might assume the number was larger because the graphic designer was bored and making it look pretty for no reason &#8230; the tick confirms &#8220;No, you didn&#8217;t misread it. This really is a 0&#8221; (or 5).
<li>The tab!
<ul>
<li>The tab moves along with the number! No lack of clarity about whether it&#8217;s merely &#8220;bonus info&#8221;. Nope, this is explicitly part of the rating itself.
<li>What does a number mean, anyway? The tab tells us!
<li>The position of the tab is the 3rd emphasis on the number&#8217;s relative position. Relative position matters enormously to the public: &#8220;is this THE SAFEST place to eat? Maybe it&#8217;s not great, but IS IT THE BEST I&#8217;M LIKELY TO FIND?&#8221; etc.
<ol>
<li>The numbers are all visible, and one is &#8220;selected&#8221;; the percentage left-to-right of the &#8220;selected&#8221; circle acts like a progress-bar showing how good/bad it is relative to the rest of the possibilities
<li>The tick does the same, but makes it even more explicitly &#8220;progress&#8221;-like
<li>The tab further cements this, by moving from left (bad) to right (good) with increasing scores
</ol>
<li>The tab is smaller than the number; why? Probably because: a few words cannot hope to give detail on this particular establishment. People understand that a number is a gross simplification, but words incline them to see it as a detailed summary. So: de-emphasize the words and emphasize the number. The words are here to shine meaning on the number, and to give reassurance. e.g. some readers may assume that &#8220;anything less than 5 means I&#8217;ll get poisoned!&#8221; &#8211; dealing with Fear, Cultural differences, and General Ignorance is a daily struggle in mass-market UX.
</ul>
</ol>
<h3>More thoughts&#8230;</h3>
<p>I find it interesting that the &#8220;normal&#8221; rating is 3/5 (exactly halfway if you rated 1,2,3,4,5), but ends up positioned slightly to the right of center.</p>
<p>This is partly a side-effect of starting at 0, but they might have arrange 1-5 on one line, and used a different sticker (maybe a red background, for DANGER!) for 0.</p>
<p>However, it provides another benefit: in a well-regulated market, &#8220;average&#8221; is actually a very GOOD thing! It&#8217;s something to be proud of. In Western societies, &#8220;average&#8221; is generally associated with mediocrity and connotations of failure.</p>
<p>Shifting the &#8220;average&#8221; score of 3 slightly towards the &#8220;perfect&#8221; score of 5 helps suggest to the reader that they ought to be pleased with that score, rather than disappointed.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Use shift-N to create new scripts in Unity Project Window, fast</title>
		<link>https://new.t-machine.org/index.php/2015/06/09/use-ctrl-shift-n-to-create-new-scripts-in-unity-project-window-fast/</link>
					<comments>https://new.t-machine.org/index.php/2015/06/09/use-ctrl-shift-n-to-create-new-scripts-in-unity-project-window-fast/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Tue, 09 Jun 2015 16:32:19 +0000</pubDate>
				<category><![CDATA[Unity3D]]></category>
		<category><![CDATA[Unity3D-tips]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3649</guid>

					<description><![CDATA[In Unity, you create new scripts many times per day, and folders but there&#8217;s no keyboard shortcuts. I fixed this, and made the popup rather more intelligent than Unity&#8217;s built-in one. I&#8217;ve decided to make the basic version available for free here: UPDATE: there&#8217;s a bug in the 1.0 version &#8211; it WILL NOT WORK [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In Unity, you create new scripts many times per day, and folders but there&#8217;s no keyboard shortcuts. I fixed this, and made the popup rather more intelligent than Unity&#8217;s built-in one. I&#8217;ve decided to make the basic version available for free here:</p>
<p><span style="color: red">UPDATE: there&#8217;s a bug in the 1.0 version &#8211; it WILL NOT WORK if you set your Project window to 2-column layout. This is due to BUGS IN UNITY (not my code!). I have a workaround that&#8217;s in the Asset Store version, but is missing from the free version. I&#8217;ll patch it later</span></p>
<blockquote><p>
<a href="http://t-machine.org/wp-content/uploads/FreeIntelligentNew.dll">FreeIntelligentNew.dll</a> &#8211; I&#8217;m not supporting this; it&#8217;s free: use at your own risk.</p>
<p>Or, for $2, you can <a href="https://www.assetstore.unity3d.com/en/#!/content/35088">get the latest version with full source code from Asset Store</a> &#8211; I&#8217;m supporting + updating this.
</p></blockquote>
<h2>Installation</h2>
<p>Drag/drop the DLL into any folder named &#8220;Editor&#8221; in your project.</p>
<p>(required by Unity; this is how they make sure that Editor scripts aren&#8217;t accidentally included in your final game)</p>
<h2>Usage</h2>
<ol>
<li>Select the Project panel
<li>Hit shift-N
<li>By default, it intelligently guesses if you wanted a new Folder or a new Script. If it guessed wrong, hit &#8220;tab&#8221; to cycle through the options
<li>Choose a name and hit Enter (like normal in Unity). Done!
</ol>
<h2>How&#8230;?</h2>
<p>This works by peeking into some of Unity&#8217;s internals and detecting which EditorWindow has focus. If it&#8217;s the Project window, it uses some hardcoded constants (which differ between Unity versions, due to bugs they gradually fix, I think) to get the positions right, and offer you the popup.</p>
<p>I did it this way because Unity currently provides NO PUBLIC API for reproducing some of their core Editor features (e.g. where they temporarily change the render-style of the &#8220;newly-created item&#8221; in a Unity windowpane, so that you can edit the name in-line. Not possible for you or I!)</p>
<p>With a bit more hacking, I might be able to hook Unity&#8217;s own code and enable / trigger / alter the hidden features from keyboard, but &#8230; that&#8217;s on the wrong side of &#8220;Fragile; would probably break unexpectedly in a future version&#8221;.</p>
<p>How I&#8217;ve done it so far it sits independently of Unity&#8217;s code, and is very unlikely to stop working, or to cause bugs later on. YMMV&#8230;</p>
<p>(if you want to know more, get the Asset Store version, read the source. I&#8217;m happy to answer quetsions via the support links or in the Unity Forums page for this)</p>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2015/06/09/use-ctrl-shift-n-to-create-new-scripts-in-unity-project-window-fast/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Entity ID&#8217;s: how big, using UUIDs or not, why, etc?</title>
		<link>https://new.t-machine.org/index.php/2015/06/09/entity-ids-how-big-using-uuids-or-not-why-etc/</link>
					<comments>https://new.t-machine.org/index.php/2015/06/09/entity-ids-how-big-using-uuids-or-not-why-etc/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Tue, 09 Jun 2015 12:05:05 +0000</pubDate>
				<category><![CDATA[entity systems]]></category>
		<category><![CDATA[programming]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3644</guid>

					<description><![CDATA[This has come up a few times, and I ended up replying on Twitter: @t_machine_org any thoughts of using 128bit guids for entity-ids? too big? — Richard Kogelnig (@RichardKogelnig) June 9, 2015 But that&#8217;s a crappy way to find things later, so I made a quick-and-dirty infographic with a few key points:]]></description>
										<content:encoded><![CDATA[<p>This has come up a few times, and I ended up replying on Twitter:</p>
<blockquote class="twitter-tweet" lang="en">
<p dir="ltr" lang="en"><a href="https://twitter.com/t_machine_org">@t_machine_org</a> any thoughts of using 128bit guids for entity-ids? too big?</p>
<p>— Richard Kogelnig (@RichardKogelnig) <a href="https://twitter.com/RichardKogelnig/status/608196541086633984">June 9, 2015</a></p></blockquote>
<p><script async="" src="//platform.twitter.com/widgets.js" charset="utf-8"></script></p>
<p>But that&#8217;s a crappy way to find things later, so I made a quick-and-dirty infographic with a few key points:</p>
<p><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Docs-entityID.png" alt="Docs-entityID" class="aligncenter size-full wp-image-3647" width="600" height="1100" srcset="https://t-machine.org/wp-content/uploads/Docs-entityID.png 600w, https://t-machine.org/wp-content/uploads/Docs-entityID-82x150.png 82w, https://t-machine.org/wp-content/uploads/Docs-entityID-164x300.png 164w, https://t-machine.org/wp-content/uploads/Docs-entityID-559x1024.png 559w" sizes="(max-width: 600px) 100vw, 600px" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2015/06/09/entity-ids-how-big-using-uuids-or-not-why-etc/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>6 ways to massively improve the #unity3d AssetStore (for #gamedev&#8217;s)</title>
		<link>https://new.t-machine.org/index.php/2015/06/09/6-ways-to-massively-improve-the-unity3d-assetstore-for-gamedevs/</link>
					<comments>https://new.t-machine.org/index.php/2015/06/09/6-ways-to-massively-improve-the-unity3d-assetstore-for-gamedevs/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Tue, 09 Jun 2015 09:54:29 +0000</pubDate>
				<category><![CDATA[advocacy]]></category>
		<category><![CDATA[games industry]]></category>
		<category><![CDATA[games publishing]]></category>
		<category><![CDATA[marketing and PR]]></category>
		<category><![CDATA[Unity3D]]></category>
		<category><![CDATA[usability]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3637</guid>

					<description><![CDATA[Six months ago I tweeted a handful of obvious ways that you could make the Unity Asset Store greatly more profitable. One of the Unity folk reached out to me, claimed that Unity was highly invested in improving this and asked for specific suggestions. So I wrote longer, detailed versions of each tweet and emailed [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Six months ago I tweeted a handful of obvious ways that you could make the Unity Asset Store greatly more profitable.</p>
<p>One of the Unity folk reached out to me, claimed that Unity was highly invested in improving this and asked for specific suggestions. So I wrote longer, detailed versions of each tweet and emailed them.</p>
<p>It&#8217;s been six months. No response. So &#8230; for Unity&#8217;s competitors, maybe looking to make/improve their own Asset Stores (or newcomers hoping to unseat the incumbents), here&#8217;s six obvious commercial improvements.</p>
<blockquote><p>
I&#8217;ve cut a few paragraphs I wrote to Unity about who I think their 3 main audiences are on the Asset Store; I included them as a &#8220;here are the assumptions I&#8217;m making&#8221; &#8211; I have no idea what their real audiences are. So I omitted that here.
</p></blockquote>
<p>NB: I&#8217;ve made the formatting webpage friendly, added some details, but this is essentially an info dump. I was too busy at the time to sugar-coat it &#8211; I figured that if Unity wanted to talk, I&#8217;d talk to them, and in person I&#8217;m really quite friendly and gentle. But at the time we were working 24/7 getting ready for a major exhibition, so this is a bit &#8230; terse.</p>
<p><span id="more-3637"></span></p>
<h2>Without stats, vendors are blind</h2>
<p>I cannot emphasise this enough: selling on the Asset Store today is like advertising before the existence of Google. It&#8217;s absurd: the people at Unity in charge of this stuff appear to be rank amateurs at SEO, eCommerce, Advertising, etc. There is no excuse for trying to sell stuff ONLINE without metrics to tell you what&#8217;s selling and why.</p>
<p>So&#8230;</p>
<p>Set some easy measurables to gauge the health of sales:</p>
<ol>
<li> what happens to sales of new assets, <em>cohorted</em>?
<li> What happens to pageviews?
<li> What&#8217;s the &#8220;reviews/purchase&#8221; ratio?
<li> What&#8217;s the sales volume before and after an Asset Sale?
</ol>
<p>(if the Store is working well, the sales volume would be lower after each sale, it ought to drop-off; post-mortems by many devs suggest the opposite. In that case, the whole of &#8220;Discovery&#8221; on your store is FUBAR and needs fixing urgently: this is the initial flow of potential sales, and you&#8217;re cutting it off)</p>
<h2>Unity&#8217;s store is ugly and impossible to navigate</h2>
<p>Web design is a well-established skill; hire a web-design agency and ask them to design the site for you. Focus on:</p>
<ol>
<li>what do people look for on your site?
<li>how will they find each of those things?
<li>how much effort does it take them to do so?
<li>what&#8217;s confusing/misleading (and can you remove/fix that)?
<li>how long is each user-journey, and how short can you make it?
<li>what isn&#8217;t useful (and can be removed)?
<li>&#8230;etc etc etc etc. If your Asset Store has a few hundred entries, you can get away without this (temporarily). But when you have hundreds of thousands of products on sale, it&#8217;s inexcusable
</ol>
<p>Or just copy this well-researched, well-made example that every consumer already knows how to use:</p>
<p><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-06-09-at-10.50.22.png" alt="Screen Shot 2015-06-09 at 10.50.22" width="737" height="342" class="aligncenter size-full wp-image-3639" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2015-06-09-at-10.50.22.png 737w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-06-09-at-10.50.22-150x70.png 150w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-06-09-at-10.50.22-300x139.png 300w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-06-09-at-10.50.22-624x290.png 624w" sizes="(max-width: 737px) 100vw, 737px" /></p>
<p>It&#8217;s also fugly. That immediately lowers people&#8217;s ambitions, gives them a negative impression of everything they MIGHT have bought, and reduces overall sales volume.</p>
<ol>
<li>Build wireframes for new site.
<li> Your fonts are wrong, your images are wrong, your clickable areas are wrong.
<li>These should be decided by wireframe, not by &#8220;what&#8217;s easy to implement in the Unity 2.x UI&#8221;
</ol>
<p>(tongue-in-cheek; I have no idea why the fonts on the asset-store page are so poor (wrong size, poor legibility, poor kerning, etc) and the layout so weak).</p>
<p>But whatever the reason, wireframing for screen-size/share would be a quick route to fixing.</p>
<h2>It&#8217;s almost impossible to find things you need on the Asset Store</h2>
<p>COMPLETELY replace the discovery system.</p>
<p>At the very least, delete the search box and replace it with &#8220;search this site using Google&#8221;,<br />
because that is MORE EFFECTIVE than the current system.</p>
<p>But really: search (and filtering) should only be used when Discovery is failing; there are many Discovery systems you could put in place.</p>
<p>The only bit that sort-of, maybe works for purchasers right now is the filtering/sorting. But even that hasn&#8217;t been thought-through: it lacks the basic essentials that most/all devs need.</p>
<ol>
<li>e.g. can&#8217;t filter by Unity version.
<li>e.g. categories are useless (too broad, too irrelevant; should be using a tagging system instead)
<li>e.g. can&#8217;t filter/sort by &#8220;price&#8221; and &#8220;rating&#8221; simultaneously &#8211; if you hit<br />
the &#8220;related items&#8221; link you can&#8217;t sort by anything at all !</p>
<ul>
<li>this absurd bug crops up in a couple of places on the Asset Store
<li>e.g. I saw it the other day on a Sale page: the sort-by-rating link was missing
<li>I don&#8217;t understand this. How can you make an ecommerce website without a Database and a CMS?
<li>If you have those &#8230; these features would be one-click-enabled on every page!
</ul>
<li> &#8230; etc
</ol>
<h2>Unity is an IDE. The I stands for Integrated</h2>
<p>Integrate it with the Editor. Your entire audience for purchasing BY DEFINITION spends most of their time in the Editor; but you force them to stop working each time they want to use the Asset Store. You positively break their development workflow, and reduce their output; you make it harder/slower for them to make their games.</p>
<p>The crappy popup window (that is often VERY slow to render &#8211; why? Are you too cheap-ass to pay for proper web-hosting?) which forgets your username AND your password 9 times in 10 &#8230; is not &#8220;integrated&#8221;.</p>
<ol>
<li>e.g. top-row buttons in Unity frequently vanish, requiring restart/close-open.
</ol>
<p>It&#8217;s almost as if no-one cares that the Asset Store &#8220;doesn&#8217;t work&#8221; inside the Editor. It<br />
actively drives people away from using the Asset Store!</p>
<p>Rather, you want something that&#8217;s FAST and LEAN and people are happy to keep open 24/7. Normally, you wouldn&#8217;t need that &#8211; but given your flash sales, it&#8217;s amazing you don&#8217;t have it (since it would drive sales volume very effectively). Surface the wishlisting, make it<br />
explicitly &#8220;tell me when this asset goes on sale&#8221;. Again, many many good exampels of this kind of thing elsewhere.</p>
<h2>Before I spend, I research; I like to ask questions</h2>
<p>Make it a source of DIALOGUE between devs and purchasers.</p>
<p>There is a tiny amount of this in the review/comment system, but this is a drop in the ocean compared to what could be there.</p>
<ol>
<li>e.g. it&#8217;s hugely frustrating that purchasers can&#8217;t publically question authors until<br />
AFTER you purchase.</p>
<li>e.g. Integrate it with social networks. Amazing that there&#8217;s no twitter integration.
<li>e.g. Amazing that developer-identity (who made this? Can I trust them? What&#8217;s their StackOverflow score? etc) is so hidden, relegated, hard to find.
<li>e.g. 5-star ratings which 99% of the time are &#8220;we have too few ratings to give you an average, SO WE&#8217;RE GONNA SAY NOTHING&#8221; are passive-aggressive insulting to your purchasers &#8211; &#8220;we know whether this is positive or negative rated BUT YOU DON&#8217;T! HAAHAHAHAHAH!&#8221;
<li>e.g. why can&#8217;t we see the percent of refunds / complaints on this product?
<li>e.g. why can&#8217;t we see which versions of Unity this is being successfully used with? (c.f. WordPress&#8217;s own VERY SIMPLE and yet better-than-Unity plugin-store which shows at a glance which versions are confirmed (by users! It would cost Unity nothing to collect this!) to work with the Asset
<li>&#8230;etc
</ol>
<h2>It&#8217;s my money, Unity, not yours</h2>
<p>If you won&#8217;t give developers marketing support (and you don&#8217;t), and you&#8217;re saying devs are <em>entirely responsible</em> for marketing and promoting their own products &#8230; you don&#8217;t get to deny them the choice of who they give it to.</p>
<p>If developers want to give away 1,000 free versions of their software &#8230; why are you restricting them to 12 / year?</p>
<p>Every dev I know who has assets on the asset store gives loads of copies away by email &#8211; no DRM, nothing. Simply trust. None of them want to. But Unity won&#8217;t allow them to do it on the Asset Store!</p>
<p>This REDUCES footfall via the Asset Store, and ENCOURAGES off-store sales. That seems, from the outside, to be the opposite of what you want to be doing.</p>
<h2>PS: thoughts</h2>
<p>Let me be clear: this <strong>is a lot less than a complete list of improvements I&#8217;d make</strong>. These were merely the off-the-top-of-my-head-obvious things I was thinking about at the time.</p>
<p>When I emailed Unity, I offered (explicitly) to talk to them about others &#8211; even offered to meet in person (I live less than 5 minutes walk from one of their major offices!).</p>
<p>I got silence. Which reinforces my very first point, from January 2015:</p>
<blockquote class="twitter-tweet" lang="en">
<p lang="en" dir="ltr"><a href="https://twitter.com/t_machine_org">@t_machine_org</a> ..I suspect self-fufilling prophecy: they&#39;re not getting rich from it, so management refuses budget to fix it. Vicious circle</p>
<p>&mdash; Adam Martin (@t_machine_org) <a href="https://twitter.com/t_machine_org/status/551426840372719616">January 3, 2015</a></p></blockquote>
<p><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script></p>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2015/06/09/6-ways-to-massively-improve-the-unity3d-assetstore-for-gamedevs/feed/</wfw:commentRss>
			<slash:comments>10</slash:comments>
		
		
			</item>
		<item>
		<title>Journalling for #entitySystems: #unity3d corrupted my scene; I&#8217;ve built a debugger for Unity!</title>
		<link>https://new.t-machine.org/index.php/2015/06/07/journalling-for-entitysystems-unity3d-corrupted-my-scene-ive-built-a-debugger-for-unity/</link>
					<comments>https://new.t-machine.org/index.php/2015/06/07/journalling-for-entitysystems-unity3d-corrupted-my-scene-ive-built-a-debugger-for-unity/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Sun, 07 Jun 2015 21:08:32 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3628</guid>

					<description><![CDATA[Experimenting with shorter Entity Systems articles This post is an experiment: rather than write massive, heavily-edited articles, I&#8217;m writing &#8220;shallow&#8221; versions first, which takes me only an hour or so. Then I&#8217;m saving the in-depth, detailed versions of each topic for future subscribers to my own Unity3D Entity System. This way I can cover a [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2>Experimenting with shorter Entity Systems articles</h2>
<p>This post is an experiment: rather than write massive, heavily-edited articles, I&#8217;m writing &#8220;shallow&#8221; versions first, which takes me only an hour or so. Then I&#8217;m saving the in-depth, detailed versions of each topic for future subscribers to my own Unity3D Entity System. This way I can cover a lot more topics in the same amount of time, and I suspect most people will get all they need without the deep dives I used to do.</p>
<p>Let me know what you think &#8211; <a href="http://twitter.com/t_machine_org">@t_machine_org</a></p>
<h2>The Unity bug that deleted my game prototype</h2>
<p>A few days ago, I fired up my Unity3d test project for the new Entity System. All the data was serialized into Unity&#8217;s scene, everything was fine. I was expecting to see all my &#8220;registered&#8221; components (that are saved directly into the scene) exactly as they were last time:</p>
<p><a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-05-26-at-11.23.54.png"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-05-26-at-11.23.54.png" alt="Screen Shot 2015-05-26 at 11.23.54" width="234" height="325" class="aligncenter size-full wp-image-3629" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2015-05-26-at-11.23.54.png 234w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-05-26-at-11.23.54-108x150.png 108w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-05-26-at-11.23.54-216x300.png 216w" sizes="(max-width: 234px) 100vw, 234px" /></a></p>
<p>Instead &#8230; I got this. Why, Unity &#8211; WHY?</p>
<p><a href="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-06-07-at-21.29.31.png"><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-06-07-at-21.29.31.png" alt="Screen Shot 2015-06-07 at 21.29.31" width="255" height="226" class="aligncenter size-full wp-image-3630" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2015-06-07-at-21.29.31.png 255w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-06-07-at-21.29.31-150x133.png 150w" sizes="(max-width: 255px) 100vw, 255px" /></a></p>
<p>On further inspection, Unity&#8217;s serialization system had stabbed me in the back: it combined data from two different situations (which is blatantly wrong and should be impossible &#8211; although since Unity has failed to document it &#8230; who knows what contracts it promises to uphold internally?). I&#8217;d like to know why&#8230;but the Unity Editor won&#8217;t tell me (they don&#8217;t let us see this data).</p>
<p>But I don&#8217;t really know what happened. Even with extensive logging, Unity lacks a solid debugger &#8211; and <strong>most of Unity&#8217;s code here runs BEFORE your debugger starts or AFTER your debugger stops</strong>. Any Unity bugs here are happening inside the invisible, opaque, known-to-be-buggy, Unity startup/shutdown routines. ARGH!</p>
<h2>Software &#8230; has BUGS! OMGWTFBBQ!</h2>
<p>Unity has bugs. Lots of bugs. So does all software. So what?!</p>
<p>Some (many?) of Unity&#8217;s many bugs sit in mission-critical parts of the engine. Rumour suggests that&#8217;s not because the devs are unaware of them &#8211; quite the opposite! &#8211; but because they&#8217;re too hard to fix. Any mistake in the fix, and it might cause more harm than the original bug (because these systems are so core).</p>
<blockquote><p>
This in itself suggests Unity&#8217;s internal dev teams maybe lacked a culture of TDD in the early days. My impression was that they do significant TDD now (yes? no?) but if it only arrived recently, then much of their code might be weakly tested or even untestable. i.e.: I try not to be too hard on them here, even when I&#8217;m suffering and there&#8217;s no help to be had.
</p></blockquote>
<p>In particular with Serialization: Unity doesn&#8217;t allow anyone to see what the bugs are. The Serialization system (along with some other super-critical-data-corrupting-bastard-evil-features of Unity &#8211; like the Undo system) has no API to let people outside of Unity corp see WTF it&#8217;s doing.</p>
<p>And we know it has bugs. But we can only guess at them, and how to workaround them. Unless you have a million dollars spare and can afford to purchase source-code access&#8230;?</p>
<blockquote><p>
Incidentally, this is why it is <strong>standard</strong> in the games industry to <strong>demand</strong> source-code access to your game-engine. This is non-negotiable. It has always been a black mark against Unity in professional / experienced gamedev teams that they are so secretive about their source code. It would be fine if they had a high-quality, Automatically Tested, well-documented accurate API, etc &#8211; but they don&#8217;t.
</p></blockquote>
<h2>I have an idea &#8230; a new feature for my Entity System</h2>
<p>At this point, I&#8217;ve already accidentally built quite a lot of the pieces of a debugger for fixing Unity itself. I&#8217;m recording the exact data, I&#8217;m storing it in memory in raw bytes (which sidesteps all the bugs in Unity&#8217;s undocumented serialization layers), and I&#8217;m displaying live data-visualizations in human-readable pretty colours, etc.</p>
<p>Enter: the Entity Systems Journal.</p>
<h3>What&#8217;s a Journal?</h3>
<p>If you don&#8217;t know, and you care about programming that involves data or storage, read this:<br />
<a href="http://en.wikipedia.org/wiki/Journaling_file_system">http://en.wikipedia.org/wiki/Journaling_file_system</a>.</p>
<blockquote><p>
In the event of a system crash or power failure, such file systems can be brought back online quicker with <strong>lower likelihood of becoming corrupted</strong>.
</p></blockquote>
<h3>What&#8217;s an Entity System Journal?</h3>
<p>As many people have noticed, while experimenting with Entity Systems for their games, an ES is very easy to integrate with Event-driven programming.</p>
<p>You&#8217;re changing raw data which has no side-effects; that makes it very easy to write generic code that automatically converts every &#8220;change&#8221; into an &#8220;Event object&#8221; that the rest of your app / game can <em>programmatically</em> inspect.</p>
<p>With an ES, we&#8217;re going to use a Journal to record exactly what happened to your entire game-state, at all times, and in all places.</p>
<h3>Journals in AAA Gamedev</h3>
<p>To be clear: in an abstract sense this is nothing new, games have been doing &#8220;journalling&#8221; (But not calling it that!) since the 1990&#8217;s, when it was discovered to be a very effective way of making multiplayer / internet games run reliably while sending minimal data over slow network connections. Read about the early RTS implementations (Anything from Patt Wyatt&#8217;s blog, or the old Ensemble Studios gamasutra piece about 10,000 archers IIRC).</p>
<p>What makes this a little different is that we&#8217;re going to be a lot more &#8230; explicit &#8230; about it. Our Entity Journal will come with its own cross-platform API that&#8217;s easy to write tools for.</p>
<h2>Considerations</h2>
<p>a.k.a. &#8220;lessons learned in software design and architecture over many years and from standing on the shoulders of giants&#8221;</p>
<ol>
<li>The API itself might be best expressed using one of the API&#8217;s we&#8217;re already using to access and/or manage data elsewhere
<ul>
<li><em>aka: the &#8220;don&#8217;t screw-up like XML version 1 screwed up&#8221; rule; XML (a data langage) invented a second language to describe its data. Until they woke up one day and said WAIT A MINUTE &#8230; WE ALREADY HAVE A DATA LANGUAGE!</em>
</ul>
<li>Whatever first-class objects exist in the API need to be few, simple, and generic
<ul>
<li><em>Journals are a bit like Entity Systems: the simpler the API, the more robust and easier to optimize performance &#8211; and re-use with all the world&#8217;s generic data</em>
</ul>
<li>The Journal is a lot like Quake3&#8217;s networking compression; however we build it, it OUGHT to be compatible with that when finished
<ul>
<li><em>i.e. once this is implemented, it ought to be re-usable &#8220;in server mode&#8221; with almost no code changes to provide a multi-host non-uniform distributed event log and playback system. &#8220;ought to&#8221;.</em></ul>
<li>From a tools perspective, we want to click on any Journal event and see <em>the exact state of the entire Game at that point in time</em>
<ul>
<li><em>Game Debugging &#8230; on steroids. BECAUSE WE CAN, THAT&#8217;S WHY</em></ul>
<li>&#8230;which&#8217;ll destroy C#&#8217;s crappy Garbage Collector.
<ul>
<li><em>So we&#8217;d better be aggressive about using weak references and/or converting &#8220;old&#8221; data into &#8220;summary&#8221; data, and dumping the data itself</em>
</ul>
<li>Just like an FS Journal, the ES Journal should allow us to reconstruct our entire game data at any point in time, so that <em>we never, ever lose data, no matter how many bugs in Unity we encounter</em>
<ul>
<li><em>Unity: your refusal to debug and TEST your own frickin&#8217; &#8220;undo&#8221; implementation? Yeah. I&#8217;m looking at YOU!</em>
<li><em>Make a stupid mistake in your game-code and accidentally delete critical stuff while in Editor? Not done a git-commit recently? NO WORRIES! GO BACK IN TIME AND RELOAD IT! YEAH!</em>
<li><em>Find a bug in the Entity System itself? (shock! Horror! But also: guaranteed to happen) &#8230; well, we&#8217;ve got you covered ;)</em>
<li>&#8230;(which leads to the next point)
</ul>
<li>This absolutely unfailingly guaranteeably &#8230; must not have any bugs in it.
<ul>
<li><em>Unit Tests FTW</em>
<li><em>This is our equivalent to Unity&#8217;s Serialization: everything will rely upon the assumption that &#8220;the Journal will take care of it&#8221;, making the Journal our weakest link / most critical code</em>
<li><em>KISS: the simpler we keep the implementation AND the API, the more confident we can be that it works at all times in all situations</em>
</ul>
</ol>
<h2>Building it</h2>
<p>Yeah, well &#8230; that&#8217;s going to be a much longer article (or three!)</p>
<h2>Want more? Want to support this ES in future?</h2>
<p>&#8230;Sign up here to be kept up-to-date on the project&#8217;s upcoming Kickstarter / Patreon / whatever-it-ends-up-beign (if you&#8217;re already signed up, it won&#8217;t add you again)</p>
<div style="background: #beb; border: thin gray solid; margin: 5px auto; text-align: center; width: 350px; ">
[smlsubform emailtxt=&#8221;&#8221; showname=&#8221; mailinglist=&#8221;ecs-kickstarter&#8221;]
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2015/06/07/journalling-for-entitysystems-unity3d-corrupted-my-scene-ive-built-a-debugger-for-unity/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>2015 talk: Progress on An Entity System for #Unity3d</title>
		<link>https://new.t-machine.org/index.php/2015/05/28/2015-talk-progress-on-an-entity-system-for-unity3d/</link>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Thu, 28 May 2015 13:43:09 +0000</pubDate>
				<category><![CDATA[dev-process]]></category>
		<category><![CDATA[devdiary]]></category>
		<category><![CDATA[entity systems]]></category>
		<category><![CDATA[games design]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Unity3D]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3625</guid>

					<description><![CDATA[Slides from my talk last night at Unity Brighton. Three parts: First: introduction / overview of Entity Systems, and why you care (as a &#8220;person who makes games&#8221;) Second: Progress so far: screenshots of the Unity Editor with explanation of the new features I&#8217;ve added Third: Challenges and solutions I&#8217;ve encountered so far Aliqua-progress-2015-BUUG-v3 WordPress, [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Slides from my talk last night at <a href="http://www.meetup.com/Brighton-Game-Collective/events/222613917/?comment_table_id=449647710&#038;comment_table_name=event_comment">Unity Brighton</a>.</p>
<p>Three parts:</p>
<ol>
<li>First: introduction / overview of Entity Systems, and why you care (as a &#8220;person who makes games&#8221;)
<li>Second: Progress so far: screenshots of the Unity Editor with explanation of the new features I&#8217;ve added
<li>Third: Challenges and solutions I&#8217;ve encountered so far
</ol>
<p><a href="http://t-machine.org/wp-content/uploads/Aliqua-progress-2015-BUUG-v3.pdf">Aliqua-progress-2015-BUUG-v3</a></p>
<p>WordPress, HTML, the web etc &#8211; don&#8217;t support &#8220;presentations&#8221; yet. No, I&#8217;m not creating a fake Slideshare account just so you can wait ages for a non-bookmarkable slide viewer to (slowly) load. Until then &#8230; we have PDF. Enjoy!</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Unity3D Entity Systems: Zero-copy data storage revisited</title>
		<link>https://new.t-machine.org/index.php/2015/05/13/unity3d-entity-systems-zero-copy-data-storage-revisited/</link>
					<comments>https://new.t-machine.org/index.php/2015/05/13/unity3d-entity-systems-zero-copy-data-storage-revisited/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Wed, 13 May 2015 18:11:53 +0000</pubDate>
				<category><![CDATA[entity systems]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Unity3D]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3616</guid>

					<description><![CDATA[Recap: previous posts on Unity3D and designing an efficient Entity Systems add-on library, using structs to store data in C#. But &#8230; C# doesn&#8217;t allow you to efficiently use structs nor objects C# objects are a little inefficient in memory usage and iteration speed (when you compare to raw underlying data). That&#8217;s fine for many [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Recap: <a href="http://t-machine.org/index.php/category/entity-systems/">previous posts on Unity3D and designing an efficient Entity Systems add-on library, using structs to store data in C#</a>.</p>
<p>But &#8230;<br />
<span id="more-3616"></span></p>
<h2>C# doesn&#8217;t allow you to efficiently use structs nor objects</h2>
<p>C# objects are a little inefficient in memory usage and iteration speed (when you compare to raw underlying data). That&#8217;s fine for many people, especially corporate programmers who never encounter performance issues. But it&#8217;s not fine for us.</p>
<p>But it&#8217;s cool; C# has structs that offer almost exactly the same behaviour as C structs: highly efficient memory and iteration.</p>
<p>But &#8230; but there are only four ways you can write code that uses (reads from, writes to) C# structs, and they all suck donkey.</p>
<h3>C# sucks 1: Forget OOP, forget methods/procedures/functions</h3>
<p>Pretend you got in a time machine and are living in 1965, before programmers started using &#8220;procedures&#8221;; write your app as ONE HUGE FILE WITH ONLY ONE METHOD. WHY AM I SHOUTING? WELL BACK THEN THEY DIDN&#8217;T HAVE LOWER CASE LETTERS ON THEIR KEYBOARDS EITHER, AND I&#8217;M BEING AUTHENTIC.</p>
<h3>C# sucks 2: go &#8216;unsafe&#8217;</h3>
<p>C# does not allow you to return a pointer-to-a-struct. This fundamentally undermines the concept of a struct. It&#8217;s particularly bad considering C# has an unhealthy obsession with copying things around in memory all the time, especially when it has no need to and is (literally) wasting CPU cycles at a very low level (significant impact on performance in large data applications &#8211; e.g. games).</p>
<p>But &#8230; well, I told a lie. C# does allow precisely that: except people at Microsoft decided normal people can&#8217;t cope with pointers as a concept (a lot of truth in that) and/or that making pointers &#8220;safe&#8221; would reduce the performance of them in extreme situations (a lot of truth there, too), and so &#8230; anything in C# that even thinks about a pointer won&#8217;t compile unless you convert your entire app into a &#8220;C# unsafe codebase&#8221;.</p>
<blockquote><p>
I normally am more than happy with C#&#8217;s &#8216;unsafe&#8217; concept; it&#8217;s a nice idea. e.g. it&#8217;s a great way for me to see at a glance whether my team mates have gone and put some potentially ruinous code in our codebase and hence I have to be as cautious as a C programmer. I&#8217;m only unhappy at the moment because C# has less than universal support for executing unsafe-compiled code at runtime.
</p></blockquote>
<p>Unity can&#8217;t/won&#8217;t build in &#8220;unsafe&#8221;-mode: the Webplayer is incapable of running code compiled in this mode, so Unity (rightly so) disables it globally. You can re-enable it, but your game will crash on start on some platforms.</p>
<p>Other languages (*ahem*Java*ahem*) allow for both &#8220;competely unsafe&#8221; pointers and &#8220;protected against damaging Java, but up to you to protect your own code from itself&#8221; pointers in parallel. It would be nice if C# did too. There&#8217;s a lot of places where C# takes this &#8220;Well! if THAT&#8217;S what you want, you can HAVE IT! THERE! DO YOU LIKE THAT?? DO YOU!??&#8221; all-or-nothing binary option for the programmer. It would be nice if it recognized that real-world programming is a much more nuanced process.</p>
<h3>C# sucks 3: destroy OOP: pass internal data structures back to callers</h3>
<p>One of the tenets of OOP, one of its greatest benefits, is data-hiding: classes can (and nearly always do) take any internal state and mechanics that are NOT part of their contract with the outside world, and prevent the outside world from seeing them. Code is easier to write (classes have fewer things for you to read and think about when trying to use them), and maintenance and debugging is MUCH easier (there&#8217;s less to worry about; many little silos that can be independently tested and debugged).</p>
<p>Well, a workaround to C#&#8217;s little problem with structs is this:</p>
<ol>
<li>When you want to read &#8220;struct for entity #1234&#8221;, you call &#8220;.GetStruct( 1234 )&#8221;
<li>The callee does NOT return you that struct (C# won&#8217;t let it do this via pointer, unless you go unsafe)
<li>Instead, it returns you the ENTIRE ARRAY that the struct lives in
<li>&#8230;and the integer index into that array where your struct lives
<li>&#8230;because C# DOES ALLOW you to return pointers-to-arrays that contain structs (just not directly to structs themselves. Ironic, that)
<li>Caller now has to be intelligent enough to:
<ol>
<li>Combine array + index to find what it wanted in the first place
<li>VERY EXPLICITLY IGNORE everything else in that array; one slip of the index, and all hell will break loose
</ol>
</ol>
<p>Congratulations! You just hard-coded every piece of game-logic in your app to the specific set of arrays that you use to store the back-end data.</p>
<p>What&#8217;s that, Little Johnny? &#8230; You came up with a new data structure that&#8217;s 10x as efficient, and want to replace it? &#8230; Uh &#8230; forget it. You&#8217;d have to rewrite 90% of your codebase.</p>
<h3>C# sucks 4: There&#8217;s a delegate, that delegates delegation. Delegatedly</h3>
<p>All the above suck. There&#8217;s one more way out, one that doesn&#8217;t involve dropping good OOP principles (not exclusive to OOP &#8211; so good that they&#8217;re used all over the place, pre-date OOP by a decade or more). But &#8230; it&#8217;s tortuous. It&#8217;s so complex to use you&#8217;ll want to shoot yourself rather than write any more game code. Which removes one of the main benefits of Entity Systems in the first place (you get to keep &#8220;performance&#8221; but you lose &#8220;easy writing of new code / changing old code&#8221;).</p>
<blockquote><p>
C# won&#8217;t let you &#8220;return&#8221; a pointer to a struct &#8211; but it will let you &#8220;pass&#8221; a pointer to a struct as a parameter to a method. WTF? What the ACTUAL ****? Yep! No messing; it really does do this.
</p></blockquote>
<p>So&#8230;</p>
<ol>
<li>Callee defines a C# delegate (google them if you haven&#8217;t used them; it&#8217;s a fancy/clean way of allowing pointer-to-function)
<li>Caller says &#8220;Get( Component blah, EntityID blahblah, delegate DoThisToTheThingI&#8217;mGetting() )&#8221;
<li>Callee gets the component, as expected, and then manually runs &#8220;DoThisToTheThing&#8230;()&#8221; on the object
<li>Callee hopes nothing goes wrong, because it&#8217;s going to be a PITA to inform Caller of that fact in a sensible and efficient manner
<li>Caller gets messy
<li>Debugging makes you weep
<li>Junior Programmers on your team look at what you&#8217;ve done and cry
<ul>
<li>WHY? WHY ARE YOU DOING THIS TO ME? I WAS AN INNOCENT!
</ul>
</ol>
<h3>Plz Fix C# nowz, KTHNXBYE</h3>
<p>There&#8217;s a simple solution, and <a href="https://github.com/dotnet/roslyn/issues/118">it&#8217;s proposed for the next official version of C#</a>:</p>
<blockquote><p>
Make C# allow you to &#8220;return ref (struct)&#8221;
</p></blockquote>
<p>There&#8217;s plenty of people who hate the idea on principle (the principle being, apparently &#8220;I have no idea what this is for, but I don&#8217;t like structs, they&#8217;re something to do with C? I think? And I never use them &#8211; so you shouldn&#8217;t either!&#8221;. Yeah. Me, bitter? Noooooo&#8230;), so support for this going in isn&#8217;t universal.</p>
<p>I don&#8217;t blame those people: they&#8217;re happy living in their professional environment where they never have to marry high-performance code with mass-market deployment. But that doesn&#8217;t mean we should accept their stance. I encourage you to reach out to them and help them see the value of this minor tweak to the language, and do what you can to get it approved and added.</p>
<p>NB: I say &#8220;minor tweak&#8221; quite carefully; Eric Lippert (formerly of the C# language design team, IIRC?) has publically stated that the feature already exists in the runtime, but C# compiler is not allowed to use it, and that he&#8217;s personally tested and proved that it works fine to enable this in C# &#8211; the runtime works without needing changes. Technically (I&#8217;m no expert here, but it seems legit) it appears to be legal to go and hack your C# compiler to support the feature, compile some code, and then use it at runtime alongside &#8220;ordinary&#8221; C# code.</p>
<p>So, yeah &#8211; we should support this.</p>
<p>Also, future teachers will thank us for making the language just that little bit more consistent with itself (you can ref into a method, you should be able to ref out).</p>
<h2>Moving on: let&#8217;s start copying memory!</h2>
<p>Now that I&#8217;ve ranted and obsessed and spent more time than anyone should worrying about avoiding copying memory &#8230; I&#8217;m going to advocate copying memory!</p>
<p>Muahahahaha!</p>
<p>There&#8217;s an enormous difference though between what C# imposed and what we actually want to do deliberately: we&#8217;re only interested in batch copying. i.e.:</p>
<ol>
<li>Copies are created infrequently (at most: once per frame. Ideally: only a few times per second)
<li>We copy large blocks at once, not individual items
<li>There are genuine benefits to having a copy rather than the original (i.e. this will NOT be appropriate for all algorithms; but it is for most that we care about)
</ol>
<h3>A unity example: The Unity Editor OnGUI Refresh is 100 times per second</h3>
<p>That&#8217;s a long subtitle; many many MANY Unity developers are blithely unaware of this fact. It&#8217;s right there in the Unity docs! (it didn&#8217;t used to be, but is now, so you no longer have any excuse). Unity&#8217;s Editor refreshes the screen at 100 FPS. Thats a heck of a lot of pointless wasted work if nothing&#8217;s changing &#8211; and even if it is, there&#8217;s very very little in an Editor GUI that needs updating so fast.</p>
<p>(There&#8217;s very little that needs updating more than once per second; even the smoothest of editor features will usually be fine at 10-30 FPS)</p>
<p>Editor GUI is often doing much harder work than the final game &#8211; it has to work with not-yet-optimized code and dynamically changing data that will be fixed, static, and made much more efficient by compiler/build process before it goes into the game. So &#8230; we&#8217;d really like to keep it nippy.</p>
<p>What we don&#8217;t want to do is this:</p>
<ul>
<li>100 times / second:
<ol>
<li>Fetch all entities
<li>Fetch their &#8220;name&#8221; component
<li>Construct strings for all of them to display
<li>Redraw window segments and background colours for each item
</ol>
</ul>
<p>Now, all Unity devs should (these days) be well-educated in being conservative about OnGUI implementations &#8211; don&#8217;t recreate stuff that isn&#8217;t changing frame to frame (e.g. background texture references). But how do you avoid re-doing it when the set of data you&#8217;re rendering could change at any moment?</p>
<p>Enter &#8230; the COPIED list of entities (not pointer-to-&#8230;).</p>
<h3>What would you actually want?</h3>
<p>Something like this:</p>
<ol>
<li>OnGUI:
<ol>
<li>For each: cached entity-name / entity ID pair:
<ol>
<li>Draw the name + entity ID to screen
<li>Allow mouse to click on any row
<li>Clicked row triggers an Editor event &#8220;Entity with ID = BLAH was selected&#8221;
</ol>
<li>Refresh():
<ol>
<li>Whenver called, this re-populates the cache of &#8220;entity name + entity ID&#8221;
</ol>
<li>Only two arrays are stored at class level:
<ol>
<li>int[] entityIDs
<li>EntityName[] entityNames
</ol>
</ol>
</ol>
<p>&#8230;although clicking a specific row will trigger the Entity Inspector window to load up the complete data on that entity, the main GUI doesn&#8217;t need that info.</p>
<p>i.e. the amount of data being duplicated in RAM is going to be tiny, <em>even on a huge game with a vast number of entities</em>.</p>
<p>If we get to &#8211; say &#8211; 100,000 live entities then the RAM numbers will no longer be &#8220;tiny&#8221;. For most platforms, they&#8217;ll still be small enough that we probably don&#8217;t care in this particular case &#8211; but more likely at that point we&#8217;d be using filters to reduce the number accessed at once.</p>
<p>e.g. in the GUI we&#8217;d only display &#8220;1000 most-recently changed&#8221; or &#8220;1000 entities at a time&#8221; &#8211; no GUI will meangingfully display 100,000 rows on screen at once anyway.</p>
<h2>Copying in C#</h2>
<p>This, at least, is easy. C# today (2015) is extremely efficient at direct array-to-array copy (as you&#8217;d hope!).</p>
<p>So fast that even if you try to get &#8220;clever&#8221; and go re-implement array-copying in &#8220;unsafe&#8221; mode, using raw pointers &#8230; you won&#8217;t make it much/any faster. You might even slow it down.</p>
<h3>Allocation, Shmallocation</h3>
<p>Naively, we&#8217;d do each copy by allocating a new array of appropiate size and copying into it.</p>
<p>&#8220;But allocations are slow!&#8221;</p>
<p>Yeah, yeah &#8211; not when you&#8217;re doing 1 of them per frame they&#8217;re not. They&#8217;re only slow when you&#8217;re re-allocating once for every entity in the game. We&#8217;re allocating once, in total. So we don&#8217;t care.</p>
<p>But potentially you might care, in which case you&#8217;d want to make the &#8220;copied array&#8221; store into an array of memory shared between the caller (game logic) and the callee (the entity/component store). That&#8217;s fine. Standard practice: optionally the caller passes-in a pre-allocated array, and takes responsibility for ensuring it&#8217;s &#8220;big enough&#8221; for the data that will go into it (and for not trying to read/write to it on another thread until after the callee has finished copying into it!).</p>
<h3>Any colour you want, so long as it&#8217;s black</h3>
<p>When do you want the copy, and when do you want the zero-allocation original?</p>
<p>Who gets to decide?</p>
<p>In the long-run, I want it to be non-optional: everyone gets a copy. But that will require some re-architecting of my thinking on standard algorithms I&#8217;m used to using (and re-thinking some libraries I already re-use). So, in the short term, I&#8217;m going for &#8220;caller gets to decide&#8221;.</p>
<p>[csharp]<br />
public enum EntityListType<br />
{<br />
REFERENCE, CLONE<br />
}</p>
<p>/** Returns a C# structure you can &quot;foreach()&quot; over.<br />
 Defaults to a zero-copy reference, but optionally will<br />
 clone it for you.</p>
<p>The foreach() structure can be re-iterated over multiple<br />
times (as expected by C# spec). The cloned one can be<br />
iterated as many times as you want &#8211; it&#8217;s your private<br />
copy. The (default) referenced one you do need to be<br />
careful about multi-threading, since other callers<br />
may be reading/writing to the same areas of memory.<br />
*/<br />
public ArrayEnumerable&lt;T&gt; all&lt;T&gt;( EntityListType listType = EntityListType.REFERENCE );<br />
[/csharp]</p>
<h2>TL;DR</h2>
<p>C# needs &#8220;return ref&#8221; added to the language; .NET already supports it explicitly; rant rant structs pointers unsafe-mode rant; sometimes, copying is a good idea.</p>
<p><a href="http://t-machine.org/index.php/2015/12/12/support-me-on-patreon-for-early-access-to-new-entity-systems-articles/">Support me on Patreon, writing about Entity Systems and sharing tech demos and code examples</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2015/05/13/unity3d-entity-systems-zero-copy-data-storage-revisited/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Self deception of the Startup Founder: Paralysed decisions</title>
		<link>https://new.t-machine.org/index.php/2015/05/08/self-deception-of-the-startup-founder-paralysed-decisions/</link>
					<comments>https://new.t-machine.org/index.php/2015/05/08/self-deception-of-the-startup-founder-paralysed-decisions/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Fri, 08 May 2015 11:35:03 +0000</pubDate>
				<category><![CDATA[advocacy]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[education]]></category>
		<category><![CDATA[entrepreneurship]]></category>
		<category><![CDATA[startup advice]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3613</guid>

					<description><![CDATA[This week I&#8217;m paralysed on some of my simplest decisions while happily making complex decisions quickly, and being incisive and highly effective on others. This problem occasionally crops up in my work and personal life, and it frustrates the hell out of me; I&#8217;m going to write about it here, see if it helps me [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>This week I&#8217;m paralysed on some of my simplest decisions while happily making complex decisions quickly, and being incisive and highly effective on others. This problem occasionally crops up in my work and personal life, and it frustrates the hell out of me; I&#8217;m going to write about it here, see if it helps me find a new way forwards. Hopefully this may also help others who&#8217;ve experienced a similar problem in their own lives.</p>
<p><span id="more-3613"></span></p>
<h2>A minor epiphany</h2>
<p>I&#8217;ve always known it felt like Writer&#8217;s Block, and blamed myself for the inactivity. Other people &#8211; from my teachers and parents onwards &#8211; accused me of rampant laziness, when the opposite was usually true: I was slogging away, exhausting myself, and nothing was happening.</p>
<p>This week, in the middle of broad range of these all at once, I noticed a pattern: the things that block me are decisions where I have literally no idea what the comparative impact is of the different alternatives. I have many ideas for what might happen each way &#8211; but no experience or information to tell me how (un)likely each one is, nor how severe (or insignificant).</p>
<p>Life experience has taught me over and over again that I have a high rate of making the &#8220;wrong&#8221; decision in such cases, and causing myself great loss. My perception of the cost of being wrong seems to increase each time I have to make these kinds of decisions; it only fades when I have a long string of &#8220;normal&#8221; decisions where I have even a small amount of information to go on.</p>
<h2>Coping mechanisms</h2>
<p>One of my learned behaviours in these situations is to look for some other high-value task to work on instead. It&#8217;s a kind of running-away, but one that produces strong results (albeit in a different area), and so the net outcome is usually positive.</p>
<p>Tasks I tend to jump on are:</p>
<ol>
<li>New game-designs
<li>New technologies that don&#8217;t exist but ought to
<li>New tools that would speed up my workflow
<li>New tools that transform our work: they make the impossible become possible
<li>New products
<li>Experiments on things I&#8217;ve previously run-into and concluded: &#8220;I really don&#8217;t understand this&#8221;
</ol>
<p>Now I&#8217;ve put that down on (metaphorical) paper, something screams at me that&#8217;s missing from that list:</p>
<blockquote><p>
There&#8217;s many good things on the list, but nothing that actively increases my knowledge of the different alternatives I&#8217;m being asked to decide upon in the first place
</p></blockquote>
<p>Arguably: I&#8217;m doing the exact opposite of Eric Ries&#8217;s practical interpretation of Lean Startups: Always be testing/gaining knowledge of the thing that you understand least or fear most.</p>
<p>By definition, in a startup (where you never know more than 1% of what normal businesses know about their environment) &#8230; that is always your highest reward / lowest cost option; that knowledge is worth more than anything else you could be doing right now.</p>
<h2>Self deception of the Startup Founder</h2>
<p>Is this a problem? Often: no.</p>
<p>Especially in a startup, where there&#8217;s always 10x as many &#8220;urgent&#8221; things to do as there is time/manpower to do them &#8230; the chances are that whatever random distraction you pick to work on will be just as valuable to the business as the thing you got blocked on.</p>
<p>But this is a deception: it&#8217;s only through random luck that the net outcomes are positive. The better you understand your business, the more likely you&#8217;re already working on the most important items. In which case, the things you choose to work on instead of being blocked &#8230; are lower value than the ones you&#8217;re avoiding.</p>
<p>Therefore, I believe this is a bad habit I need to eradicate. I&#8217;m sufficiently good at sufficiently many things that I&#8217;ve historically been able to make up for the damage this causes. If I could get rid of it, I would achieve much closer to my true potential. That&#8217;s a big win.</p>
<h2>Cures for analysis paralysis</h2>
<p>From Wikipedia&#8217;s article on Analysis Paralysis:</p>
<blockquote><p>
a choice is never made, rather than try something and change if a major problem arises
</p></blockquote>
<p>&#8230;and this is probably why I&#8217;ve always found zero value in the concept. Every one of my paralysed decisions are ones where <em>there is no possibility of changing if any problem arises</em>.</p>
<p>They are always decisions of finality.</p>
<p>Often, it&#8217;s because other people / other organizations are so incapable of changing once a decision has been made. Looking back, I&#8217;m very good at blasting through this kind of paralysis wherever I have a powerful position over the other actors I&#8217;m working with.</p>
<p>For instance, where the decision will affect a small sub-contractor who&#8217;s beholden to the large organization where I&#8217;m working &#8230; and I know that if I twist their arm, they&#8217;ll renege on any strategy we caused them to start upon. I know that if things go wrong, whether or not they want to change, I can make them do so (for their own good, and ours).</p>
<h3>Digging deeper into Analysis Paralysis</h3>
<p>AP situations are characterized by large amounts of research, planning, etc. 10 years ago, I used to do that; it was mostly <em>because I was taught to do so, by Employers, Teachers, and Society</em>. It was a bad lesson that is still widely taught today.</p>
<p>I escaped that trap many years ago. In my early 20&#8217;s I discovered that much of the received wisdom in how to run companies and products was &#8211; frankly &#8211; complete bullshit. Mostly it was wild extrapolation by people who&#8217;d benefited from others&#8217; innovation, but never had to take the risks or do the work themelves. After that, Scrum was a huge help to me: it said &#8220;look, you were right: there are completely different ways of working and structuring work with other people. Here&#8217;s one of them &#8211; and it looks like nothing you&#8217;ve been taught, but a lot like the things you&#8217;ve been discovering by accident <strong>actually work</strong>&#8220;.</p>
<p>So &#8230; screw Analysis Paralysis. And scorn any individual who levels that accusation at you. They mean well, but they are peddling a neat-sounding phrase they don&#8217;t understand, applied to a situation they don&#8217;t know.</p>
<h2>Seeking other ways forwards</h2>
<p>Thinking back to my introduction to Scrum 10 years ago, I see a lot that might be applicable here. Nothing about Scrum itself, but instead the abstraction &#8220;discover new process that re-inforces and celebrates things that I know work, but was taught to avoid; proceed to embrace those things&#8221;.</p>
<p>Uninformed high-stake decisions are scary. I&#8217;m highly educated with an extremely creative background coupled with an extremely strong grasp of Mathematics and logic. Given any situation, even convoluted and intricate ones, I can rapidly and relatively easily extrapolate forwards and predict multiple outcomes, all in m head, with a high degree of accuracy.</p>
<p>TL;DR: I have a high success rate of predicting the unpredictable. As a result, when I have to make a difficult decision, I very nearly always pick a &#8220;winning&#8221; route. I estimate I pick a better than average (&#8220;good or great&#8221;) route approximately 90% of the time.</p>
<p>I also have an insanely high rate of predicting low-probability events. If something is only 1% likely to happen, and I declare it&#8217;ll happen, I&#8217;m right perhaps 50% of the time or more. If I&#8217;m unsure, and say I think it&#8217;s a high possibility, I&#8217;m right about 20% of the time. This is not luck: it&#8217;s intuition and prediction.</p>
<p>Let&#8217;s compare them:</p>
<blockquote><p>
Paralysed decision: Random unpredictable (50/50) outcome, no possibility of adapting after the decision
</p></blockquote>
<p>vs.</p>
<blockquote><p>
Standard &#8220;Difficult&#8221; decision: Highly predictable (90/10) outcome, and/or many opportunities to adapt to poor/unlucky decision
</p></blockquote>
<p>Oh. Right. Now I see why I get stuck. Why I&#8217;m paralysed. It&#8217;s nothing to do with over-analysing (as others sometimes believe). It&#8217;s simple risk/reward. I&#8217;m like a 20/20 vision knife-thrower being asked to work blindfold in the dark with unfamiliar knives in a venue I&#8217;ve never been before. Ouch.</p>
<h2>Conclusions and practical steps</h2>
<p>Writing this has given me two concrete ideas. One is intuitive, the other is a self-suggestion from noticing that I was doing the opposite of chanelling Eric Ries.</p>
<h3>1. Blast it with repetition</h3>
<p>Shy geeks who struggle with dating are given a recurring piece of advice when too scared to approach potential dates: Do it 100x times more often than you are right now. Fail over and over and over again.</p>
<p>Fail until failure itself becomes meaningless. Until you start to seek out failure instinctively, and have to stop yourself, because it&#8217;s become so natural to you to &#8220;fail&#8221; &#8211; you&#8217;ve rewired your previous instinct that you ought to avoid failure.</p>
<p><em>In practice:</em> Pro-actively seek out these kinds of decisions. There are probably lots of them lurking in my week-to-week work and life, but not important enough to bubble to the surface. Normally I&#8217;m happy with that &#8211; they&#8217;re like sharks, and I&#8217;m subconsciously ignoring them hoping that by the time I am forced to confront them, the situation has changed and they&#8217;ve become cuddly dolphins instead. But I could seek them out aggressively, throw myself at them. Better to do that when they AREN&#8217;T (yet) critical!</p>
<h3>2. Channel Eric Ries: kill it with data</h3>
<p>Paralysed by a decision whose outcomes you don&#8217;t understand, or can&#8217;t evaluate? The answer is simple: think of an action you can take that would give you some extra information about one (or more) of the outcomes &#8211; any information, no matter how small, for any outcomes, no matter how few.</p>
<p><em>In practice:</em> With people, be bold in asking them what outcomes they see, and how they would be affected. In my experience, this will only work if done promptly and very briefly.</p>
<p><em>In practice:</em> With commitments, invent a smaller version of the commitment and try that. Try multiple smaller versions, and commit in different decisions &#8211; evaluate what happens and then return to the Big One.</p>
<p><em>In practice:</em> With organizational strategies, outsource resources to attempt one or more strategies at once on a small scale, as &#8220;tests&#8221;. Monitor what happens, do NOT use the outcomes to predict what to do (your team is not the same as the outsourced team). But use your observations of what happened to the outsourced teams to predict and evaluate what might happen to your team. Critically: this requires you have a deep exposure to the day to day challenges and outcomes faced by the outsourcer; having them go silent and deliver a Fait Accomplit is entirely useless to you here.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2015/05/08/self-deception-of-the-startup-founder-paralysed-decisions/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
		<item>
		<title>Data Structures for Entity Systems: Multi-threading and Networking</title>
		<link>https://new.t-machine.org/index.php/2015/05/02/data-structures-for-entity-systems-multi-threading-and-networking/</link>
					<comments>https://new.t-machine.org/index.php/2015/05/02/data-structures-for-entity-systems-multi-threading-and-networking/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Sat, 02 May 2015 14:23:51 +0000</pubDate>
				<category><![CDATA[entity systems]]></category>
		<category><![CDATA[Unity3D]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3600</guid>

					<description><![CDATA[(One of a series of posts about converting Unity3D into a 1st-class Entity Component System. Read others here) It&#8217;s a year and a half since I wrote about choosing Data Structures for high-performance Entity Systems in A-AAA games. I always had a followup post in mind, but never wrote it down (thanks largely to the [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>(One of a series of posts about converting Unity3D into a 1st-class Entity Component System. <a href="http://t-machine.org/index.php/category/entity-systems/">Read others here</a>)</p>
<p>It&#8217;s a year and a half since I wrote about <a href="http://t-machine.org/index.php/2014/03/08/data-structures-for-entity-systems-contiguous-memory/">choosing Data Structures for high-performance Entity Systems in A-AAA games</a>. I always had a followup post in mind, but never wrote it down (thanks largely to the demise of <a href="https://twitter.com/altdevblog">#AltDevBlog</a>). These days I&#8217;m too busy to write such big articles, but it&#8217;s long overdue &#8230; This post is a shorter version of what I had planned, but should have enough to get you going in the right directions.</p>
<p><span id="more-3600"></span></p>
<h2>Recap &#8230; what we concluded last time</h2>
<p>If you haven&#8217;t already, then you should <a href="http://t-machine.org/index.php/2014/03/08/data-structures-for-entity-systems-contiguous-memory/">read the previous post on Data Structures</a>. Diagrams and everything! But to save time, here&#8217;s a recap:</p>
<ol>
<li>A medium/large desktop game will have:
<ul>
<li>100&#8217;s of Component types
<li>10,000&#8217;s of pre-made templates for game-objects
<li>100,0000&#8217;s of entities in live game
<li>100&#8217;s of bytes storage per Component
</ul>
<li>Contiguous memory storage is the holy grail
<li>Processors usually read MULTIPLE Components at once, per-Entity
<li>It&#8217;s easy to make memory optimal for <em>any one set of Components</em>, but almost impossible for <em>all the different combinations of Components</em> that you see on your Entities
<li>We can achieve <strong>a lot</strong> by messing around with only small differences in how we fill / layout our Arrays in memory
<li>Versioning (keeping multiple copies of the same variable at once) was completely ignored, other than to say &#8220;we&#8217;ll need it, and none of these approaches help at all&#8221;
<li>Fragmentation is a recurrent nightmare
</ol>
<p>That article focussed on &#8220;core&#8221; / basic questions of memory-management for Entity Systems; this one will focus on the networking and multithreading issues issues for memory-management. These features <strong>are a huge advantage whether or not you do any networking</strong>, but it gives me a source of concrete examples for how/why/where you&#8217;d want them in-game.</p>
<h2>Data needs: going beyond a single thread</h2>
<h3>&#8230;Networking</h3>
<p>How do you implement good quality real-time multiplayer networking in a computer game? I used to be an expert on this &#8230; a decade ago. How it&#8217;s done today? I&#8217;ve no idea; I get the impression it&#8217;s much the same: the main limitations 10 years ago were &#8220;the internet isn&#8217;t perfect&#8221; and &#8220;nothing can go faster than the speed of light&#8221;. I don&#8217;t think those have changed?</p>
<p>So I&#8217;m going to point you at one seminal work if you&#8217;ve not read it: <a href="https://www.google.com/search?q=Quake3+networking+architecture">Google: Quake 3 networking architecture</a>, with <a href="http://trac.bookofhook.com/bookofhook/trac.cgi/wiki/Quake3Networking">a very short summary of key elements here</a>.</p>
<h3>Networking: takeaways (not just from Q3)</h3>
<p>I used to be a Network Programmer in a AAA studio. Off the top of my head, these are the generic requirements that most/all game-networking subsystems have of their data / memory management:</p>
<ul>
<li>Changes to game-state are stored efficiently (less RAM = fewer bytes over internet = faster responsiveness)
<li>Game-state (and changes to game-state) are easy to serialize/deserialize at low CPU time, and work for all current and future game-logic/game-classes, without ever rewriting the code
<li>Server <strong>and</strong> Client easily hold many different copies of the complete game-state at any one time
<li>All changes to game-state are tracked, no matter which code in which thread on which CPU made the actual change (so you can diff it, both client and server)
<li>The networking layer knows the &#8220;true&#8221; game-state; all other parts of game (rendering, physics, AI) are using <strong>multiple, different, deliberately incorrect</strong> copies of the game-state. This e.g. lets rendering hide <a href="https://www.google.co.uk/search?q=rubber-banding">rubber-banding</a> by faking on-screen positions of players.
<li>&#8230;TBA: probably several others I&#8217;ve forgotten&#8230;
</ul>
<h3>Threading: takeaways</h3>
<p>For threading, we want:</p>
<ul>
<li>As much data as possible is read-only. Ideally complete data-structures.
<ul>
<li>With read-only data, many CPU&#8217;s can access at once at full speed without having to write any MT code</ul>
<li>Mistakes in MT code are some of the most expensive to debug in programmer-time. You can waste literally months solving simple problems &#8211; months you couldn&#8217;t afford!
<ul>
<li>Our MT code needs to be idiot-proof.
<li>As much as possible, our MT structures and methods should be &#8220;invisible&#8221;: they happen automatically, without us ever having to &#8220;remember&#8221; special rules when writing game-logic
</ul>
<li><strong>Different subsystems can and should run at different frequencies</strong>.
<ul>
<li>Rendering at 60FPS? Cool! But your AI shouldn&#8217;t, your Physics doesn&#8217;t have to, etc
<li>You can buy a lot of performance (when you&#8217;re having trouble optimizing your frame rate) simply by running some things slower
<li>When debugging, it can be a huge advantage to slow down (or stop/pause) some systems around the key point, while others keep running. The volume of debug data you&#8217;re watching becomes smaller and more (humanly) manageable.
</ul>
<li>Unity sucks at MT code
<ul>
<li>If you ever wonder &#8220;does Unity have a weak/crappy core architecture?&#8221; look no further than this: Unity3D in 2015 <strong>still cannot run on multiple threads</strong>
<li>You can work around it; we will work around it. But it&#8217;s likely to cause recurring challenges.
</ul>
</ul>
<h2>Solution 1: Ctrl-D the Universe</h2>
<p>Long story short: one interesting possible approach is to combine all the above and re-think our arrangement of memory at a more abstract level. Instead of &#8220;storing our data in a (set of) data structures&#8221;, let&#8217;s &#8220;store multiple overlapping copies of the same data in different places in memory&#8221;.</p>
<p>Key benefits:</p>
<ol>
<li>When you spin-up a new thread/CPU core: Duplicate the current game-state, give it to that thread, &#8230; Profit! (no MT code to worry about, it can get running immediately)
<li>Networking can hold different copies of the game-state based on &#8220;time&#8221; and &#8220;ACKnowledged server/client state&#8221;
<li><strong>BONUS:</strong> you can cache frequently-used Component-lookups (e.g. &#8220;all entities with a Physics Component and a Render Component&#8221;), especially read-only ones, into tightly-packed, highly optimized data-structures
</ol>
<p>(That last one should be ringing some bells from the previous post &#8230; best of all worlds, yes?)</p>
<h3>Using it: API for the data-structures</h3>
<p>Originally, our Data Structures were really simple &#8211; just an array. The average programmer could easily remember how to use it. Then it became a set of similar arrays. Then a bit more funky array with internal state. Now &#8230; now, it&#8217;s getting complicated. To keep it idiot-proof (and let&#8217;s be honest: all programmers do something idiotic, sooner or later. Where do you think bugs come from? :))</p>
<p>Quick and dirty needs for our API:</p>
<ul>
<li>Get me a (set of) data structures that represent a new Copy of the Universe
<li>Give me a customized Copy
<ol>
<li>&#8230;give me only specific Components, from specific Entities
<li>&#8230;give me the Copy as at a specific moment in time
</ol>
<li>Merge my changed Copy of the Universe with other people&#8217;s cop(ies)
<ol>
<li>Update <strong>mine</strong> by applying changes from N specific copies with mine
<li>Update <strong>all of theirs</strong> by sending my changes out to N different other copies
</ol>
</ul>
<p>In practice, this forces into a couple of architecture-design activities. We&#8217;ll have to codify our main Data Structure for lists-of-components, we&#8217;ll have to define our filtering/search parameters &#8211; and the algorithms we&#8217;ll support for filtering. We&#8217;ll also need a representation of &#8220;which&#8221; copy of the universe is which, and some concept of a &#8220;master&#8221; copy that all others merge into / update from.</p>
<p>Thinking ahead, the easiest implementation strategy will be to break this down into &#8220;deltas&#8221;. Each Copy will be stored / defined as &#8220;how it is different from a reference/base Copy&#8221;. This makes a lot of the operations above much easier to implement, and it&#8217;s also a highly efficient way to store, debug, and act upon the complex data.</p>
<p><em>Start thinking about your favourite SCM (Git? Mercurial? SVN?), and how it&#8217;s implemented; such knowledge will come in useful</em></p>
<h3>Basic implementation 1: Events</h3>
<p>Conceptually, the easiest way to implement this is for every change to any piece of data to be stored as an Event. Your storage of data is simply storage of lists of events.</p>
<p>This is grossly inefficient. To find out &#8220;what&#8217;s the Position of object X?&#8221; your CPU has to iterate over every change that has ever happened to X&#8217;s position, and apply each change, one by one &#8230; all to find out one single value.</p>
<p>You could do it this way; let&#8217;s not even go there.</p>
<h3>Implementation 2: Copy on Write</h3>
<p>Another simple approach is for each Data Structure to wrap two internal DS&#8217;s:</p>
<ol>
<li>Base copy (All Components for all Entities)
<li>Changed subset (Only the Components that have changed, only for the Entities that have change)
</ol>
<p>This has a few benefits:</p>
<ol>
<li>Fetching &#8220;the current value of variable V on Component C&#8221; is a single lookup: directly access that Component from the Changed subset
<li>Merging this back onto the original you copied from is fairly efficient: iterate across the Changed set and clobber the original&#8217;s Components, via direct RAM copy / array-copy
<ul>
<li>It&#8217;s not hugely optimal: you&#8217;re copying probably tiny pieces of RAM at once, rather than big, contiguous sections
</ul>
<li>Assessing &#8220;how much&#8221; has changed is trivial and fast: count the size of the Changed set
<li>Memory usage is <strong>at worst twice the original, three times in total</strong>, but on average a lot less
<ul>
<li>&#8230;unless your use-case for this particular Copy is to change EVERYTHING (e.g. the Movement Processor looping over every Position Component and changing every single one of them, adding their .velocity to their .position)</ul>
<li>We can safely delete Entities and Components in one thread, and it won&#8217;t cause any dangling-pointers or memory leaks elsewhere
<ul>
<li>&#8230;but merging two Copies where one has deleted the Component and the other hasn&#8217;t &#8230; will require some careful design, and careful coding
</ul>
</ol>
<p>There&#8217;s still a notable weakness: if you want to store many Copies that differ by a small amount &#8211; e.g. a Server storing the ACKnowledged game-state for each Client &#8211; you&#8217;ll end up wasting huge amounts of RAM for the spammed &#8220;Base&#8221; copies.</p>
<h3>Other implementations&#8230;</h3>
<p>There are plenty. I leave them as an exercise for the reader ;). Feel free to suggest in the Comments below (as noted at the top, this post isn&#8217;t ideal &#8211; I don&#8217;t have time to do an exhaustive look at the topic. But this should have got you started&#8230;)</p>
<h2>Next Steps</h2>
<p>I&#8217;m off to try this out in C#, and see what challenges arise. In the meantime &#8230;</p>
<p><a href="http://t-machine.org/index.php/2015/12/12/support-me-on-patreon-for-early-access-to-new-entity-systems-articles/">Support me on Patreon, writing about Entity Systems and sharing tech demos and code examples</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2015/05/02/data-structures-for-entity-systems-multi-threading-and-networking/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Replacing Unity3d&#8217;s core architecture: Structs</title>
		<link>https://new.t-machine.org/index.php/2015/04/29/replacing-unity3ds-core-architecture-structs/</link>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Wed, 29 Apr 2015 13:37:16 +0000</pubDate>
				<category><![CDATA[entity systems]]></category>
		<category><![CDATA[Unity3D]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3587</guid>

					<description><![CDATA[(One of a series of posts about converting Unity3D into a 1st-class Entity Component System. Read others here) How to store game data: GameObject? MonoBehaviour? ScriptableObject? Those three pillars of Unity&#8217;s architecture are the curse of game implementation and performance. Architecturally, they&#8217;re great: they&#8217;re a big part of what makes Unity easy for newcomers to [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>(One of a series of posts about converting Unity3D into a 1st-class Entity Component System. <a href="http://t-machine.org/index.php/category/entity-systems/">Read others here</a>)</p>
<h2>How to store game data: GameObject? MonoBehaviour? ScriptableObject?</h2>
<p>Those three pillars of Unity&#8217;s architecture are the curse of game implementation and performance. Architecturally, they&#8217;re great: they&#8217;re a big part of what makes Unity easy for newcomers to pick up and understand within hours, instead of taking weeks.</p>
<p>On large Unity game projects, they&#8217;re hated for being slow and hard to work with when you get to hundreds of thousands (or millions, tens of millions, &#8230;) in a single scene. Unity provides zero tools and support for this situation &#8211; it just gets harder and harder to work with, and slower and slower to run.</p>
<p>In Entity Systems world, we hate them because they are inherently slow and buggy &#8211; no matter how great Unity&#8217;s coders, they&#8217;ll never make them work as well as our preferred approach (See below).</p>
<p>But &#8230; replacing them forces you to replace <strong>most of the Unity Editor</strong>!</p>
<p>Most of the features of our Entity System need new Editor GUI anyway. If we&#8217;re going to be adding big chunks to the editor, replacing GO/MB/SO is going to be much cheaper than normal. And it potentially has huge benefits that are independent of the Entity System.</p>
<p>If we&#8217;re going to replace them, what will we replace them with? Custom versions that have almost the same name and work the same way? Or something very different?</p>
<h3>What is Unity&#8217;s &#8216;GameObject&#8217; anyway?</h3>
<p>As far as I can tell, the real meaning of GameObject is:</p>
<blockquote><p>
<strong>def. GameObject:</strong> Something that exists inside a Scene, and has a Position, Rotation, and Scale. It can be &#8220;embedded&#8221; inside any other GameObject, meaning that any change to the other object&#8217;s Position, Rotation, or Scale gets merged onto this one. It&#8217;s the ONLY thing that can have Unity &#8220;Components&#8221; (MonoBehaviours) attached to it. Anything that is not a GameObject, and is not attached to a GO, gets deleted every time you load/reload/play/resume a Scene.
</p></blockquote>
<p>From a code perspective, looking at the backend systems, there&#8217;s a lot more to it. The GameObject (GO) has a slightly weird name, when you think about it. You use it so much during Unity dev that you stop noticing it. &#8220;Game &#8230; Object&#8221; &#8230; wha?</p>
<h3>Other purposes GameObject serves</h3>
<p>Here&#8217;s a few obvious ones (I&#8217;ll edit later if I think of more):</p>
<ol>
<li>Guarantees everything has the GetInstanceID() method
<ol>
<li>Needed for Unity&#8217;s Serialization system to work (because of how it&#8217;s been designed, not because serializing requires this &#8211; C# has built-ins that would have done the same job)
<li>Enables the Editor to &#8220;select&#8221; anything in any tab/window, and that thing is ALSO selected in all other tabs/windows (e.g. click in Scene, and the Inspector updates to show the components on that thing)
<li>&#8230;probably loads of other things. It&#8217;s so commonly used I hardly notice it
</ol>
<li>When doing in-Editor things, Unity can often &#8220;ignore&#8221; classes that are &#8220;not part of the game, because they don&#8217;t extend GameObject&#8221;
<ol>
<li>Reading between the lines of official docs, and simplifying vastly, this is what happens behind the scenes. Especially with Serialization, I suspect.
<li>This can be a huge pain. It&#8217;s hard to debug code when &#8220;GameObject subclasses&#8221; magically behave differently to &#8220;all other classes&#8221; with no indication of why
</ol>
<li>Since every GO has a Transform &#8230; you can do automatic, general-purpose, high-quality, Occlusion Culling
<ol>
<li>NB: for this to work perfectly, you&#8217;d also want every GameObject to have a .bounds variable. Why did Unity&#8217;s original architects leave that out? Dunno, sorry.
</ol>
</ol>
<h2>How to store game-data: the Entity Systems ideal way</h2>
<p>We know this, it&#8217;s been discussed to death: if your programming language supports it, <em>use structs</em>.</p>
<p>By definition, structs are the most memory-efficient, CPU-efficient, multi-thread-safe, typesafe way of storing data, bar none. There is no better way to do this in mainstream languages. C# and C++ both support structs; I think we have a winner!</p>
<p><em>There are probably some awesomely clever advanced Math ways of doing things better, or by using raw assembler and code optimized for each individual CPU on the market. Or, or &#8230; but: in terms of what&#8217;s &#8216;normal&#8217;, and commonly used, this is the best you&#8217;re going to get</em></p>
<p>But how will this work in practice? What about all the &#8220;other&#8221; roles of GO etc in Unity?</p>
<h3>Structs in &#8230; Identity (GetInstanceID)</h3>
<p>Simple ECS implementations often hand-around raw pointers to their Components; that gets messy with Identity.</p>
<p>But most (all?) advanced implementations have some kind of indirection &#8211; a smart pointer, or an integer &#8220;index&#8221; that the Component Storage / Manager maps internally to the actual point in memory where that lives.</p>
<p>If we turn that &#8220;advanced&#8221; feature into a requirement, we should be fine.</p>
<h3>Structs in &#8230; Serialization</h3>
<ol>
<li>Start writing your own version of the Unity Serialization system that only uses structs
<li>Finish it the same day
<li>Discover it runs 10 times faster than Unity&#8217;s built-in one
<li>&#8230;with fewer bugs
<li>PROFIT!
</ol>
<p>Structs are the easiest thing you could possibly try to serialize and deserialize. Unity coders probably wish that they could restrict us all to structs &#8211; it would make their live much easier in some ways.</p>
<h4>User-written structs: special rules?</h4>
<p>Do we need to add special &#8220;rules&#8221; to user-written structs that appear in the game?</p>
<p>Nope! It turns out that C#&#8217;s built-in Reflection system is able to inspect every struct, shows us every field/property/etc, and lets us easily read and write to them. Both private and public.</p>
<h4>CAVEAT: structs break C# .SetValue()</h4>
<p>Yeah, <a href="http://stackoverflow.com/questions/6608368/why-doesnt-reflection-set-a-property-in-a-struct">this sucks &#8211; and it&#8217;s nothing to do with Unity, it&#8217;s core C#</a>.</p>
<p>A little care is needed when we implement the Entity System internals. But it has no effect on user code / game code.</p>
<h3>Structs in &#8230; SceneView (Transforms)</h3>
<p>No! Just &#8230; NO!</p>
<p>This is one of the architectural mistakes of Unity we&#8217;re going to fix in passing: we <em>won&#8217;t</em> require everything to have a Transform.</p>
<p>However, it foreshadows a more subtle problem that we&#8217;ll eventually have to deal with:</p>
<blockquote><p>
Entity Systems are a table-based/Relational/RDBMS way to store and access data; such systems are very inefficient at storing and retrieving tree-structured data (e.g. OOP classes + objects)
</p></blockquote>
<p>The transform hierarchy in a Unity scene is a massive tree. As it turns out, it&#8217;s bigger than it needs to be (because of that law of Unity that everything must have a Transform) &#8211; but we uses trees <em>all the damn time</em> in game-development. So it&#8217;s a problem we&#8217;ll have to come back to.</p>
<h2>Bigger storage: where do the structs live?</h2>
<p>Fine; at the lowest level, the individual ECS Components, we&#8217;ll use structs.</p>
<p>But how do we store those?</p>
<p><a href="http://t-machine.org/index.php/2014/03/08/data-structures-for-entity-systems-contiguous-memory/">Choosing the right aggregate data-structures for your ECS</a> is a major topic in itself. C# gives us (almost) total control of how we&#8217;d like to do it &#8211; plenty of rope to hang ourselves with.</p>
<p>At this point: I&#8217;m not sure.</p>
<p>As a temporary solution, I&#8217;m going to focus on making the storage-system swappable, so that I can implement a crappy version quickly, and then easily swap-it-out with something much better &#8211; without having to rewrite anything else.</p>
<h2>Does it work?</h2>
<p>Yes. I tried it &#8211; I wrote a complete replacement for the Unity Inspector tab that only works on Entities-with-Components, where &#8220;Component&#8221; is any struct. Ugly, but it works:</p>
<p><img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/Screen-Shot-2015-04-29-at-14.41.23.png" alt="Screen Shot 2015-04-29 at 14.41.23" width="278" height="100" class="aligncenter size-full wp-image-3594" srcset="https://t-machine.org/wp-content/uploads/Screen-Shot-2015-04-29-at-14.41.23.png 278w, https://t-machine.org/wp-content/uploads/Screen-Shot-2015-04-29-at-14.41.23-150x53.png 150w" sizes="(max-width: 278px) 100vw, 278px" /></p>
<p>Everything there is auto-generated (including the colour; every struct gets a globally unique background colour, which I find makes it much easier when you have hundreds or thousands of Component types).</p>
<p>The only tricky bit was the problem with C# FieldInfo.SetValue(&#8230;), as mentioned above.</p>
<h2>Further Reading</h2>
<p>&#8230;some things I might want to pick up on in future posts:</p>
<ul>
<li><a href="http://stackoverflow.com/questions/9335455/mutable-struct-vs-class">Worked example of converting struct to immutable struct, and why/how to do it</a>
<li><a href="http://csharp.2000things.com/2013/03/07/795-rules-for-creating-an-immutable-class/">Guidelines for implementing immutable structs</a>
</ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Kickstarting Entity Systems in Unity3d &#8211; What to include?</title>
		<link>https://new.t-machine.org/index.php/2015/04/26/kickstarting-entity-systems-in-unity3d-what-to-include/</link>
					<comments>https://new.t-machine.org/index.php/2015/04/26/kickstarting-entity-systems-in-unity3d-what-to-include/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Sun, 26 Apr 2015 12:54:55 +0000</pubDate>
				<category><![CDATA[entity systems]]></category>
		<category><![CDATA[Unity3D]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3566</guid>

					<description><![CDATA[A first-class Entity System for Unity3D Unity is a great 3D engine and a good editor &#8211; but the programming environment is 10-15 years behind the curve. Entity Systems are a much better way of writing games, but they are surprisingly difficult to add to Unity. I&#8217;ll bring the latest in modern ES techniques to [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2>A first-class Entity System for Unity3D</h2>
<p>Unity is a great 3D engine and a good editor &#8211; but the programming environment is 10-15 years behind the curve. <em>Entity Systems are a much better way of writing games, but they are surprisingly difficult to add to Unity.</em></p>
<p>I&#8217;ll bring the latest in modern ES techniques to Unity, turning parts of it from a &#8220;weak&#8221; programming environment into &#8220;one of the best&#8221;. In game-engine terms, this will put it far ahead of the pack.</p>
<p>This blog post is testing the waters:</p>
<ol>
<li>You can give me direct feedback on the proposed contents/scope
<li>I can start to see how much interest there is in making this
</ol>
<h2>First round of feedback</h2>
<p>A lot of people read this and got the impression I was going to charge them extra for the final product, and provide a library with no tutorials. Big confusion and misunderstanding! So, I&#8217;ve reworded those bits to be clearer.</p>
<h2>Kickstarter: planning the campaign</h2>
<h3>Target Audiences (Expected)</h3>
<p>I think I have four target audiences:</p>
<ol>
<li>Newbie devs, and non-programmers (artists, designers), who find the &#8220;coding&#8221; parts of Unity overwhelmingly difficult today
<li>Unity devs who&#8217;ve never used an Entity System on a real game project, and don&#8217;t know what they&#8217;re missing. They may have a lot of experience (shipped multiple games), or none (University/College students).
<li>Small Indie teams / sole coders who&#8217;ve used Entity Systems elsewhere, and feel that coding in Unity is slow, error-prone, boring, frustrating, and time-wasting by comparison
<li>Large Indie teams whose games won&#8217;t work in Unity because Unity is so bad at scaling to large projects. They&#8217;ve already re-written or replaced substantial chunks of Unity&#8217;s core so that it&#8217;ll work fast enough / reliably enough.
</ol>
<h2>Types of Reward</h2>
<h3>Reward type 1: Discounted License</h3>
<p>Everyone who backs the KS gets a copy of the library / license to use it. By backing the KS (at any level) you&#8217;re getting a substantially cheaper purchase compared to the final launch pricing on the Asset Store.</p>
<p>There might be some options here for different team sizes, different levels of support, etc.</p>
<h3>Reward type 2: Expert Knowledge</h3>
<p>When you have non-trivial questions about ES design and usage, it&#8217;s hard to get the attention of experts. They&#8217;re usually experienced, older, programmers with young families, or working in senior jobs. They have little free time.</p>
<p>Big developers fix this by hiring experts for a few days at a time. But small teams/individuals can&#8217;t afford the &#8220;entry&#8221; cost &#8211; as a Consultant, you need to charge at least $5,000 per engagement to cover all the admin overhead and hidden costs.</p>
<p>So, we have some options here to give everyone this kind of access.</p>
<h3>Reward type 3: Source Code</h3>
<p>In mainstream IT, when you purchase a library you rarely (if ever) get the source code. If you find bugs, or missing features, the vendor works hard and fast to fix them for you.</p>
<p>In the games industry, it&#8217;s the other way around: vendors take no responsibility for the code they&#8217;ve sold you, and in return &#8230; they give you full source access. &#8220;Fix it yourself, dude!&#8221;</p>
<p>If I let everyone have source, it raises my support costs. With each change, it won&#8217;t work for some people &#8211; because they&#8217;ve modified their copy &#8211; and I&#8217;ll have to help them update it.</p>
<p>On the flip side: Source code is your &#8220;Plan B&#8221; in case I get sick, or sell-out, or lose interest in the project, etc. It also gives you an easy way to add features of your own and send them back to me (which I then take on responsibility for maintaining).</p>
<p>I&#8217;m offering this, but it&#8217;ll be a high-cost. The teams that really need it should have no problem justifying the cost.</p>
<h2>Types of Stretch Goal</h2>
<p>To clear up confusion: these are things that would be present in the core product (e.g. the GUI is going to be a major part of the library!), but stretch goals would allow me to add extras to each of them.</p>
<h3>Goal type 1: Editor GUI</h3>
<p>In my experience the biggest effect on programming speed &#8211; once you get past your innate ability + level of experience &#8211; is the quality and &#8220;friction&#8221; of your tools.</p>
<p>As soon as you go beyond the simple stuff it&#8217;s damn hard to extend the Unity editor. But I&#8217;ve been hacking the Editor for a few years now, and I&#8217;m willing to do pretty much anything. Especially if it makes it easier to make games with!</p>
<h3>Goal type 2: Example Games</h3>
<p>The core will have some form of tutorials, but it probably won&#8217;t have a complete demo game.</p>
<p>Writing a game just to demonstrate an API is extremely time-consuming, and it&#8217;s not what you&#8217;re paying for when you buy the library.</p>
<p>But &#8230; it&#8217;s also a great idea: it improves the quality of the API, by giving me a reference product to check everything is as easy-to-use as intended. So I&#8217;d like to write one (or several), but I can&#8217;t do that on the base funding.</p>
<p><em>(Aside: If I ran the technology division at Unity corp, they&#8217;d be writing and publishing games every quarter)</em></p>
<h3>Goal type 3: Tutorials</h3>
<p>There will be tutorials with the core library. They&#8217;ll cover the basics of how to use it.</p>
<p>But &#8230; I&#8217;d like to go further, and do tutorials for every aspect. I&#8217;d like to do a written tutorial for everything, and I&#8217;d like to ALSO do a video tutorial for everything (some people only use written tutorials, other people only use videos. I&#8217;d like to make it great for both groups).</p>
<p>With a new library, tutorials are extremely expensive to write. Minor changes to the API &#8211; bug fixes, refactorings, feature additions &#8211; invalidate whole pages of tutorial at one stroke.</p>
<h2>Pricing and Funding levels</h2>
<h3>Tier costs</h3>
<p>These are <strong>approximate</strong> based on extrapolations of cost and expected &#8220;version 1.0&#8221; feature-set.</p>
<ul>
<li>License: $50-$150 (after launch, general public can buy at $200-$400 in Asset Store)
<li>Source code: $300-$1000 (various amounts of support)
<li>Access to experts: $150-$750 (various levels of privacy + interaction)
</ul>
<p><em>UPDATE:</em> One person has stated they would &#8220;never pay these prices&#8221;. That&#8217;s fine &#8211; they&#8217;re way outside my target audience. I&#8217;m more likely to increase these prices than decrease them. If you know what an ECS is, and understand the value, this is probably too cheap already.</p>
<h3>Funding targets</h3>
<p>This is what it&#8217;s going to cost to build:</p>
<ol>
<li>Minimal version that&#8217;s usable in most game-dev: <em>approx. $15,000</em>
<li>My preferred v1.0: <em>approx. $75,000</em>
<li>High-quality version for large games: <em>approx. $200,000</em>
</ol>
<p>I can write-off about 50% of the cost as this is a project that I need and will use myself &#8211; and it&#8217;s a labour of love. I can also add a %age in expected additional sales that happen naturally after the campaign has ended (from the Asset Store, etc).</p>
<p>But Kickstarter takes a cut, and the government takes a cut, and Amazon takes a cut. In the end, I need a KS campaign to raise something like:</p>
<ol>
<li>Minimal funding: <em>$5,000</em>
<li>Preferred funding: <em>$30,000</em>
<li>High-quality funding: <em>$75,000</em>
</ol>
<h2>My situation</h2>
<h3>Who are you, anyway?</h3>
<p>In case you don&#8217;t know &#8230; I&#8217;ve run Technology/Development for a couple of game companies (e.g. Mindcandy, NCsoft Europe). My StackOverflow score is <a href="http://stackoverflow.com/users/153422/adam">somewhere north of 20,000</a>. I&#8217;ve contributed to a few open-source projects, but the one I&#8217;m most active on is <a href="https://github.com/SVGKit/SVGKit/">the SVG rendering library for iOS and Mac</a>, where I&#8217;m the project lead and one of the top 3 contributors.</p>
<p>I started writing about <a href="http://t-machine.org/index.php/2007/09/03/entity-systems-are-the-future-of-mmog-development-part-1/">Entity Systems back in 2007</a>, mostly because I was frustrated that so many game studios were &#8220;doing it wrong&#8221;.</p>
<h3>What I&#8217;m doing now</h3>
<p>I teach non-technical people how to program. I work with schools, teachers, and directly with children/adults. I invented a <a href="http://everyonecanprogram.com">new system of programming using physical objects and toys</a>.</p>
<p>Working with a local school, I&#8217;m making a new course where I&#8217;ll be teaching children &#8220;how to make games with Unity3D&#8221;. I&#8217;m particularly interested in what I can do to the Unity Editor to make it more user-friendly and better for use in the classroom.</p>
<p>Depending on how this goes, I have a few people in mind I&#8217;ll hire to share the burden of writing this library. It&#8217;s <strong>something I need</strong> both in my day-job and in <em>all my personal game projects</em>. Doing it as a Kickstarter gives me the excuse to spend 100x as much time and effort on it as I would otherwise, and gives me a much better library than I&#8217;d get on my own.</p>
<h2>Why Kickstarter?</h2>
<p>I suck at Marketing. The biggest risk factor to this project is that I fail to make enough noise, and hence there&#8217;s too little money coming in to pay for the ongoing development and support. As a result, dev gets sidelined while I pay the bills.</p>
<p>A Kickstarter is my way of testing &#8220;can I find a critical mass of people who need this project, and get them to put their money where their mouth is?&#8221;.</p>
<p>It&#8217;s going to be hard &#8211; I suck at marketing &#8211; but to be honest I&#8217;m leaning heavily on the idea that this is something people want badly enough they&#8217;ll help me market and promote it. With KS, there&#8217;s no risk to you for helping here &#8230; if the campaign fails, you pay nothing. If it succeeds, I get enough cash (and enough users!) to guarantee development through to a production-ready version.</p>
<h2>Are you in?</h2>
<p><a href="http://t-machine.org/index.php/2015/12/12/support-me-on-patreon-for-early-access-to-new-entity-systems-articles/">Support me on Patreon, writing about Entity Systems and sharing tech demos and code examples</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2015/04/26/kickstarting-entity-systems-in-unity3d-what-to-include/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title>ECS for Unity: design notes + next prototype</title>
		<link>https://new.t-machine.org/index.php/2015/04/25/ecs-for-unity-design-notes-next-prototype/</link>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Sat, 25 Apr 2015 20:57:12 +0000</pubDate>
				<category><![CDATA[entity systems]]></category>
		<category><![CDATA[Unity3D]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3555</guid>

					<description><![CDATA[Recently I&#8217;ve been thinking a lot about how a high-quality ECS would appear / present itself within Unity, how it would interact with standard Unity3d game-code at the API level, how it would appear in the Unity Editor, etc. This evening, I had a go at making some of that within Unity itself. NB: a [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Recently I&#8217;ve been thinking a lot about how a high-quality ECS would appear / present itself within Unity, how it would interact with standard Unity3d game-code at the API level, how it would appear in the Unity Editor, etc. This evening, I had a go at making some of that within Unity itself.</p>
<p>NB: a few weeks ago I made a small Editor Plugin that used Reflection to upgrade and fix some of the core Unity Editor code/GUI. That was practice for what I&#8217;m doing here. It&#8217;ll hopefully appear on the Asset Store at some point (pending review right now!) &#8211; it has the full source unobfuscated, so you can see for yourself both <em>what</em> and <em>how</em> I got it to do its clever bits.</p>
<p><span id="more-3555"></span></p>
<h2>References</h2>
<p>Some things to read if you haven&#8217;t already:</p>
<ul>
<li><a href="https://grovecodeblog.wordpress.com/2015/04/02/using-scriptableobject-for-data-objects-in-unity-scenes/">Sampsa&#8217;s post on the missing documentation for Unity&#8217;s ScriptableObject</a> (follow him <a href="http://twitter.com/snlehton">@snlehton</a>)
<li><a href="http://t-machine.org/index.php/2014/10/05/towards-a-unity3d-ecs-what-gui-what-features/">Mockups of GUI we might want in Unity3D for managing an Entity System</a>
<li><a href="http://t-machine.org/index.php/2014/03/08/data-structures-for-entity-systems-contiguous-memory/">High-performance, low-level memory management for Entity System implementation</a> &#8211; we won&#8217;t be doing this immediately, but it&#8217;s a precursor to some of the things I&#8217;ll end up doing here.
<li><a href="http://t-machine.org/index.php/2014/12/22/unitys-failure-as-an-entity-system-example-1-selecting-things/">A single worked-example of where Unity&#8217;s built-in architecture makes it much harder to write games than if you were using a modern Entity System</a>
<li>Lucas Meijer&#8217;s (<a href="https://twitter.com/lucasmeijer/">@lucasmeijer</a>) post on official Unity blog about<a href="http://blogs.unity3d.com/2014/06/24/serialization-in-unity/">Serialization in Unity &#8211; what is it, how it works under the hood, and how you fix it when it breaks/has missing features</a>
</ul>
<p>(that last one is particularly important; working around Unity&#8217;s broken Serialization system is a whole mega topic in its own right, and I&#8217;ll be largely assuming you already have read up on it. If you don&#8217;t know Unity Serialization yet (enough to fear it!) go read that article)</p>
<h2>Initial thoughts/plans</h2>
<p>There&#8217;s been one thought in particular nagging away at me for a while now:</p>
<blockquote><p>
If we&#8217;re going to really, truly, genuinely replace Unity&#8217;s core scripting architecture (which sucks for game development) with a modern ECS one, then we MUST create a new custom panel for the GUI Editor.
</p></blockquote>
<p>&#8230;until / unless we do that, it&#8217;s just a Programmers&#8217; Circle Jerk: it loses 90%+ of the audience of Unity developers, people who chose Unity because of the Editor. 1st-class Editor integration is more important than anything else (certainly a lot more important than &#8211; say &#8211; performance).</p>
<h2>Core Unity bugs that got in the way</h2>
<h3>Unity never repaints windows when Scene changes</h3>
<p>If the scene changes, we&#8217;ll be looking at a new Entity System (different entities, different components). You would naturally expect that Unity automatically repaints all windows when Unity changes the Scene, right?</p>
<p>Wrong.</p>
<p>(incidentally, this is why it&#8217;s also very hard to be sure that a scene has actually loaded when you double-click on it &#8211; Unity gives no indication to the user that anything changed, if the Hierarchy for the two Scenes was the same)</p>
<h4>Workaround to Unity bug</h4>
<p>The undocumented method &#8220;EditorWindow.OnDidOpenScene()&#8221; which you can override. Amusingly, in Unity 4.5 they &#8220;fixed&#8221; the &#8220;bug&#8221; that this was documented; now your only way of discovering it is by finding a Mystical Unity Guru who knows The Secrets of Unity.</p>
<h3>ScriptableObject: fundamentally broken</h3>
<p>This isn&#8217;t even funny any more&#8230;</p>
<h4>ScriptableObject System.Guid properties are wiped by Unity Serialization</h4>
<p>public class EntityID : ScriptableObject<br />
{<br />
public System.Guid GUID = System.Guid.Empty; // this will NEVER be saved by Unity<br />
}</p>
<p>&#8230; you have to manually write a serializer and deserializer for System.Guid. Because C# built-in structs weren&#8217;t considered important enough to be supported by Unity. <em>WTF!!!??!??</em></p>
<h4>ScriptableObject breaks C#: no constructors allowed, no initialization allowed</h4>
<p>We know why: it&#8217;s because Unity Serialization is crap.</p>
<p>Unity Serialization requires every class to use a zero-argument constructor and has a bizarre array of hacks to try and restore state.</p>
<p>If &#8211; for instance &#8211; you need to create a ScriptableObject and guarantee that it gets an internal globally unique ID &#8230; you can&#8217;t. C# supports it, but Unity removes that support. Joy!</p>
<h4>ScriptableObject data loss</h4>
<p>New discoveries:</p>
<ol>
<li>SerializedObjects saved into your scene are automatically deleted whenever you change Scene.
<ul>
<li>&#8230;Unity staff apparently felt that developers are too stupid to write code; an info message tells you you &#8220;leaked&#8221; memory (no, no you didn&#8217;t. Unity incorrectly DELETED your non-leaking data)
<li>&#8230;probably they&#8217;re too embarassed to admit that their failure to include Editor UI to show &#8220;SerializedObjects in current scene&#8221; was causing many projects to accidentally build up masses of invisible objects.
<li>&#8230;there was a fix for that bug. It would have taken them MINUTES to code it up (I&#8217;ve done it myself, seems to work fine?). Or &#8230; they could break Unity further. Which option did they go with?
<ul>
<li>(this was probably due to some time pressure at the time; but that&#8217;s what CTO&#8217;s and Tech Directors are for: to make sure such hacks are then fixed properly shortly afterwards, not brushed under the carpet)</ul>
</ul>
<li>If you mark a SerializedObject as &#8220;DontDestroyOnLoad&#8221; you discover that bug is even worse. It&#8217;s really, really bad:
<ol>
<li>When you try to change Scene, Unity correctly asks &#8220;do you want to save? You have unsaved changes&#8221;
<li>&#8230;and then whatever you do, Unity deletes your SAVED DATA, using the first bug above.
<li>&#8230;looks like the bug isn&#8217;t just &#8220;deleting data when it shouldn&#8217;t&#8221;, but &#8220;incorrectly implemented DELETE that overrides Unity&#8217;s built-in data and scene management&#8221;
</ol>
</ol>
<p>From Unity forums, <a href="http://forum.unity3d.com/threads/editorwindow-loses-reference-of-scriptableobject-on-play-mode.107831/">this has been around for a good 4 years</a>.</p>
<h2>Some Classes</h2>
<h2>EntityID &#8211; with workarounds for core Unity bugs</h2>
<p>Here&#8217;s the fixed EntityID class from above, with the hacks needed to make up for Unity&#8217;s &#8220;oh, let&#8217;s take C# core features, and break them&#8221; attitude.</p>
<p>You need to do this a lot if you work with Unity, sadly&#8230;</p>
<p>[csharp]<br />
 /**<br />
 NOTE: this class is really only 1 line long. Unity problems add 10 lines to it!<br />
 */<br />
public class EntityID : ScriptableObject, ISerializationCallbackReceiver<br />
{<br />
	public System.Guid GUID = System.Guid.Empty;</p>
<p>	private string _UnityWorkaroundProperty_GUID = System.Guid.Empty.ToString();<br />
	public void OnBeforeSerialize()<br />
	{<br />
	_UnityWorkaroundProperty_GUID = GUID.ToString();<br />
	}</p>
<p>	public void OnAfterDeserialize()<br />
	{<br />
		GUID = new System.Guid (_UnityWorkaroundProperty_GUID );<br />
  }<br />
}<br />
[/csharp]</p>
<h2>Conclusions</h2>
<p>I got a basic self-managing EditorWindow interacting, and duplicating the most basic behaviour of the Hierarchy window, but I wasted so much time trying to kick Unity&#8217;s awful ScriptableObject into working shape that I got no further than that. Very frustrating.</p>
<p>Here&#8217;s a video:</p>
<p><iframe loading="lazy" width="640" height="390" src="https://www.youtube.com/embed/SFCzy0u8wLc" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Intelligent &#8220;new (thing)&#8221; control for #unity3d</title>
		<link>https://new.t-machine.org/index.php/2015/04/07/intelligent-new-thing-control-for-unity3d/</link>
					<comments>https://new.t-machine.org/index.php/2015/04/07/intelligent-new-thing-control-for-unity3d/#comments</comments>
		
		<dc:creator><![CDATA[adam]]></dc:creator>
		<pubDate>Mon, 06 Apr 2015 23:09:14 +0000</pubDate>
				<category><![CDATA[Unity3D]]></category>
		<category><![CDATA[Unity3D-tips]]></category>
		<guid isPermaLink="false">http://t-machine.org/?p=3544</guid>

					<description><![CDATA[In Unity, hundreds of times a day you do &#8220;new (folder)&#8221; or &#8220;new (C# script)&#8221; etc. But Unity makes this ridiculously hard: you have to hunt and peck a tiny button and then hunt-peck a tiny item in a huge dropdown that is very easy to miss. And you can&#8217;t do any of this from [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In Unity, hundreds of times a day you do &#8220;new (folder)&#8221; or &#8220;new (C# script)&#8221; etc. But Unity makes this ridiculously hard: you have to hunt and peck a tiny button and then hunt-peck a tiny item in a huge dropdown that is very easy to miss.</p>
<p>And you can&#8217;t do any of this from the keyboard. Even though you&#8217;re fully in keyboard mode and about to write the name of the New Thing (required!) and if it&#8217;s a script: type in the source code.</p>
<p>Screw that.</p>
<h2>UPDATE: Now available in Asset Store &#8211; get the source</h2>
<p><a href="https://www.assetstore.unity3d.com/en/#!/content/35088">For a mere $2, I will Intelligent New you long time:</a></p>
<p><img decoding="async" src="https://d2ujflorbtfzji.cloudfront.net/key-image/3729907c-b11a-4296-b35a-bcb0073c948e.jpg" class="aligncenter"/></p>
<p>Source is included. If you want to see how I did it, knock yourselves out&#8230;</p>
<h2>My context-sensitive New for Unity</h2>
<p>So, what I&#8217;ve made today:</p>
<p><a href="http://t-machine.org/wp-content/uploads/intelligent-new-demo-1.mov">intelligent-new-demo-1</a><br />
<img loading="lazy" decoding="async" src="http://t-machine.org/wp-content/uploads/intelligent-new-demo-1.gif" alt="intelligent-new-demo-1" width="266" height="112" class="aligncenter size-full wp-image-3550" /></p>
<ul>
<li>Select any folder or object in the Project window
<li>Hit &#8220;shift-N&#8221; (because Unity sucks and steals Ctrl-N and refuses to let you choose a better one. Stupid stupid stupid.)
<li>A popup appears pre-filled with a sensible new file name OR folder name
<ol>
<li>If you were on a folder, it prepares to auto-create a new folder
<li>If you were on a script file, it prepares to auto-create a new script
<li>The name is pre-selected and editable, exactly as with Unity built-in
</ol>
<li>Sometimes that intelligent guess above will be wrong, so &#8230; hit Tab, and it switches type, while keeping the text selected and editable
</ul>
<p>Net result: super-fast workflow for creating new scripts and organizing your project.</p>
<p>(This required an ungodly amount of hacking and trial and error to work around bugs, bad documentation, and obvious missing core features from Unity APIs. But it works, and seems to be pretty seamless now)</p>
<h2>Implementation Notes</h2>
<p>A subset of the things I discovered / re-discovered on the journey to this one small fix / improvement:</p>
<ol>
<li>AssetDatabase.CreateAsset is basically broken: can&#8217;t create C# scripts at all. Don&#8217;t try.
<li>ScriptableWizard is unusable in Unity less than 5.0, because they made a core method private / non-overridable. Don&#8217;t bother.
<li>You can find the Project window and others by doing a reflection on the Assembly to find the magic C# Type of known Unity private classes (that SHOULD BE public!) and comparing at runtime. Hoops? Jumping through? Because an API has something private that should have always been public? Welcome to Unity customization! :)
<li>You can find the exact position of the selected row by adding yourself as a callback on Unity&#8217;s own row-by-row rendering of their built-in windows, and saving the data every frame. Sounds scary; works great (one of the few bits here that is a perfect hack with no downsides)
<li>Popups need you to create a new class, and that class MUST BE in file of its own or you will break Unity (internal bugs in Unity window management that trigger when you reload/restart Unity)
<li>&#8230;if you trigger that bug (or in any way end up with floating, non-closeable windows), go to the Layout menu and re-select the layout you&#8217;re already using. It will kill any unexpected windows. Phew!
<li>Unity still hasn&#8217;t made the Indent width (in pixels) public. The documentation insults you by saying that when you hardcode the number 20 this will break your code in future. YES, WE KNOW. SO MAKE THE DAMN NUMBER PUBLIC, YOU BASTARDS.
<li>There is a 2 pixel top and bottom padding needed to surround textfields in 1-line popups. I hardcoded this, it may have a number somewhere in the API. Good frickin&#8217; luck trying to find it. Given the taunt about indents above, I very much doubt it is public.
<li>If you have a button or non-editable textfield with a changeable title, or anything that can be changed by a keypress during rendering, <strong>it is critical that in OnGUI you read Event.current.type and switch() on it</strong>. As far as I can tell, this has never been documented except in forum threads and blog posts by Unity staff. Once you know about it, you can sort of guess it from reading the undocumented bits of the API, but it&#8217;s damn hard to find references to it online. (I found it years ago by trial and error and blind luck). Until you do this you get race conditions when changing GUI based on keypresses. Ugh.
</ul>
<h2>Compatibility</h2>
<p>Critically, this (should) work no matter how much I customized Unity elsewhere. It&#8217;s peeking into the actual window and render areas to decide what to popup and where on screen.</p>
<p>The only conflict I expect is one that &#8211; thanks to some brainfart design at Unity corp &#8211; we can&#8217;t workaround: I had to hardcode &#8220;shift N&#8221; as the keyboard shortcut :(.</p>
<h2>Want it yourself?</h2>
<p>I thought it would take me about 10-20 minutes to do. HAHAHAHAHAHAAHAH! If I&#8217;d done this as a client project, I worked out it cost almost $1500 in billable hours. Ugh.</p>
<p>I&#8217;m going to use this in production for a while. If it continues not to break or corrupt anything, I&#8217;ll put it on the Asset Store.</p>
<h2>Next up&#8230;</h2>
<p>&#8230;I&#8217;m going to do some context-sensitive New for the Hierarchy window, I think. Now that I have these hacks working, that&#8217;ll be quite a lot easier.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://new.t-machine.org/index.php/2015/04/07/intelligent-new-thing-control-for-unity3d/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		<enclosure url="http://t-machine.org/wp-content/uploads/intelligent-new-demo-1.mov" length="396862" type="video/quicktime" />

			</item>
	</channel>
</rss>
