<?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>Horse Drawn Games &#187; Remote Debug Tool</title>
	<atom:link href="http://www.horsedrawngames.com/category/remote-debug-tool/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.horsedrawngames.com</link>
	<description>Horse Drawn Games</description>
	<lastBuildDate>Sun, 10 Jun 2018 09:50:52 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>Hdg Remote Debug &#8211; Released!</title>
		<link>http://www.horsedrawngames.com/hdg-remote-debug-released/</link>
		<comments>http://www.horsedrawngames.com/hdg-remote-debug-released/#comments</comments>
		<pubDate>Fri, 13 May 2016 09:00:42 +0000</pubDate>
		<dc:creator><![CDATA[Geoff]]></dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Remote Debug Tool]]></category>

		<guid isPermaLink="false">http://www.horsedrawngames.com/?p=230</guid>
		<description><![CDATA[You can now get the Remote Debug tool on the asset store! Editing live on the device has never been easier, for fast iteration time and the ultimate in &#8220;what you see is what you get&#8221;.  For more info check out this video, the forum thread or just read some of the other entries on this...  <a class="excerpt-read-more" href="http://www.horsedrawngames.com/hdg-remote-debug-released/" title="ReadHdg Remote Debug &#8211; Released!">Read more &#187;</a>]]></description>
				<content:encoded><![CDATA[<p>You can now get the Remote Debug tool on the <a title="asset store" href="https://www.assetstore.unity3d.com/en/#!/content/61863">asset store</a>!</p>
<p>Editing live on the device has never been easier, for fast iteration time and the ultimate in &#8220;what you see is what you get&#8221;.  For more info check out this <a title="video" href="https://www.youtube.com/watch?v=3Oigkg-8rWQ">video</a>, the <a title="forum thread" href="http://forum.unity3d.com/threads/hdg-remote-debug-live-update-inspector-for-your-phone.399096/">forum thread</a> or just read some of the other entries on this blog!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.horsedrawngames.com/hdg-remote-debug-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hdg Remote Debug &#8211; How It Works</title>
		<link>http://www.horsedrawngames.com/hdg-remote-debug-more-info/</link>
		<comments>http://www.horsedrawngames.com/hdg-remote-debug-more-info/#comments</comments>
		<pubDate>Tue, 03 May 2016 01:06:49 +0000</pubDate>
		<dc:creator><![CDATA[Sam]]></dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Remote Debug Tool]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[unity3d]]></category>

		<guid isPermaLink="false">http://www.horsedrawngames.com/?p=220</guid>
		<description><![CDATA[Hdg Remote Debug works using .NET&#8217;s reflection features; it doesn&#8217;t use any sort of built-in Unity serialisation. Every second it gathers all GameObjects that are currently active, finds all Components on them, and for each component, uses reflection to find all serialised and public fields. This data is sent back to the client running in...  <a class="excerpt-read-more" href="http://www.horsedrawngames.com/hdg-remote-debug-more-info/" title="ReadHdg Remote Debug &#8211; How It Works">Read more &#187;</a>]]></description>
				<content:encoded><![CDATA[<p>Hdg Remote Debug works using .NET&#8217;s reflection features; it doesn&#8217;t use any sort of built-in Unity serialisation. Every second it gathers all <code>GameObjects</code> that are currently active, finds all <code>Components</code> on them, and for each component, uses reflection to find all serialised and public fields. This data is sent back to the client running in the editor over a network connection, where the data is displayed in custom hierarchy and inspector windows.</p>
<p>This means it doesn&#8217;t use the built-in Unity inspectors or any custom inspectors you may have created, so when you click on, say, a <code>Camera</code> object you see the public and serialised fields of the <code>Camera</code> type rather than what Unity&#8217;s built-in <code>CameraEditor</code> inspector would have shown.</p>
<p>I would like to fix this and use the built-in inspectors and I have actually prototyped it extensively but it turns out there are several problems. To use the built-in inspectors we require a proxy <code>GameObject</code> that represents the selected object on the server. The idea is that whenever we receive a message from the server, we create a new proxy <code>GameObject</code>, dynamically add all components to it, and for each component, create an <code>Editor</code> instance with <code>Editor.CreateEditor(component)</code>. When drawing the UI for the components, we just call <code>Editor.OnInspectorGUI</code> for each one and use <code>BeginChangeCheck/EndChangeCheck</code> to determine if anything changed. If fields have changed we send a message to the server to update it.</p>
<p>There are a couple of problems with this approach. The built-in inspectors cause undo events to be added to the system, but those undo events are undesirable; the <code>GameObject</code> is a temporary proxy object for which we don&#8217;t want to track undo events. In fact the object is not visible in the scene, so the undo events seem spurious to the user. It&#8217;s not a good user experience to generate all these undo events that go nowhere.</p>
<p>Another problem is that <code>EndChangeCheck</code> doesn&#8217;t detect that changes have happened when certain fields are changed. One such field that I found was the camera mask property. It seems to be something to do with the <code>EditorGUI.PropertyField</code>, which doesn&#8217;t seem to set <code>GUI.changed</code> to true.</p>
<p>The last major problem is with the proxy <code>GameObject</code>. We create a new proxy every time we receive a message from the server, but destroying the previous one seems to cause the <code>Editor</code> objects that we created to throw <code>NullReferenceExceptions</code> when you hit play or when Unity reloads assemblies, when it tries to reinitialise its <code>serializedObject</code> field. I think I need to find a way to clear the reference on the <code>Editor</code> when destroying the <code>GameObject</code>, but it wasn&#8217;t possible when I last investigated. I can&#8217;t just leave the proxy object; that&#8217;s a memory leak!</p>
<p>I have a Trello <a href="https://trello.com/b/TSDsEbrA/hdg-remote-debug-roadmap" target="_blank">roadmap board</a> with some features I&#8217;d like to add. Some are wishlist features which may not really be possible without digging into the Unity source (e.g. hotswapping prefabs, or the aforementioned built-in inspectors). One feature I would like to add is an extensible console system, where you can hook in your own commands to control the game remotely. That way you can add debug features to the game that you can then control from Unity.</p>
<p>Get in touch if you have any questions or feature requests for Hdg Remote Debug!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.horsedrawngames.com/hdg-remote-debug-more-info/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remote debug / live update of Unity builds on device</title>
		<link>http://www.horsedrawngames.com/remote-debug-live-update-of-unity-builds-on-device/</link>
		<comments>http://www.horsedrawngames.com/remote-debug-live-update-of-unity-builds-on-device/#comments</comments>
		<pubDate>Sat, 30 Apr 2016 12:09:43 +0000</pubDate>
		<dc:creator><![CDATA[Sam]]></dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Remote Debug Tool]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[unity3d]]></category>

		<guid isPermaLink="false">http://www.horsedrawngames.com/?p=214</guid>
		<description><![CDATA[Unity has a feature called the Unity Remote which is an app that you run on an Android or iOS device. The editor talks to this app via USB and sends the render output of the game as it is running in the editor to the device. The touch inputs from the device along with...  <a class="excerpt-read-more" href="http://www.horsedrawngames.com/remote-debug-live-update-of-unity-builds-on-device/" title="ReadRemote debug / live update of Unity builds on device">Read more &#187;</a>]]></description>
				<content:encoded><![CDATA[<p>Unity has a feature called the <a title="Unity Remote" href="http://docs.unity3d.com/Manual/UnityRemote4.html" target="_blank">Unity Remote</a> which is an app that you run on an Android or iOS device. The editor talks to this app via USB and sends the render output of the game as it is running in the editor to the device. The touch inputs from the device along with other device-specific data such as GPS and accelerometer are also sent back to the editor. This gives you an idea of how your game looks on a device and also lets you test touch controls and other device hardware without having to constantly do full builds.</p>
<p>That&#8217;s the theory, anyway. A lot of people have complaints about the Unity Remote, saying that it doesn&#8217;t work very well or at all.</p>
<p>I&#8217;ve always felt that Unity should have a live debug view of the game running on the device that shows you all the GameObjects and their components and serialised fields. I imagined it would look like the regular built-in hierarchy and inspector windows, except it would be pulling the data via a network connection from the live build. A lot of AAA engines have a live update feature like this but Unity has nothing.</p>
<p>In 2014 I started work on a tool to do just this. I built an initial prototype with plans to sell it on the asset store. But then contracting jobs got in the way, and I put the project on hold. Late last year my contract work dried up, and I decided it was time to get back to it and finish it off, so I&#8217;ve spent the last four months working on it. It&#8217;s now working pretty well:</p>
<p>&nbsp;</p>
<p>You can sit in Unity, bring up the Remote Debug window, connect to your device, and see what&#8217;s happening on it, just as though you were looking at a build running in the editor. It&#8217;s really easy to iterate on things on the device, and I&#8217;ve found it especially useful for tweaking touch controls.</p>
<p>Currently it requires Unity 5.3.2f1 or better because I&#8217;m using the new <a href="https://docs.unity3d.com/ScriptReference/SceneManagement.Scene.GetRootGameObjects.html" target="_blank"><code>Scene.GetRootGameObjects</code></a> API that was added. I can make it work in previous versions of Unity but with some unfortunate side effects depending on what API I use. If I use <code>Object.FindObjectsOfType</code> I can&#8217;t get inactive objects. There is also <code>Resources.FindObjectsOfType</code> but it returns all objects including resources that were manually loaded from the Resources directory. I think I can filter these out, but it just means the server is a bit more costly in terms of memory and CPU. This is something I want to do though because it would be great to provide versions of the tool for Unity 5.x across the board.</p>
<p>I&#8217;ve made a thread on the <a href="http://forum.unity3d.com/threads/hdg-remote-debug-live-update-inspector-for-your-phone.399096/" target="_blank">Unity forums</a> about Hdg Remote Debug. If you want more information feel free to post there or email us here at Horse Drawn HQ. The tool should be going live on the asset store in the next couple of weeks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.horsedrawngames.com/remote-debug-live-update-of-unity-builds-on-device/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
