HomeVideos

Antigravity Arcade: From prompt to game in minutes

Now Playing

Antigravity Arcade: From prompt to game in minutes

Transcript

189 segments

0:03

Hi, I'm Tom Greenaway, and I'm part of the developer relations

0:06

team here at Google.

0:08

Today, my colleague James O'Reilly and I

0:11

will show you anti-gravity arcade, a project we built

0:14

for Google I/O in which anyone, whether they were

0:17

a traditional developer or not, could walk up

0:20

to a laptop running anti-gravity with a collection of AI skills

0:24

and workflows and with just an idea for a game,

0:27

have it generated entirely by AI and running on an arcade machine

0:31

within minutes.

0:33

We used a variety of Google technologies

0:35

to create this workflow and deployment flow,

0:38

including anti-gravity, Gemini, Cloud Run, Firestore,

0:43

and Firebase authentication.

0:45

If you have ever dreamed of building your own video game,

0:49

well then this is the solution for you.

0:51

So in this solution we wrote several best practices skills

0:55

for game development, which brought consistency

0:58

to the coding process of the developers

1:00

at Google I/O. As they generated their games on the fly and later

1:05

in this video, James will join me and explain how he built

1:08

the deployment flow from anti-gravity connecting

1:10

its systems to Firestore via Cloud Run.

1:14

By the end of the solution, you'll

1:16

understand how to leverage Google's technologies

1:18

to create vibe coding skills and workflows, just

1:21

like anti-gravity.

1:22

Arcade let's begin by looking at some of the sample games

1:27

we created.

1:28

Here we have a simple 8 directional survivor game.

1:32

The player must evade the enemies,

1:33

and if an enemy is in range, they

1:35

will automatically attack them.

1:38

Next, a space shoot em up in which

1:40

players move with the arcade stick and attack

1:42

with a dedicated fire button.

1:45

And lastly, a more complex platforming game

1:48

with both jump mechanics and gravity switching.

1:51

All these games were created without writing

1:54

a single line of code.

1:55

But notice how the games have underlying similarities.

1:59

They all appear in a retro arcade aesthetic.

2:02

The background of the games are all black

2:04

and there is a screen warping shader present.

2:06

The fonts are all pixelated.

2:08

They all include particle effects

2:10

when objects are destroyed, and there

2:12

is screen shaking when the player is injured.

2:15

Furthermore, all the games use the same key mappings

2:18

and have gamepad support for the arcade setup.

2:22

Was this an accident.

2:24

No this is because we prepared anti-gravity skills

2:28

in the project, along with a starting game template built

2:31

using phasor js's game engine.

2:34

Now, you might be wondering what are AI skills exactly.

2:38

In anti-gravity skills are modular sets

2:41

of capabilities that allow an AI agent to dynamically load

2:44

specialized workflows, best practices, instructions,

2:49

and executable scripts on demand.

2:51

Instead of cluttering a global system prompt

2:54

with every possible instruction, a skill

2:56

bundles the exact context and tooling

2:59

needed for a specific job, like migrating a database or best

3:03

practices for front end design.

3:06

The AI loads these lightweight instructions only

3:08

when a relevant task is triggered

3:11

by loading context dynamically.

3:13

Skills prevent context window bloat,

3:16

ensuring the AI maintains high reasoning accuracy

3:19

rather than getting distracted by irrelevant instructions.

3:22

This guarantees the AI autonomously

3:25

follows organizational best practices

3:27

while executing complex operations directly

3:30

in the developer's environment.

3:32

As an example, here's a snippet of one

3:35

of the skills we wrote for this project.

3:37

This skill, named ensuring arcade visuals,

3:40

provides the AI with four key guidelines to follow,

3:44

which ensure the consistency of the visuals.

3:46

For whatever the game the creator prompts the AI to build.

3:50

It ensures the background color is always black,

3:53

and that the game should always use the CRT shader provided

3:57

in the project template Genkit refers

3:59

to cathode ray tube, an old screen technology commonly found

4:03

with arcade machines.

4:05

Furthermore, we encourage the eye

4:07

to separate the visual layers so that the heads up display, where

4:11

elements like user interface text is drawn,

4:14

is not affected by the screen warping of the CRT shader,

4:18

which is a more modern UX decision.

4:20

On top of our retro feel.

4:22

And finally, we always require that the retro

4:25

font we provided be used by the games.

4:29

But visuals are only half the battle

4:31

when building games for physical arcade cabinets,

4:34

you run into unique hardware quirks.

4:36

To solve this, we wrote a handling user input skill.

4:40

This skill instructs the eye to wrap all player input

4:43

checks in a translation layer.

4:46

