JOANNA: Hey, everybody I'm Joanna Smith,
and I work on Google+.
WOLFF: And I'm Wolff Dobson.
I work on Android.
And today, we're going to talk about Google I/O Hunt, which
is the game that we made for Google I/O 2013.
We've just open sourced it.
It's at NFCHunt.appspot.com.
And we want to tell you about what the game is and then how
you can make your own.
So the game is actually easier to show than it is to
demonstrate right here.
So we're going to a clip of Joanna and I playing this game
on the Google campus.
To put up an NFC hunt, we hide NFC tags
in interesting places.
The hunt's now set up, so Joanna is going to be our
guinea pig.
JOANNA: What I have here is I've opened the app.
And it's welcoming me, and I'm going through it.
And I'm getting to find out the story.
Now I've got Google+ sign-in option.
So I'm going to go ahead and sign in.
So the first thing is I've got a clue.
And it's got an image as well as text, letting me
know where to go out.
And since I happen to work on this floor, I know the floor
pretty well.
So let's take a look at where I think this area might be.
And I was right.
So I can immediately see a clue.
This is exactly what I want.
So I'm going to take my NFC device.
Let's scan it.
[PHONE CHIMES]
And I got a [INAUDIBLE], which means I found the first clue.
But what's really cool is I can actually scan these--
[PHONE CHIMES]
JOANNA: --in any order and they're going to show up.
So that's pretty awesome.
We usually have one or two that are easy to find and one
that's kind of hard.
Wolff!
[PHONE CHIMES]
JOANNA: Oh, and I got them all, so I get to
go to the next clue.
The picture is a slide.
And that's part of my favorite part of the floor.
So let's go down the slide.
Here I go!
Yes.
All right.
So let's get the app back up, because I already see a clue.
And sure enough, once again any order I can scan them.
And look, two more.
They're so easy.
So I've got the second one and the third one--
[PHONE CHIMES]
JOANNA: What?
This is a fake tag!
So this is a feature that we added that's really fun.
Because you can throw people off the scent and have decoy
tags all over the place.
And then you bring up this little guy.
So let's find the last real clue.
There it is.
So now you can see, once again, I'm going
to get a new clue.
And I know where the sign is.
But unfortunately, I think we're out of time.
So let's go back to the studio.
So that was our video.
A little cheesy, but obviously really fun.
And you can set up the game yourself in a number of ways--
set it up as a race, or in teams.
It's pretty cool.
But in order to make these changes, you need to actually
see it run and see how it works.
So Wolff?
WOLFF: All right.
So as you can see, we have this intro section here.
And you'll want to modify that with your own text, because
you're not actually going to be on the
floor of Moscone Center.
So we're going to import the two
products that you download.
Or actually, three projects.
We get Simple I/O Hunt.
You get Hunt Writer, which writes tags.
And you get I/O Hunt.
I/O Hunt is the full version of the game that includes
trivia questions, Google+ sign in, game services, all the
things you need.
We're going to do Simple I/O Hunt, which is the same thing,
except without the trivia questions and so forth.
And we're going to import that.
And you can modify all those strings and assets and
everything inside the resources directory.
In particular, you can modify the strings.
You can see we have lots of strings in here.
All the story strings, you can edit them any way you want.
And if I run this, you get the game running.
And it's kind of fun.
I click Let's Go.
JOANNA: So if we take a look at the screen, now that we've
got past the story and actually started playing the
game, you'll see this image.
And this image is part of the clue, letting you
know where to go.
The text might help you get there.
And the picture helps people remember, oh
wait, I've seen that.
I know where to go now.
And once they get there, they're going to find tags.
We do three tags in the game.
And the tags are actually what you need to scan in order to
move onto the next clue.
WOLFF: Right.
And so if we were to scan these tags right now you just
hold it up and go,
[PHONE CHIMES]
WOLFF: B-dink.
But these tags are empty, because we haven't written
anything to them yet.
This tag in particular came from Coveo.
They're custom printed with our own labels.
They've got this big scan area.
They're pretty neat.
But they're only write once.
Which means basically, when you write them, you
can only write 1s.
You can't write 0s.
Joanna, do we have another kind of tag?
Which is this little round guy here.
This one's an all-weather one that we got from Tagstand.
It's rewritable, which means you can
write it several times.
Which is great if you're experimenting.
It's not so good if somebody's attacking your tags and trying
to change them in the middle of the hunt.
This one's also shielded, which means you can put it
against metal.
These ones aren't shielded, so you have a
little bit more careful.
So going back to where we were, the game itself has any
number of tabs between one and three.
And when you scan them, you're finding them.
And when you scan all three, you'll go on to the next clue.
You'll obviously want to change that.
So we're going to show you how to change this screen just
using data.
So if we open up this JSON file, we have a hunt object,
which contains a list of clues.
So a clue has this display text.
In this case, it's saying, go find this robot.
It's got an image, which we'll show you how to add.
And then it's got a list of tags.
And the tags can be any arbitrary string.
I have them numbered because that's easier to remember.
We also have a trivia question.
If you're playing the full version of the game, this
question is there.
If you're not using the full version of the game, it'll let
us ignore this question and keep going.
And so we have another clue down here.
This one only has one tag to find.
It's pretty straightforward.
All you have to do is make sure that you have unique tag
names for each thing and that you set the
text the way you want.
Now, this JSON file ends up inside your app inside the raw
directory inside a zip file.
What's in that zip file?
Let's take a look.
If we look inside Hunt Data, you can see it's a series of
images and this JSON file.
And it's actually not showing the extension, but trust me,
it has the extension .json.
If I wanted to add another one, say, off my desktop here.
I have this picture of this cool robot.
You just add it here.
And then you'll need to package it
up when you're done.
To packaging it up, if you have a UNIX-based machine, you
can just run our little Make Bundle script.
Whoosh.
And you get a zip file, which is just the
contents of that thing.
And Make [? Level ?]
just copies it into the right place.
So let's assume we've done that.
We've added the zip files.
Now we need to write tags.
It comes with this utility Hunt Writer.
And we can pull that in as well.
And you can compile it yourself.
You need to compile your own Hunt Writer, because it's
going to have its own unique hunt.zip in it.
That's part of it.
So we're going to pull that in.
Grab Hunt Writer.
And there we have it.
Hunt Writer, when it's running, looks like this.
Oh, right.
And again, you're going to put that hunt.zip inside raw.
You can put it right there.
This is what it looks like.
You can tell we spent hours and hours and
hours on that UI.
[LAUGHS]
But if I want to write a tag, I'm going to click there.
I just select it and then--
[PHONE CHIMES]
WOLFF: Doink.
I've created a tag.
We've got to do that a couple more times, for each one of
these tags.
Come on.
Scan.
You're my best friend.
[PHONE CHIMES]
WOLFF: There you go.
I'm not going to--
You want me to write--
JOANNA: You can write my hand if you want.
WOLFF: Sure.
I'll totally write it.
We're going to write Joanna, too.
[PHONE CHIMES]
WOLFF: And actually, that's a fun thing you can do.
You don't have to just stick tags to the walls like we did
in the video.
During Google I/O, Colt actually
wore a tag for awhile.
People had to chase around and find him.
So you can have lot of fun with this.
So we've written these tags.
But the question is, what did we actually
write to these tags?
We can check.
We have Tag Info up here, which is an app you can
download the Play store.
I scanned this tag.
And it says, "you have NDEF data." What is that NDEF data?
It's a URI.
So what we're basically doing is just
writing a URI to a tag.
Then you scan that tag, it gets caught by the intent
filter on the app.
And I've actually got the intent filter up here.
You can see, it says, when you find an NDEF thing, and that
NDEF has https and the URL of our site.
And it's also looking for path prefix f.
If you look over here, we have the f--
it's basically "f" for find--
equals clue dev4good-0.
So dev4good-0 is the tag that we just wrote.
So that's what's on the tag.
It's just a URI.
Now, we can actually play the game using these tags that we
just wrote.
So we have it up.
Scan it.
[PHONE CHIMES]
And you can see it's filling in the little dog prints.
And when we find all three of them, it takes
us to the next clue.
And the next clue is the big green Google sign.
So that's the game.
What you're going to be doing, then, is going around, taking
pictures of the places that you want people to go, then
adding them to your hunt.zip.
You're going to be then writing a whole bunch of tags
for each one of those places and then hiding the tags.
JOANNA: And what we noticed when we were setting this us
is if you have one really obvious tag, it let's people
know they made it to the right place.
And the other two can be hidden a little higher
difficulty to make the search more fun.
So one easy, two hard worked out pretty well.
WOLFF: We also have one Easter egg.
If you have a tag that's written with the same URIs,
everything else, but the tag name is Decoy, you get this.
[PHONE CHIMES]
WOLFF: Oh no!
TOGETHER: It's a decoy!
WOLFF: And that can be a surprise.
We put that later in the hunt.
When people ran along and found it, they were like, oh
my gosh, it's a decoy.
So that's the whole thing.
You could also try running them in the full experience,
which has trivia questions.
But otherwise, it's open source.
We invite you guys take a look, try making your own
hunts, and playing it yourself.
JOANNA: Good.
Have a great day.