Hey, everybody, welcome. Let's go ahead and get started with today's presentation, Building Better Games with Unity and Microsoft Azure. First, let me introduce myself a little. My name's David Antognoli, and I'm a game developer. I got started in the game industry as a designer working on console games. I worked on the blood pumping action title Dora the Explorer as soon as I finished college. And I did a couple other Wii first-person shooter games. But eventually, I decided I would enjoy making some of my own games. So now I've moved to independent game development and teaching others how to create great games at Columbia College Chicago. So we have a demo packed session today. And what we're gonna do is create a PC racing game in Unity that uses an Azure backend for leaderboard and telemetry data. First, I'm going to briefly discuss some ways to use Microsoft Azure to add motivating content for your players as well as to inform your game design decisions. And next, I'll step you through a demo of how to set up the Easy Tables backend in the Azure web portal. And after that, I'll step you through using the Azure Mobile Client SDK to connect a Unity game to the new backend that we just created. So the first part of that will be a lot of setup, cuz there's a number of prerequisites we need to get this working. But then after that, I'll show you how easy it is to actually use the Azure SDK to add some really cool online features to your game. So at any time throughout the presentation, if you have questions, be sure to enter them in the chat and we'll get to them as we go. Don't worry, the webinar is recorded. So if you miss something, you can always come back and review it later. Let's get started discussing how to improve your games with Azure. So I'm gonna start the presentation with a anecdote from my personal gaming history here. This is a screenshot from Elder Scrolls III, Morrowind. This was a single player game from the early 2000s. And it had a huge open world with tons of content, and it was a really fun game. I put a lot of hours into it, but I never wound up finishing it. And as I started sort of grinding away on some of these quests, it hit me at some point. I'm like, why am I still playing this? What is the point of all this? These quests are difficult and grindy. And at the end of the day, who's gonna care that I did this? So at a certain point, players are gonna finish your game's content or get bored with your game's content, even if it's really good. So that raises the question, how do we keep players interested in your end-game content? Now, here's an online game from a similar era. A little bit earlier, actually. This is Diablo II. This is what you would see if you logged in to Battle.net. Now, Diablo II, I would say, it has less content. And I would certainly say, it's less immersive. It has simpler graphics. You play the game from a more zoomed out perspective. But despite all that, I actually played through all of the content in this game and then I kept grinding away at the end-game content. And so I guess the question is, how come I'm willing to do that in Diablo and not in Morrowind? And I think the answer has to do with this small little band of characters along the bottom of this screen. Cuz when you logged into Diablo II online, you would see all of the other characters that are also playing, even though you're not actually in the game with them necessarily. You just know that they're there. And you can see the sort of gear and weapons that they've earned by completing the various content in the game. And just that fact that I knew other people could see what I was doing and see what I accomplished in the game provided a big element of motivations for me. So with that said, how can we use Azure to sort of add that kind of motivation to our games? So there's many ways we can use the Azure to improve our games, or even make games that wouldn't even be possible without cloud services, like what Azure offers. But I'm gonna focus today on two basic simple ways to use Azure to enhance your games right away, even if they might are mainly be single player. So the first is leaderboards and the second is telemetry. So if you're a gamer, you've probably come across leaderboards. They're one of the oldest social features used in games. This is a leaderboard from the arcade Pacman. So you can see that this has been around for a long time. And today, leaderboards are still used in a wide range of games. On the left, we have Angry Birds, which is like more of a casual game. And on the right, we have PlayerUnknown's Battlegrounds, which is one of the more recent competitive online multiplayer shooter games on the PC. So that pretty much is a huge spectrum, but both games are using this old form of motivation in the leaderboard. So even though leaderboards might seem rudimentary by sharing players's achievements, they do add a potent layer of motivation to your game. Leaderboards can expand the boundaries of your game beyond the player's living rooms and add meaning to their accomplishments. So, like I mentioned with Diablo, the fact that I knew other people were playing this besides me and other people could see what I was doing added a lot of meaning for me. And drove me to keep playing and trying to accomplish more. And players on top of the leaderboard can become important figures in your game's community, especially today with the wide range of social websites and features that gamers are used to. So as you'll see shortly, we are going to use Easy Tables in Azure to make it easy to build a backend for a leaderboard. Now the second way to build better games with Azure that I'm gonna be going over today is recording telemetry data. Telemetry data is collected remotely. And so in games, it improves our understanding of how players use our games. We can use telemetry to keep tabs on how our game's performing for actual users. And we can also see what our users are actually doing in our game. So with telemetry, we can answer some key questions about our player's experience. Things like, how long is the average player session? Where do players consistently have problems in our levels? And when do players quit? And how did a design change affect how players are actually behaving in our game? So these are all things we can answer by tracking what players are doing and tracking how our game's reacting with telemetry. So as you can see in this screenshot from Heroes of the Storm, you can even ask players directly about their match experience. And you can ask them quite directly how they feel about content in your game and then record their feedback as telemetry. Telemetry is also invaluable for informing what areas we should invest in our game. We can use it to reveal what content and features in our game players are using the most, and we can also see what players aren't really interested in. And you can also use telemetry to give you empirical evidence about your design decisions. So this is helpful for distinguishing the opinion of a single designer, or a single player, as opposed to the actual statistics recorded from all of the players playing the game. And so you can see in this screenshot developers can actually track which characters or which abilities are leading to players winning the most, or which are not that successful. And as something stands out as exceptionally high or too low, developers can actually react to that and make changes to the balance of the game and try to even things back out. All right, so let me show you what we're actually gonna make today. So what we have here is a simple racing game that I've put together with Unity Standard Assets. We've got the vehicle's package and the prototyping package. And whenever the player wrecks into a wall the game is gonna save that location in 3D space and upload it to our Azure backend that we're gonna make in the demo as telemetry data. And then we can use that data to put together a heat map, which I'll show you in a little bit, about where the player's crashing. And we can use that to figure out how to adjust our racecourse level design. And if the player, when they finish a lap, if they happen to get a high score, the game will ask them to enter their name. And it will save their name and their time and send that to Azure for the leaderboard that we're gonna put together. So here's the leaderboard, you can see it's just simply showing the player names and the player times. And I think this is really all the information that we need in order to add an extra layer of motivation for the player. But at the end of the presentation I'll give you a few ideas about how to extend this. And here you can see the heat map, which is going to draw a red sphere anywhere on the track that a player has crashed into the wall. And this is gonna allow us to sort of analyze where the difficult sections of our track are and where maybe the easier sections are. And if I look at the top left corner here, I can see that this second turn is a little challenging. There's a lot of times where players have wrecked into this thing. And so if this was intended to be an easier track, I may wanna consider extending the width of that section of track to make that curve a little easier. On the other hand, if you take a look at the right-hand section of the track, it's quite a bit wider. And even though there's a bunch of little obstacles in the way, players don't seem to really be bumping into them. So if I wanted this to be more difficult, I should maybe consider adding even more obstacles, or perhaps adding some extra curves there. Or come up with some other game mechanic to make this section a little bit more dynamic and interesting. All right, now that you've seen what we're gonna make, let's get started with the first demo section of the presentation. In this first demo, I'm gonna walk you through how to set up an Azure mobile app backend with Easy Tables using the Azure portal, it'll take about 15 minutes. And later in the session, we'll actually connect to this backend community and then use it to store our telemetry and leaderboard data. So there are some requirements to follow this demo and, first of all, the first thing you're gonna need is an Azure subscription. There is a free Azure trial you can use, and that will work just fine for the demonstration. Or alternatively, another thing you might wanna look into are the Visual Studio Dev Essentials, which also gives you some free Azure credits every month that you can use. And then those will work fine for the demo today as well. All right, so to get started, we're gonna need to log into the Azure portal, which is just portal.azure.com. And once you get logged in this is what it will look like. Now if you wanna learn all about Azure and everything you can do from the portal, we have separate resources that I can refer you to at the end of the presentation. But for today, I'm just gonna be discussing the features we actually need to use. So this is gonna be from the perspective of a Unity developer that wants to get their game connected to a cloud database as quickly and simply as possible. So once you're logged into the portal, you'll see the dashboard, and we wanna do first is look for the New resource button up here. So let's go ahead and click that. And the thing we're gonna actually create is called a mobile app. So it's under this Web + Mobile section. And here we see the Mobile App, so go ahead and click that. And we need to give a name to our new mobile app, so I'm gonna call it super-race because we're making this super racing game. And I'm going to go ahead and let Azure create a new resource group called super-race. And that'll just help me keep all of my Azure resources linked together so I can easily manage them. And Azure's gonna create a new app service plan for me, and you can see it's gonna be in the South Central US location. If you wanted, you could not use the default one and create your own, and customize it however you want, and pick where it's gonna be. But for the demo, I'm just gonna be using the default selections for this stuff so we can get up and running as quickly as possible. So I'll just go ahead and stick with the new one that Azure wants to create for me by default. And I will click Create. And at this point, Azure's gonna go ahead and start spinning up this new resource for me. So that'll take just a moment. And while we're waiting for it to finish, we should talk a little bit about the fact that this thing is called a mobile app. That doesn't mean that we're gonna actually have an iOS or an Android build that while we're finished making this on the Azure portal. It just means we're creating a backend that we can use to connect to from another app. So the app that you connect to this from could be a mobile app, but in our case we're actually gonna make a PC game in Unity. And that's what we're gonna use to connect to this mobile app backend. So even though it's called a mobile app, it doesn't have to a mobile app. It could be, in our case it's not going to be. And I can see now this is actually finished. So I can click Go to resource or I could click on All resources here and just find my super-race mobile app here. And I'll click on that. And the next step here will be to scroll through this left-hand side menu until we see the section for Easy Tables. So go ahead and click the Easy Tables. And once this new blade, these are called blades that open up in the Azure portal, when it's open we can see this little notification along the top that says we need to configure Easy Tables, Click here to continue. So let's go ahead and just follow along Click that, and it's explaining to us that there's essentially two steps to this. So first is we need to connect a database. And it says, you need a database to use Easy Tables. Click here to create one. So let's go ahead and do that. And in the Data Connections blade, let's click the Add button. And we'll leave this as an SQL Database. We need to configure the new database, so go ahead and click here. And since we don't already have one, we're gonna go ahead and create a new database. And we need to give it a name, so we'll call it super-race-db. And we actually need a new server to host this database. So I'll click there and give the server a name, and we'll just call it super-race-server. And I need a new username and password, so I'll just come up with that real quick. And finally, I can choose the location. And I know that my mobile app was actually hosted on the South Central US Azure location. So I'm gonna go ahead and choose South Central US for this as well because we wanna keep these resources in close proximity just to speed things up a little bit. So I'll go ahead and hit Select, and I'll choose Select again. And finally, I need to go ahead and verify a name for this connection string. The default name works just fine, but you do have to click it and verify it, so I'm gonna just choose OK. And then I'll choose OK again. And you'll see in the notifications area again that the Azure is creating this new database and new database server for us. So this step will take a few moments again. And during this time, I'm gonna be proactive and go ahead and start working on creating my new Unity project that's ultimately gonna connect to this Azure backend. So I'm gonna give it a name. I'm gonna just call it Super Race as well. And it's gonna be a 3D project, and so we'll go ahead and create that. So here is my new Unity project. And I should mention that the steps we're going through today will only work on Unity 2017.1 and above. So you're gonna wanna check and see that you have the most current version of Unity available to you. And it needs to at least be above 2017.1 because this demonstration is gonna use some of the newer features that came out in Unity 2017, so you have to be on 2017.1. All right, so let's go ahead and flip back over to Azure and see how we're doing. And it looks like actually the new database is all set for us. So the next step, we have to go back to this Easy Tables section. But unfortunately, you do have to close it first and click back onto it in order to refresh it cuz that's the trick to getting that nice little tutorial notification to pop up for us. So I'm gonna go back to Easy Tables. And once the blade loads, there it is again, Need to configure Easy Tables, Click here to continue. And this time, I can see that we have step 1 as all set. And we are ready to do the super challenging step 2, which consists of checking this box and clicking this button. And so just like that, step 2 is done. But we do have to wait for Azure to finish initializing the backend, which shouldn't take very long at all. So while we're waiting for that, I'll talk a little about what an Easy Table actually is. And it's just going to be a really simple database for us to use that we don't have to write any code to set up, we don't even need to open Visual Studio. And also, you'll notice that we won't need to really even manage the schema very much because it's totally dynamic. And as we send data to it, the Easy Tables will adapt and add the columns as necessary. So I'll show you a little bit more about what I mean once we're all set here. And it looks like it just popped up and it's finished. So, there we go, our App Service backend is initialized, cool. Let's go ahead and close the notifications. And now I can actually click this Add button to add some Easy Tables. So let's do that, and I need to make two of them. The first one will be for the leaderboard and I'm gonna call that HighScoreInfo. And I'm gonna go ahead and allow anonymous access. But if you wanted to set up permissions, that's something you can do, or authentication. But for this sample, let's go ahead and leave it as anonymous. And so I'll click OK, and that's all set. So the next Easy Table I need to create is going to be for our telemetry, and that's gonna be called CrashInfo. And this is where we're gonna store the x, y, and z coordinates of where players crash. So I'll go ahead and hit OK there. And just to show you a little bit about what it looks like now, if I click on the HighScoreInfo table, you'll see that there's a variety of columns that are set up for us by default, including ID and DELETED. And these things are useful to have, so I'm not gonna get rid of them. If I wanted, I could click here and actually add columns through the Azure portal. But, like I said, we can actually add columns as necessary once we start sending data to the table. That can just happen automatically for us. So basically, we're done in the Azure portal now. So let's recap a little bit. We created a new mobile app, we configured a new data connection, and then we added two new Easy Tables. We added the HighScoreInfo and the CrashInfo tables. And it is important that we name them just like that. And I'll explain a little bit more about that when we get to it. But for now, just trust me and name them the same way I did. All right, so now we're ready for the second demo portion of the presentation. Here we're gonna set up a new Unity project to take advantage of the Azure Mobile Client SDK, which is what we're gonna use to connect to our Easy Table backend. I think these steps will probably take about ten minutes to get through. So with that said, let's go ahead and get started. So I got a headstart creating my Unity project, but it is just an empty project. You saw everything I did. The first thing I'm gonna have to do is add some assembly references to some packages that I'm gonna need to use in order to get the Azure Mobile Client SDK working. The first one is System.Net.Http. And Unity actually includes this DLL when you install it, but we have to add a assembly reference to get it to work. So I'm gonna right-click in the Project area here, and choose Show in Explorer just to get a quick File Explorer window open. And I'm gonna enter into the Assets directory here. And I'm gonna right-click and hit New, and I'm gonna choose New > Text Document. And I need to name this document really specifically. It has to be called mcs.rsp. And then I'll delete the old file extension there and hit Enter. And it's gonna warn us, are you okay with changing the file name extension? Yes, yes I am. And I'll right-click on this guy and then I'm gonna choose Open with, and you just wanna choose whatever text editor you like. Notepad works just fine, so I'm gonna go with that, okay? And so inside of this mcs.rsp file, I need to add a single line, and that is gonna be -r:System.Net.Http.dll. And then I need to make sure I've saved it. So as I was researching this project, this is actually something that was new to me. I hadn't seen these .rsp files, they're Unity response files. And you can add them, as long as you name it just right and add it to your root Assets directory, you'll see now that I'm back in Unity, it updated, and there it is. We can actually add instructions to the compiler, like telling it to use the System.Net.Http.dll that's built into our Unity install. So that should take care of that. There are two more packages I wanna use, but these are not included in our Unity install, so we're actually gonna have to go to NuGet to find them. So let's go ahead and go to NuGet.org and let's search for the first one we need, which is Newtonsoft.Json. And it's this first search result here. So I'll go ahead and click that. Now normally, if you're working in Visual Studio, you would use the built-in NuGet Package Manager to set up your references for your NuGet packages. But unfortunately, the way Unity works is whenever you open your Unity project, it regenerates the Visual Studio projects, and so it'll wipe out anything you've set up in Visual Studio on your own. So instead, we're gonna have to navigate to the actual package on NuGet, and then click the Manual download button here. And I'm gonna choose Save. And once that's done downloading, I'll choose Open folder. And I need to change the file extension here from what it came in as to .zip. And that's gonna allow me to double-click on this and open it up just like any archive. And I'm gonna go into the lib directory here, and then the net45 directory. And I'm gonna find Newtonsoft.Json.dll. And I wanna go ahead and drag this into my Unity project's Assets directory. So just go ahead and drag it over. If I go back to Unity, it should pop up in the project window, all right? So there's one more package that we're gonna need. So go ahead and go back to NuGet. And this time, we're gonna search for Azure Mobile Client SDK, search for that. And if you scroll down just a little bit, you should see the Azure Mobile Client SDK right here. And so let's click on that guy. And again, we need to choose Manual download, and I'll save it. And when it's finished downloading, I'll open it up. I need to, again, rename this to be a .zip, and yeah, that's fine. I'm gonna open it up and go into the lib directory, go into the net45 directory and find the Microsoft.Azure.Mobile.Client- .dll file and copy that over to my Unity project's Assets directory. Here we go. So now I'm gonna head back to Unity, and I should see that pop up in here. And what I'm gonna do next is I need to go to the File > Build Settings on my Unity project. And that should bring up the Build Settings window here. And then I need to choose Player Settings. And this is where I can actually change the scripting runtime version here from the .NET 3.5 Equivalent to .NET 4.6. And this is what we need to do in order to get, System.Net.Http and these other packages to work for us in Unity. So it's gonna tell us that we need to restart Unity for this change to take effect. That's fine, let's go ahead and do that. So while we're waiting for Unity to come back, there's another requirement that we should probably look at. And that is that you're on Visual Studio 2017 15.3 or above and that you have the Unity workload. So if you look at the Workloads section here and scroll down to Mobile & Gaming, you just wanna make sure that you have Game development with Unity checked here. And it looks like Unity's back, and we should be on the .NET 4.6 now. And so what I'm gonna do next is just right-click and create a new C# script. I'm just gonna leave the default name because this is just gonna be a junk script that I use to just make sure everything is set up right. And when I'm done, I'm just gonna delete it. So I'm going to double-click it to open it. And as long as you have your preferences set so that the external tools, External Script Editor, is set to Visual Studio 2017, it should open up in Visual Studio. So here's our new script. And I just want to test a handful of using statements here to make sure everything is hooked up right before we go any further. So at the top here, I'm just going to type using. And the first one I'll look for is System. So I'm just gonna start typing and let IntelliSense do its thing because if IntelliSense is working, then I know that I've got everything set up right. So System, and I'm gonna look for .Net, and then I'm gonna look for .Http. And if it pops up in IntelliSense like this, we know that we're in good shape. So that one's working. The next one I wanna look for is going to be using, and then I'm gonna start typing Newtonsoft, so Newton, and then I see that that's up there, so I'll hit period. And then I wanna look for Newtonsoft.Json. And I see that's showing up in IntelliSense as well, so that's working for me. And then finally, we wanna look for using Microsoft, so that's popping up, .WindowsAzure.MobileServices. So if you can get those three using statements to complete in IntelliSense, then you know that you have this stuff set up correctly. All right, so that was the whole point of this script, just to test our setup. So I'm done with it now. I'm gonna go ahead and close it. I don't even need to save it. I'll go back to Unity. And I'm just gonna go ahead and delete it because it's not doing anything for me. All right, so I think that wraps up this stage of the demo. So let's just recap a little bit cuz there's a decent amount of stuff here. So we needed to make sure that we're on Unity 2017.1 and Visual Studio 2017 15.3 and above with the Unity workload. We had to make this response file called mcs.rsp in our Unity project's root Assets folder. So it has to be in the root Assets folder. And it needs to have a single line, and that is -r:System.Net.Http.dll just like I have it there. That's the only line that needs to be in there. And then you need to save and change your scripting runtime in Unity to .NET 4.6. We had to download a couple of packages from NuGet. And change their file extensions to ZIP files. And then copy the DLLs from the lib/net 4.5 directory, to Unity's Assets folder. And then we just made a little test script to make sure our setup was working. Now if you tried this and the using statements didn't autocomplete in IntelliSense for you, I would just say that you should double check that you have the Unity workload in Visual Studio 2017 installed. And I would also try, make sure, when I switched to .NET 4.6 in Unity, it restarted my Unity program. But if you did that first or you added some of these packages since you've restarted, you need to restart Unity and then also restart Visual Studio. So that's a lot of times the issue that people have. Okay, so now we have one more prerequisite section of the demonstration. And this is where we need to update the Unity Mono security certificate store so that we can actually connect from Unity to our Azure backend. So by default, Unity comes with a version of Mono that doesn't trust any website. So its certificate store is totally empty. And in order to fix that, we're gonna use a command line tool called mozroots to update the security certificate store with the latest from Mozilla. So this is the command that we're gonna have to paste into the command prompt. So I'm gonna open my command prompt here. And this is a lengthy command, so we'll try and paste it in the chat so that you guys can copy and paste it. But if you do need to type it in, make sure you type it just right because it's important to get it just right. And also, take note that this command is assuming that you're using a default Unity install location. If you actually installed Unity somewhere different, then you're gonna need to change this a little bit and actually use the path that you installed Unity on. So I'm gonna just copy this command and paste it into my command prompt and hit Enter. And you should get a little message, where it tells you that it's downloading the latest security certificates from Mozilla. And it'll tell you what it did. And then it'll tell you it's finished. In my case, it only added one new certificate, but that's because I've done this before. If you're doing it for the first time, it should add a few more. And so once this is done, we actually have our Unity set up to access other websites with SSL. All right, so let's move on and recap. Again, there are no trusted sites in the Mono security certificate store by default when you install Unity. So we just used the mozroots command line tool to update that. And now we should be all set to talk to our Azure backend. All right, so now that we've got all the prerequisites out of the way, it's time to start building our demo in Unity. I'm gonna show you everything you need to send data to and read data from the Azure backend that we set up in the Azure portal. And this demo will take about 15 minutes to get through. So what we're gonna need to do first is go back to Unity. And I'm just gonna make a new folder in the Project window here, and I'm gonna call it Scripts. And this is just to help us stay organized because we're gonna add a handful of scripts. So go inside of that folder, and the first scripts we're gonna be making are what are called data model scripts. So right-click and choose Create and hit C# Script. And the trick here is that we need to name these just like we named our Easy Tables. So the table we're using for the leaderboard was called HighScoreInfo. And then if you need to remember, you can just go back to the Azure portal and see that we had HighScoreInfo and CrashInfo. So let's go ahead and add CrashInfo also. So another C# script, and this one will be called CrashInfo, all right? And so let's open up HighScoreInfo, and we'll go ahead and reload. And this is not going to be a MonoBehaviour. So you can go ahead and get rid of that, and go ahead and get rid of Start and Update because that's not a MonoBehaviour so we don't need that. I actually don't need any of these using statements either. But what I'm gonna wanna add here is simply a handful of properties, right? And so these properties are gonna represent the data that we wanna send to our Easy Table. So the first one in the HighScoreInfo that we need is gonna be the player's name. So that's gonna be public string Name. And the other data that we need for our leaderboard is gonna be the player's time. Because it's a racing game, so their score is essentially how quickly they finish the race. So public float Time. And we also are gonna have to keep track of an ID for each entry just to make things easy to delete and organize, keep sorted. So we'll have a public string ID. All right, and so when we eventually create a new HighScoreInfo and send it to Azure, it will actually add these columns to the HighScoreInfo Easy Table. Even though we didn't set them up in the portal, I can just do that dynamically. And this one, if you remember, is actually already there. So it will just use the existing ID data column. All right, so that takes care of the HighScoreInfo. Let's go back to Unity and open up CrashInfo. So again, it's not a MonoBehaviour, so we can get rid of all Start and Update here, and we'll go ahead and get rid of MonoBehaviour. And we can get rid of the using statements just to make it even more cleaned out. And the properties that we're gonna wanna add here are the X, Y, and Z coordinates for where the player crashed into the wall. So that's gonna be public float X. And public float Y. And public float Z. And then, finally, we are gonna wanna add an Id for this also, so string Id. All right, that's looking good. Let's make sure that we saved everything here. So I'm just gonna choose the Save All button here and go back to Unity. And it should compile, and it seems like it's working fine. And now the next step is going to be to create another script. So right-click, Create > C# Script. And this is going to be our AzureMobileServiceClient. And we're gonna use this as a singleton to make a static single reference to the Azure Mobile Service SDK. So open that up in Visual Studio. This one is not gonna be a MonoBehaviour either, so you can get rid of that and you can get rid of Start and Update. And actually, I'm gonna go ahead and paste some code in here. And I'll leave it up so that you can get a good look at it. And we'll make sure that this is available in the resources section of the webinar. But just to quickly overview, we just have a using statement here that says we're using the Microsoft.WindowsAzure.MobileSe- rvices. And this is a static class so that we know there's only ever gonna be one of these. And we have a constant here that is gonna keep hold of the URL to our Azure backend. So what we need to do is fill this in with the accurate information. So let's go back to the Azure portal. And let's go ahead and just go back to all resources here and find our super-race mobile app, and I'll click on that. And in the Overview, I'm going to look for where it says URL. And if you mouse over it, you should see a Click to copy icon. So I'm just gonna click that, and it tells me it copied. So let's go back to Visual Studio. And I'm just gonna paste that in over where it said MOBILE_APP_URL. So this is the actual location of my Azure backend, so that's set up right now. And then this is just the setup for our static property that any other class that's gonna need to connect to our backend is gonna use this Client property. And if the client hasn't been initialized yet, it's just gonna call this one line and initialize it with this endpoint. So that's all the setup we really need to get the Azure Mobile SDK working for us, so let's save. I'll just click the button to make sure everything's saved and go back to Unity. And now that we have everything set up, the next step is gonna be to test it out and make sure it's actually working and doing what we think it should do. So I'm gonna go to Create, and I'm gonna make another C# script. And this one I'm gonna call TestConnection, all right? So let's open this in Visual Studio. And we can go ahead and hit Reload. And I'm going to paste in some more code. So again, I'll walk through it so you can see it. And we'll also have links to it in the webinar. But what we have here is a class called TestConnection, and this one actually is a MonoBehaviour. So we're gonna have to make sure we remember to actually put this on a game object in our scene before we run it to make sure it works. We'll get to that. So all this does is inside the Start, it runs this TestTableConnection function. And inside of the TestTableConnection function, we are getting a new table from our client. And we're gonna go ahead and get the HighScoreInfo table just for this test. Eventually, we'll use the CrashInfo, too. But for the test, we just need to do one of them to see that it's just working in general. And so we're gonna save this table as a variable table, and we're gonna try inserting some data into it. So this TestInsertAsync function down here is going to use the function InsertAsync. And this is really gonna be the workhorse of this example because this is what we're gonna use to insert all of our telemetry and leaderboard entries into our tables. So I'm just making a new HighScoreInfo with a Name property set to Hank. And so when I run this function, it should insert this into our Easy Table on Azure, and there should be an entry there with the name of Hank. And so we're gonna await that until it's done. And once it's finished, we're gonna try and test reading the data. So we'll use TestToListAsync. And that's gonna showcase the other main workhorse of this demonstration, which is ToListAsync. And what that will do is get a hold of all the entries in the table that's on Azure and store them in a list in C# that we can then iterate through. And in this case, we're just gonna print the name of each entry that's in the list. So let's make sure this is saved, I'll hit Save All again. Now let's go back to Unity. And again, I'm gonna have to remember to create a new empty game object here, and I'm gonna call it TestConnection. And I'm gonna drag the TestConnection script that we just made onto that empty game object. And let's go ahead and run it. And it should connect to our table in Azure and insert an entry, and then read it back to me. So if we go back and look at the The console, I'm just gonna drag it out here. You'll see it says, it's Inserting data. And what I've noticed is that the first time I use an Easy Table after making it on the portal, it actually takes a little bit of time to insert data or connect for the first time. And so you should have noticed that as you watched. It didn't take forever but a couple of seconds. However, we will try it again here in a second. And I've noticed an subsequent connections go really, really fast, so we'll look and see if that's the case. So we inserted the data and then we read it back and the name is Hank. So we'll look on the Azure Portal and see if that actually showed up in it. And then let's, actually before we do that though, let's stop the game. And let's try and add another entry, just for fun. So I'm back in our TestConnection.cs and let's add another one. And I'll call this one David, and I'm gonna Save. And let's go back to Unity, and run the game one more time. And so in theory, it should go a little faster, and yeah, that was almost instant. So we inserted the new entry and then we printed out all of the entries so now we have two, we have Hank and we have David. All right, so it seems to be working but let's just make super duper sure. So I'm gonna go to the Azure Portal, and I'm going to go back and find the Easy Table section of our mobile app. And let's take a look at the high score info table, because that's where we were storing these entries and theory. And sure enough, we have two entries, we have a Hank and we have a David. And they both have times of 0 because we actually didn't provide a time in that test script, we just only provided a name. So we're stuck with the default time of 0. Now 0 is a pretty good time, I don't think anyone's ever gonna be able to beat that. So before we go any further, I'm actually gonna click this More button here, and then just clear the table. Because those scores are unfair, and I wanna make sure that we have only real, legit scores in our leaderboard. So let's clear the table. Are you sure? Yes, and so that's done. Now we are ready to move on to the next step here. But first, let's go ahead and recap a little bit. So in this last demonstration, what we did was we created data model classes. And these had to have the properties that corresponded to the data that we wanted to send into our Easy Table. The other important thing here was that they had to be named, just like the Easy Tables were named on Azure. So we had HighScoreInfo for our leaderboard and we had CrashInfo for our crash telemetry. And the next step was to create a MobileServiceClient singleton. And this was the sort of single access point that we wanna use throughout our game to connect to our Azure backend and get a hold of all of the tables and send and read to them. The last thing we did in this demonstration was actually test the client's connection with the test connection script that we went over. And we tested out InsertAsync, and ToListAsync. And we'll use that to add entries to our HighScoreInfo, and then read them back in Unity. So at this point, we should be all set up for the next step here, and this is the final demo of today's section. And in this we're gonna actually import the sample racing game that I showed you earlier. And we're gonna go over how the Unity game is gonna connect to Azure. And I think the steps involved are only gonna take a couple minutes. But then I'll spend about 15 minutes discussing the sample and showing you how it's all set up. So the first step here is actually gonna be to download the sample game assets. So we have this link here. If you paste this into your browser, it should take you a .unitypackage file that you can download. I have it already downloaded here so I'm gonna go into my downloads. And what you're gonna wanna do is make sure that your Unity project is open, make sure that you only have one Unity project open. And then just double-click this Azure Easy tables sample game assets.unitypackage file that you can download from the location on the slide here. All right, so this should be available to you in the resources of the webinar. I'm gonna double-click it, and that should bring up the Import Unity Package window here. And by default, everything should be checked and that's what we want, so make sure everything's checked. You could just hit All to make sure everything's checked, if it's not, and then hit Import. And that will bring all the sample game assets into your Unity project. And again, all these assets are primarily taken from the included standard assets in Unity. So the car and the prototyping packages I used to build the actual track. That's all available, and you can just download this package to get this sort of preconfigured setup that I've made. So once it's all imported into your project, the one thing you do have to make sure you remember to do before you test is out is go to the File>Build Settings. And we're gonna need to add the scenes that are involved in the build to this build settings here. Go to the Azure Easy tables sample game assets folder in your project after importing, open up the scenes folder. And then, just select these four scenes and drag them into the scenes and builds section of the build settings. And so once we've done that, we can go ahead and close the build settings. And I'm gonna open up the MenuScene, which is the first scene. It asked me if I wanna save the scene we've been working on. I guess I'll go ahead and do that. In case we wanna mess with that test any further at some point. So I'm just gonna call this the test scene, and Save it. And then you should go ahead and open up the menu scene, that was in the included sample. So this is just a UI, so I'm gonna go ahead and click on 2D, so it looks a little more normal. And I'm gonna go ahead and try and run it. And the first thing I'll do once it's running is just try out a race because we don't have any data in our leaderboard or our heat map. So we're gonna have to run some races to add some data there. All right, so here's the game that you should remember from the beginning of the session. And you can drive the car around with WASD or the arrow keys should work too. And as you drive through the course, Just make a point of crashing in some spots. And I would say, go ahead and crash in some spots that you think you'll be able to remember. So that when you go and look at the Heatmap later, you can just verify that there are red spheres loaded in at the spots you remember crashing. And when you go around this corner, you can go ahead and hit these fun, yellow ramps, but just make sure that you don't flip the car over. Because if the car lands on its top, it gets stuck and you won't be able to finish the race. And it's when you finish the race is when the data actually gets sent to Azure. So if that happens to you, you're gonna have to hit the Restart button and try again. I'm just gonna wreck right at the finish line here, so it's really obvious where I should expect to see some crashes on the Heatmap. And I'm gonna complete the lap, and this is where we're submitting stuff to our Azure backend. So I'm gonna go ahead and enter my name for a high score. The high scorers are not competitive right now because there's no entries, so you should get a high score no matter what, and go ahead and hit Submit. And you might notice, in the console, there's some printouts that explain that we've finished uploading the crash data, we're uploading the score, or we finished uploading the score. So if you see those log messages, at that point, you should be safe to go ahead and look at the Leaderboard. And there it is, there's my time, there's my name that I entered. If I go to the Azure Portal again, let's go ahead and refresh the high score table and I can see that David is in there with this time. It's just being formatted a little nicer in the actual Leaderboard. I can take a look at the crash Heatmap, and there's all those spots I made a point of wrecking right before the finish line. So I can see that's working out for me too. And just again to verify that, let's take a peek at the CrashInfo Easy Table. And so I can see all those crashes, they're logged and their coordinates are there. So it's all working out for me. Now, let's talk a little bit about how it's setup. So I'm gonna go and stop the game. And let's take a peek at the Scripts folder that's inside of the Azure Easy Tables sample game assets. So this is the package we imported, and now here's the scripts directory. And let's take a look first at RecordCrashInfo and yeah, I'll go ahead and reload my solution here. I can go ahead and update my line endings, so it's fine. And here we are at RecordCrashInfo.cs. And so what this script is going to do is in it's on collision enter, it's gonna see where the player crashed, and it's going to create a new CrashInfo with that location. And then when the game is finished, so we're making a list of these. We're adding all the CrashInfos to a list called newCrashes. And when the game is finished, we're gonna call this UploadNewCrashDataAsync. And if you look in that function, all that's doing is we're using this client.GetTable like we had in our test connection script. And we're iterating through our list of new crashes, and for each one of them, we're using InsertAsync. And that's, again, the same function we used in test connection. And so we're just inserting each of these new crashes into our Azure Easy Table. All right, if you go back to Unity and take a peek at the Heatmap script, you’ll see that when this thing loads up, we’re running InitializeCrashList, which is going to connect to our Easy Table. And again, run ToListAsync, just like we did in the test connection script. And so it's gonna store all of the crashes from our Azure Easy Table into this crashesFromServer variable, and then we're gonna spawn markers from that list. So for each crash that's in the crashesFromServer list, we're going to instantiate one of these markerPrefabs. And it comes in at the coordinates that are loaded from the CrashInfo that's on our Azure Easy Table. All right, the next thing we should take a look at is the Leaderboard stuff. So let's take a peek at RecordHighScore. The way this script works is when the player finishes a lap, it's going to check and see if it's a new high score. The high scores are loaded actually in the Leaderboard scripts. If you go into this UI folder and you look at Leaderboard, This is going to actually connect to our Easy Table, and download the current high scores, and then sort them here. Again, we're just using ToListAsync. And then so in RecordHighScore, we're gonna check with that list and see if we actually have a new high score. And if we do, we're gonna get the player's name. And when the player has finished entering their name, we're gonna call UploadNewHighScoreAync. And it's just gonna sort of do the same stuff we've been doing where we make a new HighScoreInfo with the player's name and their time. And then we call InsertAsync to send it to our HighScoreTable. And then again back on the Leaderboard here, we saw where it's downloading the high scores. What it's gonna do on the leader board scene is actually instantiate a rowPrefab for each of the high score entries. So the rowPrefab just had some UI fields for the player's name and the player's time. And we're just going through our list of high scores, and instantiating one of these prefabs for each of them. And that's pretty much all of the ways that we're connecting to Azure right there. So like I've mentioned, it's essentially everything that we just did in that really simple test connection script if you remember that. So inside of our assets, we had test connection. And you can see a really simple demonstration of how to connect to a table, and then use InsertAsync to store things, and ToListAsync to read things. All right, so let's recap a little bit one last time. We imported the sample game assets, and then we had to make sure that we added the scenes that are in that new package we imported to our build settings. And then finally, we just run the game from the menu scene, and did some races to get some data into our Easy Tables. And then checked out the Leaderboard and the Heatmap to see The telemetry and leaderboard data in action. So at this point you should have everything you need to start building Unity games with this type of Azure functionality. And returning back to the beginning of the presentation you can use this stuff to add a lot of motivating features for your players. So I do want to sorta talk about some next steps you could make now that you have these sorta basics out of the way. Regarding the leaderboards, I think it's important to remember that everybody likes winning, but not everybody can be on the top of the leaderboard. So what I would start thinking about as I move to extend this example and build on it, would be what are some of the more advanced stats that you could start tracking. Because the more categories that you track in the leaderboard, the more ways people can have fun with your game. So you can start thinking about a list of a leaderboard for who has the most crashes in a play through, or maybe you wanna track who's driven the most miles in the game, and I personally think the jumps are pretty fun. So even if they don't help me win the race, maybe I could start tracking how long players spend the air or how many times they spin around in a given lap. And so, in that way, I would just try to come up with some fun, silly stats to start tracking, in addition to the serious competitive ones, to just give the full range of my players something to look at and have fun with. And then, regarding telemetry, I would start thinking about adding some more features to the game. And then using telemetry to sorta track how they're performing, and how players use them. One easy thing you could do would be to add a second type of car. And sort of slightly modify its attributes. So you can give it maybe better turning speed, or slower max speed, or something like that. And then, you can use telemetry to sort of track how often each player picks what car and you could use telemetry to track the success each car has. So we could see the average lap time for each type of car and if one car tends to complete lapse way faster than the other, that's a good indication that we need of sorta rebalance our car design. Another thing you could do is to add some pick-ups or maybe some speed boost spots on the map so if you drive over it, you get a little speed boost. And then we could start using telemetry to see how often players actually go over those pick-ups or drive over those speed boosts. And this would be a good way to sorta spice up the sections of the map that don't have a lot of action already. So we looked at the crash heat map, and we noticed that there are some sections, even the ones with the ramps that not all of players are crashing. So if I added some collectibles or some speed boosts, that might actually ratchet up the intensity of those sections and make them a little bit more engaging for our players. And one last thing I would think about is we could start adding alternate routes or shortcuts to the maps themselves, and then start tracking how often players actually take which route. So we could see how many players actually try and take the shortcut or maybe they're not intended to be shortcuts, they're just different. And we can see how often players use each route. So here's the resources you can use to keep up with what we've done today. There's a documented version of this presentation so if you prefer to get a little bit more in depth info about each of the steps, you can check these links out. And then we also have links to the free trial for Azure as well as the Visual Studio Dev Essentials which you can use to get some free Azure credits. And you can find the link to Unity where you can download Unity and learn all about how to use the Unity engine with, they have a lot of tutorials there that can help you get up and running if you're not already. So that wraps up today's presentation. I hope that you can use this to start making some awesome games with Azure and Unity. Thanks again for joining us. Once again, we will be sticking around for some Q&A, so if you have any questions, don't hesitate to ask and I think that's all we got today so thanks again.