So if the player presses the physical button on the gamepad,

4:50

the game code Maps it correctly behind the scenes.

4:53

This means the eye can build a game that works perfectly

4:56

on our physical cabinet controllers on the very

4:59

first try.

5:00

Additionally, we built an upscaling container

5:03

into our phasor JS starting template

5:06

so that the classic arcade games render at low resolutions.

5:10

But of course, modern displays need high definition inputs,

5:14

so the template instructs the AI to render all the retro gameplay

5:17

to a tiny 320 by 240 logical container,

5:21

and then we upscale it using nearest neighbor filtering.

5:24

But these are just a few of the many skills used by the project.

5:29

Explore the game montage video in the solution

5:32

to see the various skills in action in the solution log.

5:36

You'll see notifications of which skills

5:38

were used by anti-gravity to build those particular features

5:41

in the game.

5:43

Now my colleague James will take you

5:45

through the anti-gravity workflows,

5:47

powering the developer experience and the back end

5:50

system.

5:50

He built to host and serve the generated games.

5:54

Over to you, James.

5:56

Thanks, Tom.

5:56

And hi, everyone.

5:57

I'm James O'Reilly, the project lead for anti-gravity arcade.

6:00

When an attendee at Google I/O finished generating their game,

6:03

they needed a way to deploy it to one

6:05

of the physical arcade cabinets to play it.

6:08

But how do we deploy user generated code

6:10

to physical public arcade machines.

6:13

To solve this, we used go to build a custom deployer CLI

6:16

tool.

6:17

To use the tool, an attendee simply

6:19

prompted deploy my game and our custom anti-gravity deploy skill

6:24

executed the deployer CLI tool.

6:27

This tool talks to Google Cloud back

6:28

end using a highly sensitive, though limited in scope

6:32

API token.

6:33

However, exposing the token to attendees

6:36

is an unacceptable risk.

6:38

To solve this, we use the Unix setuid model API.

6:42

Secrets are stored in a restricted directory,

6:44

readable only by specialized system account.

6:47

When the agent executes the deployer tool,

6:50

the OS temporarily elevates its privileges,

6:53

allowing the tool to read the token

6:55

and authenticate the upload without exposing

6:57

the keys to the agent, user, or terminal.

7:01

Under the hood, the deployer tool

7:03

runs a white build to compile the game,

7:05

packages the compiled directory into a zip archive,

7:09

calculates a checksum, and requests a short lived

7:12

signed URL from the central server.

7:15

The server performs an MD5 deduplication check to prevent

7:18

uploading duplicate files.

7:20

If it's a new build, the server returns a five minute GCS signed

7:24

put URL, and the deployer streams the zip archive

7:28

to the Google Cloud Storage upload bucket.

7:30

The moment the upload completes, a Google Cloud eventarc trigger

7:34

spins up Cloud Run function, which

7:36

runs a few automated verification and validation

7:39

steps on the uploaded files.

7:41

If the game passes validation, the files

7:44

are copied to the playback bucket.

7:45

A Firestore transaction increments the game counter,

7:48

a sequential game ID is issued and the game

7:51

is registered for moderation using our game moderation web

7:54

app.

7:55

Demo staffers tested and reviewed all

7:57

deployed games for playability.

7:59

Games marked by staff as approved or featured instantly

8:02

become playable by attendees on all arcade cabinets and showcase

8:06

TV.

8:08

By combining a custom CLI tool, asynchronous Google Cloud

8:11

processing, and smart database queries,

8:13

we build a robust game deployment pipeline

8:15

for the event.

8:17

So that's anti-gravity arcade, a physical to Cloud

8:20

game development and deployment platform

8:22

that brings the speed of vibe coding to retro arcade cabinets,

8:25

showcases the power of custom developer agent skills,

8:28

and demonstrates how to build a Cloud Native Deployment

8:31

pipeline with anti-gravity.

8:33

What vibe coding environments will you create next.

8:37

Explore our solution.

8:38

Inspect the full architecture.

8:40

Quiz your knowledge.

8:42

And we can't wait to see what AI powered experiences you build.

Interactive Summary

Anti-gravity Arcade is a project developed for Google I/O, enabling users to generate complete video games using AI and deploy them to arcade machines in minutes. It leverages Google technologies like Gemini, Cloud Run, Firestore, and Firebase authentication. The core concept involves AI skills, which are modular capabilities that dynamically load workflows, best practices, and scripts to guide game generation, ensuring visual consistency, proper hardware input handling, and efficient deployment. A robust, secure deployment pipeline handles compiling, uploading, validating, and moderating games, making approved creations playable on physical arcade cabinets.

Suggested questions

5 ready-made prompts