WindowsGame
Development withUnity 5
Jiri Danihelka
• Full 2D & 3D support
• Terrain building & SpeedTree support
• Physics
– Nvidia Physx3 & Box2D
• Over 22 platforms supported
• Real time GI & Physically based shaders
• Mechanim Animation system
• Asset Store
Major Components
• Use Visual Studio to edit & debug code
• Integrates VS with Unity
• Provides
– Shader syntax highlighting
– Code templates
– Intellisense
– Full debugging support
– Better debug visualization
Visual Studio Tools for Unity
VSTU
• Start with one
• Blueprint of your game
• Living document, provides reference point
• Some prefer a single page
• Describes game play, mechanics, story line, and more
• Easy to get lost without one
Game Design Document
Standard Shader
• Why another shader?
• Two types – default (metallic), specular is other
• You can customize the shader
– Source available
• All new materials use it by default
• Caution when importing models
– Legacy textures may be set
New Skybox
• Skybox is a material, with a skybox shader
– 6-Sided
– Cube Map
– Procedural
• HDRI Support (High Dynamic Range Image)
• Can dynamically control properties
Lighting
• 4 types of lights
– Directional, point, spot, area
• Lighting is expensive
• What’s baking?
Global Illumination
• Real time system powered by Enlighten
• Cache can grow large, note size
Reflection Probes
• A tool for creating high-quality, localized reflections.
• Captures surround environment on sphere, reprojects as
cubemap on relflective objects.
• Place as needed through scene, smaller high-detailed objects up
close.
• Blend Probes and Box projection for hallways type
environments.
• Lightmap static
Animation
• Unity supports two animation systems
– Legacy
– Mechanim – Uses .ani file and animation controllers
• New features targeted at Mechanim
– AnimationStateBehaviors
– No more:
• animator.GetCurrentAnimatorStateInfo(0).isName(“Attack")
• 2D Root Motion
• Can use API to create animation controllers
Zombie Animations
• New AnimationStateBehaviors
• New Any State & Exit State
Entry
Idle
Any State Exit
Walk
Died
Audio
• Previously, all audio played through single AudioSource
• No control over various levels, mixing, controlling groups
• New mixer allows precise control, signal routing, effects
• Can edit in play mode
• Unity supports custom plugins
– http://docs.unity3d.com/Manual/AudioMixerNativeAudioPlugin.html
• Profiler supports audio
Coin pickup
• Typical process is check trigger, increment score
• A PlayerScore component tracks score
• Simply a variable to track inventory
• Challenges of UI / Rotation
Zombie Score
• Get references to player score
• If we hit the player, tell someone about it.
– Some will check on the player for a hit
Enabling Mobile Input
• Input system reads values (button, keys, controller, arrows)
• Input.GetButtonDown(“Fire1”)
– Works on Mobile for touch only!
• Input.GetAxis(“Horizontal”) works with keyboard
– Doesn’t work on mobile (no keyboard)
• Solution – track image position on screen and read virtual values
• Third party assets like EasyTouch
• Code exists in CrossPlatformInput
Perspective
• Default Camera Mode
• Viewing area defined by field of view
• Clipping planes define min and max viewing distance
Orthographic
• Common for 2D
• Further away objects = same size
• orthographicSize is how many units = ½ height
• Fixed height, width variable by aspect ratio
Unity UI
• Allows placement of one or more Canvas game objects
• Can overlay or project from other areas onto screen
• Allows for scaling, pixel perfect, even measurement based
drawing
• Text & Image components + script form bulk of UI components
• Based off NGUI initially, completely separate though
Canvas
• Various canvas modes
• UI Elements MUST be in a canvas
• Event system detects actions to send to components in canvas
• Three modes
The RectTransform
• Critical portion of Unity UI, used instead of Transform for UI
• Defines
– location, rotation
– Defines anchors for positioning, pivot for rotation, and size
Enhancing the game
• Pickup text
• Other effects
• Particles
– Optimized system
– Can include animations and physics
Phone Small
Tablet
2-in-1s
(Tablet or Laptop)
Desktops
& All-in-Ones
Phablet Large
Tablet
Classic
Laptop
Xbox IoTSurface Hub
Windows 10 powers a huge range of hardware…
Holographic
• Windows 10 supports device families
• Will ship with Mobile and Desktop families
• Additional will come
– Xbox, HoloLens, etc.
• Multiple builds still work
• Can use Asset Bundles to dynamically load assets
• Requires Unity 5.2 (currently in private beta)
The Build

Windows game development with Unity 5

  • 1.
  • 2.
    • Full 2D& 3D support • Terrain building & SpeedTree support • Physics – Nvidia Physx3 & Box2D • Over 22 platforms supported • Real time GI & Physically based shaders • Mechanim Animation system • Asset Store Major Components
  • 3.
    • Use VisualStudio to edit & debug code • Integrates VS with Unity • Provides – Shader syntax highlighting – Code templates – Intellisense – Full debugging support – Better debug visualization Visual Studio Tools for Unity VSTU
  • 4.
    • Start withone • Blueprint of your game • Living document, provides reference point • Some prefer a single page • Describes game play, mechanics, story line, and more • Easy to get lost without one Game Design Document
  • 5.
    Standard Shader • Whyanother shader? • Two types – default (metallic), specular is other • You can customize the shader – Source available • All new materials use it by default • Caution when importing models – Legacy textures may be set
  • 7.
    New Skybox • Skyboxis a material, with a skybox shader – 6-Sided – Cube Map – Procedural • HDRI Support (High Dynamic Range Image) • Can dynamically control properties
  • 8.
    Lighting • 4 typesof lights – Directional, point, spot, area • Lighting is expensive • What’s baking?
  • 9.
    Global Illumination • Realtime system powered by Enlighten • Cache can grow large, note size
  • 10.
    Reflection Probes • Atool for creating high-quality, localized reflections. • Captures surround environment on sphere, reprojects as cubemap on relflective objects. • Place as needed through scene, smaller high-detailed objects up close. • Blend Probes and Box projection for hallways type environments. • Lightmap static
  • 11.
    Animation • Unity supportstwo animation systems – Legacy – Mechanim – Uses .ani file and animation controllers • New features targeted at Mechanim – AnimationStateBehaviors – No more: • animator.GetCurrentAnimatorStateInfo(0).isName(“Attack") • 2D Root Motion • Can use API to create animation controllers
  • 12.
    Zombie Animations • NewAnimationStateBehaviors • New Any State & Exit State Entry Idle Any State Exit Walk Died
  • 13.
    Audio • Previously, allaudio played through single AudioSource • No control over various levels, mixing, controlling groups • New mixer allows precise control, signal routing, effects • Can edit in play mode • Unity supports custom plugins – http://docs.unity3d.com/Manual/AudioMixerNativeAudioPlugin.html • Profiler supports audio
  • 14.
    Coin pickup • Typicalprocess is check trigger, increment score • A PlayerScore component tracks score • Simply a variable to track inventory • Challenges of UI / Rotation
  • 15.
    Zombie Score • Getreferences to player score • If we hit the player, tell someone about it. – Some will check on the player for a hit
  • 16.
    Enabling Mobile Input •Input system reads values (button, keys, controller, arrows) • Input.GetButtonDown(“Fire1”) – Works on Mobile for touch only! • Input.GetAxis(“Horizontal”) works with keyboard – Doesn’t work on mobile (no keyboard) • Solution – track image position on screen and read virtual values • Third party assets like EasyTouch • Code exists in CrossPlatformInput
  • 17.
    Perspective • Default CameraMode • Viewing area defined by field of view • Clipping planes define min and max viewing distance
  • 18.
    Orthographic • Common for2D • Further away objects = same size • orthographicSize is how many units = ½ height • Fixed height, width variable by aspect ratio
  • 19.
    Unity UI • Allowsplacement of one or more Canvas game objects • Can overlay or project from other areas onto screen • Allows for scaling, pixel perfect, even measurement based drawing • Text & Image components + script form bulk of UI components • Based off NGUI initially, completely separate though
  • 20.
    Canvas • Various canvasmodes • UI Elements MUST be in a canvas • Event system detects actions to send to components in canvas • Three modes
  • 21.
    The RectTransform • Criticalportion of Unity UI, used instead of Transform for UI • Defines – location, rotation – Defines anchors for positioning, pivot for rotation, and size
  • 22.
    Enhancing the game •Pickup text • Other effects • Particles – Optimized system – Can include animations and physics
  • 23.
    Phone Small Tablet 2-in-1s (Tablet orLaptop) Desktops & All-in-Ones Phablet Large Tablet Classic Laptop Xbox IoTSurface Hub Windows 10 powers a huge range of hardware… Holographic
  • 24.
    • Windows 10supports device families • Will ship with Mobile and Desktop families • Additional will come – Xbox, HoloLens, etc. • Multiple builds still work • Can use Asset Bundles to dynamically load assets • Requires Unity 5.2 (currently in private beta) The Build