Making console games in Unity Tomas Jakubauskas
Making console games in Unity History Getting started Development workflow Limitations and requirements New input methods Q&A
History Wii dev started in 2007, first game out in 2008 Xbox 360 dev started in 2010, first game out in 2011 Playstation 3 dev started in 2010, first game out in 2011 Unity is getting ready for next-gen!
Why develop for consoles? Xbox 360: over 66M sold o Over 18M Kinects sold o Over 40M Xbox Live subscribers Playstation 3: over 62M sold Nintendo Wii: over 95M sold Parallel market to mobiles, not dead yet
OK! Where do I start? Become a licensed developer o Complete a licensing agreement with platform holder o Complete a detailed NDA Xbox 360 - www.xbox.com/developers Playstation 3 - www.scedev.net Nintendo Wii www.warioworld.com
Hardware & SDKs Ordered online after becoming a licensed developer Xbox 360 and PS3 tools integrate with Visual Studio o Visual Studio Pro comes free with every Xbox 360 kit. Development and testing done over Ethernet o Easy to share hardware Can use Unity with testkits o Devkits needed for native plugin development
Unity licensing Console licences are per-title o Price varies depending on title-type: retail DVD, XBLA, PSN, FunLabs. Trial licences o Contact sales with proof that your studio is a licensed developer News and discussions in private mailing lists o Unity engineers o Other users of Unity for consoles Source-code licences available
Unity builds Console support comes as add-on packages o o Install over an existing copy of Unity Extended documentation and samples Workflow is the same o Build And Run Deployment options o Xbox 360 Copy to HDD (Ethernet) DVD emulation (USB) o Playstation 3 PC hosted (Ethernet) PSN Submission Blu-Ray Disk
Debugging Unity 3.5 o Native tools (PIX, XbPerfView, GPad) o Crash dumps (runtime symbols provided) o Script symbols generated o Explicit null checks o Built-in CPU profiler Next version o MonoDevelop support for Xbox360 (in QA now) o Built-in GPU profiler for Playstation 3
Can we ship the game now? Not yet There are limitations And specifics And requirements And even new possibilities!
Limitations? Nothing serious! Limited memory o 512MB unified on Xbox 360 and 256MB/256MB video/system on Playstation 3 o Devkits provide extended memory to help with the initial port o Native tools help in reducing texture memory (mipmap usage statistics) o Built-in profiler displays memory usage in various areas PowerPC CPU architecture o Scripts execute slower than on your beefy x86 desktop machine o Use built-in profiler to find bottlenecks
Specifics: Scripting Ahead-of-time (AOT) script compilation o Platform owners do not allow JIT compilation for security reasons o Limited support of generics and LINQ No duck-typing: o Wrong: var a = go.getcomponent<meshrender>(); o Right: var a : MeshRender = go.getcomponent<meshrender>(); Unhandled managed exceptions are not caught o Work in progress o Runs faster though Code stripping helps decrease memory footprint.net Marshalling allows to interface native code
Specifics: Native code access? Yes! o o o Xbox 360 DLL Access D3DDevice Playstation 3 PRX Access Sony SPURS Wii links directly to UnityWii library Implement rarely used features for your game o Also those that Unity doesn t expose yet Reuse existing C++ code base Extensive manual: www.mono-project.com/interop_with_native_libraries
Specifics: Graphics No fixed-function pipeline o Just write vertex and fragment programs o Avoid ShaderLab combiner effects Xbox 360 has one fixed resolution: 720p Playstation 3 supports SD and HD resolutions Hardware MSAA is not available o FXAA3 post-process effect gives similar results Optimised skinning o Xbox 360 on GPU o Playstation 3 on SPU
Specifics: Graphics (part 2) Video playback using native APIs o UnityEngine.X360VideoPlayer for WMV files o UnityEngine.PS3VideoPlayer for MPEG4/AVC/DivX files Editor supports graphics emulation o Find unsupported materials easily Multi-threaded rendering o Make use of those Xbox 360 cores
Specifics: Other No Mono threads on Playstation 3 Certain APIs not yet available o WWW for Xbox 360 will be ready in the next build o MovieTexture is replaced with native APIs Xbox 360 is a 4-user machine
Requirements: Title id Every game gets one Binds network services Xbox 360: o Game configuration (SPA) o _SpaConfig.cs o PartnerNET Playstation 3: o Trophy signature
Requirements: SPA - Stats At least one leaderboard Must be in active session to submit new stats o UnityEngine.X360Session Single-player mode too!
Requirements: SPA - Presence Broadcast player in-game status. o UnityEngine.X360Presence API.
Requirements: SPA - Achievements Achievements and gamer points o Award using UnityEngine.X360Achievements API Different rules for: o Retail titles o XBLA titles o Kinect Fun Lab titles
Requirements: Trophies (PS3) Signature key provided by Sony Packages are created using SDK tools o Award using UnityEngine.PS3TrophyUtility
Requirements: Other XBLA / PSN games must have a trial mode o DRM functionality in UnityEngine.PS3DRMUtility and UnityEngine.X360Core o Needs extra menu items to exit to the market place Technical certification requirement list is in the SDK o Unity handles as many TCRs as possible o Developers need to be aware of certain TCRs and work apropriately
So what are the new possibilities?
You guessed it - Input! Controllers Playstation 3 Move Xbox 360 Kinect o Skeleton tracking o Camera streams
Controllers The usual story o Xbox 360 pad o PS3 Sixaxis o UnityEngine.PS3Pad Sensor filtering Vibration InputManager UnityEngine.Input API
Playstation 3 Move Fully supported o Including Eye Toy 2 camera o Accessed via UnityEngine.PS3Move o Can access camera feed for calibration
Johann Sebastian Joust Innovation Award o 12th Annual Game Developers Choice Awards o [Video]
Xbox 360 Kinect Skeleton tracking Camera streams Microphone Speech recognition Fitness API Editor integration
Kinect Skeleton Tracking Hand refinement Smoothing Biometric identification Full API exposed o UnityEngine.KinectSkeleton o UnityEngine.KinectIdentity
Kinect Fun Labs: Air Band First Unity Xbox 360 title Features o Skeleton tracking o Video post-processing and super-composition o Video recording and Youtube publishing o [Video]
Kinect Camera Streams Full API exposed o UnityEngine. KinectCamera o UnityEngine. KinectImageStream
Kinect Fun Labs: Mutation Station Another Unity Xbox 360 title Features o Camera streams o Depth-stream based video effects o [Video]
Kinect Editor Integration Skeleton tracking o Prototype gesture code instantly Camera feeds o Prototype video effects instantly
Other Kinect features Easy script access o o o Microphone void MyAudioDataHandler(float[] data) { } KinectAudio.OnMicData = MyAudioDataHandler; Speech recognition void MyPhraseHandler(string phrase, float confidence) { } KinectSpeech.OnRecognitionPhrase = MyPhraseHandler; Fitness KinectFitness.GetFitnessLevels()
Hey, did I forget Nintendo Wii? Nope, but Unity 3.5 is the last version with Wii support o That is why we give it less attention However Wii support in 3.5 is mature o o DVD and WiiWare titles supported LotCheck requirements handled (Strap reminder, Home button, disconnection dialog, disk error handling, etc.) Some difference from other consoles o o Only fixed-function JIT enabled
Final notes Less restrictive release schedule for console runtime We can profile your game prior to submission We take your input on what to improve o And what APIs to expose o And what your next game will require
Q&A