← Projects

ART-TI-FICIAL

A drawing game where players sketch a prompt and an AI vision model scores how well it recognized their art. Best Game award at HACK110 2025.

Date
Domain
software
Stack
Python · pygame · OpenAI

Photo of project demonstration at UNC's HACK110 hackathon

ART-TI-FICIAL is a Pictionary-style drawing game built in Python: each round you get a word to draw, and once the timer runs out, GPT-4o-mini analyzes your sketch and scores how close it thinks it is to the target, on a scale from 0 to 5000. With dynamic difficulty controllers and unscripted responses, the game provides a surprisingly high level of fun replayability, despite (or maybe because of) the simplicity of our concept. The source is on GitHub.

Stack

  • Pygame for the drawing canvas and game loop
  • PIL (Pillow) for converting the pygame surface into an image file
  • OpenAI API (GPT-4o-mini) for vision-based scoring
  • NumPy for pixel array manipulation
  • Python csv module for parsing the word lists

Process

The core loop is straightforward: the player draws on a pygame canvas, and when the round ends, the canvas is captured as a pixel array, normalized, saved as a JPEG, and base64-encoded before being sent to the OpenAI vision API. The API is prompted to identify what it sees in the image and then score the semantic similarity to the target word on a 0–5000 scale, returning a structured [phrase, score] response that gets parsed back into the game.

The game spans three rounds with escalating difficulty (easy → medium → hard word lists) and increasing time limits, so players have more time on harder prompts. The prompt engineering for the API call was important, as it had to instruct the model to describe what it sees without being told the target word first, to avoid bias in scoring.

One tricky part was reliably parsing the AI’s response. The model doesn’t always return a perfectly clean [phrase, score] format, so the parser includes a fallback that scans the string character-by-character to extract any digits if the integer conversion fails outright.

Outcomes

A fully playable 3-round game with real-time drawing, automated AI grading, and a final score screen, which took home the Best Game award out of a field of 30+ teams. The project was a fun introduction to working with vision-capable LLM APIs and the practical challenges of getting structured output from a language model. Shoutout to my wonderful hackathon teammate Frank Lin—I couldn’t have done this without you!

Photo of Frank and I after recieving our hackathon award