Eric Botti
commited on
Commit
·
1108bdd
1
Parent(s):
c7c80d3
README Updates
Browse files- GAME_RULES.MD +18 -0
- README.md +16 -15
- src/prompts.py +3 -18
GAME_RULES.MD
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## Game Rules
|
2 |
+
|
3 |
+
You are playing a social deduction game where every player pretends the be the same animal.
|
4 |
+
During the round each player gets a turn to describe themselves using an "I"-statement as if they were the animal.
|
5 |
+
All but one of players know what animal they are pretending to be, collectively these players are called the Herd.
|
6 |
+
The remaining player, known as the Chameleon, does not know what animal the others are pretending to be.
|
7 |
+
The Chameleon must blend in by providing details about the animal using context from other players.
|
8 |
+
The Herd must be careful not to give away too much information with their responses so that Chameleon deduce the animal.
|
9 |
+
|
10 |
+
After all players have spoken, two thing will happen:
|
11 |
+
1. The Chameleon will guess what animal the other players are pretending to be
|
12 |
+
2. The Herd will vote on who they think the Chameleon is.
|
13 |
+
|
14 |
+
The game is played in rounds, and the first player to reach 7 points wins. Points are awarded during a round as follows:
|
15 |
+
- If the majority of the Herd does not vote for the Chameleon, the Chameleon gets +1 point
|
16 |
+
- If the Chameleon guesses the animal correctly, they get +1 point
|
17 |
+
- If a member of the Herd votes for the Chameleon, they get +1 point
|
18 |
+
- If the Chameleon is unable to guess the animal, each member of the Herd gets +1 point
|
README.md
CHANGED
@@ -2,26 +2,27 @@
|
|
2 |
|
3 |
*A social deduction game powered by LLMs*
|
4 |
|
5 |
-
|
6 |
|
7 |
-
|
8 |
|
|
|
9 |
|
10 |
At the start of the game, each player is assigned one of two roles:
|
11 |
-
- **
|
12 |
-
- **
|
13 |
|
14 |
-
|
15 |
|
16 |
-
|
17 |
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
-
Example Round:
|
22 |
-
*The secret animal is an owl Owl*
|
23 |
-
Herd player 1: I have sharp claws.
|
24 |
-
Herd player 2: I am a creature of the night.
|
25 |
-
Herd player 3: I soar the skies looking for prey.
|
26 |
-
Herd player 4: I have a keen eye.
|
27 |
-
Chameleon: I am a predator.
|
|
|
2 |
|
3 |
*A social deduction game powered by LLMs*
|
4 |
|
5 |
+
[Play Now](https://huggingface.co/spaces/ericbotti/chameleon)
|
6 |
|
7 |
+
## Description
|
8 |
|
9 |
+
Chameleon is a social deduction game (a la Mafia, Among Us, etc.) about blending in, and figuring out who doesn't belong.
|
10 |
|
11 |
At the start of the game, each player is assigned one of two roles:
|
12 |
+
- **Herd**: The herd is a group of players who are all the same animal. They are trying to identify the chameleon hidden amongst them, while keeping the true animal a secret.
|
13 |
+
- **Chameleon**: This player is pretending to be part of the herd. Their goal is to identify what animal the herd is while remaining undetected.
|
14 |
|
15 |
+
See the [game rules file](GAME_RULES.md) for more details.
|
16 |
|
17 |
+
## Running the Game
|
18 |
|
19 |
+
The Easiest way to play the game is to use [Hugging Face Space Demo](https://huggingface.co/spaces/ericbotti/chameleon)
|
20 |
+
|
21 |
+
If you want to run the game locally, you can clone the repository and run the game using the command line or the Streamlit app.
|
22 |
+
|
23 |
+
1. **Using the command line**:
|
24 |
+
- Run `python src/main.py` from the root directory
|
25 |
+
|
26 |
+
2. **Using the Streamlit App**:
|
27 |
+
- Run `streamlit run src/app.py` from the root directory
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/prompts.py
CHANGED
@@ -8,24 +8,9 @@ def format_prompt(prompt_name, **kwargs):
|
|
8 |
return fetch_prompt(prompt_name).format(**kwargs)
|
9 |
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
All but one of players know what animal they are pretending to be, collectively these players are called the Herd.
|
15 |
-
The remaining player, known as the Chameleon, does not know what animal the others are pretending to be.
|
16 |
-
The Chameleon must blend in by providing details about the animal using context from other players.
|
17 |
-
The Herd must be careful not to give away too much information with their responses so that Chameleon deduce the animal.
|
18 |
-
|
19 |
-
After all players have spoken, two thing will happen:
|
20 |
-
1. The Chameleon will guess what animal the other players are pretending to be
|
21 |
-
2. The Herd will vote on who they think the Chameleon is.
|
22 |
-
|
23 |
-
The game is played in rounds, and the first player to reach 7 points wins. Points are awarded during a round as follows:
|
24 |
-
- If the Chameleon remains undetected, they get +1 point
|
25 |
-
- If the Chameleon guesses the animal correctly, they get +1 point
|
26 |
-
- If a member of the Herd votes for the Chameleon, they get +1 point
|
27 |
-
- If the Chameleon is unable to guess the animal, each member of the Herd gets +1 point
|
28 |
-
'''
|
29 |
|
30 |
_assign_herd = """\
|
31 |
You are a **{herd_animal}**, keep this secret at all costs and figure which player is not really a {herd_animal}
|
|
|
8 |
return fetch_prompt(prompt_name).format(**kwargs)
|
9 |
|
10 |
|
11 |
+
# Get game rules from GAME_RULES.md
|
12 |
+
with open("GAME_RULES.md", "r") as file:
|
13 |
+
_game_rules = file.read()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
_assign_herd = """\
|
16 |
You are a **{herd_animal}**, keep this secret at all costs and figure which player is not really a {herd_animal}
|