{"id":1779,"date":"2015-11-13T19:59:06","date_gmt":"2015-11-13T19:59:06","guid":{"rendered":"http:\/\/www.frozax.com\/blog\/?p=1779"},"modified":"2016-04-25T11:24:29","modified_gmt":"2016-04-25T11:24:29","slug":"why-i-stopped-using-unity3d-after-two-months-and-a-working-prototype","status":"publish","type":"post","link":"https:\/\/www.frozax.com\/blog\/2015\/11\/why-i-stopped-using-unity3d-after-two-months-and-a-working-prototype\/","title":{"rendered":"Why I stopped using Unity3D after two months and a working prototype"},"content":{"rendered":"<p>Two years after my previous mobile game, I decided to start a new 2D puzzle game. I wanted to try a new technology and chose Unity. In this article, I&#8217;ll explain why I chose Unity in the first place, and describe what I liked and disliked. After developing a fully working prototype of my new game in about two months (not my full time job, working when kids are sleeping), I finally came back to a framework I used previously: <a href=\"http:\/\/www.cocos2d-x.org\">cocos2d-x<\/a>.<\/p>\n<h1>Why choosing unity<\/h1>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.frozax.com\/blog\/wp-content\/uploads\/2015\/11\/unity.png\" alt=\"unity\" width=\"100\" height=\"96\" class=\"alignleft size-full wp-image-1782\" \/>Mobile game developement is a hobby, and I love learning new things. Unity had new features for 2D games since v4.3 (Sprites), and became free for small teams with the <a href=\"http:\/\/unity3d.com\/unity\/personal-edition\">personal edition<\/a>. I knew C# quite well already from experience of <a href=\"http:\/\/www.frozax.com\/x360\">previous XBLIG games<\/a>.<\/p>\n<h1>What I liked in Unity<\/h1>\n<p>Here are some of the great features in Unity that I used while developing my prototype. Keep in mind that I&#8217;m focused on simple 2D games, and not on huge 3D FPS. Also, I&#8217;m single developer on the project, doing both programming and game design.<\/p>\n<h4>Prefabs<\/h4>\n<p>A prefab is a set of objects tied together. It&#8217;s easy to instantiate prefabs programmatically in real time in the game. For example, to create a pack selection screen such as <a href=\"http:\/\/www.frozax.com\/static\/img\/games\/hep4.jpg\">this one<\/a> from a previous project, I made a prefab and modified by script the values of each pack. If you want to change the layout or overall look of the prefab, there&#8217;s nothing to change in the code, everything is done in the editor.<\/p>\n<h4>Editor customization<\/h4>\n<p>The editor is very well done and it&#8217;s easy to add properties to game objects. You can also add specific features. Here is a small list of stuff that helped me debugging and developing my game:<br \/>\n* showing game object bounds (see tweet below)<br \/>\n* showing mouse position on screen<br \/>\n* logging debug information on screen<br \/>\n* changing language in real time<\/p>\n<blockquote class=\"twitter-tweet\" lang=\"en\">\n<p lang=\"en\" dir=\"ltr\">Here&#39;s my <a href=\"https:\/\/twitter.com\/hashtag\/unity3d?src=hash\">#unity3d<\/a> component used to show bounds of any object <a href=\"https:\/\/t.co\/SSCfRUUhn0\">https:\/\/t.co\/SSCfRUUhn0<\/a>. <a href=\"https:\/\/twitter.com\/hashtag\/gamedev?src=hash\">#gamedev<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/UnityTips?src=hash\">#UnityTips<\/a> No. 12 <a href=\"http:\/\/t.co\/2zJiy8pWa7\">pic.twitter.com\/2zJiy8pWa7<\/a><\/p>\n<p>&mdash; Francois Guibert (@Frozax) <a href=\"https:\/\/twitter.com\/Frozax\/status\/648166818197164032\">September 27, 2015<\/a><\/p><\/blockquote>\n<p><script async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<h4>Running in the editor<\/h4>\n<p>When you run the game in the editor, you still have access to variables and exposed settings of your game objects. You can also view objects outside the window. It&#8217;s handy when you don&#8217;t see an object on screen to know whether it&#8217;s invisible or simply out of screen.<br \/>\nThe editor also lets you try some new layouts while the game is running by simple moving your instances.<\/p>\n<h4>Profiling<\/h4>\n<p>Profiling is another great feature recently made available for free in Unity 5. You can see in real time memory allocations, rendered meshes and CPU usage of any script. Sorting scripts by CPU usage helps to understand where to optimize first.<\/p>\n<blockquote class=\"twitter-tweet\" lang=\"en\">\n<p lang=\"en\" dir=\"ltr\"><a href=\"https:\/\/twitter.com\/hashtag\/UnityTips?src=hash\">#UnityTips<\/a> No.3: Use the profiler to check for memory, performance and rendering issues. It&#39;s very powerful! <a href=\"https:\/\/twitter.com\/hashtag\/unity3d?src=hash\">#unity3d<\/a> <a href=\"http:\/\/t.co\/WOG9VTOQx2\">pic.twitter.com\/WOG9VTOQx2<\/a><\/p>\n<p>&mdash; Francois Guibert (@Frozax) <a href=\"https:\/\/twitter.com\/Frozax\/status\/640995249901445120\">September 7, 2015<\/a><\/p><\/blockquote>\n<p><script async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<h4>Multiplatform<\/h4>\n<p>This is one of the feature that made me try Unity in the first place. Being able to deploy on all platforms with a single click. It&#8217;s not as simple as that in reality, because sometimes you need to create projects and build them with external tools (iOS, Windows 8.1 for example). With my prototype, I built Windows, Linux, WebGL, Android and Windows Phone 8.1 builds very quickly and without major issues.<\/p>\n<h4>Visual Studio Integration<\/h4>\n<p>I initially used MonoDevelop and honestly didn&#8217;t like it. However, I discovered <a href=\"https:\/\/www.visualstudio.com\/en-us\/features\/unitytools-vs.aspx\">Visual Studio Tools for Unity<\/a> and used it with Visual Studio Community 2015 and now I have a great dev environment. Unity recently included the plugin in the editor package directly. You can even set breakpoints and step into your code directly in Visual Studio.<\/p>\n<h1>What I didn&#8217;t like in Unity<\/h1>\n<p>Let&#8217;s look now at the issues I had with Unity.<\/p>\n<h4>2D<\/h4>\n<p>I found the 2D features not good enough for my needs. There was a promising new UI system, but it&#8217;s slow and not recommended on mobiles. I also had to play with texture tiling (repeating UVs) and there is no support natively in the 2D sprite game objects. I had to re-code a sprite using a 3D quad to have access to UV settings. And last but not least:<\/p>\n<blockquote class=\"twitter-tweet\" lang=\"en\">\n<p lang=\"en\" dir=\"ltr\"><a href=\"https:\/\/twitter.com\/hashtag\/UnityTips?src=hash\">#UnityTips<\/a> No.6: MonoBehaviour.OnGUI generates allocations every frame, even if the method is empty! Use with caution <a href=\"https:\/\/twitter.com\/hashtag\/unity3d?src=hash\">#unity3d<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/gamedev?src=hash\">#gamedev<\/a><\/p>\n<p>&mdash; Francois Guibert (@Frozax) <a href=\"https:\/\/twitter.com\/Frozax\/status\/642436466610733063\">September 11, 2015<\/a><\/p><\/blockquote>\n<p><script async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<h4>Resources transformation<\/h4>\n<p>When working with artists, I find it useful to send them a desktop version of the game so that they can change the raw resources files and see their work in game. Unfortunately, there is no easy way to do that in Unity without sending the whole project with assets and source code. I had to develop a specific function to load custom files at startup. See <a href=\"https:\/\/www.reddit.com\/r\/Unity3D\/comments\/3juspb\/how_to_have_raw_images_in_builds_so_that_artists\/\">this reddit thread<\/a> if you want more information and sample code on this topic.<\/p>\n<h4>Big packages<\/h4>\n<p>Because Unity has to include the C# libraries in your packaged game, games take a lot of space:  A simple empty game without resources and only displaying a white screen takes 28.5 Mb on Windows and 18.4 Mb on Android (<em>EDIT<\/em>: I didn&#8217;t realize you could create ARM only binary, in this case the size is 9.5 Mb)! My latest mobile game (made with cocos2dx) takes 4.7 Mb, code, resources and art included. It&#8217;s not a problem for big productions but it is for smaller games.<\/p>\n<h4>Visual Studio Tools instability<\/h4>\n<p>I told above that I loved Visual Studio integration but the stability is for from perfect. I had to kill Unity and Visual Studio at least twice a day because they stopped responding. When it happened middle of a big debugging session, it&#8217;s very frustrating.<\/p>\n<h4>Memory allocations<\/h4>\n<p>I raised the issue in the 2D section, but it also happened with mandatory function: this tweet sums it all:<\/p>\n<blockquote class=\"twitter-tweet\" lang=\"en\">\n<p lang=\"en\" dir=\"ltr\">Input.Touches: A function supposed to be called every frame that &quot;Allocates temporary variables&quot;! What were they thinking? <a href=\"https:\/\/twitter.com\/hashtag\/unity3d?src=hash\">#unity3d<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/gamedev?src=hash\">#gamedev<\/a><\/p>\n<p>&mdash; Francois Guibert (@Frozax) <a href=\"https:\/\/twitter.com\/Frozax\/status\/637746975216128000\">August 29, 2015<\/a><\/p><\/blockquote>\n<p><script async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<h4>Splash screen<\/h4>\n<p>In the free version, you have to use Unity&#8217;s splash screen on every platform. I knew that from the beginning and understand that, as I use a free version of the tool. But that&#8217;s a drawback nonetheless.<\/p>\n<h4>Connection<\/h4>\n<p>I think this is only in the free version, but Unity games connect to Internet and therefore forces Android permissions (INTERNET and ACCESS_NETWORK_STATE). As a user, I don&#8217;t like being asked for too many permissions. I&#8217;m still unsure if I&#8217;ll have ads in my next game (I probably won&#8217;t), but if I don&#8217;t, I surely don&#8217;t want to have extra permissions in my app.<\/p>\n<h4>Too expensive<\/h4>\n<p>The last two issues can simply be solved by purchasing Unity Pro. As I&#8217;m doing this as a hobbyist, I don&#8217;t have a big budget to put into gamedev, and I&#8217;m really not sure my game sales will be able to cover the costs of Unity Pro (about 171 \u20ac per month or 3420 \u20ac once if I want support for Windows, iOS, Android and Windows Phone 8.1).<\/p>\n<h1>Switching to cocos2dx<\/h1>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.frozax.com\/blog\/wp-content\/uploads\/2015\/11\/cocossmall.png\" alt=\"cocossmall\" width=\"72\" height=\"100\" class=\"alignleft size-full wp-image-1787\" \/>I considered some of the issues so important (splash screen and big packages, mostly) that I looked for other multiplatform engines and decided to come back to cocos2dx. Since I used cocos2dx v1 a few years ago, there has been many great changes, and I am now using v3. It&#8217;s really a powerful framework, and I made <a href=\"https:\/\/github.com\/frozax\/cocos2d-x\/tree\/frozax\">my own fork<\/a> where I can do some specific tweaks. Cocos2d-x is not as &#8220;plug&#8217;n&#8217;play&#8221; as Unity and the documentation is sometimes too light, but I don&#8217;t feel limited. I have working Android, Windows Phone, iOS and Windows builds for now.<\/p>\n<h1>Conclusion<\/h1>\n<p>Unity3D is a good tool, but I don&#8217;t think it&#8217;s suited to small 2D games. Cocos2d-x team have made some great changes and are still very active.<\/p>\n<p>Feel free to comment, <a href=\"http:\/\/twitter.com\/frozax\">tweet<\/a> or share this article.<\/p>\n<h1>Bonus tweets<\/h1>\n<p>While actively learning Unity, I made a series of #UnityTips tweets, here are the best ones:<\/p>\n<blockquote class=\"twitter-tweet\" lang=\"en\">\n<p lang=\"en\" dir=\"ltr\"><a href=\"https:\/\/twitter.com\/hashtag\/UnityTips?src=hash\">#UnityTips<\/a> No.1: Use the header attribute to create sections in the in the inspector [Header(&quot;Section&quot;)] <a href=\"https:\/\/twitter.com\/hashtag\/gamedev?src=hash\">#gamedev<\/a> <a href=\"http:\/\/t.co\/C6DvOaO4dU\">pic.twitter.com\/C6DvOaO4dU<\/a><\/p>\n<p>&mdash; Francois Guibert (@Frozax) <a href=\"https:\/\/twitter.com\/Frozax\/status\/640276218428981248\">September 5, 2015<\/a><\/p><\/blockquote>\n<p><script async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<blockquote class=\"twitter-tweet\" lang=\"en\">\n<p lang=\"en\" dir=\"ltr\"><a href=\"https:\/\/twitter.com\/hashtag\/UnityTips?src=hash\">#UnityTips<\/a> No.4: If, like me, you don&#39;t like the default script, edit the template in Unity\/Editor\/Data\/Resources\/ScriptTemplates <a href=\"https:\/\/twitter.com\/hashtag\/unity3d?src=hash\">#unity3d<\/a><\/p>\n<p>&mdash; Francois Guibert (@Frozax) <a href=\"https:\/\/twitter.com\/Frozax\/status\/641348872908836864\">September 8, 2015<\/a><\/p><\/blockquote>\n<p><script async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<blockquote class=\"twitter-tweet\" lang=\"en\">\n<p lang=\"en\" dir=\"ltr\"><a href=\"https:\/\/twitter.com\/hashtag\/UnityTips?src=hash\">#UnityTips<\/a> No.5: <a href=\"https:\/\/twitter.com\/hashtag\/Android?src=hash\">#Android<\/a> users love their back button: check if it&#39;s pressed with Input.GetKeyDown(KeyCode.Escape) <a href=\"https:\/\/twitter.com\/hashtag\/unity3d?src=hash\">#unity3d<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/gamedev?src=hash\">#gamedev<\/a><\/p>\n<p>&mdash; Francois Guibert (@Frozax) <a href=\"https:\/\/twitter.com\/Frozax\/status\/641720757396086784\">September 9, 2015<\/a><\/p><\/blockquote>\n<p><script async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<blockquote class=\"twitter-tweet\" lang=\"en\">\n<p lang=\"en\" dir=\"ltr\"><a href=\"https:\/\/twitter.com\/hashtag\/UnityTips?src=hash\">#UnityTips<\/a> No.9: Dependences in your scripts? Use the powerful Script Execution Order window! <a href=\"https:\/\/twitter.com\/hashtag\/unity3d?src=hash\">#unity3d<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/gamedev?src=hash\">#gamedev<\/a> <a href=\"http:\/\/t.co\/L0FsexsK6X\">pic.twitter.com\/L0FsexsK6X<\/a><\/p>\n<p>&mdash; Francois Guibert (@Frozax) <a href=\"https:\/\/twitter.com\/Frozax\/status\/644952759045914624\">September 18, 2015<\/a><\/p><\/blockquote>\n<p><script async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<blockquote class=\"twitter-tweet\" lang=\"en\">\n<p lang=\"en\" dir=\"ltr\"><a href=\"https:\/\/twitter.com\/hashtag\/UnityTips?src=hash\">#UnityTips<\/a> No.10: One of the best free script asset on the store: Log Viewer <a href=\"https:\/\/t.co\/NZkqlEkrfY\">https:\/\/t.co\/NZkqlEkrfY<\/a>. Helped me fix a mobile-only issue.<\/p>\n<p>&mdash; Francois Guibert (@Frozax) <a href=\"https:\/\/twitter.com\/Frozax\/status\/645719281359958016\">September 20, 2015<\/a><\/p><\/blockquote>\n<p><script async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<blockquote class=\"twitter-tweet\" lang=\"en\">\n<p lang=\"en\" dir=\"ltr\"><a href=\"https:\/\/twitter.com\/hashtag\/UnityTips?src=hash\">#UnityTips<\/a> No. 11: When you instantiate game objects, make sure to change their name to simplify debugging. <a href=\"https:\/\/twitter.com\/hashtag\/gamedev?src=hash\">#gamedev<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/unity3d?src=hash\">#unity3d<\/a><\/p>\n<p>&mdash; Francois Guibert (@Frozax) <a href=\"https:\/\/twitter.com\/Frozax\/status\/647120986635141120\">September 24, 2015<\/a><\/p><\/blockquote>\n<p><script async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<blockquote class=\"twitter-tweet\" lang=\"en\">\n<p lang=\"en\" dir=\"ltr\"><a href=\"https:\/\/twitter.com\/hashtag\/UnityTips?src=hash\">#UnityTips<\/a> No. 13: You can move a component with all its settings with a drag&#39;n&#39;drop from the inspector to the hierarchy. <a href=\"https:\/\/twitter.com\/hashtag\/unity3d?src=hash\">#unity3d<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/gamedev?src=hash\">#gamedev<\/a><\/p>\n<p>&mdash; Francois Guibert (@Frozax) <a href=\"https:\/\/twitter.com\/Frozax\/status\/649325527904423938\">September 30, 2015<\/a><\/p><\/blockquote>\n<p><script async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<div class=\"addtoany_share_save_container addtoany_content_bottom\"><div class=\"a2a_kit a2a_kit_size_32 addtoany_list a2a_target\" id=\"wpa2a_1\"><a class=\"a2a_button_twitter\" href=\"http:\/\/www.addtoany.com\/add_to\/twitter?linkurl=https%3A%2F%2Fwww.frozax.com%2Fblog%2F2015%2F11%2Fwhy-i-stopped-using-unity3d-after-two-months-and-a-working-prototype%2F&amp;linkname=Why%20I%20stopped%20using%20Unity3D%20after%20two%20months%20and%20a%20working%20prototype\" title=\"Twitter\" rel=\"nofollow\" target=\"_blank\"><\/a><a class=\"a2a_button_facebook\" href=\"http:\/\/www.addtoany.com\/add_to\/facebook?linkurl=https%3A%2F%2Fwww.frozax.com%2Fblog%2F2015%2F11%2Fwhy-i-stopped-using-unity3d-after-two-months-and-a-working-prototype%2F&amp;linkname=Why%20I%20stopped%20using%20Unity3D%20after%20two%20months%20and%20a%20working%20prototype\" title=\"Facebook\" rel=\"nofollow\" target=\"_blank\"><\/a><a class=\"a2a_button_google_plus\" href=\"http:\/\/www.addtoany.com\/add_to\/google_plus?linkurl=https%3A%2F%2Fwww.frozax.com%2Fblog%2F2015%2F11%2Fwhy-i-stopped-using-unity3d-after-two-months-and-a-working-prototype%2F&amp;linkname=Why%20I%20stopped%20using%20Unity3D%20after%20two%20months%20and%20a%20working%20prototype\" title=\"Google+\" rel=\"nofollow\" target=\"_blank\"><\/a><a class=\"a2a_button_reddit\" href=\"http:\/\/www.addtoany.com\/add_to\/reddit?linkurl=https%3A%2F%2Fwww.frozax.com%2Fblog%2F2015%2F11%2Fwhy-i-stopped-using-unity3d-after-two-months-and-a-working-prototype%2F&amp;linkname=Why%20I%20stopped%20using%20Unity3D%20after%20two%20months%20and%20a%20working%20prototype\" title=\"Reddit\" rel=\"nofollow\" target=\"_blank\"><\/a>\n<script type=\"text\/javascript\"><!--\nwpa2a.script_load();\n\/\/--><\/script>\n<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Two years after my previous mobile game, I decided to start a new 2D puzzle game. I wanted to try a new technology and chose Unity. In this article, I&#8217;ll explain why I chose Unity in the first place, and describe what I liked and disliked. After developing a fully working prototype of my new&hellip; <a class=\"more-link\" href=\"https:\/\/www.frozax.com\/blog\/2015\/11\/why-i-stopped-using-unity3d-after-two-months-and-a-working-prototype\/\">Continue reading <span class=\"screen-reader-text\">Why I stopped using Unity3D after two months and a working prototype<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[12,150],"tags":[],"_links":{"self":[{"href":"https:\/\/www.frozax.com\/blog\/wp-json\/wp\/v2\/posts\/1779"}],"collection":[{"href":"https:\/\/www.frozax.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.frozax.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.frozax.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.frozax.com\/blog\/wp-json\/wp\/v2\/comments?post=1779"}],"version-history":[{"count":15,"href":"https:\/\/www.frozax.com\/blog\/wp-json\/wp\/v2\/posts\/1779\/revisions"}],"predecessor-version":[{"id":1805,"href":"https:\/\/www.frozax.com\/blog\/wp-json\/wp\/v2\/posts\/1779\/revisions\/1805"}],"wp:attachment":[{"href":"https:\/\/www.frozax.com\/blog\/wp-json\/wp\/v2\/media?parent=1779"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.frozax.com\/blog\/wp-json\/wp\/v2\/categories?post=1779"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.frozax.com\/blog\/wp-json\/wp\/v2\/tags?post=1779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}