I like the game cardboard game codenames and now that COVID-19
is part of our life I have played a lot online with my friends on this website. But I
realized that I want to play codename pictures instead. So I've decided to create my own.
(Click here for more in-game footage)
- Realtime online multiplayer
- Multiple game modes:
- Codename classic (multiple languages)
- Codename pictures
- Add your own images/words if you want to
- Just like the codenames board game but online
docker run -p 5000:5000 -e GAME_MODES="pictures,classic_de,classic_en,classic_en-undercover" ghcr.io/schluggi/codenames:latest
git clone git@github.com:Schluggi/codenames.git
cd codenames
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python3 tools/words_to_image.py
flask --app codenames run
name | Description | required | default |
---|---|---|---|
GAME_MODES | A comma separated list of available game modes | No | pictures,classic_de,classic_en,classic_en-undercover |
SECRET_KEY | A secret key to encrypt the user sessions | No | <a random key will be created> |
name | Description | required | default |
---|---|---|---|
OPENAI_API_TOKEN | Your OPENAI API token | Yes | - |
If you already had images you want to import see Import images
First you need an OpenAI API token. You can get one here. Make sure you have access to
the gpt-image-1
model.
To generate a new image you can use the script tools/create_new_image.py
. Just execute and input your prompt. Do not
include colors or styling in your prompt.
This is handled by the script. The script also unionize the background color and saves the images as a webp-file. Done.
In this example we'll add france as language for the classic mode.
- Create a language file:
tools/words/fr.txt
(one word each line) - Run the script (existing files will be overwritten)
python3 tools/words_to_image.py
- Append
classic_fr
to yourGAME_MODES
environment variable
To get the best experience it's recommend to buy the original cardboard game and scan all images. In my case I scanned
all pictures with 400dpi and used picpunch to cut them to size and render for
web (--border 5 --quallity 30
).The new images have to be placed into the corresponding folders.
The code images into (at least 20):
codenames/static/images/codes
And the colored team cards (at least 1 each):
codenames/static/images/cards/assassin
codenames/static/images/cards/blue
codenames/static/images/cards/neutral
codenames/static/images/cards/red
The filename does not matter. But the file extension and type has to be JPEG/JPG, PNG or WEBP.
Created and maintained by Schluggi.
All images are generated by AI (gpt-image-1).