{"id":619,"date":"2014-03-19T16:00:45","date_gmt":"2014-03-19T16:00:45","guid":{"rendered":"http:\/\/www.doolwind.com\/blog\/?p=619"},"modified":"2014-03-26T11:18:46","modified_gmt":"2014-03-26T11:18:46","slug":"how-we-use-unity","status":"publish","type":"post","link":"https:\/\/www.doolwind.com\/blog\/how-we-use-unity\/","title":{"rendered":"How We Use Unity"},"content":{"rendered":"<p dir=\"ltr\"><a href=\"http:\/\/www.doolwind.com\/blog\/wp-content\/uploads\/2014\/03\/battlegroup2editor_savedforweb.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright  wp-image-621\" alt=\"Battle Group 2 Editor\" src=\"http:\/\/www.doolwind.com\/blog\/wp-content\/uploads\/2014\/03\/battlegroup2editor_savedforweb.png\" width=\"180\" height=\"133\" srcset=\"https:\/\/www.doolwind.com\/blog\/wp-content\/uploads\/2014\/03\/battlegroup2editor_savedforweb.png 500w, https:\/\/www.doolwind.com\/blog\/wp-content\/uploads\/2014\/03\/battlegroup2editor_savedforweb-300x221.png 300w\" sizes=\"auto, (max-width: 180px) 100vw, 180px\" \/><\/a>We\u2019re using Unity exclusively at Bane Games and are absolutely loving it. I get asked a lot about what tools we use and how we lay out our projects. Today I discuss this briefly and would love to hear about the 3rd party tools you recommend and how you make your games in Unity.<\/p>\n<h2 dir=\"ltr\">3rd Party Tools<\/h2>\n<p dir=\"ltr\">We love the Asset Store and think this is one of the big selling points of Unity. I know a couple of Asset Store developers and they speak highly of the ease of development when extending Unity as well as the revenue generated. There are four main tools we use.<\/p>\n<h3 dir=\"ltr\">2D Toolkit<\/h3>\n<p dir=\"ltr\">Our first three games used a simple rendering system that I created. While this worked well for our first few games, it was one of the main areas I wanted to make use of someone else\u2019s technology to give us access to atlasing\/batching, more robust animations and general performance improvements. After some investigation back in 2013 I found that 2D Toolkit was one of the two or three major contenders. After some experimentation I found it to be exactly what we were after.<\/p>\n<p dir=\"ltr\">\u00a0We began using 2D toolkit for a number of prototypes we were developing as we decided on the next game to create. We have now embraced it fully and are using it both for prototyping and the full games we are working on (Battle Group 2 (BG2) and our space game). We\u2019ve found it easy to use, almost entirely bug free and extremely performant. We\u2019ve gone from 90+ draw calls in Battle Group 1 (which used my custom, simple, rendering system) to less than 10 in Battle Group 2.<\/p>\n<p dir=\"ltr\">\u00a0With the release of Unity\u2019s 2D system we will access our options when we begin work on our next game. After some quick investigation though I\u2019ve found that 2D Toolkit overs everything we need and has been updated to make use of some of the new features in Unity\u2019s 2D, such as sorting layers and the 2D viewport.<\/p>\n<h3 dir=\"ltr\">NGUI<\/h3>\n<p dir=\"ltr\">GUI support in Unity has been an issue for me from the time I started developing in it in 2011. When I used to give talks on Unity I would list it among the few negatives to development and as of 2014 it\u2019s the only remaining issue that has not been resolved. We can expect Unity\u2019s new GUI system in the coming months, but until then, the best choice is NGUI.<\/p>\n<p dir=\"ltr\">I\u2019ve tried every GUI library on the Asset Store and unfortunately I have not found one I\u2019m happy with. NGUI is the best of the options, however we are having a bunch of issues with it (such as image sprites swapping place in the atlas without updating in game). We\u2019re hoping things will improve in time and we will definitely be reviewing Unity\u2019s new GUI system for our space game.<\/p>\n<h3 dir=\"ltr\">Autopilot<\/h3>\n<p dir=\"ltr\">Autopilot is invaluable for anyone who targets iOS. It integrates with TestFlight and allows you to publish a build with a single click. Where we used to take ~20 minutes to make a build and upload to TestFlight, we can now complete the whole process automatically. I highly recommend Test Flight and AutoPilot to anyone who requires build to be created for iOS.<\/p>\n<h3 dir=\"ltr\">UnityVS<\/h3>\n<p dir=\"ltr\">UnityVS is an invaluable tool for anyone who uses Visual Studio as their primary IDE while developing Unity games. UnityVS lets you attach a debugger to Unity as it runs on your development PC and both set breakpoints and step through the code. It doesn\u2019t support the full functionality of the debugger (such as changing current source execution line) however it does do the majority of tasks required for debugging. It\u2019s a great alternative to the standard Debug.Log() way of finding bugs in code. It integrates well with Unity and Visual Studio and despite it\u2019s minor quirks is highly recommended.<\/p>\n<h2 dir=\"ltr\">Project Structure<\/h2>\n<p dir=\"ltr\">Our project structure is fairly standard from those I\u2019ve talked to about their Unity setup. We break scenes, scripts, images, etc up into specific directories to keep things as organized as possible as the project grows. There are a few key techniques we use that I think are worth mentioning.<\/p>\n<h3 dir=\"ltr\">A Single Scene File<\/h3>\n<p dir=\"ltr\">As much as I can, I like to keep the scene file count to a minimum. When possible we like to have a single scene for the game including main menu, in-game and pause states. This gives us full control over load times between levels and lets us seamlessly switch from game to menu. We\u2019ve had success with this in the past during our prototypes, however BG2 will be our first published game that uses a single scene.<\/p>\n<p dir=\"ltr\">In addition to this single game scene, we do have a splash screen that is as simple as possible to make sure it loads within the required time on iOS so our application is not termianated. We also usually have an intro movie scene which displays our intro logos and movie.<\/p>\n<h3 dir=\"ltr\">Multiple Scene Files During Development<\/h3>\n<p dir=\"ltr\">One caveat to the single scene file setup is that we do break the menu and in-game up into separate scenes during development. We use a LoadLevelAdditive() to load the in-game in when the Menu.scene file is being edited. This allows us to play the full game from the Menu.scene while still quickly accessing the gameplay without bothering with the menu through the InGame.scene file.<\/p>\n<h3 dir=\"ltr\">Global Object<\/h3>\n<p dir=\"ltr\">We have a \u201cGlobal Object\u201d GameObject that is used for storing references to shared objects within the game. This allows multiple GameObject\u2019s to share a reference without having to look them up at run-time and allows changing the object referenced in a single place without having to remember and find every GameObject that accesses them.<\/p>\n<h2 dir=\"ltr\">Future Plans<\/h2>\n<p dir=\"ltr\">There are a few things we\u2019re not currently using that we would like to begin using on future projects.<\/p>\n<h3 dir=\"ltr\">Unit Testing<\/h3>\n<p dir=\"ltr\">Unity has recently released a suite of unit testing functionality within Unity. I\u2019m a huge fan of Unit Testing and Test Driven Development (TDD) and it\u2019s one of the areas game development has lagged a long way behind other software development. For our projects that use the MVC pattern I\u2019ve used TDD as much as I can with great success. I see the built-in Unit Testing functionality filling the gap and allowing much more of our code to be unit tested in the future. The only reason we haven\u2019t begun using this is that it\u2019s too new for us to have adopted yet.<\/p>\n<h3 dir=\"ltr\">Asset Store Tools<\/h3>\n<p dir=\"ltr\">I would like to roll up some of the tools we use internally and offer them for sale on the Asset Store. This will encourage me to make them as robust as I can as well as generate some secondary income from the work we\u2019ve completed. As I mentioned previously, I\u2019ve heard good things from my friends that have released products on the Asset Store and I see it as a great way of giving back to the Unity community.<\/p>\n<h2 dir=\"ltr\">Conclusion<\/h2>\n<p dir=\"ltr\">This is a quick wrap up of how we are using Unity for our 4th title in the engine. What 3rd Party Tools do you recommend? How do you lay out your Unity Projects and what tips do you have for other developers?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We\u2019re using Unity exclusively at Bane Games and are absolutely loving it. I get asked a lot about what tools we use and how we lay out our projects. Today I discuss this briefly and would love to hear about the 3rd party tools you recommend and how you make your games in Unity. 3rd <a class=\"more-link\" href=\"https:\/\/www.doolwind.com\/blog\/how-we-use-unity\/\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[33,99],"tags":[112,95],"class_list":["post-619","post","type-post","status-publish","format-standard","hentry","category-game-development","category-unity-game-development","tag-game-development","tag-unity"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pgEc5-9Z","_links":{"self":[{"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/posts\/619","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/comments?post=619"}],"version-history":[{"count":0,"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/posts\/619\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/media?parent=619"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/categories?post=619"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/tags?post=619"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}