Unity & Windows 8 Starter Kits - Windows 8 App Factor
Some of the other posts Here are the other posts in the series.
Post 1 | Windows 8 and Windows Phone 8 .NET Development Overview - Windows8AppFactor | https://blogs.msdn.com/b/brunoterkaly/archive/2013/05/17/windows-8-and-windows-phone-8-net-development-overview-windows8appfactor.aspx |
Post 2 | Understanding XAMARIN – Create iOS, Android, Mac and Windows apps in C# | https://blogs.msdn.com/b/brunoterkaly/archive/2013/05/18/understanding-xamarin-create-ios-android-mac-and-windows-apps-in-c.aspx |
Post 3 | Windows 8 Game Construction using Scirra’s Construct 2 | https://blogs.msdn.com/b/brunoterkaly/archive/2013/05/19/windows-8-game-construction-using-scirra-s-construct-2.aspx |
Introduction This post is the 4th in a series about providing additional content for the Windows 8 App Factor learning series.
- This post has two goals:
- Describe the product Unity
- Point developers to other Windows 8 Starter Kits
Quick Facts Here is some quick facts about Unity.
- Unity (also called Unity3D)
- A cross-platform game engine with a built-in IDE developed by Unity Technologies.
- Main advantage is that you are working in an authoring environment, not C++ in Direct3D.
- Direct3D is not for the feint of heart.
- You can also port to multiple platforms easily.
- Primary Use
- Develop video games for web plugins, desktop platforms, consoles and mobile devices
- The things that simplify a developer's life
- Asset Pipeline
- Work with output from modeling software
- Play with materials and textures easily
- Building Scenes
- Using building blocks (PreFabs, GameObjects, Components)
- Iterating fast
- Just hit "play" avoid long recompilations
- Scripting, not C++
- Less code means less headaches
- Networking
- Easily implement multi-player games
- Asset Pipeline
- Developer Audience
- Utilized by over one million developers
- Focused on
- Unity is primarily used to create mobile and web games
- You can also deploy games to consoles or the PC
- Languages
- Written in
- The game engine was developed in C/C++
- Supports
- Able to support code written in C#, JavaScript or Boo
- It currently supports development for iOS, Android, Windows, OS X, Linux, web browsers, Flash, PlayStation 3, Xbox 360, and Wii U
- Written in
- Origins
- It grew from an OS X supported game development tool in 2005 to the multi-platform game engine that it is today
- Latest Version
- The latest update, Unity 4.1, was released March 2013
- 2 versions
- The game engine is downloadable from their website in two different versions: (1) Unity and (2) Unity Pro
Unity - What it supports for Graphics APIs The graphics engine uses the following APIs.
Graphics API | Supported by | Description |
---|---|---|
Direct3D | Windows, XBOX 360 | Direct3D is part of Microsoft's DirectX application programming interface (API). Direct3D is available for Microsoft Windows operating systems (Windows 95 and above), and for other platforms through the open source software Wine. |
OpenGL | Mac, Windows, Linux | OpenGL (Open Graphics Library) is a cross-language, multi-platform API for rendering 2D and 3D computer graphics. Developed by Silicon Graphics Inc. in 1991. OpenGL is managed by the non-profit technology consortium Khronos Group. |
OpenGL ES | Android, iOS | OpenGL for embedded systems such as mobile phones |
Proprietary APIs | Wii | Set of C++ classes that allow you to connect to your Wii remote through Windows' HID interface to send and receive commands |
Key features in programming graphics and games Here are some examples of the capabilities the modern game programmer needs.
- Bump mapping
- A technique in computer graphics for simulating bumps and wrinkles on the surface of an object
- Makes a rendered surface look more realistic by simulating small displacements of the surface
- Example
- Reflection mapping
- Efficient image-based lighting technique for approximating the appearance of a reflective surface by means of a precomputed texture image
- Is more efficient than the classical ray tracing approach of computing the exact reflection by tracing a ray and following its optical path
- Example
- Parallax mapping
- An enhancement of bump mapping.
- An example is stone walls that have more apparent depth and thus greater realism
- At steeper view-angles, the texture coordinates are displaced more, giving the illusion of depth due to parallax effects as the view changes
- Example
- Screen space ambient occlusion (SSAO)
- In realtime, it approximates the way light radiates in real life, especially of what are normally considered non-reflective surfaces.
- For objects that are close together areas tend to block out or occlude ambient light, hence they appear darker.
- Looks more realistic. Compare here.
- Dynamic shadows using shadow maps
- Shadows are added to 3D computer graphics in realtime
- Example
- Render-to-texture
- Rendering to texture, or "texture baking,” allows you to create texture maps based on an object's appearance in the rendered scene.
- Example
Game Types Video games can be categorized into different genres, which is nothing more than a fancy way to categorize games based on the gameplay interaction.
- In the action game category, you will find some familiar approaches to gaming, such as a fighting game, a pinball game, ball and paddle, and first-person shooter, to name a few.
- First Person Shooter
- One of the more popular approaches to creating action games is first-person shooter, which is a video game genre centered on gun and projectile weapon-based combat through a first-person perspective
- Razor Salvation
- This is a Windows 8 title that leverages the FPS approach (first-person shooter)
- https://apps.microsoft.com/windows/en-US/app/razor-salvation/e501241f-0574-448d-853b-d757d91766ba
- First Person Shooter
- For additional genres, see https://en.wikipedia.org/wiki/Video_game_genre
Top-down perspective AKA bird's-eye view, Overworld, overhead view or helicopter view.
- Used be popular with 2D role playing video games
- SimCity
- Pokémon
- Railroad Tycoon
- The Legend of Zelda
- Grand Theft Auto
- Microsoft GunPowder
Unity Editor interface
You will need to learn the user interface.
Unity and the demos A lot of great examples are available to give you a clear picture of what is exactly possible with Unity.
- Check out demos below
Asset Workflow
You generally need a 3D modeling package to create a rough version of your asset. Maya3D is typically used.
A scene contains a collection of assets.
Key Relationships At a high level, here is the way to think about how scenes are constructed
- Assets - Examples
- Materials
- Materials have textures
- Materials are applied on to GameObjects
- Animations
- Animations are applied on to GameObjects
- Sound Files
- Sound files are added to GameObjects
- Materials
- Unity defines the following components:
- Scripts
- Mesh Renderer
- Animation
- Audio Source
- You can group things together with PreFab
- Prefab is top level component for GameObjects
- GameObjects + Components = PreFab
- Think of GameObjects as types and PreFab as real live obects
- You can clone PreFabs and all clones can update in unison
Creating Scenes Scenes contain the objects of your game
- Scenes contain the objects of your game
- Scenes instantiate PreFabs and GameObjects
- Scenes have cameras and act as the eyes for the scene
- The player looks through the camera
- Cameras can be pointed and positioned
- Scenes have lights and create shadows
Grid App Templates There are a number of samples that demonstrate the use of the Grid App template available on CodePlex.
- With each sample, you typically get both C# and JS versions:
- Source (C# and JS)
- Package
- Snapshots
- Documentation
- https://www.codeplex.com/site/search?query=win8template
Examples Cover many categories
News | Travel | Baby Journal | Pictures |
Financial Advisor | Recipes | Shopping | and more |