Download and install the Windows SDK here.
Go to Start -> Settings -> Update & Security -> For developers -> Use developer features and select Devloper mode.
Install and download Visual Studio 2017 here.
Ensure the following workloads are installed.
To compile this application, the mixed-reality version of Unity (MRTP4) used in the development of Pinball Lizard is required. It’s a special Unity build with the mixed-reality toolkit built in. Install Unity by selecting Windows Store options and accepting defaults for other options in the Wizard. Once installed, sign into Unity.
Open Unity.
Once signed in, click ↑ Open and locate and open the Pinball Lizard Unity project.
The Unity code can be found under the Unity folder at the root of the Pinball Lizard source code. It is a copy of the production code that was showcased at the Game Developers Conference (GDC) 2018. Open the project folder with the Unity editor, and then load Basic Scene.
Now you can see all of the game objects and scripts created during the development of Pinball Lizard. Any modifications here would deviate from the original game experienced at GDC 2018.
From here, provided you have a mixed-reality headset plugged in, you can press the Play button at the top middle of the Unity 3D editor and interact with the Unity part of the game.
***Note: At this point in the guide, the game’s backend is not functional, which means the game will not play as intended. You will only be able to interact with the tutorial screen.
Pinball Lizard uses Best HTTP (Pro) to facilitate the connection between Unity and Azure. Without this plug-in, the game will be stuck in tutorial mode. To use this plug-in, a license is required. If you want to deploy this yourself, you will need to obtain a license key.
Learn more or download Best HTTP. You can also search for and download Best HTTP from within Unity by searching for it in the Asset Store.
Once you have downloaded the Best HTTP Pro asset, import it into your Pinball Lizard Unity project.
***Important*** Right-click the parent Assets folder and reimport all assets.
The Unity Game Engine needs to communicate with the Azure Functions endpoint and must be aware of it before the game is built into a Universal Windows Platform (UWP) application. If this is not enabled, the application will never interact with the enemies.
You can find the file that needs to be modified at the following location:
<pinball lizard root>\unity\Assets\Scripts\WebSocketClientSingleton.cs
Modify the following values and press CTRL + s to save:
private const string address = "wss://<INTERNAL\_RELAY_IP>:8085/ws"
private string auth = "<INTERNAL_RELAY_AUTH_TOKEN>
***Note: These values can be found in your Function App settings.
***Note: The Unity Game Engine needs to be aware of the Azure Functions endpoint prior to building, either through local Azure Functions (using 127.0.0.1) or Azure Functions running on Azure.
In order to install Pinball Lizard in a reliable way, you need to build the code into a UWP application that is specifically targeted for the mixed-reality headset.
The build settings must be set in Unity as follows:
- Platform: Windows Universal Platform
- Target device: Any device
- Build type: D3D
- SDK: Latest installed
- Build and run on: Local machine
- Copy references: True (check box)
You can optionally enable debugging to see what is happening as the game is being played.
Learn more about mixed reality.
Press play to start the game. Make sure to keep headset at eye-level when you press play. Press the spacebar when the cursor is in the game window within Unity to generate a new instance.
Pinball Lizard was developed using the Samsung Odyssey with motion controllers, although the game will work on other mixed-reality headsets. One caveat is that it requires motion controllers.
Microsoft has merged development of HoloLens into its mixed-reality platform. Note, however, that we used an older version of the HoloToolkit, specifically the MRTP4 development build. This gave us the additional functionality we needed to complete this project.
With the C# application code built, you can now use Visual Studio to create and deploy the UWP application. This installs the Pinball Lizard application into the mixed-reality portal on your dev machine.
In Visual Studio, be sure to change the build configuration (in the top middle of the screen) to X64 Release and then build toward the local machine.
Learn more about the UWP application and Visual Studio.
When you’re planning your game, don’t forget to visit azure.com/gaming to learn more about how Azure can help. See how easy it is to build, launch, and scale across any platform with Azure. You can start a free trial with $200 in credit by visiting azure.com/free.