Tip:
Highlight text to annotate it
X
Hello, and welcome to this video
tutorial by Game Analytics.
My name is Simon Millard, and I'm the lead SDK developer
here at Game Analytics.
I'm going to show you how to get started with the Game
Analytics SDK for Corona.
Game Analytics has this cool tool that allows you to track
player behavior and visualize it in a ton of different ways
on our dashboards.
In this video, we're going to cover how to get started with
the SDK, how to set it up, and how to get tracking data.
We're also going to take a look at some of the cool
automatic tracking features that the Corona SDK includes.
So let's get started.
OK, so the first thing that we're going to do is test a
simple Corona SDK project with the Game Analytics plug-in and
make sure that we're sending some data to the Game
Analytics servers.
And we're going to take a look at that data to see how it
looks like.
I've installed the Corona SDK inside the Sample Code folder.
And the physics folder, you'll find a project
called Simple Pool.
And we'll be modifying this project with the game
analytics plug-in to make sure that it sends data and taking
a look at this data.
So inside this folder, you'll open the Build Settings file
as I've done right here.
And inside this file, you have to add a few lines of code to
make sure that the Game Analytics plug-in is actually
included in this project.
Now, also open the [? main.lure ?]
file inside the Simple Pool project, and you have to add a
few lines of code right here.
So just below the Required Physics line, you add the
information that we're going to be using the Game Analytics
plug-in, so require the plug-in.
And we have to set up a little bit of parameters here.
So first of all, we tell Game Analytics that
we're in debug mode.
We're going to tell Game Analytics to run in the
simulator, which makes sure that we'll be able to test it
on our computer instead of installing
the game to our device.
And, of course, we're going to tell Game Analytics to submit
some basic system information so there'll be some data for
us to look at.
The most important thing, however, is to initialize the
Game Analytics SDK or plug-in.
First of all, you'll need the game key and the secret key,
and you have to set a build name.
So the build name can basically be
whatever you want.
I've just set it to 0.1 here.
The most important thing is that whenever you update your
game, you change the build name.
And then you'd be able to segment the data on our
dashboards based on the build information.
So let's get the game key and the secret key.
Inside the Game Analytics tool here on the Game Analytics
website, I've created a studio called Game Analytics, and
under that studio I've created a game called Corona SDK Test.
If I go to the settings of the Corona SDK Test game, I'll
find my game key and secret key, and I can simply click
them and copy-paste them into this script editor right here.
So that's the game key and secret key.
And I'm going to save this.
Now, when we run this project, Game Analytics will
automatically initialize.
It'll go into debug mode.
It'll run in the simulator, of course.
And it'll submit some basic system information which we
can look at.
So let's try to do that.
Here's the Corona simulator, and we're going to have to
open the terminal window as well so we can see
the data coming in.
So I'm going to open the Simple Pool project, which was
the project that we edited.
First of all, you can see that the Game Analytics SDK is
being initialized.
You can see that we've been given a user ID
and a session ID.
And you can see some basic status information.
Now here at the bottom, you can see that some system
information has been submitted to the server.
You can see that it's a quality event.
We've got several different types of events, which we'll
talk about a little bit later.
And here you can see the event IDs, the
message that was sent.
So you can see that it was the model of our device, which is
an iPhone, of course, because we're running in iPhone
simulator mode, and you can see basic information like the
platforms, of course, since we're running this on a Mac OS
X. We'll get that kind of information when running
inside the simulator.
Most importantly, we'll get a response from the server.
And this is what indicates whether the message was sent
successfully or not.
As you can see, we've gotten a status OK message, which means
that everything worked.
So to sum up, basically, all you need to do is add a few
lines of code to your main lure file, indicating that
you'll be using the Game Analytics SDK and initializing
it with your game key and secret key and
setting a build name.
And, of course, you'll have to include the plug-in in the
build.settings file.
But that's really as simple as it is to get started with
using Game Analytics.
So as you can see, it's very easy to get started with the
Game Analytics Corona SDK.
Let's take a look at some of the more advanced features and
out-of-the-box tracking that we have
here at Game Analytics.
So I'm going to show you is some of the more advanced
features available in the Game Analytics plug-in for Corona.
We've added a few extra lines of code here to the main.lure
file, which basically tells the Game Analytics plug-in
that we want to submit average frames per second and that we
want to set the average frames per
second interval 10 seconds.
This basically means that when the game is started, with an
interval of 10 seconds, we submit the average
performance, or frames per second, of the game.
And, of course, this will give you a very good indicator of
whether the performance of your game is lacking in
certain areas.
So this is just another example of some of the
out-of-the-box tracking that you can do very easily.
And there's numerous other examples of this which you can
find on the Game Analytics documentation website.
Let's go to the end of our file here, because we've also
added something called custom invents.
And this is just a very quick example inside the init
function, which is a function that it's called whenever the
player chooses whether he wants to play the game as one
player or two player.
Those are the two modes that you can play simple pool in.
It's a very simple game, of course.
So if these are the lines of code that we have added, and
if the mode of choice is one player or two player, then we
check if it's one player.
If it's one player, we send an event indicating that we're
playing as one player to the game analytics servers.
If it's two players, we send an event indicating that we're
playing as two players to the servers.
The type of event that we are sending is, in this case, a
design event.
Earlier you saw us send a quality event, which was the
basic system information.
We've got numerous different types of events.
We've got the quality events, which are for system
information, debug information,
errors, and so forth.
We've got the design events, which are for gameplay,
gameplay-related events basically.
We've got business events, which are for in-app purchases
and that kind of thing.
And we've got user events, which are any information
about the user that you want to segment your data based on
later on the dashboard.
So here we're just calling the Game Analytics plug-in,
telling it to submit a new event.
The type of event is a design event, so that's the event
category, if you will.
And the information that we're sending is basically the event
ID, which we're setting to game launched either one
player or game launched two player.
So that's as simple as it is to send a custom event with
Game Analytics, and we'll be able to create a custom
dashboard on the website and look at this data for this
specific customer.
So now that we've added both the average frames per second
events and the custom events, let's try
running our game again.
So we've got the simulator here, and I'm going to run the
simple pool game.
And as you can see, just as before, the
simulator's loaded up.
Game analytics is initialized.
We've got a user ID, a session ID, and we've submitted some
basic system information, quality event, and we've
gotten the response status OK.
So everything seems to be fine.
We've also gotten an average frames per second event.
And you can see the value is just around 30 here on average
for both of these events.
Of course, they're submitted with an interval of 10
seconds, as we set up in the code.
And the status of all these messages are OK.
So so far so good.
Let's try and select two players.
So now, as we select two players, you can
see the game starts.
We're ready to play.
We can start ping-ponging the ball and so forth.
But another event has also been sent
down here in the console.
We can see that a design event called "game launched two
player" has been sent, and the response from the server was
"status OK." So it seems that our custom event worked.
Of course, we can make custom events for
numerous different things.
We could make a custom event for whenever the players score
a point by putting a ball into a hole.
And we can make custom events for winning the game, losing
the game, changing the color off the table, and so forth.
But let's close this real quick and take a look at the
dashboards.
So here we've got the Game Analytics website.
And I've set up the dashboard here in the Explorer tool,
which you'll find inside the menu.
I've chosen to show the average
frames per second event.
You can see here, basically search for
average frames per second.
And I've set it up to show as a graph.
I've chosen to show only information
for January the 16th.
And you can see that the average frames per second was
lying at a flat 30 frames per second on this date.
That's just an example of how you'll be able to
visualize your data.
You can also show it as a bar chart and so forth.
So very simple.
Another example here, a little more advanced, is the
dashboards.
As you can see right here, we've created a custom
dashboard, which you'll be able to find inside the menu
right here.
And we've created a custom dashboard showing whether one
or two player mode has been selected.
So the game preference dashboard right here.
And as you can see, one player is the option that has been
chosen 66.67% of the time, and two play has been chosen only
33.33% percent of the time.
So this gives you a rough idea whether the players prefer to
play the game in the one player or two player mode.
Just a very quick example showing you some of the more
advanced features of what you could do with Game Analytics.
Game Analytics comes with a ton of cool features.
It's very easy to set up, and it's completely free.
So if you're interested in more information, go to
support.gameanalytics.com.
Thanks for watching.
[MUSIC PLAYING]