• Stars
    star
    163
  • Rank 230,113 (Top 5 %)
  • Language
    C#
  • License
    Other
  • Created over 2 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A multiplayer geospatial experience

Balloon Pop

A multiplayer geospatial experience


By Google Creative Lab, Sydney

Contents:





What is the Balloon Pop code example?

Balloon Pop is a simple sandbox style game that showcases a multiplayer experience using the ARCore Geospatial API and Firebase.

Place geospatial anchors in the world, and they will stay fixed to the ground in AR. In this demo, balloons are placed as targets and hit using a ball that reacts to distance in world space. The multiplayer aspect means that nearby users can pop the same balloons using Firebase.




How does it work?

The Balloon Pop Unity project can be built to create a mobile game/app.
The project uses Unity 2019.4.36f1 and Google's ARCore Geospatial API.

The Geospatial API anchors balloons to specific GPS coordinates in the real world. The API can track a user's latitude, longitude and altitude on the earth. A user can place a balloon at a location N meters directly ahead of them, at their current altitude (using data from the ARCore Geospatial API).

The balloon anchor's latitude, longitude and altitude is stored on a Firestore database in the cloud. A multiplayer experience is created by loading balloons nearby and anchoring them at the same position in the real world. Users can pop balloons and even watch balloon pops triggered by other players.





Requirements

Your app will require the following:

  • Internet and GPS access.
  • The experience works best outdoors.
  • A compatible device: Android: Google Pixel 2 or later device for optimum performance.



Developer Setup

The app has not been released to the public on a mobile app store, but the code can be downloaded and built in Unity. So far the experience has only been tested on fairly recent Android phones, such as a Pixel or Samsung Galaxy 7 or higher.


