Skip to content

google/gemma-journey

Gemma Journey - Gemma.cpp for Unity Sample

This a simple sample game powered by the Gemma.cpp for Unity plugin, and demonstrates the use of Gemma 3 in games.

The game features non-player characters (NPCs) whose dialogue is dynamically generated by a Gemma model.

cover

The player moves between rooms to talk to Android-themed NPCs that generate real-time dialogue from predefined character personalities. The goal is to interrogate each Android to discover a secret word, allowing progression to the next room.

One such NPC is Chef Gus, a highly-regarded and temperamental chef. Gus's role and personality, along with game logic and rules, are defined in the Gemma 3 prompt, guiding his interactions and the riddle he presents to players in the game.

chat_with_gus_image

For more information, read the blog post about the game.

This is not an officially supported Google product.

Controls

  • WASD: Movement
  • E: Interact with NPCs

The player can type messages to the NPCs in the chat panel that appears upon interaction.

Getting Started

Pre-built releases

Pre-built releases are built using CI/CD and are available under the Releases tab. These releases bundle a copy of Gemma 3 4B.

  1. Download the runnable game from [release][game_download].
  2. Extract the ZIP file.
  3. Double-click the Gemma Journey icon.

Building the game from source.

The game targets Unity 6 (6000.0.33f1) and requires the Gemma.cpp for Unity plugin along with a copy of Gemma 3 4B.

  1. Open the GemmaSettings scriptable object in Assets/GemmaSampleGame or create one if it doesn't exist.
  2. Note the Model Type and Weight format in GemmaSettings.
  3. Go to Kaggle to download the appropriate weights and tokenizer.
    • Example: If ModelType is Gemma 3_4B and Weight format is sfp, download the Gemma C++ variation 3.0-4b-it-sfp.
  4. Place the downloaded files under Assets/StreamingAssets/[folder name].

For other variations, go to Assets/GemmaSampleGame and update the GemmaSettings scriptable object's Model type, weight format folder, and filename.

  1. Open Build Profiles by clicking File > Build Profile.
  2. Click Build.

Dependencies

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors