Unity for Software Engineers

Embed Size (px)

Citation preview

  • 8/17/2019 Unity for Software Engineers

    1/28

  • 8/17/2019 Unity for Software Engineers

    2/28

  • 8/17/2019 Unity for Software Engineers

    3/28

    Introduction

    !

    Unity is a Game Engine! In constant development, multitude of

    plugins available on the Asset Store

    !

    Before official 2D support, alternative mix of frameworks and workarounds

  • 8/17/2019 Unity for Software Engineers

    4/28

    Unity

    !

    Built with Mono! UnityEditor is built with (mostly) the sa

     API used to make games in Unity

    !

    Output to Web (plugin), iOS, Androidand soon WebGL

  • 8/17/2019 Unity for Software Engineers

    5/28

    Unity

    !

    IL2CPP: an AOT compiler and VM! Their own implementation of the CLI

    ! Claim 2x, 3x performance uptick over

    usage of Mono! Not about recreating .NET or Mono

    toolchain, will still use Mono C# comp

  • 8/17/2019 Unity for Software Engineers

    6/28

  • 8/17/2019 Unity for Software Engineers

    7/28

    ExampleMonoBehaviour.cs

    void Start()

    void Update()

    void OnDisable()

  • 8/17/2019 Unity for Software Engineers

    8/28

    Basic Workflow

    !

    Drag and Drop assets intoScene, creating GameObjects

    ! Specialize GameObjects withComponents

    !

    Set properties on Components! Problematic for teams larger

    than 2

  • 8/17/2019 Unity for Software Engineers

    9/28

    Basic Workflow - Problems

    !

    Scenes are problematic for version control, sincare basically binaries

    ! Solutions and workarounds: heavy use of prefa

    view scenes as prefabs interacting (have a prefwhole UI, for example)

    ! Lack of visibility for engineers

  • 8/17/2019 Unity for Software Engineers

    10/28

    Design Patterns

    MVVM! Model - C# class

    ! View Model - MonoBehaviour

    ! View - GameObject

  • 8/17/2019 Unity for Software Engineers

    11/28

    Design Patterns

    Dependency Injection

    To avoid using GameObject.Find or static classes

     Already a number of frameworks:

    ! StrangeIoC

    ! Zenject

  • 8/17/2019 Unity for Software Engineers

    12/28

    Zenject Context example  public class Context : MonoBehaviour

    {

    public Root root;

    public void RegisterBindings(DiContainer container){

    container.Bind().AsSingle(root);

    container.Bind().AsSingle();

    container.Bind().AsSingle();container.Bind().AsSingle();

    container.Bind().AsSingle();

    container.Bind().AsSingle();}

    }

  • 8/17/2019 Unity for Software Engineers

    13/28

    Art Integration

    ! High artist input is encouraged

    !  Artists can work with Unity on a daily basis, desUI and tinker

    ! They don’t need an engineer to build the game

    can test their changes themselves

  • 8/17/2019 Unity for Software Engineers

    14/28

    UI System

    !

    Official Unity UI recently released! Visual design driven

    !  Artists and designers can implement tdesigns directly

  • 8/17/2019 Unity for Software Engineers

    15/28

  • 8/17/2019 Unity for Software Engineers

    16/28

    Animations

  • 8/17/2019 Unity for Software Engineers

    17/28

    Unit Tests

    ! Compatible with any C# unit testing frameworks

    ! UnityUnitTesting: open source package to visualiz

    results within the Unity Editor

    ! MonoBehaviours are impossible to test (they can’t

    instantiated) - Solution: separate logic from MBs! UnityTestTools allows testing GameObjects within

    scenes

  • 8/17/2019 Unity for Software Engineers

    18/28

    Dependency Management & CI

    ! Maven plugin

    ! Create C# libs for general purpose functionalitycomms, etc)

    !  Automated builds for iOS, Android, etc

    !  AssetBundles: dynamically load new content

  • 8/17/2019 Unity for Software Engineers

    19/28

  • 8/17/2019 Unity for Software Engineers

    20/28

    Native Plugins

    !

    Similar flow to AIR’s native extensionsbuild native functionality in Objective-

    ! Prime31: one of the top Unity native p

    suppliers, they’ve made Purchases,Facebook and others

  • 8/17/2019 Unity for Software Engineers

    21/28

    Case Study: Samurai Siege

  • 8/17/2019 Unity for Software Engineers

    22/28

    Case Study: Samurai Siege

  • 8/17/2019 Unity for Software Engineers

    23/28

    Case Study: Samurai Siege

    ! 6 month development timeFeb - July 2013, soft launch Australia & New Ze

    ! 3 months polish, global launch October 2013

    ! Team had no previous experience with Unity

  • 8/17/2019 Unity for Software Engineers

    24/28

    Conclusion

    ! Impetus to use Unity is speeding up our gamedevelopment process

    ! Speed up asset integration by allowing artists todirectly on the project

    ! Speed up game prototyping and testing of ideasprototype a new feature in a day, then spend a cweeks implementing)

  • 8/17/2019 Unity for Software Engineers

    25/28

    Conclusion

    !  Although heavily oriented by visual design, thesolutions to allow higher degree of visibility andof the project to engineers

    !

    Posit: faster art integration, more time for enginwork on new features, optimization

    ! Viability for Mobile is proven, Web is still to be s

  • 8/17/2019 Unity for Software Engineers

    26/28

    License

    Unity Pro iOS Pro Android Pro Tota

    One-off perversion (4.x, 5x)

    1500$per developer 

    1500$per developer 

    1500$per developer 

    450per

    Subscription 75$per monthper developer 

    75$per monthper developer 

    75$per monthper developer 

    225per per

  • 8/17/2019 Unity for Software Engineers

    27/28

    Reference

    IL2CPP: http://blogs.unity3d.com/2014/05/20/the-future-of-scripting

    Design Patterns for Unity:https://docs.google.com/document/d/1Kja6ZSBaG0Fl4WyBklPSUDLmjCo8jilDGkhW3dOxF2c/pub

    Samurai Siege:

    http://www.pocketgamer.biz/asia/feature/59222/clash-of-alliances-tof-samurai-siege/

    http://www.gamasutra.com/view/pressreleases/217015/SAMURAI_SIEGE_SURPASSES_12_MILLION_REVENUE_IN_FINTHS.php

    http://www.gamasutra.com/view/pressreleases/217015/SAMURAI_SIEGE_SURPASSES_12_MILLION_REVENUE_IN_FIRST_SIXMONTHS.phphttp://www.pocketgamer.biz/asia/feature/59222/clash-of-alliances-the-making-of-samurai-siege/https://docs.google.com/document/d/1Kja6ZSBaG0Fl4WyBklPSUDLmjCo8jilDGkhW3dOxF2c/pubhttp://blogs.unity3d.com/2014/05/20/the-future-of-scripting-in-unity/

  • 8/17/2019 Unity for Software Engineers

    28/28

    Reference

    Unit & Integration Testing

    https://github.com/catburton/UnityUnitTesting

    http://blogs.unity3d.com/2013/12/18/unity-test-tools-released/

    http://blogs.unity3d.com/2014/06/03/unit-testing-part-2-unit-testing-monobehaviours/

    New UI Systemhttp://blogs.unity3d.com/2014/05/28/overview-of-the-new-ui-system

    Jenkins plugin: https://github.com/jenkinsci/unity3d-plugin

    https://github.com/jenkinsci/unity3d-pluginhttp://blogs.unity3d.com/2014/05/28/overview-of-the-new-ui-system/http://blogs.unity3d.com/2014/06/03/unit-testing-part-2-unit-testing-monobehaviours/http://blogs.unity3d.com/2013/12/18/unity-test-tools-released/https://github.com/catburton/UnityUnitTesting