This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass
When I was a child, I used to play various kind of outdoor games. Be it hide and seek, Baraf-Pani (Ice-water, A South Asian version of Freeze-tag game), Kumir Danga (Crocodile and Land) - a Bengali game (search it up! quite interesting) and the list will go on and on but you'll get tired counting it. However, as tech and AI emerged and with the pandaemic that had occurred, each of those games vanished into thin air.
So to recall those memories and maintain a good health, I created this game of Treasure Hunt which uses AI for both Pirates and Protectors, where the Protectors hide the treasure (anything considers as treasure) while the Pirates hunts them as well as the treasure.
What I Built
Open Treasure Hunt is a real-world, proximity-based multiplayer game that transforms outdoor parks and neighborhoods into a live game board.
The game splits players into two competing factions:
The Protectors: They are tasked with stealthily hiding the treasure with the help of AI for suggestions
The Pirates (Hunters): They are tasked with AI to find the protectors and they can also use AI (but it won't give them their coordinates, just suggestions)
The phone acts as a tactical support. Players keep their devices in their pockets while outside. As both teams move through the real world, the AI Game Master constantly monitors live GPS coordinates, detects movement patterns, and provides one-sentence tactical updates.
Also, once a player selects Protector or Pirate, their device locks to that role using localStorage to ensure game integrity during physical outdoor movement unless otherwise changed when game is over.
Demo
Frontend: On Render
My Demo Video: Go to YouTube
Code
To set up the code, let us first know the Prerequisites:
- A computer with a decent gpu (because gemma 2 model will have to run locally, if you can use ollama. I have used huggingface because I don't have that kind of hardware)
- Python 3.9+
- Hugging Face Access
- A free TabPFN License Token
Github Repo:
To clone and install:
git clone https://github.com/nillohitroy/open-treasure-hunt.git
cd open-treasure-hunt
python -m venv venv
# On Windows:
venv\Scripts\activate
# On Mac/Linux:
source venv/bin/activate
pip install -r requirements.txt
Next, create environment variables .env:
HF_TOKEN=hf_your_hugging_face_token_here
Your TabPFN code will generate when you run it in VS Code (create an account and accept license).
To run the app: python app.py
To run it in your phone, after you have server is running:
Open up the terminal -> go to Ports -> Forward a Port -> Enter the port number (5000) -> it will generate an address -> Copy it in your phone and just accept when asking about devtunnels.
How I Built It
The game runs on a lightweight, modular open-source AI architecture built on a standard laptop with no dedicated GPU.
Instead of wasting our dev time on if/else blocks, we used TabPFN as a zero-shot foundational model. It evaluates whether a player is "wandering aimlessly" or "moving towards the treasure or the target" instantly on standard CPU threads without model training overhead.
The game state is synthesized into dynamic prompts for Google's Gemma 2 (2B) model.
Lastly, we are serving the game locally by running the flask app using: python app.py when you clone the repo and go to the root directory. After that we port forward (through VS code) to get a https url.
Why Does Open Innovation Matter?
Through this project, we have showcased three ways where Open Innovation over closed proprietary APIs.
GPS Data Privacy: We do not want the corporate companies to have our live location. For this very reason, the open innovation shines where we can enjoy to the fullest without worrying about data breach.
Real-time Economies: Live proximity games require background pings every 5–10 seconds. On closed, pay-per-token commercial APIs, a single 30-minute play session with several players would rack up substantial API costs. Another win for Open Innovation.
Hardware Accessibility: AI shouldn't require expensive hardware and GPUs to run the models for this simple game. We can just use open-weight models to run the game effectively.
Prize Categories
- Best Use of Gemma
- Best Use of TabPFN
- Best Use of Render
Top comments (0)