Unity App

  1. Download Unity version 2019.4.36f1 for compatibility. We recommend using Unity Hub.

  2. Clone this repo to your machine (optionally fork this repository if you plan on expanding on it).

  3. Open the project in Unity 2019.4.36f1, and open the 'BalloonPopAR' scene (if it doesn't open automatically).

  4. Follow the steps below in the 'ARCore Geospatial API Key' section

  5. Follow the steps below in the 'Firestore Balloon Database' section

  6. Deploy to an ARCore compatible device.


ARCore Geospatial API Key

You will need an API Key with ARCore Geospatial API enabled for your app to use GeoAR features.

Follow the steps here to in order to obtain an API key.

Add the API Key to your Unity Project:

  1. Open the Unity Project Settings

  2. Under 'XR Plug-in Management', click on 'ARCore Extensions'

  3. Past the Android API Key into the 'Android API Key' textfield

  4. 'Geospatial' should be turned on


Firestore Balloon Database

The project uses the Firestore database in Firebase to save balloon coordinates, send balloon pops and listen for changes in balloons near the user. This allows the game to keep a shared global state of balloon locations, creating a multiplayer experience of balloon placing and popping.

Install Firebase

Import the following plugins - using Assets > Import Package > Custom Package menu item - from the Firebase Unity SDK:

IMPORTANT

After importing the Firebase packages you may run into a compatibility issues with the ExternalDependencyManager (EDM) that ships with both Firebase and and ARCore Extensions. We recommend using whichever version is newer.

If ARCore Extensions has a newer EDM you may uncheck the 'ExternalDependencyManager" when importing these packages:

  • FirebaseAuth.unitypackage
  • FirebaseFirestore.unitypackage

If Firebase is using a newer EDM we suggest installing the lite version of ARCore Extensions per the instructions here.

Create a Firebase API Key

  1. Create a Firebase account if you don't already have one

  2. Add a new project in the Firebase Console.

  3. In the 'Build' -> 'Firestore Database' section of your project click 'Create a database'.

  4. Select production mode and choose a relevant region for your Cloud Firestore data to be stored.

  5. Create a new collection in your database and name it 'balloons'.

  6. Go to your 'Project settings' -> 'General' -> 'Your apps' and click the 'Add app' button. Click the button with the Unity icon on it.

  7. Choose a unique package name (for Android), then download the 'google-services.json' config file for the Android build.

  8. Now place the 'google-services.json' config file in the 'StreamingAssets' folder within the Unity project. (Assets -> StreamingAssets -> 'google-services.json').




Debug


Within the 'BalloonPopAR' Unity scene, there is a GameObject called "DEBUG SETTINGS". You can use this to toggle some debug info about the Geospatial API by toggling 'Display Earth Debug'. You can also toggle a information panel to be shown on every balloon which displays some useful information about each balloon.





Attributions


Balloon Pop Cloud Asset

Cloud 3D model 'Cloudsculpt2' on Sketchfab
The 3D model was slightly modified.
Author: curiositysphere
License: CC BY 4.0
(Creative Commons)



Contributors

License & Notes

Apache 2.0 license.

This is not an official Google product, but an AR Experiment developed at the Google Creative Lab. We’ll do our best to support and maintain this experiment but your mileage may vary.

We encourage open sourcing projects as a way of learning from each other. Please respect our and other creators’ rights, including copyright and trademark rights when present, when sharing these works and creating derivative work.

You must disclose the use of ARCore’s Cloud Anchors or Geospatial APIs prominently in your application by including the following text, as well as a link to learn more on a notice screen: https://developers.google.com/ar/cloud-anchors-privacy.

To power this session, Google will process visual data from your camera. Learn more.

You can do this by implementing the recommended user notice flow available in our Cloud Anchor sample apps and Geospatial API sample apps.


More Repositories

1

anypixel

A web-friendly way for anyone to build unusual displays
C
6,437
star
2

quickdraw-dataset

Documentation on how to access and use the Quick, Draw! Dataset.
6,092
star
3

teachable-machine-v1

Explore how machine learning works, live in the browser. No coding required.
JavaScript
3,848
star
4

coder

A simple way to make web stuff on Raspberry Pi
JavaScript
2,425
star
5

open-nsynth-super

Open NSynth Super is an experimental physical interface for the NSynth algorithm
C++
2,419
star
6

chrome-music-lab

A collection of experiments for exploring how music works, all built with the Web Audio API.
JavaScript
2,127
star
7

aiexperiments-ai-duet

A piano that responds to you.
JavaScript
1,631
star
8

teachablemachine-community

Example code snippets and machine learning code for Teachable Machine
TypeScript
1,488
star
9

paper-signals

Build your own voice controlled object.
C++
742
star
10

aiexperiments-drum-machine

Thousands of everyday sounds, organized using machine learning.
JavaScript
736
star
11

Sprayscape

Sprayscape is a perfectly imperfect VR-ish camera. It is an open source Android app released on the Android Experiments platform.
Objective-C
568
star
12

teachable-machine-boilerplate

Boilerplate code for Teachable Machine
JavaScript
504
star
13

aiexperiments-giorgio-cam

Take a picture to make music with the computer.
JavaScript
481
star
14

aiexperiments-bird-sounds

Thousands of bird sounds visualized using machine learning.
JavaScript
474
star
15

ar-drawing-java

A simple AR drawing experiment build in Java using ARCore.
Java
415
star
16

inside-music

Inside Music lets you step inside of a song, seeing its individual pieces to give you a closer look at how music is made.
JavaScript
384
star
17

meter

Meter is a data-driven wallpaper that displays your battery, wireless signal and notifications
Java
362
star
18

digital-wellbeing-experiments-toolkit

Code components for starting your own Digital Wellbeing experiments
Kotlin
341
star
19

giantemoji

JavaScript
313
star
20

creatability-components

Web components for making creative tools more accessible.
TypeScript
287
star
21

morse-learn

A fun little web app to help you learn Morse code on Gboard.
JavaScript
284
star
22

alto

Explore the basics of machine learning by building your own teachable object at home.
Python
278
star
23

aiexperiments-sound-maker

Make unusual new sounds with machine learning.
JavaScript
255
star
24

justaline-android

The first cross-platform collaborative AR app (for doodling)
Java
252
star
25

shadercam

Simple OpenGL Shaders with the camera2 apis in Android 5.0+
Java
240
star
26

posenet-sketchbook

PoseNet Sketchbook is a collection of open source, interactive web experiments designed to allude to the artistic possibilities of using PoseNet (running on tensorflow.js) to create a relationship between movement and machine.
JavaScript
207
star
27

arexperiments-portal-painter

Doodle new worlds onto your own, with Google ARCore.
C#
198
star
28

beat-blender

Blend beats using machine learning to create music in a fun new way.
JavaScript
190
star
29

coder-projects

Fun projects and sneakily educational things that can all be made with Coder and Rasberry Pi.
CSS
188
star
30

landmarker

Orientation, GPS, and Places enabled Android Experiment
Java
180
star
31

webvr-musicalforest

Join users from around the world in a musical forest. A WebVR Experiment.
JavaScript
164
star
32

melody-mixer

A fun way to explore music using machine learning.
JavaScript
153
star
33

lipswap

Replace sections of a photo with your own recorded video.
Java
142
star
34

norman-ar

Decorate your world with AR animations.
C++
136
star
35

justaline-ios

The first cross-platform collaborative AR app (for doodling)
Swift
120
star
36

quickdraw-component

Use any of the of the 50 million Quick, Draw! doodles in your web-based project with one line of markup
JavaScript
104
star
37

creatability-seeing-music

Experience music visually.
JavaScript
101
star
38

semi-conductor

Semi-Conductor allows you to conduct a virtual orchestra using only your web browser & webcam.
JavaScript
100
star
39

tunnelvision

Distort your surroundings through a collection of transformative filters
Java
93
star
40

lines-of-play

Design domino art creations that interact with the real world using the ARCore Depth API.
C#
89
star
41

project-oasis

A voice controlled terrarium that recreates outside weather inside a box
JavaScript
89
star
42

access-mars

JavaScript
82
star
43

tiny-motion-trainer

Train and test machine learning models for your Arduino Nano 33 BLE Sense in the browser.
JavaScript
79
star
44

mystery-animal

A new spin on the classic 20-questions game.
JavaScript
79
star
45

mix-lab

MixLab is an experiment that makes it easier for anyone to create music, using simple voice commands.
TypeScript
71
star
46

sounds-in-space

An interactive audio experience, where the virtual sounds you hear change depending on your physical location.
C#
70
star
47

tf4micro-motion-kit

Arduino Sketch and a Web Bluetooth API for loading models and running inference on the Nano Sense 33 BLE device.
C++
66
star
48

obvi

A Polymer 3+ webcomponent / button for doing speech recognition
JavaScript
57
star
49

finger-user-interface

Control connected devices with the wave of a finger.
C
54
star
50

xyfi

Xyfi: BYO pointing device at a physical installation
JavaScript
48
star
51

morse-speak-demo

Text-to-Speech (TTS) demo web app that converts written text into spoken words via Morse code
JavaScript
44
star
52

aog-canvas-quiz

Canvas Quiz is a starter kit for developers to make custom, voice-enabled question-answer games for the Google Assistant.
JavaScript
40
star
53

air-snare

Play drums in the air.
Svelte
40
star
54

webvr-speaktogo

Explore the world with your voice.
JavaScript
34
star
55

norman-sketch-player

Embed Norman animated sketches on the web
JavaScript
29
star
56

pattern-radio

Code for patternradio.withgoogle.com
JavaScript
27
star
57

things-with-firebase-at-io2017

The Android Things projects used in the Experiments Tent at Google I/O 2017
Java
22
star
58

astrowand

Draw shapes in the sky to form constellations with TensorFlow and a microcontroller.
JavaScript
19
star
59

visual-alarm-clock

Get up in the morning by striking a pose to stop your alarm from ringing.
C++
10
star
60

dat.fire

JavaScript
6
star
61

.allstar

2
star
62

.github

1
star