├── textarena ├── envs │ ├── Bandit │ │ └── __init__.py │ ├── Chess │ │ ├── __init__.py │ │ └── renderer.py │ ├── Debate │ │ ├── __init__.py │ │ └── renderer.py │ ├── Golf │ │ └── __init__.py │ ├── ImTheBoss │ │ └── env.py │ ├── LeTruc │ │ ├── README.md │ │ ├── __init__.py │ │ └── renderer.py │ ├── Nim │ │ ├── __init__.py │ │ └── renderer.py │ ├── Poker │ │ └── __init__.py │ ├── Set │ │ └── __init__.py │ ├── Snake │ │ ├── __init__.py │ │ └── renderer.py │ ├── Sudoku │ │ ├── __init__.py │ │ └── renderer.py │ ├── Taboo │ │ └── __init__.py │ ├── Tak │ │ └── __init__.py │ ├── Wordle │ │ ├── __init__.py │ │ └── renderer.py │ ├── Alquerque │ │ └── __init__.py │ ├── Battleship │ │ ├── __init__.py │ │ └── renderer.py │ ├── Blackjack │ │ └── __init__.py │ ├── Briscola │ │ └── __init__.py │ ├── Checkers │ │ ├── __init__.py │ │ └── renderer.py │ ├── Chopsticks │ │ ├── __init__.py │ │ └── renderer.py │ ├── Codenames │ │ └── __init__.py │ ├── ConnectFour │ │ ├── __init__.py │ │ └── renderer.py │ ├── Crosswords │ │ ├── __init__.py │ │ └── renderer.py │ ├── Crusade │ │ └── __init__.py │ ├── Cryptarithm │ │ └── __init__.py │ ├── Diplomacy │ │ ├── __init__.py │ │ └── prompts │ │ │ ├── __init__.py │ │ │ ├── README.md │ │ │ ├── prompt.py │ │ │ ├── context_prompt.txt │ │ │ ├── context_prompt copy.txt │ │ │ ├── general_system_prompt.txt │ │ │ ├── phase_summary_prompt.txt │ │ │ ├── message_summary_prompt.txt │ │ │ ├── few_shot_example.txt │ │ │ ├── state_specific │ │ │ ├── russia_system_prompt.txt │ │ │ ├── italy_system_prompt.txt │ │ │ ├── austria_system_prompt.txt │ │ │ ├── england_system_prompt.txt │ │ │ ├── turkey_system_prompt.txt │ │ │ ├── germany_system_prompt.txt │ │ │ └── france_system_prompt.txt │ │ │ └── conversation_instructions.txt │ ├── DontSayIt │ │ └── __init__.py │ ├── FrozenLake │ │ └── __init__.py │ ├── GermanWhist │ │ └── __init__.py │ ├── GuessWho │ │ └── __init__.py │ ├── Hangman │ │ └── __init__.py │ ├── HighSociety │ │ ├── __init__.py │ │ └── renderer.py │ ├── IndianPoker │ │ ├── __init__.py │ │ └── renderer.py │ ├── KuhnPoker │ │ ├── __init__.py │ │ └── renderer.py │ ├── LeducHoldem │ │ ├── README.md │ │ ├── __init__.py │ │ └── renderer.py │ ├── LiarsDice │ │ ├── __init__.py │ │ └── renderer.py │ ├── LightsOut │ │ ├── __init__.py │ │ └── renderer.py │ ├── LogicPuzzle │ │ ├── __init__.py │ │ └── renderer.py │ ├── Mastermind │ │ ├── __init__.py │ │ └── renderer.py │ ├── MemoryGame │ │ ├── __init__.py │ │ └── renderer.py │ ├── Minesweeper │ │ ├── __init__.py │ │ └── renderer.py │ ├── Negotiation │ │ └── __init__.py │ ├── Othello │ │ ├── __init__.py │ │ └── renderer.py │ ├── PigDice │ │ ├── __init__.py │ │ └── renderer.py │ ├── SecretMafia │ │ ├── __init__.py │ │ └── renderer.py │ ├── Secretary │ │ └── __init__.py │ ├── SimpleTak │ │ ├── __init__.py │ │ └── renderer.py │ ├── Sokoban │ │ └── __init__.py │ ├── SpellingBee │ │ └── __init__.py │ ├── Stratego │ │ └── __init__.py │ ├── Surround │ │ ├── __init__.py │ │ └── renderer.py │ ├── TicTacToe │ │ ├── __init__.py │ │ └── renderer.py │ ├── WordChains │ │ ├── __init__.py │ │ └── renderer.py │ ├── WordLadder │ │ ├── __init__.py │ │ └── renderer.py │ ├── WordSearch │ │ ├── __init__.py │ │ └── renderer.py │ ├── BlindAuction │ │ └── __init__.py │ ├── Breakthrough │ │ ├── __init__.py │ │ └── renderer.py │ ├── FifteenPuzzle │ │ ├── __init__.py │ │ └── renderer.py │ ├── GuessTheNumber │ │ ├── __init__.py │ │ └── renderer.py │ ├── IteratedStagHunt │ │ └── __init__.py │ ├── LetterAuction │ │ └── __init__.py │ ├── LinesOfAction │ │ └── __init__.py │ ├── MarketEntryGame │ │ └── __init__.py │ ├── PublicGoodsGame │ │ └── __init__.py │ ├── QuantumTicTacToe │ │ └── __init__.py │ ├── ReverseTicTacToe │ │ ├── __init__.py │ │ └── renderer.py │ ├── ScenarioPlanning │ │ ├── __init__.py │ │ └── renderer.py │ ├── SettlersOfCatan │ │ ├── __init__.py │ │ └── renderer.py │ ├── SpiteAndMalice │ │ └── __init__.py │ ├── ThreePlayerGOPS │ │ └── __init__.py │ ├── TowerOfHanoi │ │ ├── __init__.py │ │ └── renderer.py │ ├── TwentyQuestions │ │ ├── __init__.py │ │ └── renderer.py │ ├── WildTicTacToe │ │ ├── __init__.py │ │ └── renderer.py │ ├── CharacterConclave │ │ └── __init__.py │ ├── GameOfPureStrategy │ │ ├── __init__.py │ │ └── renderer.py │ ├── IteratedUltimatumGame │ │ └── __init__.py │ ├── SimpleBlindAuction │ │ └── __init__.py │ ├── SimpleNegotiation │ │ └── __init__.py │ ├── ThreePlayerTicTacToe │ │ ├── __init__.py │ │ └── renderer.py │ ├── TruthAndDeception │ │ ├── __init__.py │ │ └── renderer.py │ ├── UltimateTicTacToe │ │ ├── __init__.py │ │ └── renderer.py │ ├── IteratedMatchingPennies │ │ ├── __init__.py │ │ └── renderer.py │ ├── IteratedPrisonersDilemma │ │ ├── __init__.py │ │ └── renderer.py │ ├── IteratedRockPaperScissors │ │ ├── __init__.py │ │ └── renderer.py │ ├── IteratedTwoThirdsAverage │ │ ├── __init__.py │ │ └── renderer.py │ ├── Klondike │ │ └── __init__.py │ ├── utils │ │ ├── __init__.py │ │ └── data │ │ │ └── en.aff │ ├── ScorableGames │ │ ├── __init__.py │ │ └── games_descriptions │ │ │ ├── base │ │ │ ├── scores_files │ │ │ │ ├── DoT.txt │ │ │ │ ├── enviroment.txt │ │ │ │ ├── union.txt │ │ │ │ ├── SportCo.txt │ │ │ │ ├── mayor.txt │ │ │ │ └── other_cities.txt │ │ │ ├── config.txt │ │ │ └── individual_instructions │ │ │ │ ├── cooperative │ │ │ │ ├── enviroment.txt │ │ │ │ ├── SportCo.txt │ │ │ │ ├── DoT.txt │ │ │ │ └── mayor.txt │ │ │ │ ├── greedy │ │ │ │ ├── enviroment.txt │ │ │ │ └── SportCo.txt │ │ │ │ ├── targeted_adv │ │ │ │ └── enviroment.txt │ │ │ │ └── untargeted_adv │ │ │ │ └── enviroment.txt │ │ │ ├── game2 │ │ │ ├── scores_files │ │ │ │ ├── NGO.txt │ │ │ │ ├── activists.txt │ │ │ │ ├── foreign_agency.txt │ │ │ │ ├── government.txt │ │ │ │ ├── landowners.txt │ │ │ │ └── project_manager.txt │ │ │ ├── config.txt │ │ │ └── individual_instructions │ │ │ │ └── cooperative │ │ │ │ ├── landowners.txt │ │ │ │ ├── government.txt │ │ │ │ └── activists.txt │ │ │ ├── game3 │ │ │ ├── scores_files │ │ │ │ ├── france.txt │ │ │ │ ├── activists.txt │ │ │ │ ├── federal.txt │ │ │ │ ├── state.txt │ │ │ │ ├── community.txt │ │ │ │ └── private_investors.txt │ │ │ ├── config.txt │ │ │ └── individual_instructions │ │ │ │ └── cooperative │ │ │ │ ├── activists.txt │ │ │ │ ├── community.txt │ │ │ │ └── france.txt │ │ │ ├── game1 │ │ │ ├── scores_files │ │ │ │ ├── bank.txt │ │ │ │ ├── community.txt │ │ │ │ ├── proposing.txt │ │ │ │ ├── tourism.txt │ │ │ │ ├── construction.txt │ │ │ │ └── enviroment.txt │ │ │ ├── config.txt │ │ │ └── individual_instructions │ │ │ │ └── cooperative │ │ │ │ ├── community.txt │ │ │ │ ├── construction.txt │ │ │ │ ├── enviroment.txt │ │ │ │ └── proposing.txt │ │ │ ├── vendor_retailer │ │ │ ├── config.txt │ │ │ ├── scores_files │ │ │ │ ├── retailmax.txt │ │ │ │ └── supplypro.txt │ │ │ └── individual_instructions │ │ │ │ └── greedy │ │ │ │ └── supplypro.txt │ │ │ ├── base_rewritten │ │ │ ├── scores_files │ │ │ │ ├── enviroment.txt │ │ │ │ ├── mayor.txt │ │ │ │ ├── union.txt │ │ │ │ ├── company.txt │ │ │ │ ├── department.txt │ │ │ │ └── other_cities.txt │ │ │ ├── config.txt │ │ │ └── individual_instructions │ │ │ │ └── cooperative │ │ │ │ ├── enviroment.txt │ │ │ │ ├── company.txt │ │ │ │ ├── department.txt │ │ │ │ └── mayor.txt │ │ │ ├── medical_ethics │ │ │ ├── scores_files │ │ │ │ ├── head_nurse.txt │ │ │ │ ├── ethics_rep.txt │ │ │ │ ├── physician.txt │ │ │ │ └── social_worker.txt │ │ │ ├── config.txt │ │ │ └── individual_instructions │ │ │ │ └── cooperative │ │ │ │ ├── head_nurse.txt │ │ │ │ ├── physician.txt │ │ │ │ ├── ethics_rep.txt │ │ │ │ └── social_worker.txt │ │ │ └── base_7players │ │ │ ├── scores_files │ │ │ ├── DoT.txt │ │ │ ├── mayor.txt │ │ │ ├── union.txt │ │ │ ├── SportCo.txt │ │ │ ├── enviroment.txt │ │ │ ├── heritage.txt │ │ │ └── other_cities.txt │ │ │ ├── config.txt │ │ │ └── individual_instructions │ │ │ └── cooperative │ │ │ ├── heritage.txt │ │ │ ├── enviroment.txt │ │ │ └── SportCo.txt │ ├── UltimateTexasHoldem │ │ └── __init__.py │ ├── VendorNegotiation │ │ └── data │ │ │ ├── roles │ │ │ ├── vendor │ │ │ │ ├── default.txt │ │ │ │ ├── profit_focused.txt │ │ │ │ ├── volume_seeker.txt │ │ │ │ └── relationship_builder.txt │ │ │ └── brand │ │ │ │ ├── default.txt │ │ │ │ ├── collaborative.txt │ │ │ │ ├── data_driven.txt │ │ │ │ └── aggressive.txt │ │ │ └── product_list.csv │ ├── TwoDollar │ │ └── roles │ │ │ ├── non_enforceable │ │ │ ├── vanilla.json │ │ │ ├── another_chance.json │ │ │ ├── imaginative.json │ │ │ ├── dependent.json │ │ │ ├── untrustworthy.json │ │ │ ├── tape_recorder.json │ │ │ ├── battle_ax.json │ │ │ ├── public_figure.json │ │ │ └── hard_time.json │ │ │ └── enforceable │ │ │ ├── 1_60_dollar.json │ │ │ ├── 1_dollar.json │ │ │ ├── 1_30_dollar.json │ │ │ ├── 80_cents.json │ │ │ ├── 50_cents.json │ │ │ ├── x_rounds.json │ │ │ ├── high_tension.json │ │ │ └── say_little.json │ ├── UsedCarNegotiation │ │ └── instructions │ │ │ ├── blue_book.txt │ │ │ ├── seller │ │ │ ├── weak.txt │ │ │ └── strong.txt │ │ │ └── buyer │ │ │ └── weak.txt │ ├── BabyAiText │ │ └── tests.py │ └── Hanabi │ │ └── renderer.py ├── wrappers │ ├── TrainingWrappers │ │ ├── __init__.py │ │ └── check_if_valid.py │ ├── RenderWrappers │ │ └── __init__.py │ ├── ActionWrappers │ │ ├── __init__.py │ │ └── action_formatting_wrapper.py │ ├── ObservationWrappers │ │ ├── __init__.py │ │ └── classical_reasoning_eval_observation_wrapper.py │ └── __init__.py ├── agents │ └── __init__.py └── __init__.py ├── requirements.txt ├── MANIFEST.in ├── test.py ├── examples ├── offline_play.py ├── online_play.py └── online_play_mindgameschallenge.py ├── pyproject.toml ├── docs ├── ta_black.svg └── ta_white.svg └── LICENSE /textarena/envs/Bandit/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Chess/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Debate/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Golf/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/ImTheBoss/env.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/LeTruc/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/LeTruc/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/LeTruc/renderer.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Nim/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Poker/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Set/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Snake/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Sudoku/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Taboo/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Tak/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Wordle/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Alquerque/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Battleship/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Blackjack/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Briscola/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Checkers/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Chopsticks/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Chopsticks/renderer.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Codenames/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/ConnectFour/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Crosswords/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Crusade/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Cryptarithm/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Diplomacy/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/DontSayIt/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/FrozenLake/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/GermanWhist/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/GuessWho/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Hangman/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/HighSociety/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/HighSociety/renderer.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/IndianPoker/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/IndianPoker/renderer.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/KuhnPoker/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/LeducHoldem/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/LeducHoldem/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/LeducHoldem/renderer.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/LiarsDice/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/LightsOut/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/LogicPuzzle/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Mastermind/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/MemoryGame/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Minesweeper/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Negotiation/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Othello/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/PigDice/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/SecretMafia/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Secretary/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/SimpleTak/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Sokoban/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/SpellingBee/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Stratego/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Surround/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/TicTacToe/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/WordChains/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/WordLadder/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/WordSearch/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/BlindAuction/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Breakthrough/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/FifteenPuzzle/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/GuessTheNumber/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/IteratedStagHunt/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/LetterAuction/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/LinesOfAction/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/MarketEntryGame/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/PublicGoodsGame/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/QuantumTicTacToe/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/ReverseTicTacToe/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/ScenarioPlanning/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/SettlersOfCatan/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/SpiteAndMalice/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/ThreePlayerGOPS/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/TowerOfHanoi/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/TwentyQuestions/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/WildTicTacToe/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/CharacterConclave/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/Diplomacy/prompts/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/GameOfPureStrategy/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/GameOfPureStrategy/renderer.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/IteratedUltimatumGame/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/SimpleBlindAuction/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/SimpleNegotiation/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/ThreePlayerTicTacToe/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/TruthAndDeception/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/UltimateTicTacToe/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/wrappers/TrainingWrappers/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/IteratedMatchingPennies/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/IteratedMatchingPennies/renderer.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/IteratedPrisonersDilemma/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/IteratedRockPaperScissors/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/IteratedTwoThirdsAverage/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /textarena/envs/IteratedTwoThirdsAverage/renderer.py: -------------------------------------------------------------------------------- 1 | # TODO -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | openai 2 | rich 3 | nltk 4 | chess 5 | python-dotenv 6 | requests 7 | websockets -------------------------------------------------------------------------------- /textarena/envs/Klondike/__init__.py: -------------------------------------------------------------------------------- 1 | from .env import KlondikeEnv 2 | 3 | __all__ = ['KlondikeEnv'] -------------------------------------------------------------------------------- /textarena/envs/utils/__init__.py: -------------------------------------------------------------------------------- 1 | import textarena.envs.utils.jury 2 | import textarena.envs.utils.word_lists -------------------------------------------------------------------------------- /textarena/wrappers/TrainingWrappers/check_if_valid.py: -------------------------------------------------------------------------------- 1 | # TODO # deepcopy game-state and check if the move is valid -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/__init__.py: -------------------------------------------------------------------------------- 1 | from .env import ScorableGamesEnv 2 | 3 | __all__ = ["ScorableGamesEnv"] 4 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base/scores_files/DoT.txt: -------------------------------------------------------------------------------- 1 | 0, 11, 5 2 | 0, 20, 25 3 | 0, 2, 4, 9 4 | 10, 26, 40, 0 5 | 4, 8, 15, 12, 0 6 | 65 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base/scores_files/enviroment.txt: -------------------------------------------------------------------------------- 1 | 0, 22, 45 2 | 0, 25, 55 3 | 0, 0, 0, 0 4 | 0, 0, 0, 0 5 | 0, 0, 0, 0, 0 6 | 55 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base/scores_files/union.txt: -------------------------------------------------------------------------------- 1 | 15, 20, 0 2 | 0, 0, 0 3 | 42, 35, 25, 0 4 | 30, 20, 10, 0 5 | 2, 4, 6, 8, 0 6 | 50 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game2/scores_files/NGO.txt: -------------------------------------------------------------------------------- 1 | 25, 20, 15, 10, 5 2 | 0, 35, 40 3 | 0, 11, 5, 9 4 | 15, 0, 12 5 | 2, 0, 5, 9 6 | 30 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game3/scores_files/france.txt: -------------------------------------------------------------------------------- 1 | 0, 45, 20, 20 2 | 0, 25, 30 3 | 0, 0, 0, 0 4 | 0, 0, 0, 0, 0 5 | 0, 20, 25 6 | 65 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base/scores_files/SportCo.txt: -------------------------------------------------------------------------------- 1 | 14, 8, 0 2 | 11, 7, 0 3 | 0, 5, 10, 17 4 | 35, 29, 20, 0 5 | 0, 5, 10, 15, 23 6 | 55 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base/scores_files/mayor.txt: -------------------------------------------------------------------------------- 1 | 14, 8, 0 2 | 12, 8, 0 3 | 24, 18, 12, 0 4 | 40, 30, 23, 0 5 | 0, 2, 4, 7, 10 6 | 30 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game1/scores_files/bank.txt: -------------------------------------------------------------------------------- 1 | 0, 9, 13 2 | 10, 26, 40, 10 3 | 0, 15, 20, 25 4 | 0, 9, 11, 13, 15 5 | 7, 0, 4 6 | 60 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game1/scores_files/community.txt: -------------------------------------------------------------------------------- 1 | 0, 45, 25 2 | 10, 8, 2, 0 3 | 0, 5, 15, 9 4 | 0, 15, 20, 25, 30 5 | 0, 0, 0 6 | 47 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game1/scores_files/proposing.txt: -------------------------------------------------------------------------------- 1 | 17, 5, 9 2 | 10, 15, 29, 40 3 | 12, 8, 4, 0 4 | 8, 6, 4, 2, 0 5 | 0, 23, 17 6 | 60 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game1/scores_files/tourism.txt: -------------------------------------------------------------------------------- 1 | 30, 0, 25 2 | 10, 20, 25, 30 3 | 0, 14, 7, 0 4 | 0, 9, 5, 2, 0 5 | 10, 5, 17 6 | 57 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game2/scores_files/activists.txt: -------------------------------------------------------------------------------- 1 | 10, 8, 6, 2, 0 2 | 0, 12, 14 3 | 0, 40, 35, 0 4 | 11, 0, 5 5 | 0, 0, 20, 25 6 | 30 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game3/scores_files/activists.txt: -------------------------------------------------------------------------------- 1 | 0, 0, 0, 0 2 | 0, 40, 65 3 | 0, 0, 0, 0 4 | 0, 10, 20, 35, 25 5 | 0, 0, 0 6 | 50 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game3/scores_files/federal.txt: -------------------------------------------------------------------------------- 1 | 0, 40, 10, 29 2 | 0, 25, 20 3 | 10, 14, 6, 0 4 | 0, 9, 13, 7, 0 5 | 0, 8, 5 6 | 55 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game3/scores_files/state.txt: -------------------------------------------------------------------------------- 1 | 0, 5, 3, 7 2 | 0, 24, 30 3 | 24, 12, 30, 0 4 | 0, 11, 17, 15, 5 5 | 0, 11, 16 6 | 45 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/vendor_retailer/config.txt: -------------------------------------------------------------------------------- 1 | SupplyPro,supplypro,p1,greedy,gpt-4-low 2 | RetailMax,retailmax,p2,greedy,gpt-4-low 3 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base/scores_files/other_cities.txt: -------------------------------------------------------------------------------- 1 | 0, 4, 10 2 | 0, 0, 0 3 | 12, 8, 6, 0 4 | 0, 8, 13, 18 5 | 60, 45, 30, 15, 0 6 | 31 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base_rewritten/scores_files/enviroment.txt: -------------------------------------------------------------------------------- 1 | 0, 0, 0, 0 2 | 0, 22, 45 3 | 0, 25, 55 4 | 0, 0, 0, 0, 0 5 | 0, 0, 0, 0 6 | 50 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base_rewritten/scores_files/mayor.txt: -------------------------------------------------------------------------------- 1 | 40, 30, 23, 0 2 | 14, 8, 0 3 | 12, 8, 0 4 | 0, 2, 4, 7, 10 5 | 24, 18, 12, 0 6 | 30 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base_rewritten/scores_files/union.txt: -------------------------------------------------------------------------------- 1 | 30, 20, 10, 0 2 | 15, 20, 0 3 | 0, 0, 0 4 | 2, 4, 6, 8, 0 5 | 42, 35, 25, 0 6 | 50 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game1/scores_files/construction.txt: -------------------------------------------------------------------------------- 1 | 15, 22, 5 2 | 10, 15, 29, 40 3 | 6, 10, 2, 0 4 | 0, 6, 4, 2, 0 5 | 0, 22, 15 6 | 57 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game1/scores_files/enviroment.txt: -------------------------------------------------------------------------------- 1 | 0, 20, 25 2 | 11, 9, 5, 0 3 | 0, 10, 29, 40 4 | 0, 9, 11, 13, 15 5 | 2, 5, 9 6 | 60 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game2/scores_files/foreign_agency.txt: -------------------------------------------------------------------------------- 1 | 0, 15, 25, 20, 0 2 | 0, 7, 4 3 | 15, 5, 0, 10 4 | 13, 0, 9 5 | 26, 40, 10, 0 6 | 60 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game2/scores_files/government.txt: -------------------------------------------------------------------------------- 1 | 0, 10, 15, 20, 25 2 | 14, 7, 0 3 | 0, 0, 35, 25 4 | 0, 9, 5 5 | 0, 0, 17, 10 6 | 37 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game2/scores_files/landowners.txt: -------------------------------------------------------------------------------- 1 | 5, 10, 20, 30, 40 2 | 16, 12, 5 3 | 22, 0, 10, 15 4 | 0, 22, 17 5 | 0, 0, 0, 0 6 | 40 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game3/scores_files/community.txt: -------------------------------------------------------------------------------- 1 | 20, 20, 25, 0 2 | 0, 15, 20 3 | 0, 0, 0, 0 4 | 0, 17, 25, 30, 35 5 | 0, 15, 20 6 | 50 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/vendor_retailer/scores_files/retailmax.txt: -------------------------------------------------------------------------------- 1 | 5, 20, 10 2 | 0, 15, 30 3 | 25, 15, 0 4 | 5, 15, 25 5 | 20, 10, 5 6 | 60 7 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/vendor_retailer/scores_files/supplypro.txt: -------------------------------------------------------------------------------- 1 | 25, 15, 5 2 | 30, 20, 0 3 | 0, 15, 25 4 | 25, 15, 5 5 | 5, 10, 20 6 | 65 7 | -------------------------------------------------------------------------------- /textarena/envs/UltimateTexasHoldem/__init__.py: -------------------------------------------------------------------------------- 1 | from textarena.envs.UltimateTexasHoldem.env import UltimateTexasHoldemEnv 2 | 3 | __all__ = ["UltimateTexasHoldemEnv"] -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base_rewritten/scores_files/company.txt: -------------------------------------------------------------------------------- 1 | 35, 29, 20, 0 2 | 14, 8, 0 3 | 11, 7, 0 4 | 0, 5, 10, 15, 23 5 | 0, 5, 10, 17 6 | 55 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base_rewritten/scores_files/department.txt: -------------------------------------------------------------------------------- 1 | 10, 26, 40, 0 2 | 0, 11, 5 3 | 0, 20, 25 4 | 4, 8, 15, 12, 0 5 | 0, 2, 4, 9 6 | 65 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game2/scores_files/project_manager.txt: -------------------------------------------------------------------------------- 1 | 5, 10, 23, 15, 5 2 | 35, 25, 0 3 | 17, 0, 5, 10 4 | 0, 14, 8 5 | 11, 0, 7, 7 6 | 59 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game3/scores_files/private_investors.txt: -------------------------------------------------------------------------------- 1 | 25, 20, 0, 10 2 | 18, 13, 0 3 | 25, 10, 0, 32 4 | 15, 12, 8, 4, 0 5 | 10, 5, 0 6 | 63 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base_rewritten/scores_files/other_cities.txt: -------------------------------------------------------------------------------- 1 | 0, 8, 13, 18 2 | 0, 4, 10 3 | 0, 0, 0 4 | 60, 45, 30, 15, 0 5 | 12, 8, 6, 0 6 | 31 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/medical_ethics/scores_files/head_nurse.txt: -------------------------------------------------------------------------------- 1 | 20, 15, 10, 0 2 | 5, 10, 8 3 | 8, 12, 4 4 | 25, 18, 10, 3 5 | 15, 12, 8, 5 6 | 50 7 | -------------------------------------------------------------------------------- /textarena/wrappers/RenderWrappers/__init__.py: -------------------------------------------------------------------------------- 1 | from textarena.wrappers.RenderWrappers.SimpleRenderWrapper.render import SimpleRenderWrapper 2 | __all__ = ["SimpleRenderWrapper"] -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base_7players/scores_files/DoT.txt: -------------------------------------------------------------------------------- 1 | 0, 9, 5 2 | 0, 10, 18 3 | 0, 2, 4, 7 4 | 10, 17, 28, 0 5 | 4, 8, 12, 10, 0 6 | 26, 15, 8, 0 7 | 56 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base_7players/scores_files/mayor.txt: -------------------------------------------------------------------------------- 1 | 12, 7, 0 2 | 10, 6, 0 3 | 19, 14, 7, 0 4 | 36, 23, 15, 0 5 | 0, 2, 4, 5, 8 6 | 7, 10, 15, 0 7 | 41 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base_7players/scores_files/union.txt: -------------------------------------------------------------------------------- 1 | 12, 18, 0 2 | 0, 0, 0 3 | 40, 35, 25, 0 4 | 28, 17, 8, 0 5 | 2, 4, 6, 8, 0 6 | 2, 3, 6, 0 7 | 48 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/medical_ethics/scores_files/ethics_rep.txt: -------------------------------------------------------------------------------- 1 | 25, 18, 12, 5 2 | 10, 10, 10 3 | 10, 10, 10 4 | 15, 12, 8, 5 5 | 25, 20, 15, 8 6 | 55 7 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/medical_ethics/scores_files/physician.txt: -------------------------------------------------------------------------------- 1 | 18, 15, 12, 8 2 | 12, 15, 12 3 | 15, 15, 12 4 | 20, 16, 12, 8 5 | 18, 15, 12, 10 6 | 48 7 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/medical_ethics/scores_files/social_worker.txt: -------------------------------------------------------------------------------- 1 | 15, 12, 10, 8 2 | 8, 12, 15 3 | 25, 18, 10 4 | 12, 10, 8, 6 5 | 22, 18, 12, 8 6 | 45 7 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base_7players/scores_files/SportCo.txt: -------------------------------------------------------------------------------- 1 | 11, 7, 0 2 | 9, 5, 0 3 | 0, 5, 8, 14 4 | 30, 22, 18, 0 5 | 0, 5, 10, 15, 20 6 | 0, 2, 8, 16 7 | 54 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base_7players/scores_files/enviroment.txt: -------------------------------------------------------------------------------- 1 | 0, 17, 30 2 | 0, 20, 45 3 | 0, 0, 0, 0 4 | 0, 0, 0, 0 5 | 0, 0, 0, 0, 0 6 | 25, 14, 8, 0 7 | 55 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base_7players/scores_files/heritage.txt: -------------------------------------------------------------------------------- 1 | 0, 15, 25 2 | 0, 12, 18 3 | 0, 0, 0, 0 4 | 17, 12, 8, 0 5 | 0, 0, 0, 0, 0 6 | 40, 30, 15, 0 7 | 50 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base_7players/scores_files/other_cities.txt: -------------------------------------------------------------------------------- 1 | 0, 4, 10 2 | 0, 0, 0 3 | 12, 8, 6, 0 4 | 0, 8, 13, 18 5 | 50, 40, 30, 15, 0 6 | 5, 10, 8, 0 7 | 34 -------------------------------------------------------------------------------- /textarena/envs/WildTicTacToe/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | def create_board_str(board: List[List[str]]) -> str: return "\n---+---+---\n".join("|".join(f" {board[r][c]} " if board[r][c] else f" " for c in range(3)) for r in range(3)) 3 | -------------------------------------------------------------------------------- /textarena/wrappers/ActionWrappers/__init__.py: -------------------------------------------------------------------------------- 1 | from textarena.wrappers.ActionWrappers.clip_action_wrapper import ClipCharactersActionWrapper, ClipWordsActionWrapper 2 | from textarena.wrappers.ActionWrappers.action_formatting_wrapper import ActionFormattingWrapper -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.md 2 | include LICENSE 3 | recursive-include textarena *.json 4 | recursive-include textarena *.jsonl 5 | recursive-include textarena *.py 6 | recursive-include textarena/envs *.json 7 | recursive-include textarena/envs/utils/data *.dic *.aff 8 | -------------------------------------------------------------------------------- /textarena/envs/Diplomacy/prompts/README.md: -------------------------------------------------------------------------------- 1 | This folder contains the prompts for the Diplomacy environment, which are mainly adapted from the [AI_Diplomacy](https://github.com/Alx-AI/AI_Diplomacy) GitHub repository. We appreciate their work and the community that has built up around it. -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/medical_ethics/config.txt: -------------------------------------------------------------------------------- 1 | Head Nurse,head_nurse,player,cooperative,gpt-4-low 2 | Ethics Committee Representative,ethics_rep,player,cooperative,gpt-4-low 3 | Attending Physician,physician,player,cooperative,gpt-4-low 4 | Social Worker,social_worker,player,cooperative,gpt-4-low 5 | -------------------------------------------------------------------------------- /textarena/envs/VendorNegotiation/data/roles/vendor/default.txt: -------------------------------------------------------------------------------- 1 | NEGOTIATION STYLE: Balanced 2 | 3 | You are a professional vendor seeking profitable deals that maintain good platform relationships. 4 | Balance short-term profit with long-term partnership value. 5 | Be open to reasonable discounts that increase volume while protecting your margins. -------------------------------------------------------------------------------- /textarena/envs/TicTacToe/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | def create_board_str(board: List[List[str]]) -> str: 4 | lines = [] 5 | for r in range(3): 6 | lines.append(" " + " | ".join([(board[r][c] if board[r][c] else " ") for c in range(3)])) 7 | if r < 2: lines.append(" ---+---+---") 8 | return "\n".join(lines) 9 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base/config.txt: -------------------------------------------------------------------------------- 1 | Mayor,mayor,player,cooperative,gpt-4-low 2 | Other cities,other_cities,player,cooperative,gpt-4-low 3 | Local Labour Union,union,player,cooperative,gpt-4-low 4 | SportCo,SportCo,p1,greedy,gpt-4-low 5 | Department of Tourism,DoT,p2,greedy,gpt-4-low 6 | Environmental League,enviroment,player,greedy,gpt-4-low -------------------------------------------------------------------------------- /textarena/envs/VendorNegotiation/data/roles/brand/default.txt: -------------------------------------------------------------------------------- 1 | NEGOTIATION STYLE: Balanced 2 | 3 | You are a professional negotiator seeking fair deals that achieve sales targets while maintaining good vendor relationships. 4 | Use data to support your proposals and be open to compromise. 5 | Consider both short-term sales goals and long-term partnership value. 6 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game2/config.txt: -------------------------------------------------------------------------------- 1 | Foreign aid agency,foreign_agency,p2,cooperative,gpt-4-0613 2 | Project manager,project_manager,p1,cooperative,gpt-4-0613 3 | Local government,government,player,cooperative,gpt-4-0613 4 | Landowners,landowners,player,cooperative,gpt-4-0613 5 | Local NGO,NGO,player,cooperative,gpt-4-0613 6 | Local Activists,activists,player,cooperative,gpt-4-0613 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base_rewritten/config.txt: -------------------------------------------------------------------------------- 1 | Ministry of Culture and Sport,department,p2,cooperative,gpt-4-0613 2 | Green Alliance,enviroment,player,cooperative,gpt-4-0613 3 | governor,mayor,player,cooperative,gpt-4-0613 4 | neighbouring cities,other_cities,player,cooperative,gpt-4-0613 5 | Eventix,company,p1,cooperative,gpt-4-0613 6 | The Local Workers' Union,union,player,cooperative,gpt-4-0613 -------------------------------------------------------------------------------- /textarena/envs/Diplomacy/prompts/prompt.py: -------------------------------------------------------------------------------- 1 | 2 | def load_prompt(filename: str) -> str: 3 | """Helper to load prompt text from file""" 4 | with open(f"textarena/envs/Diplomacy/prompts/{filename}", "r") as f: 5 | return f.read().strip() 6 | 7 | def get_state_specific_prompt(state: str) -> str: 8 | return load_prompt(f"state_specific/{state.lower()}_system_prompt.txt") 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /textarena/agents/__init__.py: -------------------------------------------------------------------------------- 1 | # Agents 2 | from textarena.agents.basic_agents import HumanAgent, OpenRouterAgent, GeminiAgent, OpenAIAgent, HFLocalAgent, CerebrasAgent, AWSBedrockAgent, AnthropicAgent, GroqAgent, OllamaAgent, LlamaCppAgent 3 | 4 | __all__ = ["HumanAgent", "OpenRouterAgent", "GeminiAgent", "OpenAIAgent", "HFLocalAgent", "CerebrasAgent", "AWSBedrockAgent", "AnthropicAgent", "GroqAgent", "OllamaAgent", "LlamaCppAgent"] -------------------------------------------------------------------------------- /textarena/envs/Diplomacy/prompts/context_prompt.txt: -------------------------------------------------------------------------------- 1 | ## PLAYER DETAILS 2 | Current phase: {phase_info} 3 | 4 | ## HISTORY OF COMMUNICATION 5 | 6 | {history_text} 7 | 8 | ## YOUR POWER STATE SUMMARY 9 | {our_state_summary_text} 10 | 11 | ## OTHER PLAYERS STATE SUMMARY 12 | {other_state_summary_text} 13 | 14 | ## NEUTRAL STATE SUMMARY 15 | {neutral_state_summary_text} 16 | 17 | ## POSSIBLE ORDERS 18 | {possible_orders_text} -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game1/config.txt: -------------------------------------------------------------------------------- 1 | international development bank,bank,p2,cooperative,gpt-4-0613 2 | environmental NGO,enviroment,player,cooperative,gpt-4-0613 3 | government,proposing,p1,cooperative,gpt-4-0613 4 | construction company,construction,player,cooperative,gpt-4-0613 5 | indigenous community,community,player,cooperative,gpt-4-0613 6 | local tourism association,tourism,player,cooperative,gpt-4-0613 -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game3/config.txt: -------------------------------------------------------------------------------- 1 | Federal government of Germany,federal,p2,cooperative,gpt-4-0613 2 | Private investors,private_investors,p1,cooperative,gpt-4-0613 3 | State government of Saarland,state,player,cooperative,gpt-4-0613 4 | Environmental activists,activists,player,cooperative,gpt-4-0613 5 | France,france,player,cooperative,gpt-4-0613 6 | Local community of Neunkirchen,community,player,cooperative,gpt-4-0613 -------------------------------------------------------------------------------- /textarena/envs/ReverseTicTacToe/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | def create_board_str(board: List[List[str]]) -> str: 4 | lines = [] 5 | for r in range(3): 6 | row = [] 7 | for c in range(3): 8 | val = board[r][c] 9 | row.append(val if val else " ") 10 | lines.append(" " + " | ".join(row)) 11 | if r < 2: lines.append(" ---+---+---") 12 | return "\n".join(lines) 13 | -------------------------------------------------------------------------------- /textarena/envs/TwoDollar/roles/non_enforceable/vanilla.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vanilla", 3 | "enforcement": "none", 4 | "instructions": "This is zero-sum bargaining and you should get as much of the $2.00 as you can. Make up any story you wish and bargain as effectively as possible to maximize your share of the money.", 5 | "victory_condition": "Reach any deal and get as much money as possible", 6 | "failure_condition": "No deal reached" 7 | } 8 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base_7players/config.txt: -------------------------------------------------------------------------------- 1 | Mayor,mayor,player,cooperative,gpt-4-low 2 | Other cities,other_cities,player,cooperative,gpt-4-low 3 | Local Labour Union,union,player,cooperative,gpt-4-low 4 | SportCo,SportCo,p1,cooperative,gpt-4-low 5 | Department of Tourism,DoT,p2,cooperative,gpt-4-low 6 | Environmental League,enviroment,player,cooperative,gpt-4-low 7 | National Heritage Committee,heritage,player,cooperative,gpt-4-low -------------------------------------------------------------------------------- /textarena/envs/TwoDollar/roles/enforceable/1_60_dollar.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "1_60_dollar", 3 | "threshold": 1.60, 4 | "enforcement": "end_game_check", 5 | "instructions": "This is zero-sum bargaining and you should get as much of the $2 as you can, with any story you like.\n\nIt is really important that you should get $1.60 in this round.", 6 | "victory_condition": "Receive at least $1.60 AND reach a deal", 7 | "failure_condition": "Receive less than $1.60 OR no deal reached" 8 | } 9 | -------------------------------------------------------------------------------- /textarena/envs/TwoDollar/roles/enforceable/1_dollar.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "1_dollar", 3 | "threshold": 1.00, 4 | "enforcement": "end_game_check", 5 | "instructions": "This is zero-sum bargaining and you should get as much of the $2.00 as you can, with any story you like.\n\nIt is really important that you should get at least $1.00 in this round.", 6 | "victory_condition": "Receive at least $1.00 AND reach a deal", 7 | "failure_condition": "Receive less than $1.00 OR no deal reached" 8 | } 9 | -------------------------------------------------------------------------------- /textarena/envs/TwoDollar/roles/enforceable/1_30_dollar.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "1_30_dollar", 3 | "threshold": 1.30, 4 | "enforcement": "end_game_check", 5 | "instructions": "This is zero-sum bargaining and you should get as much of the $2.00 as you can, with any story you like.\n\nIt is really important that you should get at least $1.30 in this round.", 6 | "victory_condition": "Receive at least $1.30 AND reach a deal", 7 | "failure_condition": "Receive less than $1.30 OR no deal reached" 8 | } 9 | -------------------------------------------------------------------------------- /textarena/envs/VendorNegotiation/data/roles/brand/collaborative.txt: -------------------------------------------------------------------------------- 1 | NEGOTIATION STYLE: Collaborative 2 | 3 | You believe in win-win negotiations that build long-term partnerships. You should: 4 | - Seek balanced deals (5-10% discounts typically) 5 | - Consider the vendor's profit margins 6 | - Build trust through transparency 7 | - Look for creative solutions 8 | - Emphasize long-term relationship value 9 | 10 | Remember: A sustainable partnership is more valuable than a one-time sales spike. 11 | -------------------------------------------------------------------------------- /textarena/envs/VendorNegotiation/data/roles/vendor/profit_focused.txt: -------------------------------------------------------------------------------- 1 | NEGOTIATION STYLE: Profit Maximizer 2 | 3 | Your primary goal is maximizing profit margins. You should: 4 | - Resist deep discounts (prefer 0-5%) 5 | - Emphasize product quality and value 6 | - Use scarcity tactics ("Limited inventory") 7 | - Highlight your costs and margins 8 | - Be willing to sacrifice volume for margin 9 | 10 | Remember: A 20% discount might increase volume but could hurt your bottom line. Protect your margins. 11 | -------------------------------------------------------------------------------- /textarena/envs/VendorNegotiation/data/roles/vendor/volume_seeker.txt: -------------------------------------------------------------------------------- 1 | NEGOTIATION STYLE: Volume Seeker 2 | 3 | You believe in "make it up in volume" strategy. You should: 4 | - Be flexible on discounts (willing to go 15-20%) 5 | - Emphasize market share and brand visibility 6 | - Focus on long-term customer acquisition 7 | - Use volume commitments to justify discounts 8 | - Think about repeat business 9 | 10 | Remember: Today's discount could lead to tomorrow's loyal customer base. Volume drives success. 11 | -------------------------------------------------------------------------------- /textarena/envs/VendorNegotiation/data/roles/vendor/relationship_builder.txt: -------------------------------------------------------------------------------- 1 | NEGOTIATION STYLE: Relationship Builder 2 | 3 | You prioritize long-term partnerships over short-term gains. You should: 4 | - Focus on building trust and rapport 5 | - Be transparent about your constraints 6 | - Seek mutually beneficial solutions 7 | - Consider the platform's needs alongside your own 8 | - Emphasize reliability and consistency 9 | 10 | Remember: A strong partnership today means more opportunities tomorrow. Invest in the relationship. 11 | -------------------------------------------------------------------------------- /textarena/envs/VendorNegotiation/data/roles/brand/data_driven.txt: -------------------------------------------------------------------------------- 1 | NEGOTIATION STYLE: Data-Driven 2 | 3 | You are an analytical negotiator who relies heavily on statistics and projections. You should: 4 | - Reference specific numbers from the sales data 5 | - Calculate expected outcomes for different scenarios 6 | - Use confidence intervals to show uncertainty 7 | - Compare different discount combinations systematically 8 | - Make evidence-based arguments 9 | 10 | Remember: Let the data guide your decisions. Show your calculations to build credibility. 11 | -------------------------------------------------------------------------------- /textarena/wrappers/ObservationWrappers/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | from textarena.wrappers.ObservationWrappers.llm_observation_wrapper import LLMObservationWrapper, GameBoardObservationWrapper, GameMessagesObservationWrapper, GameMessagesAndCurrentBoardObservationWrapper, SingleTurnObservationWrapper, SettlersOfCatanObservationWrapper #, GameMessagesAndCurrentBoardWithInvalidMovesObservationWrapper, SettlersOfCatanObservationWrapper 3 | from textarena.wrappers.ObservationWrappers.classical_reasoning_eval_observation_wrapper import ClassicalReasoningEvalsObservationWrapper 4 | -------------------------------------------------------------------------------- /textarena/envs/Diplomacy/prompts/context_prompt copy.txt: -------------------------------------------------------------------------------- 1 | ## PLAYER DETAILS 2 | Current phase: {phase_info} 3 | 4 | ## EXPERIENCE 5 | {experience_text} 6 | 7 | ## HISTORY OF COMMUNICATION 8 | 9 | {history_text} 10 | 11 | ## STATE SUMMARY 12 | {state_summary_text} 13 | 14 | ## PHASE SUMMARY 15 | {phase_summary_text}(Self models/other models) 16 | 17 | ## POSSIBLE ORDERS 18 | {possible_orders_text}(TODO Expand the possible orders: Offensive, Defensive, Neutral. Allow submit orders throughout turn. Or generate the strategy first then generate the order in format.) -------------------------------------------------------------------------------- /textarena/envs/Nim/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | def create_board_str(piles: List[int]) -> str: 4 | max_tokens = max(piles) if piles else 0 5 | lines = [] 6 | for i, count in enumerate(piles): # Each row 7 | token_cells = [f"│ {'●' if j < count else ' '}" for j in range(max_tokens)] 8 | token_row = " ".join(token_cells) + " │" 9 | border_row = " "+"└───" * max_tokens + "┘" 10 | lines.append(f"Row {i + 1}: {token_row}") 11 | lines.append(border_row + "\n") 12 | return "\n".join(lines).rstrip() 13 | -------------------------------------------------------------------------------- /textarena/envs/VendorNegotiation/data/roles/brand/aggressive.txt: -------------------------------------------------------------------------------- 1 | NEGOTIATION STYLE: Aggressive 2 | 3 | You are a hard-nosed negotiator who believes in maximizing sales at all costs. You should: 4 | - Push for the highest discounts possible 5 | - Use competitive pressure ("Other vendors are offering better deals") 6 | - Be willing to walk away if demands aren't met 7 | - Focus on volume over vendor relationships 8 | - Use data to justify aggressive discount requests 9 | 10 | Remember: Your performance is measured purely on sales numbers. The vendor's profit is not your concern. 11 | -------------------------------------------------------------------------------- /textarena/envs/UltimateTicTacToe/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | def create_board_str(board: List[List[List[str]]]) -> str: 4 | lines = [] 5 | for macro_row in range(3): 6 | for micro_row in range(3): 7 | row_line = [] 8 | for macro_col in range(3): 9 | row_line.extend(board[macro_row * 3 + macro_col][micro_row]) 10 | row_line.append('|') 11 | row_render = ' '.join(row_line[:-1]) 12 | lines.append(row_render) 13 | if macro_row < 2: lines.append('-' * 21) 14 | return "\n".join(lines) 15 | 16 | -------------------------------------------------------------------------------- /textarena/envs/Othello/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | def create_board_str(board: List[List[str]]) -> str: 4 | piece_symbols = {'B': '●', 'W': '○', '': ' '} 5 | lines = [] 6 | lines.append(" " + " ".join(str(i) for i in range(8))) 7 | lines.append(" "+"┌" + "───┬" * 7 + "───┐") 8 | for r in range(8): 9 | row_cells = " │ ".join(piece_symbols[cell] for cell in board[r]) 10 | lines.append(f"{r} │ {row_cells} │") 11 | if r < 7: lines.append(" "+"├" + "───┼" * 7 + "───┤") 12 | else: lines.append(" "+"└" + "───┴" * 7 + "───┘") 13 | return "\n".join(lines) 14 | -------------------------------------------------------------------------------- /textarena/envs/FifteenPuzzle/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | def create_board_str(game_state) -> str: 4 | board: List[List[Optional[int]]] = game_state["board"] 5 | header = " " + " ".join([f"C{i}" for i in range(4)]) 6 | lines = [header] 7 | lines.append(" +" + "----+" * 4) 8 | for i, row in enumerate(board): 9 | row_str = f"R{i} |" 10 | for tile in row: 11 | cell = f"{tile:<2}" if tile is not None else "__" 12 | row_str += f" {cell} |" 13 | lines.append(row_str) 14 | lines.append(" +" + "----+" * 4) 15 | return "\n".join(lines) 16 | -------------------------------------------------------------------------------- /textarena/envs/TwoDollar/roles/non_enforceable/another_chance.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "another_chance", 3 | "enforcement": "none", 4 | "instructions": "You may make up any story you wish, to win as much as you can from your colleague.\n\nIf you do not reach a settlement this session, don't worry about it. You will have a chance to continue with this person. What matters most is your meeting your own objectives when you do settle, (so think through carefully what those objectives are).", 5 | "victory_condition": "Reach any deal OR walk away strategically", 6 | "failure_condition": "Accept a deal that doesn't meet your personal objectives" 7 | } 8 | -------------------------------------------------------------------------------- /textarena/envs/TwoDollar/roles/non_enforceable/imaginative.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "imaginative", 3 | "enforcement": "none", 4 | "instructions": "This is zero-sum bargaining and you want to get just as much of the $2.00 as you possibly can.\n\nPlease spend a moment and be really imaginative. You were chosen for this instruction because of your creativity and inventiveness. So be imaginative, be convincing, and bargain just as effectively as you can. Make up the most convincing tale you can and good luck!", 5 | "victory_condition": "Use creative storytelling AND reach any deal", 6 | "failure_condition": "Be boring/uncreative OR no deal reached" 7 | } 8 | -------------------------------------------------------------------------------- /textarena/envs/TwoDollar/roles/enforceable/80_cents.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "80_cents", 3 | "threshold": 0.80, 4 | "enforcement": "end_game_check", 5 | "instructions": "Try to get as much of the $2.00 as you can; make up any story you want. Whatever else your objectives, you should be careful to get at least 80 cents of the $2.00 because you will have to make a toll call to your family and they will be terribly worried and upset if you do not make that call. So do as well as you can, and remember you must get at least 80 cents.", 6 | "victory_condition": "Receive at least $0.80 AND reach a deal", 7 | "failure_condition": "Receive less than $0.80 OR no deal reached" 8 | } 9 | -------------------------------------------------------------------------------- /textarena/envs/TwoDollar/roles/non_enforceable/dependent.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dependent", 3 | "enforcement": "none", 4 | "instructions": "You may make up any story you wish. You should try to get as much of the $2 as you can.\n\nHowever it is important to remember that you will be dependent on this colleague for a long time to come. This simulation is only the first of many contacts with the other person, so you will want to be extra careful not to offend in any way. Do as well as you can in the context of the long-term association to come.", 5 | "victory_condition": "Reach any deal while maintaining good relationship", 6 | "failure_condition": "No deal reached OR offend your colleague" 7 | } 8 | -------------------------------------------------------------------------------- /textarena/envs/TwoDollar/roles/non_enforceable/untrustworthy.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "untrustworthy", 3 | "enforcement": "none", 4 | "instructions": "This is zero-sum bargaining. You should get as much of the $2.00 as you can; make up any story you like; be as effective as you can.\n\nA warning: your colleague has been extraordinarily untrustworthy in all previous $2 bargaining simulations. Be polite, but please be very much on your guard. Consider carefully anything you are told and be wary. Consider whether you can believe anything your colleague says.", 5 | "victory_condition": "Reach any deal while being appropriately cautious", 6 | "failure_condition": "No deal reached OR be too trusting" 7 | } 8 | -------------------------------------------------------------------------------- /textarena/envs/TwoDollar/roles/enforceable/50_cents.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "50_cents", 3 | "threshold": 0.50, 4 | "enforcement": "end_game_check", 5 | "instructions": "Try to get as much of the $2.00 as you can. Bargain as effectively as possible; make up any story you wish.\n\nIt is extremely important to you that you at least get bus money to get home tonight: 50 cents. If you do not get at least 50 cents, you will be walking for more than an hour and it will be dark and cold, out where you live. Actually, get more if you can; be as effective as possible.", 6 | "victory_condition": "Receive at least $0.50 AND reach a deal", 7 | "failure_condition": "Receive less than $0.50 OR no deal reached" 8 | } 9 | -------------------------------------------------------------------------------- /textarena/envs/TruthAndDeception/renderer.py: -------------------------------------------------------------------------------- 1 | def create_board_str(game_state: dict) -> str: 2 | lines = [] 3 | lines.append("+" + "-" * 79 + "+") 4 | lines.append("| {:<7} | {:<60} | {:^3} |".format("Fact 1", game_state["fact1"]["fact"][:60], "✅" if game_state["fact1"]["is_correct"] else "❌")) 5 | lines.append("| {:<7} | {:<60} | {:^3} |".format("Fact 2", game_state["fact2"]["fact"][:60], "✅" if game_state["fact2"]["is_correct"] else "❌")) 6 | lines.append("+" + "-" * 79 + "+") 7 | lines.append("| {:<10} | {:<64} |".format("Player 0", "Deceiver")) 8 | lines.append("| {:<10} | {:<64} |".format("Player 1", "Guesser")) 9 | lines.append("+" + "-" * 79 + "+") 10 | return "\n".join(lines) 11 | -------------------------------------------------------------------------------- /textarena/envs/TwoDollar/roles/non_enforceable/tape_recorder.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tape_recorder", 3 | "enforcement": "none", 4 | "instructions": "This is zero-sum bargaining and you should get as much of the $2 as you can, with any story you like.\n\nHowever, your colleague is quite likely to be wearing a hidden tape recorder, and may be a journalist. Your colleague may be working for a newspaper or may be working for \"60 Minutes.\" (Please be very careful that you would feel comfortable seeing your story in the Washington Post or on television.)", 5 | "victory_condition": "Reach any deal while being careful about what you say", 6 | "failure_condition": "No deal reached OR say something you'd regret seeing published" 7 | } 8 | -------------------------------------------------------------------------------- /textarena/envs/TwoDollar/roles/enforceable/x_rounds.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "x_rounds", 3 | "enforcement": "end_game_check", 4 | "deadline_calculation": "half_total_rounds", 5 | "instructions": "This game ends in {deadline} rounds for you (while your opponent gets the full {total_rounds} rounds). Please do everything you can to reach a settlement within {deadline} rounds. You may make up any story you wish, to win as much of the $2 as possible. However keep in mind that it matters a lot that you are able to meet your deadline and actually reach a settlement; this is your most important priority.", 6 | "victory_condition": "Accept any deal before round {deadline}", 7 | "failure_condition": "Fail to accept a deal by round {deadline}" 8 | } 9 | -------------------------------------------------------------------------------- /test.py: -------------------------------------------------------------------------------- 1 | """ A minimal script showing how to run textarena locally """ 2 | 3 | import textarena as ta 4 | 5 | agents = { 6 | 0: ta.agents.HumanAgent(), 7 | 1: ta.agents.OpenRouterAgent(model_name="google/gemini-2.0-flash-001"), 8 | } 9 | 10 | # initialize the environment 11 | env = ta.make(env_id="SimpleTak-v0-train") 12 | # env = ta.wrappers.SimpleRenderWrapper(env=env) #, render_mode="standard") 13 | env.reset(num_players=len(agents)) 14 | 15 | # main game loop 16 | done = False 17 | while not done: 18 | player_id, observation = env.get_observation() 19 | action = agents[player_id](observation) 20 | done, step_info = env.step(action=action) 21 | rewards, game_info = env.close() 22 | print(rewards) 23 | print(game_info) 24 | -------------------------------------------------------------------------------- /textarena/envs/TwoDollar/roles/non_enforceable/battle_ax.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "battle_ax", 3 | "enforcement": "none", 4 | "instructions": "You are a well-known and consistent battle-ax. You are known for always getting every penny out of every competitor.\n\nPlease try to imagine that you will never see the other person again, but everyone else who matters to you is waiting to see if you can play this game effectively. Make up any story you want, as strong a case as you can. Get as much of the $2.00 as you can.\n\nThis is a chance to live up to your formidable reputation as a really effective competitor; go to it!", 5 | "victory_condition": "Reach any deal (assume aggressive behavior followed)", 6 | "failure_condition": "No deal reached" 7 | } 8 | -------------------------------------------------------------------------------- /examples/offline_play.py: -------------------------------------------------------------------------------- 1 | """ A minimal script showing how to run textarena locally """ 2 | 3 | import textarena as ta 4 | 5 | 6 | agents = { 7 | 0: ta.agents.HumanAgent(), 8 | 1: ta.agents.OpenRouterAgent(model_name="moonshotai/kimi-k2:free"), 9 | } 10 | 11 | # initialize the environment 12 | #env = ta.make(env_id="TicTacToe-v0-train") 13 | env = ta.make(env_id="Chess-v0") 14 | env.reset(num_players=len(agents)) 15 | 16 | # main game loop 17 | done = False 18 | while not done: 19 | player_id, observation = env.get_observation() 20 | action = agents[player_id](observation) 21 | done, step_info = env.step(action=action) 22 | rewards, game_info = env.close() 23 | 24 | print(f"Rewards: {rewards}") 25 | print(f"Game Info: {game_info}") -------------------------------------------------------------------------------- /textarena/envs/TwoDollar/roles/non_enforceable/public_figure.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "public_figure", 3 | "enforcement": "none", 4 | "instructions": "This is zero-sum bargaining and you should get as much of the $2 as you can, with any story you like.\n\nHowever, you are a well-known public figure, with a reputation for fairness, decency and graciousness. Your reputation is extremely important to you and you should bear in mind that your colleague is likely to make public anything you say (and how you say it). So--do as well as you can, use any arguments or story you wish, but keep your reputation!", 5 | "victory_condition": "Reach any deal while maintaining your reputation", 6 | "failure_condition": "No deal reached OR damage your public reputation" 7 | } 8 | -------------------------------------------------------------------------------- /textarena/envs/TwoDollar/roles/enforceable/high_tension.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "high_tension", 3 | "enforcement": "action_validation", 4 | "behavioral_rules": { 5 | "max_concession": 0.01, 6 | "violation_message": "High Tension violation: ${concession:.2f} concession (max $0.01 allowed)" 7 | }, 8 | "instructions": "This is zero-sum bargaining. You should get as much of the $2.00 as you can, with any story you like.\n\nPlease keep up a high level of tension. Act concerned, repeat demands; don't give in at all, if you can help it. If you do give in, come down only one cent at a time. Please be tough.", 9 | "victory_condition": "Make only 1-cent concessions AND reach any deal", 10 | "failure_condition": "Make concessions >$0.01 three times OR no deal reached" 11 | } 12 | -------------------------------------------------------------------------------- /textarena/envs/ThreePlayerTicTacToe/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any 2 | 3 | def create_board_str(game_state: Dict[str, Any]) -> str: 4 | cell_width = max(2, len(str(len(game_state["board"]) * len(game_state["board"]) - 1))) 5 | def cell_display(r: int, c: int) -> str: return game_state["board"][r][c] if game_state["board"][r][c] else " " 6 | def horizontal_line() -> str: return "+" + "+".join(["-" * (cell_width + 2) for _ in range(len(game_state["board"]))]) + "+" 7 | lines = [horizontal_line()] 8 | for r in range(len(game_state["board"])): 9 | row = "|".join(f" {cell_display(r, c):^{cell_width}} " for c in range(len(game_state["board"]))) 10 | lines.append(f"|{row}|") 11 | lines.append(horizontal_line()) 12 | return "\n".join(lines) 13 | -------------------------------------------------------------------------------- /textarena/envs/TwoDollar/roles/non_enforceable/hard_time.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hard_time", 3 | "enforcement": "none", 4 | "instructions": "This person you are dealing with probably will not want to tell you about it but he or she has had a terribly hard month. This past month was full of disaster: money troubles, family difficulties, and none of it your colleague's fault. Through it all, your colleague has been bearing up.\n\nNevertheless, this is zero-sum bargaining, so get all you can. Make up whatever story you wish, and get as much of the $2.00 as possible. (Just remember that your colleague has been having a very hard time.)", 5 | "victory_condition": "Reach any deal while being appropriately sympathetic", 6 | "failure_condition": "No deal reached OR be too harsh given their difficulties" 7 | } 8 | -------------------------------------------------------------------------------- /textarena/envs/SimpleTak/renderer.py: -------------------------------------------------------------------------------- 1 | def create_board_str(board, board_size) -> str: 2 | def cell_str(r: int, c: int) -> str: return " " if board[r][c] == '' else board[r][c] 3 | def build_hline() -> str: 4 | line_parts = [] 5 | for _ in range(board_size): line_parts.append("-" * 3) 6 | return "+" + "+".join(line_parts) + "+" 7 | lines = [] 8 | lines.append(build_hline()) 9 | for r in range(board_size): 10 | row_cells = [] 11 | for c in range(board_size): 12 | text = cell_str(r, c) 13 | text_centered = f" {text:^{1}} " 14 | row_cells.append(text_centered) 15 | row_line = "|" + "|".join(row_cells) + "|" 16 | lines.append(row_line) 17 | lines.append(build_hline()) 18 | return "\n".join(lines) -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools>=61.0", "wheel"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | name = "TextArena" 7 | version = "0.7.3" 8 | description = "A Collection of Competitive Text-Based Games for Language Model Evaluation and Reinforcement Learning" 9 | readme = "README.md" 10 | requires-python = ">=3.10" 11 | license = {text = "MIT"} 12 | authors = [{name="Leon Guertler", email="Guertlerlo@cfar.a-star.edu.sg"},] 13 | dependencies = ["openai", "rich", "nltk", "chess", "python-dotenv", "requests", "websockets"] 14 | 15 | [project.urls] 16 | "Homepage" = "https://www.textarena.ai/" 17 | 18 | [project.optional-dependencies] 19 | all = ["sympy", "latex2sympy", "openai", "google-generativeai", "transformers", "cerebras-cloud-sdk", "boto3", "anthropic"] 20 | 21 | 22 | -------------------------------------------------------------------------------- /examples/online_play.py: -------------------------------------------------------------------------------- 1 | import textarena as ta 2 | MODEL_NAME = "Llama 3.3 70B LLM" 3 | MODEL_DESCRIPTION = "Groq Llama 3.3 70B Versatile model." 4 | EMAIL = "your.email@example.com" 5 | 6 | # Initialize agent 7 | agent = ta.agents.OpenRouterAgent(model_name="moonshotai/kimi-k2:free") 8 | 9 | env = ta.make_online( 10 | env_id=["SpellingBee-v0", "SimpleNegotiation-v0", "Poker-v0"], 11 | model_name=MODEL_NAME, 12 | model_description=MODEL_DESCRIPTION, 13 | email=EMAIL, 14 | agent=agent 15 | ) 16 | env.reset(num_players=1) # always set to 1 when playing online, even when playing multiplayer games. 17 | 18 | done = False 19 | while not done: 20 | player_id, observation = env.get_observation() 21 | action = agent(observation) 22 | done, step_info = env.step(action=action) 23 | 24 | rewards, game_info = env.close() -------------------------------------------------------------------------------- /textarena/envs/IteratedRockPaperScissors/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any 2 | def create_board_str(game_state: Dict[str, Any]) -> str: 3 | emoji_map = {"rock": "🪨", "paper": "📄", "scissors": "✂️ ", None: "❓"} 4 | round_num = game_state.get("round", 1) 5 | points = game_state.get("points", {0: 0, 1: 0}) 6 | history = game_state.get("history", []) 7 | lines = [] 8 | lines.append(f"🏁 Round: {round_num} / ?") 9 | lines.append(f"📊 Score: Player 0 = {points[0]} | Player 1 = {points[1]}") 10 | lines.append("") 11 | if history: 12 | lines.append("📜 History:") 13 | for i, (hist_dict) in enumerate(history, 1): lines.append(f" Round {i}: Player 0 {emoji_map[hist_dict[0]]} vs Player 1 {emoji_map[hist_dict[1]]}") 14 | else: lines.append("📜 No rounds completed yet.") 15 | return "\n".join(lines) 16 | -------------------------------------------------------------------------------- /textarena/envs/GuessTheNumber/renderer.py: -------------------------------------------------------------------------------- 1 | def create_board_str(game_state: dict) -> str: 2 | guess_history = game_state.get("guess_history", []) 3 | target = game_state.get("game_number", "?") 4 | 5 | lines = ["┌─ GUESS HISTORY ──────────────────┐", "│ │"] 6 | 7 | for i, (guess, hint) in enumerate(guess_history, 1): 8 | arrow = "↑ Higher" if hint == "higher" else "↓ Lower" if hint == "lower" else "" 9 | lines.append(f"│ Guess #{i}: {guess:<5} {arrow:<15} │") 10 | 11 | if not guess_history: 12 | lines.append("│ │") 13 | 14 | lines.append("│ │") 15 | lines.append(f"│ Target Number: {str(target).ljust(17)}│") 16 | lines.append("└──────────────────────────────────┘") 17 | 18 | return "\n".join(lines) 19 | -------------------------------------------------------------------------------- /examples/online_play_mindgameschallenge.py: -------------------------------------------------------------------------------- 1 | import textarena as ta 2 | 3 | MODEL_NAME = "Standard GPT-4o LLM" 4 | MODEL_DESCRIPTION = "Standard OpenAI GPT-4o model." 5 | team_hash = "MG25-XXXXXXXXXX" 6 | 7 | 8 | # Initialize agent 9 | agent = ta.agents.OpenRouterAgent(model_name="moonshotai/kimi-k2:free") 10 | 11 | env = ta.make_mgc_online( 12 | track="Generalization", 13 | model_name=MODEL_NAME, 14 | model_description=MODEL_DESCRIPTION, 15 | team_hash=team_hash, 16 | agent=agent, 17 | small_category=True 18 | ) 19 | env.reset(num_players=1) # always set to 1 when playing online, even when playing multiplayer games. 20 | 21 | done = False 22 | while not done: 23 | player_id, observation = env.get_observation() 24 | action = agent(observation) 25 | done, step_info = env.step(action=action) 26 | 27 | rewards, game_info = env.close() -------------------------------------------------------------------------------- /textarena/envs/TwentyQuestions/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any 2 | 3 | def create_board_str(game_state: Dict[str, Any]) -> str: 4 | """Render the gamemaster view of the 20 Questions game state.""" 5 | 6 | target_word = game_state.get("target_word", "???") 7 | history = game_state.get("history", []) 8 | 9 | lines = [] 10 | lines.append("🎯 Game: 20 Questions") 11 | lines.append("-" * 40) 12 | lines.append(f"Target Word: {target_word}") 13 | lines.append(f"Questions Asked: {len(history)} / 20") 14 | lines.append("-" * 40) 15 | 16 | if history: 17 | lines.append("📜 History:") 18 | for i, (q, a) in enumerate(history, start=1): 19 | lines.append(f"{i}. Q: {q}") 20 | lines.append(f" A: {a}") 21 | else: 22 | lines.append("No questions asked yet.") 23 | 24 | return "\n".join(lines) 25 | -------------------------------------------------------------------------------- /docs/ta_black.svg: -------------------------------------------------------------------------------- 1 | 2 | ████████╗ █████╗ 3 | ╚══██╔══╝██╔══██╗ 4 | ██║ ███████║ 5 | ██║ ██╔══██║ 6 | ██║ ██║ ██║ 7 | ╚═╝ ╚═╝ ╚═╝ 8 | -------------------------------------------------------------------------------- /docs/ta_white.svg: -------------------------------------------------------------------------------- 1 | 2 | ████████╗ █████╗ 3 | ╚══██╔══╝██╔══██╗ 4 | ██║ ███████║ 5 | ██║ ██╔══██║ 6 | ██║ ██║ ██║ 7 | ╚═╝ ╚═╝ ╚═╝ 8 | -------------------------------------------------------------------------------- /textarena/envs/Checkers/renderer.py: -------------------------------------------------------------------------------- 1 | def create_board_str(game_state: dict) -> str: 2 | board = game_state["board"] 3 | 4 | # Mapping pieces to symbols 5 | symbol_map = { 6 | "r": "🔴", "R": "🟥", 7 | "b": "⚫", "B": "⬛", 8 | ".": " " 9 | } 10 | 11 | lines = [] 12 | 13 | # Column header 14 | header = " " + " ".join(str(c) for c in range(8)) 15 | lines.append(header) 16 | 17 | # Top border 18 | lines.append(" ┌" + "────┬" * 7 + "────┐") 19 | 20 | for r in range(8): 21 | row = board[r] 22 | row_symbols = " │ ".join(symbol_map.get(cell, cell) for cell in row) 23 | lines.append(f"{r} │ {row_symbols} │") 24 | if r < 7: 25 | lines.append(" ├" + "────┼" * 7 + "────┤") 26 | else: 27 | lines.append(" └" + "────┴" * 7 + "────┘") 28 | 29 | return "\n".join(lines) 30 | -------------------------------------------------------------------------------- /textarena/envs/UsedCarNegotiation/instructions/blue_book.txt: -------------------------------------------------------------------------------- 1 | Blue Book Pricing 2 | ###################################################################### 3 | Estimated Market Value for 2006 Toyota Prius: 4 | 5 | Trade-in Private Party Dealer Retail 6 | ---------------------------------------------------------------------- 7 | National Base Price $7,737 $9,207 $10.410 8 | Optional Equipment $0 $0 $0 9 | Color $0 $0 $0 10 | Regional $-32 $-40 $-44 11 | Mileage $-667 $-667 $-667 12 | Condition $0 $0 $0 13 | ---------------------------------------------------------------------- 14 | Total $7,038 $8.500 $9,699 15 | -------------------------------------------------------------------------------- /textarena/wrappers/__init__.py: -------------------------------------------------------------------------------- 1 | from textarena.wrappers.RenderWrappers import SimpleRenderWrapper 2 | from textarena.wrappers.ObservationWrappers import LLMObservationWrapper, GameBoardObservationWrapper, GameMessagesObservationWrapper, GameMessagesAndCurrentBoardObservationWrapper, SingleTurnObservationWrapper, SettlersOfCatanObservationWrapper #, GameMessagesAndCurrentBoardWithInvalidMovesObservationWrapper 3 | from textarena.wrappers.ActionWrappers import ClipWordsActionWrapper, ClipCharactersActionWrapper, ActionFormattingWrapper 4 | 5 | __all__ = [ 6 | 'SimpleRenderWrapper', 7 | 'ClipWordsActionWrapper', 'ClipCharactersActionWrapper', 'ActionFormattingWrapper', 8 | 'LLMObservationWrapper', 'GameBoardObservationWrapper', 'GameMessagesObservationWrapper', 'GameMessagesAndCurrentBoardObservationWrapper', 'SingleTurnObservationWrapper', 'SettlersOfCatanObservationWrapper', #"GameMessagesAndCurrentBoardWithInvalidMovesObservationWrapper", 9 | ] 10 | -------------------------------------------------------------------------------- /textarena/envs/ConnectFour/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | def create_board_str(board, player_id: Optional[int]=None) -> str: 4 | def cell_str(value: str) -> str: return " " if value == "." else f" {value} " 5 | def top_border(cols: int) -> str: return "┌" + "───┬" * (cols - 1) + "───┐" 6 | def mid_border(cols: int) -> str: return "├" + "───┼" * (cols - 1) + "───┤" 7 | def bottom_border(cols: int) -> str: return "└" + "───┴" * (cols - 1) + "───┘" 8 | lines = [] 9 | lines.append(" "+" ".join(str(col) for col in range(len(board[0])))) 10 | lines.append(top_border(len(board[0]))) 11 | for r in range(len(board)): 12 | row_line = "│" + "│".join(cell_str(val) for val in board[r]) + "│" 13 | lines.append(row_line) 14 | if r < len(board)-1: lines.append(mid_border(len(board[0]))) 15 | else: lines.append(bottom_border(len(board[0]))) 16 | return "\n".join(lines) 17 | -------------------------------------------------------------------------------- /textarena/envs/Surround/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any 2 | 3 | def create_board_str(width: int, height: int, game_state: Dict[str, Any]) -> str: 4 | board = [['.' for _ in range(width)] for _ in range(height)] 5 | trail_data = game_state["board"] # Fill in trails 6 | for y in range(height): 7 | for x in range(width): 8 | if trail_data[y][x] is not None: board[y][x] = '#' 9 | for pid, pdata in game_state["players"].items(): # Fill in live player heads 10 | if pdata["alive"]: 11 | px, py = pdata["position"] 12 | board[py][px] = format(pid, 'X') # Hex digit for player ID 13 | lines = [] 14 | content_width = width * 2 - 1 15 | border_line = "+" + "-" * (content_width + 2) + "+" 16 | lines.append(border_line) 17 | for row_idx in range(height - 1, -1, -1): 18 | row_str = " ".join(board[row_idx]) 19 | lines.append(f"| {row_str} |") 20 | lines.append(border_line) 21 | return "\n".join(lines) 22 | -------------------------------------------------------------------------------- /textarena/envs/Diplomacy/prompts/general_system_prompt.txt: -------------------------------------------------------------------------------- 1 | You are playing a game of Diplomacy over text. The map is the standard Diplomacy map. Your goal is to win the game by capturing 18 supply centers - this is the only path to victory. Growing your army and taking over the map are means to this end. Be aggressive and always work toward that crucial 18th center. 2 | 3 | You will be given: 4 | • Which power you are controlling. 5 | • The current phase (e.g. S1901M). 6 | • Details about the map. 7 | • Your prior conversation history with other players (which may include agreements, lies, etc). 8 | * The prior order history which includes whether each order was successful or not. 9 | • Your units and the possible orders you may make. **Always refer to these possible_orders.** 10 | • A list of enemy units and centers. 11 | 12 | Remember that while your private chain-of-thought can consider your in-depth reasoning about possible outcomes, **only** the "PARSABLE OUTPUT" (your final orders or messages) will be used by the game engine. -------------------------------------------------------------------------------- /textarena/envs/Snake/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, List, Tuple, Any 2 | 3 | 4 | def create_board_str(width: int, height: int, snakes: Dict[int, Any], apples: List[Tuple[int, int]]) -> str: 5 | board = [['.' for _ in range(width)] for _ in range(height)] 6 | for (ax, ay) in apples: board[ay][ax] = 'A' # Place apples 7 | for pid, snake in snakes.items(): # Place snake body and head 8 | if not snake.alive: continue 9 | for idx, (x, y) in enumerate(snake.positions): 10 | if idx == 0: board[y][x] = format(pid, 'X') # Use hex digit for player ID 11 | else: board[y][x] = '#' 12 | lines = [] 13 | content_width = width * 2 - 1 14 | border_line = "+" + "-" * (content_width + 2) + "+" 15 | lines.append(border_line) 16 | for row_idx in range(height - 1, -1, -1): # Draw board from top (height-1) to bottom (0) 17 | row_str = " ".join(board[row_idx]) 18 | lines.append(f"| {row_str} |") 19 | lines.append(border_line) 20 | return "\n".join(lines) 21 | -------------------------------------------------------------------------------- /textarena/envs/ScenarioPlanning/renderer.py: -------------------------------------------------------------------------------- 1 | import textwrap 2 | 3 | def create_board_str(game_state: dict) -> str: 4 | votes = game_state.get("votes", {0: {"Votes": 0}, 1: {"Votes": 0}}) 5 | wrapped_scenario = textwrap.wrap(game_state.get("scenario", "Unknown Scenario"), width=75)[:5] # Wrap scenario to max 75 chars per line, max 3 lines 6 | while len(wrapped_scenario) < 5: wrapped_scenario.append("") 7 | lines = [] 8 | lines.append("┌─ SCENARIO ─────────────────────────────────────────────────────────────────┐") 9 | for line in wrapped_scenario: lines.append(f"│ {line.ljust(75)}│") 10 | lines.append("├────────────────────────────────────────────────────────────────────────────┤") 11 | lines.append("│ 🗳️ Judge Votes:") 12 | lines.append(f"│ Player 0: {votes[0]['Votes']} votes".ljust(75) + " │") 13 | lines.append(f"│ Player 1: {votes[1]['Votes']} votes".ljust(75) + " │") 14 | lines.append("└────────────────────────────────────────────────────────────────────────────┘") 15 | return "\n".join(lines) 16 | -------------------------------------------------------------------------------- /textarena/envs/TwoDollar/roles/enforceable/say_little.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "say_little", 3 | "enforcement": "action_validation", 4 | "behavioral_rules": { 5 | "max_words_per_message": 15, 6 | "violation_message": "Say Little violation: {word_count} words (max 15 allowed)" 7 | }, 8 | "instructions": "This is zero-sum bargaining and you are to get as much of the $2.00 as you possibly can. Please try really hard.\n\nHere is your special instruction: pick an expectation of what you will try to get and stick to it if you can, but say as little as possible. If you can, try to get away with saying essentially nothing at all, except for the amount you want. You may listen courteously as much as you want but try as hard as you reasonably can not to talk. If you absolutely have to, make up a story to bolster your claim, but try to (if you can) not to talk at all except for stating an amount of money.", 9 | "victory_condition": "Follow silence strategy AND reach any deal", 10 | "failure_condition": "Exceed word limits 3+ times OR no deal reached" 11 | } 12 | -------------------------------------------------------------------------------- /textarena/envs/WordLadder/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any 2 | 3 | def create_board_str(game_state: Dict[str, Any]) -> str: 4 | history = game_state.get("rendered_text", "") 5 | start_word = game_state.get("start_word", "?????") 6 | target_word = game_state.get("target_word", "?????") 7 | history_words = history.split("Word Ladder History: ")[-1].split(". Target Word")[0].split(" -> ") 8 | 9 | width = max(len(w) for w in history_words + [start_word, target_word]) 10 | border = "+" + "-" * (width + 12) + "+" 11 | lines = [border] 12 | lines.append(f"| {'WORD LADDER':^{width + 10}} |") 13 | lines.append(border) 14 | lines.append(f"| Start : {start_word:<{width}} |") 15 | lines.append(f"| Target: {target_word:<{width}} |") 16 | lines.append(border) 17 | 18 | for i, word in enumerate(history_words): 19 | marker = "→" if i < len(history_words) - 1 else "★" 20 | lines.append(f"| Step {i+1}: {word:<{width}} {marker} |") 21 | 22 | lines.append(border) 23 | return "\n".join(lines) 24 | -------------------------------------------------------------------------------- /textarena/envs/Mastermind/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any, List 2 | 3 | def create_board_str(game_state: Dict[str, Any]) -> str: 4 | secret_code = game_state.get("secret_code", []) 5 | history: List[Dict[str, Any]] = game_state.get("history", []) 6 | def format_code(code): 7 | return " ".join(f"[{num}]" for num in code) 8 | def format_feedback(b: int, w: int) -> str: 9 | return f"{' 🎯' * b}{' ⚪' * w}{' ▫️' * (len(secret_code) - b - w)}" 10 | lines = [ 11 | "===============================================================", 12 | f"Secret Code: {format_code(secret_code)}", 13 | "===============================================================", 14 | ] 15 | if not history: 16 | lines.append("No guesses yet.") 17 | else: 18 | lines.append("📜 Guess History:") 19 | for i, item in enumerate(history, 1): 20 | guess = format_code(item["guess"]) 21 | feedback = format_feedback(item["black"], item["white"]) 22 | lines.append(f"{i:2}. Guess: {guess} Feedback: {feedback}") 23 | return "\n".join(lines) 24 | -------------------------------------------------------------------------------- /textarena/envs/WordChains/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any 2 | 3 | def create_board_str(game_state: Dict[str, Any]) -> str: 4 | current_word = game_state["current_word"] 5 | required_start = game_state["required_start_letter"] 6 | required_length = game_state["required_length"] 7 | used_words = sorted(list(game_state["used_words"]), key=lambda w: len(w)) # sort by length for visual logic 8 | 9 | max_width = max(len(word) for word in used_words + [current_word]) 10 | border = "+" + "-" * (max_width + 26) + "+" 11 | 12 | lines = [border] 13 | lines.append(f"| Current Word : {current_word:<{max_width}} |") 14 | lines.append(f"| Required Start : '{required_start}'{' ' * (max_width - 1)} |") 15 | lines.append(f"| Required Length : {required_length:<{max_width}} |") 16 | lines.append(border) 17 | sp = " " 18 | lines.append(f"| Used Words ({len(used_words):<2} total):"+f"{sp:<{max_width}}"+" |") 19 | for word in used_words: 20 | lines.append(f"| - {word:<{max_width+20}} |") 21 | lines.append(border) 22 | 23 | return "\n".join(lines) 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 Leon Guertler 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /textarena/envs/WordSearch/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any 2 | 3 | def create_board_str(game_state: Dict[str, Any]) -> str: 4 | board = game_state["board"] 5 | height = len(board) 6 | width = len(board[0]) if height > 0 else 0 7 | header = " " + " ".join(f"C{col:02}" for col in range(width)) 8 | lines = [header] 9 | border = " +" + "-----" * width + "+" 10 | lines.append(border) 11 | for row_idx, row in enumerate(board): 12 | row_str = f"R{row_idx:02} |" 13 | for cell in row: 14 | if isinstance(cell, str) and len(cell) == 1: 15 | row_str += f" {cell} " 16 | else: 17 | row_str += f"{cell} " 18 | row_str += " " 19 | row_str += "|" 20 | lines.append(row_str) 21 | 22 | lines.append(border) 23 | 24 | # Show correct guesses if tracked (optional for more advanced renderer) 25 | if "correct_words" in game_state: 26 | lines.append("\nWords Found:") 27 | for word in sorted(game_state["correct_words"]): 28 | lines.append(f" - {word}") 29 | 30 | return "\n".join(lines) 31 | -------------------------------------------------------------------------------- /textarena/envs/MemoryGame/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any, Tuple 2 | 3 | def create_board_str(game_state: Dict[str, Any]) -> str: 4 | board = game_state.get("board", []) 5 | scores = game_state.get("scores", {}) 6 | grid_size = len(board) 7 | 8 | # Collect matched positions 9 | matched_positions = set() 10 | for r in range(grid_size): 11 | for c in range(grid_size): 12 | if board[r][c] != ".": 13 | matched_positions.add((r, c)) 14 | 15 | # Header row 16 | output = ["🧠 Memory Game", " " + " ".join(f"{c:2}" for c in range(grid_size))] 17 | 18 | # Board rows 19 | for r in range(grid_size): 20 | row = f"{r:2} " 21 | for c in range(grid_size): 22 | cell = board[r][c] 23 | if (r, c) in matched_positions: 24 | row += f"{cell:2} " 25 | else: 26 | row += "🔲 " 27 | output.append(row) 28 | 29 | # Scores 30 | output.append("\n📊 Scores:") 31 | for player_id, score_obj in scores.items(): 32 | output.append(f"Player {player_id}: {score_obj['Score']} point(s)") 33 | 34 | return "\n".join(output) 35 | -------------------------------------------------------------------------------- /textarena/__init__.py: -------------------------------------------------------------------------------- 1 | """ Root __init__ of textarena """ 2 | 3 | from textarena.core import Env, Wrapper, ObservationWrapper, RenderWrapper, ActionWrapper, Agent, AgentWrapper, State, Message, Observations, Rewards, Info, GAME_ID, ObservationType 4 | from textarena.state import SinglePlayerState, TwoPlayerState, FFAMultiPlayerState, TeamMultiPlayerState, MinimalMultiPlayerState 5 | from textarena.envs.registration import make, register, pprint_registry_detailed, check_env_exists 6 | from textarena.api import make_online, make_mgc_online 7 | from textarena import wrappers, agents 8 | 9 | import textarena.envs 10 | import textarena.envs.utils 11 | 12 | __all__ = [ 13 | "Env", "Wrapper", "ObservationWrapper", "RenderWrapper", "ActionWrapper", "AgentWrapper", 'ObservationType', # core 14 | "SinglePlayerState", "TwoPlayerState", "FFAMultiPlayerState", "TeamMultiPlayerState", "MinimalMultiPlayerState", # state 15 | "make", "register", "pprint_registry_detailed", "check_env_exists", # registration 16 | "envs", "utils", "wrappers", # module folders 17 | "make_online", # play online 18 | "make_mgc_online", # play online with MGC 19 | ] 20 | 21 | __version__ = "0.7.3" 22 | 23 | -------------------------------------------------------------------------------- /textarena/envs/Minesweeper/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | def create_board_str(grid: List[List[int]], revealed: List[List[bool]], flags: List[List[bool]]) -> str: 4 | """ 5 | Render the Minesweeper board with clean alignment for multi-digit columns. 6 | """ 7 | rows = len(grid) 8 | cols = len(grid[0]) if rows > 0 else 0 9 | 10 | # Column header 11 | col_header = " " + " ".join(f"{c:1}" for c in range(cols)) 12 | 13 | # Top border 14 | top_border = " ┌" + "──" * cols + "─┐" 15 | 16 | # Board content 17 | board_rows = [] 18 | for r in range(rows): 19 | row_content = "" 20 | for c in range(cols): 21 | if flags[r][c]: 22 | cell = "F" 23 | elif not revealed[r][c]: 24 | cell = "." 25 | elif grid[r][c] == -1: 26 | cell = "*" 27 | else: 28 | cell = str(grid[r][c]) 29 | row_content += f" {cell}" 30 | board_rows.append(f"{r:2}│{row_content} │") 31 | 32 | # Bottom border 33 | bottom_border = " └" + "──" * cols + "─┘" 34 | 35 | return "\n".join([col_header, top_border, *board_rows, bottom_border]) 36 | -------------------------------------------------------------------------------- /textarena/envs/Diplomacy/prompts/phase_summary_prompt.txt: -------------------------------------------------------------------------------- 1 | You are summarizing the history of a Diplomacy game. 2 | Create a concise summary that preserves all strategically relevant information about: 3 | 1. Supply center changes 4 | 2. Unit movements and their results 5 | 3. Key battles and their outcomes 6 | 4. Territory control shifts 7 | 8 | Focus on what actually happened, not explanations or justifications. 9 | Maintain the chronological structure but condense verbose descriptions. 10 | Use clear, factual language with specific location names. 11 | Ensure your summary maintains important tactical and strategic information that would be necessary for a player to make informed decisions. 12 | 13 | In Diplomacy, the specific territories mentioned and their control status are crucial - make sure your summary preserves: 14 | - Which Powers gained or lost Supply Centers (and which specific centers) 15 | - Successful or failed attacks and their specific locations 16 | - Supports that were cut or maintained 17 | - Bounces between units 18 | - Dislodgements and retreats 19 | 20 | Your summary should allow a player to understand the key developments in the game without losing essential strategic information. 21 | 22 | ORIGINAL PHASE HISTORY: 23 | {phase_history} 24 | 25 | SUMMARY: -------------------------------------------------------------------------------- /textarena/envs/Sudoku/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | from string import ascii_uppercase 3 | 4 | def create_board_str(board: List[List[int]]) -> str: 5 | def cell_str(num): 6 | return str(num) if num != 0 else " " 7 | 8 | col_header = " " + " ".join([str(i) if i % 3 != 0 else f"{i} " for i in range(1, 10)]) 9 | thick_line = " ┌───┬───┬───┐ ┌───┬───┬───┐ ┌───┬───┬───┐" 10 | mid_thin_line = " ├───┼───┼───┤ ├───┼───┼───┤ ├───┼───┼───┤" 11 | bottom_line = " └───┴───┴───┘ └───┴───┴───┘ └───┴───┴───┘" 12 | lines = [col_header, thick_line] 13 | 14 | for i in range(9): 15 | row = board[i] 16 | row_label = ascii_uppercase[i] 17 | row_line = f"{row_label}" 18 | for j in range(9): 19 | val = cell_str(row[j]) 20 | row_line += f" {val} │" if (j) % 3 != 0 else f" │ {val} │" 21 | row_line += f" {row_label}" 22 | lines.append(row_line) 23 | 24 | if i<8: 25 | if (i-2)%3 == 0: 26 | lines.append(bottom_line) 27 | lines.append(thick_line) 28 | else: 29 | lines.append(mid_thin_line) 30 | 31 | lines.append(bottom_line) 32 | lines.append(col_header) 33 | return "\n".join(lines) 34 | -------------------------------------------------------------------------------- /textarena/envs/Diplomacy/prompts/message_summary_prompt.txt: -------------------------------------------------------------------------------- 1 | You are summarizing diplomatic messages in a Diplomacy game. 2 | Create a concise summary of the conversations between powers that preserves: 3 | 1. Agreements and alliances formed 4 | 2. Betrayals and broken promises 5 | 3. Strategic intentions revealed 6 | 4. Explicit threats or support offered 7 | 5. Key relationships between each power 8 | 9 | Organize by relationships (e.g., FRANCE-GERMANY, ENGLAND-RUSSIA), prioritizing the most 10 | significant interactions. Include specific territory names mentioned. 11 | 12 | In your summary, maintain all of the following critical diplomatic information: 13 | - Specific agreements about attacking or supporting certain territories 14 | - Promises of non-aggression and their scope/duration 15 | - Discussions about supply center control and transfers 16 | - Stated preferences about other powers (who they want to attack/support) 17 | - Explicit lies or deceptions that were revealed 18 | - Coordination of moves between powers 19 | 20 | The summary must reflect the actual diplomatic landscape accurately so players can make informed decisions and remember past interactions that might influence current negotiations. 21 | 22 | ORIGINAL MESSAGE HISTORY: 23 | {message_history} 24 | 25 | SUMMARY: -------------------------------------------------------------------------------- /textarena/envs/Wordle/renderer.py: -------------------------------------------------------------------------------- 1 | def create_board_str(game_state: dict) -> str: 2 | """Render the full Wordle board as ASCII with emoji box feedback.""" 3 | history = game_state.get("guess_history", []) 4 | target_word = game_state.get("secret_word", "").upper() 5 | word_length = len(target_word) if target_word else 5 6 | 7 | # Emoji mapping 8 | color_map = {"G": "🟩", "Y": "🟨", "X": "⬜"} 9 | 10 | lines = [] 11 | lines.append("+" + "-" * 32 + "+") 12 | lines.append("|{:^32}|".format("WORDLE GAME")) 13 | lines.append("+" + "-" * 32 + "+") 14 | 15 | if not history: 16 | lines.append("|{:^32}|".format("No guesses yet.")) 17 | lines.append("+" + "-" * 32 + "+") 18 | else: 19 | for i, (word, feedback) in enumerate(history): 20 | word_str = " ".join(c.upper() for c in word) 21 | feedback_str = " ".join(color_map.get(f, "?") for f in feedback) 22 | lines.append(f"Guess #{i+1}: {word_str}") 23 | lines.append(f"Feedback : {feedback_str}") 24 | lines.append("") 25 | 26 | lines.append("+" + "-" * 32 + "+") 27 | lines.append("| Target Word: {:>16} |".format(target_word)) 28 | lines.append("+" + "-" * 32 + "+") 29 | 30 | return "\n".join(lines) 31 | -------------------------------------------------------------------------------- /textarena/envs/Breakthrough/renderer.py: -------------------------------------------------------------------------------- 1 | from string import ascii_lowercase 2 | def create_board_str(board, board_size: int) -> str: 3 | piece_symbols = {'W': '♙', 'B': '♟'} # Unicode for White and Black pawns 4 | # Build square dict with labels like a8, b3, etc. 5 | squares = {} 6 | for row in range(board_size): 7 | for col in range(board_size): 8 | square = f"{ascii_lowercase[col]}{str(row + 1)}" 9 | squares[square] = piece_symbols.get(board[row][col], " ") 10 | files = [ascii_lowercase[i] for i in range(board_size)] # Build template header/footer 11 | header_footer = " " + " ".join(files) 12 | lines = [header_footer] # Build rows 13 | lines.append(" ┌" + "┬".join(["───"] * board_size) + "┐") 14 | for row in range(board_size - 1, -1, -1): 15 | rank = str(row + 1) 16 | line = f"{rank.rjust(2)} │" 17 | for col in range(board_size): 18 | square = f"{ascii_lowercase[col]}{rank}" 19 | line += f" {squares[square]} │" 20 | lines.append(line + f" {rank.rjust(2)}") 21 | if row != 0: lines.append(" ├" + "┼".join(["───"] * board_size) + "┤") 22 | lines.append(" └" + "┴".join(["───"] * board_size) + "┘") 23 | lines.append(header_footer) 24 | return "\n".join(lines) 25 | -------------------------------------------------------------------------------- /textarena/envs/KuhnPoker/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any 2 | 3 | def create_board_str(game_state: Dict[str, Any]) -> str: 4 | def rank_to_str(rank: int) -> str: return {0: 'J', 1: 'Q', 2: 'K'}.get(rank, '?') 5 | pot = game_state.get("pot", 0) 6 | player_chips = game_state.get("player_chips", {0: 0, 1: 0}) 7 | current_round = game_state.get("current_round", 1) 8 | cards = game_state.get("player_cards", {0: None, 1: None}) 9 | p0_card = rank_to_str(cards.get(0)); p1_card = rank_to_str(cards.get(1)) 10 | p0_chips = f"{player_chips.get(0, 0):>3}"; p1_chips = f"{player_chips.get(1, 0):>3}" 11 | board_str = f""" 12 | ┌────────────────────────┐ 13 | │ Round: {current_round:<3} Pot: {pot:<3} │ 14 | └────────────────────────┘ 15 | 16 | ┌── P0 ({p0_chips}$) ──┐ ┌── P1 ({p1_chips}$) ──┐ 17 | │ │ │ │ 18 | │ ┌─────────┐ │ │ ┌─────────┐ │ 19 | │ │ {p0_card} │ │ │ │ {p1_card} │ │ 20 | │ │ │ │ │ │ │ │ 21 | │ │ ♥ │ │ │ │ ♠ │ │ 22 | │ │ │ │ │ │ │ │ 23 | │ │ {p0_card} │ │ │ │ {p1_card} │ │ 24 | │ └─────────┘ │ │ └─────────┘ │ 25 | │ │ │ │ 26 | └───────────────┘ └───────────────┘ 27 | """.strip() 28 | return board_str -------------------------------------------------------------------------------- /textarena/envs/LightsOut/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any, List 2 | 3 | def create_board_str(game_state: Dict[str, Any]) -> str: 4 | """ 5 | Render the Lights Out board with lit cells shaded 6 | """ 7 | board: List[List[int]] = game_state.get("board", []) 8 | if not board: 9 | return "Board not available." 10 | 11 | grid_size = len(board) 12 | on_symbol = "███" 13 | off_symbol = " " 14 | 15 | def cell_display(r: int, c: int) -> str: 16 | """Returns the 3-character representation for a cell""" 17 | return on_symbol if board[r][c] == 1 else off_symbol 18 | 19 | def horizontal_line(left: str, mid: str, right: str) -> str: 20 | """Creates a horizontal line for the grid border""" 21 | return " " + left + ("─" * 3 + mid) * (grid_size - 1) + "─" * 3 + right 22 | 23 | header = " " + " ".join(f"{c:^1}" for c in range(grid_size)) 24 | lines = [header] 25 | lines.append(horizontal_line("┌", "┬", "┐")) 26 | 27 | for r in range(grid_size): 28 | row_content = "│".join(cell_display(r, c) for c in range(grid_size)) 29 | lines.append(f"{r} │{row_content}│") 30 | if r < grid_size - 1: 31 | lines.append(horizontal_line("├", "┼", "┤")) 32 | 33 | lines.append(horizontal_line("└", "┴", "┘")) 34 | 35 | return "\n".join(lines) -------------------------------------------------------------------------------- /textarena/envs/Battleship/renderer.py: -------------------------------------------------------------------------------- 1 | def create_board_str(game_state: dict) -> str: 2 | board = game_state["board"] 3 | grid_size = len(board[0]) 4 | 5 | def cell_repr(cell): 6 | if cell == '~': 7 | return "🌊" 8 | elif cell == 'X': 9 | return "🔥" 10 | elif cell == 'O': 11 | return "💦" 12 | else: 13 | return f"{cell} " 14 | 15 | def render_single_board(grid, title): 16 | lines = [] 17 | header = " " + " ".join(str(i) for i in range(grid_size)) 18 | lines.append(f" {title.center(grid_size * 5 - 1)}") 19 | lines.append(" ┌" + "────┬" * (grid_size - 1) + "────┐") 20 | for r in range(grid_size): 21 | row_cells = " │ ".join(cell_repr(grid[r][c]) for c in range(grid_size)) 22 | lines.append(f"{chr(65 + r)} │ {row_cells} │") 23 | if r < grid_size - 1: 24 | lines.append(" ├" + "────┼" * (grid_size - 1) + "────┤") 25 | else: 26 | lines.append(" └" + "────┴" * (grid_size - 1) + "────┘") 27 | return lines 28 | 29 | board_0 = render_single_board(board[0], "Player 0") 30 | board_1 = render_single_board(board[1], "Player 1") 31 | 32 | # Merge the boards side by side 33 | combined = [] 34 | for left, right in zip(board_0, board_1): 35 | combined.append(left + " " + right) 36 | 37 | return "\n".join(combined) -------------------------------------------------------------------------------- /textarena/envs/TowerOfHanoi/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import List, Dict 2 | 3 | def create_board_str(towers: Dict[str, list]) -> str: 4 | """ 5 | Render the Tower of Hanoi board as an ASCII tower. 6 | 7 | Args: 8 | towers (Dict[str, list]): Dictionary with tower names as keys and lists of disks as values. 9 | 10 | Returns: 11 | str: A pretty-printed string of the tower states. 12 | """ 13 | all_disks = sum((tower for tower in towers.values()), []) 14 | max_disk = max(all_disks) if all_disks else 1 15 | height = max(len(towers[t]) for t in towers) 16 | 17 | tower_names = sorted(towers.keys()) 18 | lines = [] 19 | 20 | def render_level(tower: list, level: int) -> str: 21 | """Render a single level of a tower""" 22 | if level < len(tower): 23 | disk = tower[-(level + 1)] 24 | width = disk * 2 - 1 25 | return f"{'█' * width:^{max_disk * 2 + 1}}" 26 | else: 27 | return f"{'|':^{max_disk * 2 + 1}}" 28 | 29 | # Tower levels 30 | for lvl in range(height - 1, -1, -1): 31 | row = " ".join(render_level(towers[t], lvl) for t in tower_names) 32 | lines.append(row) 33 | 34 | # Base and labels 35 | base = " ".join("―" * (max_disk * 2 + 1) for _ in tower_names) 36 | labels = " ".join(f"{t:^{max_disk * 2 + 1}}" for t in tower_names) 37 | lines.append(base) 38 | lines.append(labels) 39 | 40 | return "\n".join(lines) 41 | -------------------------------------------------------------------------------- /textarena/wrappers/ObservationWrappers/classical_reasoning_eval_observation_wrapper.py: -------------------------------------------------------------------------------- 1 | import textarena as ta 2 | from textarena.core import ObservationWrapper, Env, Observations, Info 3 | from typing import Dict, Optional, Tuple, List 4 | 5 | __all__ = ["ClassicalReasoningEvalsObservationWrapper"] 6 | 7 | 8 | class ClassicalReasoningEvalsObservationWrapper(ObservationWrapper): 9 | """ TODO """ 10 | def __init__(self, env: Env): 11 | super().__init__(env) 12 | self.full_observations: Dict[int, List[Tuple[int, str]]] = {} 13 | 14 | 15 | def _convert_obs_to_str(self, player_id: int) -> Observations: 16 | """ TODO """ 17 | return ( 18 | f"<|begin▁of▁sentence|>Please reason step by step, and put your final answer within \\boxed{{}}." 19 | f"<|User|>{self.full_observations[player_id][-1][1]}" 20 | "<|Assistant|>\n" 21 | ) 22 | 23 | 24 | def observation(self, player_id: int, observation: Optional[ta.Observations]): 25 | if observation is None: 26 | return "" 27 | 28 | 29 | # Extend the full observations with the current observations without duplicates 30 | if player_id not in self.full_observations: 31 | self.full_observations[player_id] = [] 32 | 33 | # Append new observations in sequence 34 | self.full_observations[player_id].extend(observation) 35 | 36 | return self._convert_obs_to_str(player_id=player_id) 37 | -------------------------------------------------------------------------------- /textarena/envs/Diplomacy/prompts/few_shot_example.txt: -------------------------------------------------------------------------------- 1 | --- EXAMPLE --- 2 | Power: FRANCE 3 | Phase: S1901M 4 | Your Units: ['A PAR','F BRE'] 5 | Possible Orders: 6 | PAR: ['A PAR H','A PAR - BUR','A PAR - GAS'] 7 | BRE: ['F BRE H','F BRE - MAO'] 8 | 9 | Convoy Paths Possible: 10 | [("A NAP", {"F ION","F TYS"}, "TUN")] # Example route 11 | 12 | Past Phase Summaries: 13 | - Your move A BUD -> SER bounced last time because Turkey also moved A SMY -> SER with support. 14 | - Your support F TRI S A BUD -> SER was wasted because F TRI was needed to block Ionian invasion. 15 | 16 | Chain-of-thought: 17 | [Be consistent with your secret chain-of-thought here, but do not reveal it. 18 | Think about the enemy units and centers and how they might move, think about your units and centers, the conversation that's happened, the game phase summaries so far, any public and private goals you have or others might have based on conversation and reality of positions. 19 | Aim for best strategic moves based on the possible orders, 20 | and produce an output in PARSABLE JSON format as shown below.] 21 | [Consider typical Diplomacy logic: 22 | - If Germany might move to BUR with support, we could bounce or defend. 23 | - Decide to move A PAR -> BUR. Possibly also want to expand toward MAO with the fleet from BRE to secure the Atlantic. 24 | - Avoid contradictory or random supports. 25 | Therefore, let's finalize moves that maximize chances of success.] 26 | 27 | PARSABLE OUTPUT: 28 | {{ 29 | "orders": ["A PAR - BUR","F BRE - MAO"] 30 | }} 31 | --- END EXAMPLE --- -------------------------------------------------------------------------------- /textarena/envs/BabyAiText/tests.py: -------------------------------------------------------------------------------- 1 | import json 2 | import random 3 | import unittest 4 | import textarena as ta 5 | 6 | import gym 7 | import babyai_text 8 | 9 | 10 | class TestBabyAIByBot(unittest.TestCase): 11 | 12 | def test_baby_ai_text_gold_path(self): 13 | """ 14 | This function tests whether the mission can be accomplished by following the gold path provided by BabyAI bot? 15 | """ 16 | 17 | # Initialize agents 18 | agents = { 19 | 0: ta.agents.HumanAgent(), 20 | } 21 | seed = random.randint(0, 10000) 22 | 23 | # Initialize environment from subset and wrap it 24 | env = ta.make(env_id="BabyAiText-v0", seed=seed) 25 | env = ta.wrappers.LLMObservationWrapper(env=env) 26 | # Optional render wrapper 27 | env = ta.wrappers.SimpleRenderWrapper( 28 | env=env, 29 | player_names={0: "Bot"}, 30 | render_mode="board" 31 | ) 32 | 33 | env.reset(num_players=len(agents)) 34 | gold_path = list(reversed(env.gold_path())) 35 | print(f"{seed=}") 36 | print(f"Goal: {env.baby_ai_text_env.mission}") 37 | done = False 38 | while not done: 39 | env.get_observation() 40 | action = gold_path.pop() 41 | done, info = env.step(action=action.strip()) 42 | env.get_observation() 43 | env.close() 44 | assert info["reward"] > 0, "No reward was returned from the environment" 45 | 46 | 47 | if __name__ == '__main__': 48 | unittest.main() 49 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base_rewritten/individual_instructions/cooperative/enviroment.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | 3 | For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 4 | 5 | - You are somewhat worried about Eventix's preferences. Your worst deal scenario is an offshore zone (B1) with harm to the environment (C1). The important issues are the "Facility Location" (issue B) and the "Environmental Impact" (issue C). You want to reduce the environmental harm as much as possible. Your scores in these issues are: 6 | 7 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM) 8 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 9 | 10 | - You don't care about the rest of the issues. 11 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM), E4 (#E4_NUM) 12 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM), A4 (#A4_NUM) 13 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2 (#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM), D5 (#D5_NUM) 14 | 15 | The scores represent the value of each option to you. As your goal is to enhance the environment, you have high value (and scores) for option C3 and B3. Other parties have their unique values for each option and thus they have their unique scores. You already know that Eventix wants to have an "offshore" zone (B1) with "some harm" to the environment (C1), so they might have the highest values (and scores) for these options. 16 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base/individual_instructions/cooperative/enviroment.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | You represent the Environmental League. 3 | 4 | For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 5 | 6 | - You are somehow concerned about SportCo's preferences. Your worst deal scenario is a water-based park (A1) with damage to the ecology (B1). The important issues are the "Infrastructure Mix" (issue A) and the "Ecological Impact" (issue B). You want to reduce the environmental harm as much as possible. Your scores in these issues are: 7 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 8 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM) 9 | 10 | - You don't care about the rest of the issues. 11 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM), C4 (#C4_NUM) 12 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2(#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM) 13 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM), E4 (#E4_NUM), E5 (#E5_NUM) 14 | 15 | 16 | The scores represent the value of each option to you. 17 | As your goal is to improve the environment, you have high value (and scores) for option B3 and A3. 18 | Other parties have their unique values for each option and thus they have their unique scores. 19 | You already know that SportCo wants to have a "water-based" park (A1) with "some damage" to the ecology (B1), so they might have the highest values (and scores) for these options. 20 | -------------------------------------------------------------------------------- /textarena/envs/Debate/renderer.py: -------------------------------------------------------------------------------- 1 | import textwrap 2 | 3 | def create_board_str(game_state: dict) -> str: 4 | topic = game_state.get("topic", "Unknown Topic") 5 | sides = game_state.get("sides", {}) 6 | votes = game_state.get("votes", {"pre-debate": {"Affirmative": 0, "Negative": 0}, "post-debate": {"Affirmative": 0, "Negative": 0}}) 7 | wrapped_topic = textwrap.wrap(topic, width=75)[:2] # Wrap topic to max 75 chars per line, max 2 lines 8 | if len(wrapped_topic) < 2: wrapped_topic.append("") # Ensure we always have two lines 9 | player0_side = sides.get(0, "Unassigned") 10 | player1_side = sides.get(1, "Unassigned") 11 | lines = [] 12 | lines.append(f"┌─ DEBATE TOPIC ─────────────────────────────────────────────────────────────┐") 13 | for line in wrapped_topic: lines.append(f"│ {line.ljust(75)}│") 14 | lines.append(f"├────────────────────────────────────────────────────────────────────────────┤") 15 | lines.append(f"│ Player 0: {player0_side.ljust(65)}│") 16 | lines.append(f"│ Player 1: {player1_side.ljust(65)}│") 17 | lines.append(f"├────────────────────────────────────────────────────────────────────────────┤") 18 | lines.append(f"│ Pre-debate Votes: Affirmative: {votes['pre-debate']['Affirmative']:.2f} Negative: {votes['pre-debate']['Negative']:.2f} │") 19 | lines.append(f"│ Post-debate Votes: Affirmative: {votes['post-debate']['Affirmative']:.2f} Negative: {votes['post-debate']['Negative']:.2f} │") 20 | lines.append(f"└────────────────────────────────────────────────────────────────────────────┘") 21 | return "\n".join(lines) 22 | -------------------------------------------------------------------------------- /textarena/envs/Hanabi/renderer.py: -------------------------------------------------------------------------------- 1 | def create_board_str(game_state: dict) -> str: 2 | """ 3 | Create a board representing Hanabi. 4 | 5 | Args: 6 | game_state (dict): A dictionary containing the game state. 7 | 8 | Returns: 9 | str: A board representing Hanabi. 10 | """ 11 | fireworks = game_state.get("fireworks") 12 | deck_size = len(game_state.get("deck", [])) 13 | discard_pile = game_state.get('discard_pile', []) 14 | info_tokens = game_state.get('info_tokens', 8) 15 | fuse_tokens = game_state.get('fuse_tokens', 4) 16 | 17 | 18 | lines = [] 19 | 20 | # Phase display 21 | lines.append(f"╭── Hanabi ──────────────────────────────────────────────────╮") 22 | lines.append(f"│ Deck size: {deck_size:<2} │ Info tokens: {info_tokens:<1} │ Fuse tokens: {fuse_tokens:<1} │") 23 | lines.append(f"╰────────────────────────────────────────────────────────────╯") 24 | 25 | # Scoreboard 26 | lines.append("┌─ 🎆 Fireworks ─────────────────────────────────────────────┐") 27 | for key in fireworks.keys(): 28 | firework = "D" + "=" * int(fireworks[key]) + ">" + " " *(10-int(fireworks[key])) 29 | lines.append(f"│ {key.value:<10}: {fireworks[key]:<2} │ {firework} │") 30 | lines.append("└────────────────────────────────────────────────────────────┘") 31 | 32 | # Discard pile 33 | lines.append("┌─ 🚮 Discard pile ──────────────────────────────────────────┐") 34 | for card in discard_pile: 35 | lines.append(f"│ {str(card):<59}│") 36 | lines.append("└────────────────────────────────────────────────────────────┘") 37 | 38 | return "\n".join(lines) -------------------------------------------------------------------------------- /textarena/envs/PigDice/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | def create_board_str(scores: List[int], turn_total: int, current_player: int, current_roll: Optional[int], goal: int = 100) -> str: 4 | dice_faces = { 5 | 1: "┌─────────┐\n│ │\n│ ● │\n│ │\n└─────────┘", 6 | 2: "┌─────────┐\n│ ● │\n│ │\n│ ● │\n└─────────┘", 7 | 3: "┌─────────┐\n│ ● │\n│ ● │\n│ ● │\n└─────────┘", 8 | 4: "┌─────────┐\n│ ● ● │\n│ │\n│ ● ● │\n└─────────┘", 9 | 5: "┌─────────┐\n│ ● ● │\n│ ● │\n│ ● ● │\n└─────────┘", 10 | 6: "┌─────────┐\n│ ● ● │\n│ ● ● │\n│ ● ● │\n└─────────┘", 11 | None: "┌─────────┐\n│ │\n│ │\n│ │\n└─────────┘" 12 | } 13 | dice_art = dice_faces.get(current_roll, dice_faces[None]).splitlines() 14 | return f""" 15 | ┌─ SCORES ─────────────┐ ┌─ CURRENT TURN ───────────┐ 16 | │ │ │ │ 17 | │ Player 0: {scores[0]:>3} pts │ {dice_art[0]} │ Player {current_player} rolling │ 18 | │ Player 1: {scores[1]:>3} pts │ {dice_art[1]} │ Current roll: [{current_roll if current_roll is not None else ' '}] │ 19 | │ │ {dice_art[2]} │ Turn total: {turn_total:>3} pts │ 20 | │ Goal: {goal} points │ {dice_art[3]} │ Options: Roll or Hold │ 21 | │ │ {dice_art[4]} │ │ 22 | │ │ │ │ 23 | └──────────────────────┘ └──────────────────────────┘ 24 | """.rstrip() 25 | -------------------------------------------------------------------------------- /textarena/envs/UsedCarNegotiation/instructions/seller/weak.txt: -------------------------------------------------------------------------------- 1 | It’s time for you to sell your 2006 Toyota Prius. You bought it new 7 years ago, and it has 95,000 miles on it. You’ve generally done a good job maintaining it. 2 | It’s been a good car, but since you just bought a new SUV, you don’t really need it any more. It has the standard features: air conditioning, power steering, AM/FM stereo with CD player, air bags, and 4-wheel ABS braking system. 3 | After consulting the Blue Book (see chart below), which said your car was worth between $8,000 and $9,000, you listed the car a few days ago with an asking price of $10,000 on Craig’s List. 4 | A number of people have emailed and texted you about the car. However, so far only two potential buyers have come to see it. 5 | 6 | The first potential buyer offered you $7,000, but refused to pay any more. You weren’t ready to sell at that price. After all, that’s why you decided to sell the car on your own rather than trading it in at the dealer. 7 | You have their number and can call them if you change your mind. 8 | 9 | You’re now dealing with the second potential buyer. This person took the car out on a test drive, and had it inspected by a mechanic. You know your car is in good condition. 10 | The second potential buyer is coming back from the test drive to negotiate with you. 11 | 12 | You’re eager to sell your car and close the deal with this buyer. After all, the reason you’re selling the car to begin with is you just bought a new SUV. 13 | And you really need the cash from selling your Prius to help pay for gas since your new SUV isn’t as fuel efficient as a Prius. 14 | Plus, you don’t want to pay insurance on two cars, so you’re pretty eager to sell the Prius. -------------------------------------------------------------------------------- /textarena/wrappers/ActionWrappers/action_formatting_wrapper.py: -------------------------------------------------------------------------------- 1 | from textarena.core import ActionWrapper, Env 2 | 3 | __all__ = ["ActionFormattingWrapper"] 4 | 5 | 6 | class ActionFormattingWrapper(ActionWrapper): 7 | """ 8 | A wrapper that formats actions by adding brackets if they're missing. 9 | 10 | This wrapper ensures that all actions follow a consistent format by wrapping 11 | them in square brackets if they don't already contain brackets. This is useful 12 | for environments that require actions to be enclosed in brackets but where 13 | agents might not always follow this convention. 14 | 15 | Example: 16 | - Input: "move north" 17 | - Output: "[move north]" 18 | 19 | - Input: "[trade wheat]" 20 | - Output: "[trade wheat]" (unchanged) 21 | """ 22 | 23 | def __init__(self, env: Env): 24 | """ 25 | Initialize the ActionFormattingWrapper. 26 | 27 | Args: 28 | env (Env): The environment to wrap. 29 | """ 30 | super().__init__(env) 31 | 32 | def action(self, action: str) -> str: 33 | """ 34 | Format the action by adding brackets if they're missing. 35 | 36 | This method checks if the action already contains square brackets. 37 | If not, it wraps the entire action string in square brackets. 38 | 39 | Args: 40 | action (str): The action to format. 41 | 42 | Returns: 43 | str: The formatted action, with brackets added if necessary. 44 | """ 45 | if "[" not in action and "]" not in action: 46 | return f"[{action}]" 47 | else: 48 | return action -------------------------------------------------------------------------------- /textarena/envs/SettlersOfCatan/renderer.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | RESOURCE_ORDER = ("brick", "wood", "wheat", "ore", "sheep") 5 | 6 | 7 | def render_hand_cards_table(board, eliminated_pids=None, pids_from_roles=None) -> str: 8 | eliminated_pids = set(eliminated_pids or []) 9 | pids_from_roles = pids_from_roles or {} 10 | 11 | # Build table rows 12 | rows = [] 13 | for color_enum, player in board.players.items(): 14 | color_str = getattr(color_enum, "name", str(color_enum)) 15 | pid = pids_from_roles.get(color_str, None) 16 | name = color_str + (" (eliminated)" if pid in eliminated_pids else "") 17 | counts = {k.name.lower(): v for k, v in player.hand.items()} 18 | row = [name] + [str(counts.get(r, 0)) for r in RESOURCE_ORDER] 19 | rows.append(row) 20 | headers = ["Player"] + [r.capitalize() for r in RESOURCE_ORDER] 21 | 22 | # Compute column widths 23 | widths = [max(len(headers[i]), max((len(r[i]) for r in rows), default=0)) for i in range(len(headers))] 24 | def sep_line() -> str: return "+" + "+".join("-" * (w + 2) for w in widths) + "+" 25 | def fmt_row(values, right_align_idxs) -> str: 26 | cells = [] 27 | for i, v in enumerate(values): 28 | if i in right_align_idxs: cells.append(v.rjust(widths[i])) 29 | else: cells.append(v.ljust(widths[i])) 30 | return "| " + " | ".join(cells) + " |" 31 | 32 | # Assemble lines 33 | lines = ["Hand Cards", sep_line(), fmt_row(headers, right_align_idxs=set(range(1, len(headers)))), sep_line()] 34 | for row in rows: lines.append(fmt_row(row, right_align_idxs=set(range(1, len(headers))))) 35 | lines.append(sep_line()) 36 | return "\n".join(lines) -------------------------------------------------------------------------------- /textarena/envs/utils/data/en.aff: -------------------------------------------------------------------------------- 1 | PFX A Y 0 re . 2 | PFX I Y 0 in . 3 | PFX U Y 0 un . 4 | PFX C Y 0 de . 5 | PFX E Y 0 dis . 6 | PFX F Y 0 con . 7 | PFX K Y 0 pro . 8 | SFX V N e ive e 9 | SFX V N 0 ive [^e] 10 | SFX N Y e ion e 11 | SFX N Y y ication y 12 | SFX N Y 0 en [^ey] 13 | SFX X Y e ions e 14 | SFX X Y y ications y 15 | SFX X Y 0 ens [^ey] 16 | SFX H N y ieth y 17 | SFX H N 0 th [^y] 18 | SFX Y Y 0 ly . 19 | SFX G Y e ing e 20 | SFX G Y 0 ing [^e] 21 | SFX J Y e ings e 22 | SFX J Y 0 ings [^e] 23 | SFX D Y 0 d e 24 | SFX D Y y ied [^aeiou]y 25 | SFX D Y 0 ed [^ey] 26 | SFX D Y 0 ed [aeiou]y 27 | SFX T N 0 st e 28 | SFX T N y iest [^aeiou]y 29 | SFX T N 0 est [aeiou]y 30 | SFX T N 0 est [^ey] 31 | SFX R Y 0 r e 32 | SFX R Y y ier [^aeiou]y 33 | SFX R Y 0 er [aeiou]y 34 | SFX R Y 0 er [^ey] 35 | SFX Z Y 0 rs e 36 | SFX Z Y y iers [^aeiou]y 37 | SFX Z Y 0 ers [aeiou]y 38 | SFX Z Y 0 ers [^ey] 39 | SFX S Y y ies [^aeiou]y 40 | SFX S Y 0 s [aeiou]y 41 | SFX S Y 0 es [sxzh] 42 | SFX S Y 0 s [^sxzhy] 43 | SFX P Y y iness [^aeiou]y 44 | SFX P Y 0 ness [aeiou]y 45 | SFX P Y 0 ness [^y] 46 | SFX M Y 0 's . 47 | SFX B Y 0 able [^aeiou] 48 | SFX B Y 0 able ee 49 | SFX B Y e able [^aeiou]e 50 | SFX L Y 0 ment . -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game3/individual_instructions/cooperative/activists.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | 3 | You represent the environmental activists. Your goal is to protect the environment and biodiversity of Saarland and prevent ecological damage and climate change. 4 | 5 | For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 6 | 7 | - Issue B: Your most important issue is the environmental impact, and you want to have the least impact as possible. 8 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 9 | 10 | - Issue D: To compensate for the downsides of the project on the local people of Saarland, you prefer paying a high compensation (D4). Your first preference is not D5 because you would rather put the extra cost into issue B. 11 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2 (#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM), D5 (#D5_NUM) 12 | 13 | - You do not care about the rest of the issues. 14 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM), A4 (#A4_NUM) 15 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM), C4 (#C4_NUM) 16 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM) 17 | 18 | The scores represent the value of each option to you. For example, you care about minimizing the environmental impact, so option B3 has the highest score. Other parties have their unique values for each option, and thus, they have their unique scores. For example, the "private investors" will likely prefer the option that gives them profit favor (C4), and they might also prefer paying no or lower compensation (D1 or D2), etc. 19 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base_7players/individual_instructions/cooperative/heritage.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | 3 | You represent the "Regional Heritage Committee" 4 | For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 5 | 6 | - Obviously, the most important issue to you is the "Cultural Integration and Preservation" (issue F) and you would like to see the most interest in it. 7 | Issue F (max score #F_MAX_NUM): F1 (#F1_NUM), F2(#F2_NUM), F3 (#F3_NUM), F4 (#F4_NUM) 8 | 9 | - You prefer A3 to not affect the historical site on the land 10 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM) 11 | 12 | - You value the natural landscape as part of the region's heritage 13 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 14 | 15 | - The more fund the project would get the more likely SportCo would agree to fund your cultural projects. 16 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2(#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM) 17 | 18 | - You don't care about the rest of the issues. 19 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM), C4 (#C4_NUM) 20 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM), E4 (#E4_NUM), E5 (#E5_NUM) 21 | 22 | 23 | The scores represent the value of each option to you. 24 | As your goal is to improve the cultural heritage, you have high value (and score) for option F1. 25 | Other parties have their unique values for each option and thus they have their unique scores. 26 | You already know that SportCo wants to have a "water-based" park (A1) with "some damage" to the ecology (B1), so they might have the highest values (and scores) for these options. -------------------------------------------------------------------------------- /textarena/envs/Diplomacy/prompts/state_specific/russia_system_prompt.txt: -------------------------------------------------------------------------------- 1 | You are playing a game of Diplomacy over text. The map is the standard Diplomacy map. Your goal is to win the game by capturing 18 supply centers - this is the only path to victory. Growing your army and taking over the map are means to this end. Be aggressive and always work toward that crucial 18th center. 2 | 3 | Dear Russia, 4 | 5 | You command the largest starting position and the most units. Don't let this abundance paralyze you with choices. The best Russian players act decisively while maintaining strategic flexibility on their path to 18 centers. 6 | 7 | Key insights: 8 | - You can secure two builds 1901 (Sweden/Rumania) if aggressive 9 | - Must prevent or bounce Turkey in Black Sea early 10 | - St. Petersburg is crucial - almost no Russian solos exclude it 11 | - You can influence both north and south theaters 12 | 13 | Critical mindset: You're not just managing two fronts - you're exploiting them. When pressure comes from one direction, strike in the other. Your size is an advantage only if you use it actively. 14 | 15 | Paths to victory often require: 16 | 1. Securing at least one front through strong alliances 17 | 2. Eliminating at least one neighbor by 1904 18 | 3. Maintaining presence in both north and south 19 | 4. Strategic betrayal of a long-term ally 20 | 21 | Don't fall into defensive play when attacked - counter-attack elsewhere. Statistics show successful Russians often trade space for time in one theater while expanding aggressively in another. 22 | 23 | The longer the game goes, the more likely others unite against your size. Make your decisive moves by mid-game, usually years 3-4. Better to strike imperfectly than wait for perfect alignment. 24 | 25 | The twin crowns of north and south await. Show them why the Russian bear strikes with both paws. -------------------------------------------------------------------------------- /textarena/envs/Diplomacy/prompts/state_specific/italy_system_prompt.txt: -------------------------------------------------------------------------------- 1 | You are playing a game of Diplomacy over text. The map is the standard Diplomacy map. Your goal is to win the game by capturing 18 supply centers - this is the only path to victory. Growing your army and taking over the map are means to this end. Be aggressive and always work toward that crucial 18th center. 2 | 3 | Dear Italy, 4 | They call you the weakest power. Prove them wrong. Your position requires finesse, but victory comes to those who act decisively toward 18 centers, not those who wait. The successful Italian creates opportunities rather than just reacting to them. 5 | 6 | Key insights: 7 | - Austria must be friend or dead (95% of early A/I wars kill both) 8 | - Tunis is guaranteed, but don't stop there 9 | - Your fleet position can dominate the Mediterranean 10 | - You can influence both East and West uniquely 11 | 12 | Critical mindset: You're not the weak power waiting for others' mistakes. You're the opportunistic power creating situations you can exploit. The best Italian players actively shape the diplomatic landscape while appearing reactive. 13 | 14 | Paths to victory often require: 15 | 1. Securing strong early position (usually via Austrian alliance) 16 | 2. Dominating Mediterranean waters 17 | 3. Striking decisively when others are distracted 18 | 4. Expanding into either France or Turkey decisively 19 | 20 | Don't wait for the perfect moment - it rarely comes. Create your opportunities through active diplomacy and positioned strikes. Yes, patience matters, but passive play leads to slow death. 21 | 22 | Time is actually against you - the longer the game goes, the more likely others are to grow too strong. Make your moves when opportunities arise, usually years 3-4. 23 | 24 | The Mediterranean throne awaits. Show them Italian "weakness" was always just disguised strength. -------------------------------------------------------------------------------- /textarena/envs/Diplomacy/prompts/state_specific/austria_system_prompt.txt: -------------------------------------------------------------------------------- 1 | You are playing a game of Diplomacy over text. The map is the standard Diplomacy map. Your goal is to win the game by capturing 18 supply centers - this is the only path to victory. Growing your army and taking over the map are means to this end. Be aggressive and always work toward that crucial 18th center. 2 | 3 | Dear Austria, 4 | They say you're surrounded - but that means you can strike in any direction. History shows the strongest Austrian players turn early vulnerability into mid-game dominance through decisive action toward those vital 18 centers, not just survival. 5 | Key insights: 6 | 7 | Prevent Russia-Turkey alliance above all else 8 | Italy must be friend or dead quickly (95% of A/I wars kill both) 9 | Serbia is crucial 1901 - secure it 10 | Galicia bounce often vital Spring 1901 11 | Central position enables striking anywhere once secured 12 | 13 | Critical mindset: You're not playing to survive - you're playing to explode out from the center. Yes, early diplomacy keeps you alive, but it should serve your offensive goals, not replace them. 14 | Paths to victory often require: 15 | 16 | Securing strong early alliance (usually Italy or Russia) 17 | Eliminating one neighbor completely by 1904 18 | Leveraging central position for unexpected strikes 19 | Breaking stalemate line via Munich/Berlin 20 | 21 | Don't fall into defensive play just because everyone expects it. Stats show Austrian solos often come from players who turn the early "defensive" moves into aggressive positioning by year 3. 22 | Time works against you - the longer you wait, the more likely others unite. Make your decisive moves by mid-game, usually years 3-4. Better to strike imperfectly than wait for perfect alignment. 23 | The throne of Europe awaits. Show them that the "weakest" starting position was merely gathering strength to strike. -------------------------------------------------------------------------------- /textarena/envs/Diplomacy/prompts/state_specific/england_system_prompt.txt: -------------------------------------------------------------------------------- 1 | You are playing a game of Diplomacy over text. The map is the standard Diplomacy map. Your goal is to win the game by capturing 18 supply centers - this is the only path to victory. Growing your army and taking over the map are means to this end. Be aggressive and always work toward that crucial 18th center. 2 | 3 | Dear England, 4 | 5 | Your island position tempts defensive play. Resist this. The North Sea is not a moat to hide behind, but a highway to those crucial 18 centers. The most successful English players use their naval superiority to project power aggressively. 6 | 7 | Key insights: 8 | - Secure North Sea early - it's your lifeline 9 | - Norway is nearly guaranteed - but don't stop there 10 | - Must ally one of France/Germany against the other 11 | - Fleet positioning is everything - control key waters early 12 | 13 | Critical mindset: You're not playing defense, you're controlling the seas to enable offense. Every fleet should be positioned with attack in mind. Top players even use the threat of attacks to extract concessions: "Let me have Belgium or I'll support France in." 14 | 15 | Winning paths usually require: 16 | 1. Dominating Scandinavia quickly 17 | 2. Eliminating one neighbor decisively 18 | 3. Getting fleets into Mediterranean 19 | 4. Securing that crucial 18th center (often Tunis or Moscow) 20 | 21 | Don't fall into the "defensive England" trap. Yes, you're hard to invade, but you can't win by turtling. The stats show successful English players often strike aggressively in years 2-3, not waiting for the perfect moment that never comes. 22 | 23 | Your fleets are your strength - use them to strangle opponents' growth while you expand. Better to risk early aggression than watch others grow too strong to stop. 24 | 25 | Rule the waves actively, not passively. The crown of Europe awaits those bold enough to seize it. -------------------------------------------------------------------------------- /textarena/envs/LogicPuzzle/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any 2 | 3 | def create_board_str(game_state: Dict[str, Any]) -> str: 4 | """ 5 | Render the entire logic puzzle board. 6 | 7 | This function assumes the game_state contains a 'board' key with 8 | a structure like {grid_name: {row: {col: mark}}}. 9 | 10 | Returns: 11 | str: Rendered board as a string. 12 | """ 13 | board = game_state.get("board", {}) 14 | 15 | if not board: 16 | return "The board is empty or not initialized." 17 | 18 | # Dynamically calculate the rendering 19 | output = [] 20 | 21 | for grid_name, grid_data in board.items(): 22 | # Get all columns 23 | columns = list(next(iter(grid_data.values())).keys()) 24 | row_names = list(grid_data.keys()) 25 | 26 | # Calculate layout widths 27 | max_row_width = max(len(r) for r in row_names) + 2 28 | max_col_width = max(len(c) for c in columns) + 2 29 | 30 | # Header 31 | output.append(f"\n{'=' * (max_row_width + len(columns) * (max_col_width + 3))}") 32 | output.append(f"{grid_name.upper().center(max_row_width + len(columns) * (max_col_width + 3))}") 33 | output.append(f"{'=' * (max_row_width + len(columns) * (max_col_width + 3))}") 34 | 35 | # Column headers 36 | header = " " * max_row_width + " | ".join(f"{col:^{max_col_width}}" for col in columns) + " |" 37 | output.append(header) 38 | output.append("-" * len(header)) 39 | 40 | # Rows 41 | for row in row_names: 42 | line = f"{row:<{max_row_width}}" + " | ".join( 43 | f"{grid_data[row][col] if grid_data[row][col] else ' ':^{max_col_width}}" for col in columns 44 | ) + " |" 45 | output.append(line) 46 | 47 | output.append("=" * len(header)) 48 | 49 | return "\n".join(output) 50 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base_7players/individual_instructions/cooperative/enviroment.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | You represent the Environmental League. 3 | 4 | For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 5 | 6 | - You are somehow concerned about SportCo's preferences. Your worst deal scenario is a water-based park (A1) with damage to the ecology (B1). The important issues are the "Infrastructure Mix" (issue A) and the "Ecological Impact" (issue B). You want to reduce the environmental harm as much as possible. Your scores in these issues are: 7 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 8 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM) 9 | 10 | - You care to a relatively large extent about the "Cultural Integration and Preservation" (issue F) as part of broader sustainability and preservation efforts. 11 | Issue F (max score #F_MAX_NUM): F1 (#F1_NUM), F2(#F2_NUM), F3 (#F3_NUM), F4 (#F4_NUM) 12 | 13 | - You don't care about the rest of the issues. 14 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM), C4 (#C4_NUM) 15 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2(#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM) 16 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM), E4 (#E4_NUM), E5 (#E5_NUM) 17 | 18 | 19 | The scores represent the value of each option to you. 20 | As your goal is to improve the environment, you have high value (and scores) for option B3 and A3. 21 | Other parties have their unique values for each option and thus they have their unique scores. 22 | You already know that SportCo wants to have a "water-based" park (A1) with "some damage" to the ecology (B1), so they might have the highest values (and scores) for these options. 23 | -------------------------------------------------------------------------------- /textarena/envs/Diplomacy/prompts/state_specific/turkey_system_prompt.txt: -------------------------------------------------------------------------------- 1 | You are playing a game of Diplomacy over text. The map is the standard Diplomacy map. Your goal is to win the game by capturing 18 supply centers - this is the only path to victory. Growing your army and taking over the map are means to this end. Be aggressive and always work toward that crucial 18th center. 2 | 3 | Dear Turkey, 4 | 5 | Your corner position is a fortress - but fortresses don't win games. The most successful Turkish players use their defensive strength as a platform for aggressive expansion toward those vital 18 centers, not just survival. 6 | 7 | Key insights: 8 | - Black Sea control is crucial - bounce or take it 1901 9 | - Must prevent or survive early Russia/Austria alliance 10 | - Your position strengthens dramatically if you survive to 1904 11 | - Fleet position can dominate eastern Mediterranean 12 | 13 | Critical mindset: You're not playing to survive - you're playing to explode out of your corner. Yes, defense matters early, but it should enable your offensive preparations, not replace them. 14 | 15 | Paths to victory often require: 16 | 1. Securing one strong ally against the other (Russia or Austria) 17 | 2. Eliminating one neighbor completely by 1904 18 | 3. Breaking into Mediterranean decisively 19 | 4. Getting fleets into position for late-game strikes west 20 | 21 | Don't fall into the "turtle Turkey" trap. While you can often survive playing purely defensively, you can't win that way. The stats show Turkish solos often come from players who defend selectively while preparing aggressive breakouts. 22 | 23 | Time can work for you - but only if you're actively preparing your offensive positions. Build purposefully, negotiate actively, and always be ready to exploit opportunities for expansion. 24 | 25 | The crown of Europe lies west of your fortress. Show them the Sick Man of Europe was merely gathering strength to strike. -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base/individual_instructions/greedy/enviroment.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | You represent the Environmental League. 3 | 4 | You are very concerned about the effect of the project on the environment, and you think it would result in substantial environmental damage. You don't necessarily oppose the project, but you believe SportCo must not be allowed to ruin the environment in the city. 5 | 6 | For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 7 | 8 | - You are very concerned about SportCo's preferences. Your worst deal scenario is a water-based park (A1) with damage to the ecology (B1), and you absolutely don't want this to happen. The important issues are the "Infrastructure Mix" (issue A) and the "Ecological Impact" (issue B). You want to completely minimize the environmental harm as much as possible. Your scores in these issues are: 9 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 10 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM) 11 | 12 | - You don't care about the rest of the issues. 13 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM), C4 (#C4_NUM) 14 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2(#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM) 15 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM), E4 (#E4_NUM), E5 (#E5_NUM) 16 | 17 | The scores represent the value of each option to you. 18 | As your goal is to improve the environment, you have high value (and scores) for option B3 and A3. 19 | Other parties have their unique values for each option and thus they have their unique scores. You already know that SportCo wants to have a "water-based" park (A1) with "some damage" to the ecology (B1), so they might have the highest values (and scores) for these options. 20 | -------------------------------------------------------------------------------- /textarena/envs/Chess/renderer.py: -------------------------------------------------------------------------------- 1 | import chess 2 | from typing import Optional 3 | 4 | def create_board_str(board: chess.Board, player_id: Optional[int] = None) -> str: 5 | piece_symbols = {'r': '♜', 'n': '♞', 'b': '♝', 'q': '♛', 'k': '♚', 'p': '♟', 'R': '♖', 'N': '♘', 'B': '♗', 'Q': '♕', 'K': '♔', 'P': '♙'} 6 | squares = {} 7 | for file_char in "abcdefgh": 8 | for rank_char in "12345678": 9 | square_name = f"{file_char}{rank_char}" 10 | piece = board.piece_at(chess.parse_square(square_name)) 11 | squares[square_name] = piece_symbols[piece.symbol()] if piece else " " 12 | 13 | board_template = f""" 14 | a b c d e f g h 15 | ┌────┬────┬────┬────┬────┬────┬────┬────┐ 16 | 8 │ {{a8}} │ {{b8}} │ {{c8}} │ {{d8}} │ {{e8}} │ {{f8}} │ {{g8}} │ {{h8}} │ 8 17 | ├────┼────┼────┼────┼────┼────┼────┼────┤ 18 | 7 │ {{a7}} │ {{b7}} │ {{c7}} │ {{d7}} │ {{e7}} │ {{f7}} │ {{g7}} │ {{h7}} │ 7 19 | ├────┼────┼────┼────┼────┼────┼────┼────┤ 20 | 6 │ {{a6}} │ {{b6}} │ {{c6}} │ {{d6}} │ {{e6}} │ {{f6}} │ {{g6}} │ {{h6}} │ 6 21 | ├────┼────┼────┼────┼────┼────┼────┼────┤ 22 | 5 │ {{a5}} │ {{b5}} │ {{c5}} │ {{d5}} │ {{e5}} │ {{f5}} │ {{g5}} │ {{h5}} │ 5 23 | ├────┼────┼────┼────┼────┼────┼────┼────┤ 24 | 4 │ {{a4}} │ {{b4}} │ {{c4}} │ {{d4}} │ {{e4}} │ {{f4}} │ {{g4}} │ {{h4}} │ 4 25 | ├────┼────┼────┼────┼────┼────┼────┼────┤ 26 | 3 │ {{a3}} │ {{b3}} │ {{c3}} │ {{d3}} │ {{e3}} │ {{f3}} │ {{g3}} │ {{h3}} │ 3 27 | ├────┼────┼────┼────┼────┼────┼────┼────┤ 28 | 2 │ {{a2}} │ {{b2}} │ {{c2}} │ {{d2}} │ {{e2}} │ {{f2}} │ {{g2}} │ {{h2}} │ 2 29 | ├────┼────┼────┼────┼────┼────┼────┼────┤ 30 | 1 │ {{a1}} │ {{b1}} │ {{c1}} │ {{d1}} │ {{e1}} │ {{f1}} │ {{g1}} │ {{h1}} │ 1 31 | └────┴────┴────┴────┴────┴────┴────┴────┘ 32 | a b c d e f g h 33 | """ 34 | return board_template.format(**squares) 35 | 36 | 37 | -------------------------------------------------------------------------------- /textarena/envs/Diplomacy/prompts/state_specific/germany_system_prompt.txt: -------------------------------------------------------------------------------- 1 | You are playing a game of Diplomacy over text. The map is the standard Diplomacy map. Your goal is to win the game by capturing 18 supply centers - this is the only path to victory. Growing your army and taking over the map are means to this end. Be aggressive and always work toward that crucial 18th center. 2 | 3 | Dear Germany, 4 | Your central position offers unmatched opportunity - but only if you seize it. Ten centers lie within two moves of your starting position - a strong foundation for reaching those vital 18 centers needed for victory. 5 | 6 | Key insights: 7 | - Must secure at least one strong ally early (usually England or France) 8 | - Denmark is yours, but Belgium/Holland require decisive action 9 | - Naval weakness must be addressed - either through alliances or builds 10 | - Central position lets you strike any direction - use this flexibility 11 | 12 | Critical mindset: You're not a buffer state - you're the hammer of Europe. Top German players shape the game's direction through decisive action, not reactive diplomacy. Yes, you need allies, but you also need to be feared. 13 | 14 | Paths to victory often involve: 15 | 1. Securing your choice of early allies through bold offers 16 | 2. Eliminating one neighbor completely by 1904 17 | 3. Leveraging central position to strike unexpected directions 18 | 4. Taking key centers across stalemate line (usually through Russia) 19 | 20 | Don't play the mediator unless it's part of your path to victory. Your central position is not a curse but a gift - you can strike anywhere. History shows German solos often come from players who acted decisively in years 2-3. 21 | 22 | Time works against you - the longer you wait, the more likely others unite against your central position. Make your moves early, build purposefully, and always be working toward that 18th center. 23 | 24 | The heart of Europe is yours. Show them why the center controls the periphery. -------------------------------------------------------------------------------- /textarena/envs/Crosswords/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | def create_board_str(game_state) -> str: 4 | grid = game_state["board"] 5 | placed_words = game_state.get("placed_words", {}) 6 | clues = game_state.get("clues", {}) 7 | 8 | rows, cols = len(grid), len(grid[0]) 9 | 10 | # Assign clue numbers to starting positions 11 | clue_numbers = {} 12 | number = 1 13 | for word, (row, col, direction) in placed_words.items(): 14 | if (row, col) not in clue_numbers: 15 | clue_numbers[(row, col)] = number 16 | number += 1 17 | 18 | def cell_display(i, j, val): 19 | if val == ".": 20 | return " " 21 | elif (i, j) in clue_numbers: 22 | return f"{clue_numbers[(i, j)]:>2} " 23 | elif val == "_": 24 | return " ▢ " 25 | else: 26 | return f" {val.upper()} " 27 | 28 | # Column header 29 | header = " " + " ".join(f"{j:>3}" for j in range(cols)) 30 | lines = [header] 31 | lines.append(" +" + "---+" * cols) 32 | 33 | # Grid with clue numbers 34 | for i, row in enumerate(grid): 35 | row_str = f"{i:>2} |" 36 | for j, val in enumerate(row): 37 | row_str += cell_display(i, j, val) + "|" 38 | lines.append(row_str) 39 | lines.append(" +" + "---+" * cols) 40 | 41 | # Append clues 42 | clue_lines = [] 43 | reverse_map = {v: k for k, v in clue_numbers.items()} 44 | for num in sorted(reverse_map): 45 | word = None 46 | for k, v in placed_words.items(): 47 | if v[:2] == reverse_map[num]: 48 | word = k 49 | direction = v[2] 50 | break 51 | if word and word in clues: 52 | clue_lines.append(f"{num}. ({direction}) {clues[word]}") 53 | 54 | if clue_lines: 55 | lines.append("\nClues:") 56 | lines += clue_lines 57 | 58 | return "\n".join(lines) 59 | -------------------------------------------------------------------------------- /textarena/envs/UsedCarNegotiation/instructions/buyer/weak.txt: -------------------------------------------------------------------------------- 1 | Your old car just died, so you need to buy a car. You’re focused on finding a used Toyota Prius. After scouring Craig’s List and AutoTrader.com, you found two “Prii” (yes, that’s the new plural for “Prius”) that seem promising. 2 | Both are 2006 base models with standard features (air conditioning, power steering, AM/FM stereo with CD player, air bags, and 4-wheel ABS braking system). That’s really all you want. 3 | 4 | The first Prius you saw was in good condition with 89,000 miles and doesn’t need any maintenance work. You negotiated the sellers down to a price of $10,000 but they refused to lower the price any more. 5 | You told them you’d keep looking, and they told you that if you changed your mind and were ready to pay $10,000, you should come back. 6 | 7 | The second Prius was advertised for $10,000 but you think you can get it for less. During a test-drive you took it to an honest and trusted mechanic. Your mechanic said the car is generally well maintained and in good shape. 8 | There are some small dings and scrapes on the paint, and marks on the seats, but that’s to be expected in a 6 year old car with 95,000 miles. 9 | The Blue Book (see chart) suggests the car may sell for between $8,000 and $9,000 for a private party. But you know this is only an estimate. Similar cars may sell for more or less than that. 10 | You’re returning from your test drive and preparing to meet the seller of this second Prius. You’ve already secured financing. 11 | 12 | You need a car because taking the bus is inconvenient and time consuming, and you live too far from school and work to ride a bike. You’ve been taking a cab to save time, but that is getting very expensive. 13 | You’re eager to close the deal with the seller. You don’t think the Kelley Blue Book Value accurately reflects the recent trend towards rising gas prices. 14 | You expect the continued rise in gas prices will make this a good purchase and make a Prius an even more desirable car. -------------------------------------------------------------------------------- /textarena/envs/Diplomacy/prompts/state_specific/france_system_prompt.txt: -------------------------------------------------------------------------------- 1 | You are playing a game of Diplomacy over text. The map is the standard Diplomacy map. Your goal is to win the game by capturing 18 supply centers - this is the only path to victory. Growing your army and taking over the map are means to this end. Be aggressive and always work toward that crucial 18th center. 2 | 3 | Dear France, 4 | 5 | You start in perhaps the strongest position. Don't waste it with hesitation. History shows successful French players strike early and decisively - aiming for 5-6 centers by 1902 is not just possible, but often optimal on the path to 18. 6 | 7 | Key insights: 8 | - Early momentum is crucial - Spain, Portugal, Belgium all within reach 1901 9 | - Choose England or Germany as initial ally/target - fighting both is fatal 10 | - Your dual coasts (Brest/Marseilles) let you project power both directions 11 | - Tunis often proves critical for French solos - plan your Med strategy early 12 | 13 | The trap many fall into: playing too conservatively because the position feels secure. Don't. Your corner position is not a fortress to hide in, but a springboard for conquest. The stats are clear - France wins most when acting decisively in the first 2-3 years. 14 | 15 | Watch for these opportunities: 16 | - England/Germany friction you can exploit 17 | - Italy focused east (leaving their rear exposed) 18 | - Early builds that let you dominate multiple seas 19 | 20 | Your path to victory requires crossing the stalemate line. Usually this means either: 21 | 1. Mediterranean dominance + push through Munich 22 | 2. Northern control + grab of Tunis 23 | 3. Both, if you're bold enough 24 | 25 | Time is not your ally - other powers grow stronger while you wait. Make your moves early, build aggressively, and always be working toward that 18th center. Better to fail spectacularly pushing for a win than survive passively into a draw. 26 | 27 | The throne of Europe is yours to lose. Show them French audacity still rules the continent. -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base_rewritten/individual_instructions/cooperative/company.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | 3 | For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 4 | 5 | - A crucial issue to you is "government grant" (issue A); you ideally prefer higher grants and asked for £2 billion (option A1). 6 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM), A4 (#A4_NUM) 7 | 8 | - You are generally opposed to compensating "neighbouring cities" (issue D) as you believe they won't be affected. So you prefer option D5 the most. 9 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2 (#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM), D5 (#D5_NUM) 10 | 11 | - You want to be free in choosing potential employees (issue E), and ideally, you would like no preference to the "local Workers' Union" (option E4). 12 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM), E4 (#E4_NUM) 13 | 14 | - You ideally want to be free in choosing "facility location" (issue B), so you aim for option B1 ("offshore"). 15 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 16 | 17 | - You believe it is unavoidable to cause some harm to the environment (issue C). However, it is still regulated by standards. So you prefer C1 ("some harm"). 18 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM) 19 | 20 | The scores represent the value of each option to you. For example, getting a high government grant is an important issue to you, so the option that has the highest grant (A1) has the highest score. Other parties have their unique values for each option and thus they have their unique scores. For example, the "Green Alliance" will have the highest value (and score) for options that enhance the environment (option C3), "neighbouring cities" prefer higher compensation and will then have a high score for option D1, etc. -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/medical_ethics/individual_instructions/cooperative/head_nurse.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | You represent the Head Nurse with a utilitarian ethical framework. 3 | 4 | As the Head Nurse, you believe in making decisions that achieve the greatest good for the greatest number of people. You focus on maximizing overall benefit and minimizing total suffering across all patients and families affected. 5 | 6 | Your preferences by order of importance to you are: 7 | 8 | - Treatment success probability (issue D) is your highest priority because saving lives efficiently serves the greater good. 9 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2 (#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM) 10 | 11 | - Medical urgency (issue A) is critical because immediate intervention saves the most lives. 12 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM), A4 (#A4_NUM) 13 | 14 | - Patient autonomy (issue E) matters because respecting wishes reduces overall family suffering. 15 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM), E4 (#E4_NUM) 16 | 17 | - Social value (issue C) is considered because supporting those with dependents maximizes societal benefit. 18 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM) 19 | 20 | - Age considerations (issue B) have moderate importance - you slightly favor approaches that save more life-years. 21 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 22 | 23 | The scores represent the utilitarian value of each option to society as a whole. You calculate decisions based on statistical outcomes, resource efficiency, and aggregate welfare. Your minimum acceptable score is #threshold points, representing the minimum utilitarian benefit required to justify the decision. 24 | 25 | Other team members may prioritize different ethical principles (duty, virtue, care), but you focus on measurable outcomes that serve the greatest number of people. 26 | -------------------------------------------------------------------------------- /textarena/envs/IteratedPrisonersDilemma/renderer.py: -------------------------------------------------------------------------------- 1 | def create_board_str(game_state: dict) -> str: 2 | raise NotImplementedError 3 | lines = [] 4 | phase_str = "🗣️ Communication Phase" if not game_state.get("is_decision_phase", False) else "🎯 Decision Phase" 5 | lines.append(f"╭── Iterated Prisoner's Dilemma ─────────────────────╮") 6 | lines.append(f"│ Round: {game_state.get('current_round', 1):<2} | Turn: {game_state.get('current_comm_turn', 0):<2} | Phase: {phase_str:<20}│") 7 | lines.append(f"╰────────────────────────────────────────────────────╯") 8 | lines.append("┌─ 📊 SCORES ─────────────────────┐") 9 | lines.append(f"│ Player 0: {game_state.get('scores', {}).get(0, 0):<3} pts │") 10 | lines.append(f"│ Player 1: {game_state.get('scores', {}).get(1, 0):<3} pts │") 11 | lines.append("└─────────────────────────────────┘") 12 | if game_state.get('history', []): 13 | lines.append("┌─ 📜 ROUND HISTORY ────────────────────────────────────┐") 14 | lines.append("│ Round │ Player 0 │ Player 1 │ Outcome │") 15 | lines.append("├───────┼──────────────┼──────────────┼─────────────────┤") 16 | for round_info in game_state.get('history', []): 17 | d0 = round_info["decisions"].get(0, "?").capitalize() 18 | d1 = round_info["decisions"].get(1, "?").capitalize() 19 | if d0 == d1 == "Cooperate": outcome = "Both Cooperated" 20 | elif d0 == d1 == "Defect": outcome = "Both Defected" 21 | elif d0 == "Cooperate" and d1 == "Defect": outcome = "P0 Sucker" 22 | elif d0 == "Defect" and d1 == "Cooperate": outcome = "P1 Sucker" 23 | else: outcome = "Unknown" 24 | lines.append(f"│ {round_info.get("round", "?"):^5} │ {d0:<12} │ {d1:<12} │ {outcome:<8} │") 25 | lines.append("└───────────────────────────────────────────────────────┘") 26 | return "\n".join(lines) 27 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base/individual_instructions/cooperative/SportCo.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | You represent SportCo. 3 | 4 | For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 5 | 6 | - A critical issue to you is "federal loan" (issue D); you ideally prefer higher loans and asked for $3 billion (option D1). 7 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2(#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM) 8 | 9 | - You are generally against compensating "other cities" (issue E) as you believe they won't be harmed. So you prefer option E5 the most. 10 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM), E4 (#E4_NUM), E5 (#E5_NUM) 11 | 12 | - You want to be free in choosing potential employees (issue C), and ideally, you would like no preference to the "local labour union" (option C4). 13 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM), C4 (#C4_NUM) 14 | 15 | - You ideally want to be free in choosing "infrastructure mix" (issue A), so you aim for option A1 ("water-based"). 16 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM) 17 | 18 | - You believe it is inevitable to cause certain harm to the ecology (issue B). However, it is still restricted by regulations. So you prefer B1 ("some damage"). 19 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 20 | 21 | 22 | The scores represent the value of each option to you. 23 | For example, getting a high federal loan is an important issue to you, so the option that has the highest loan (D1) has the highest score. 24 | Other parties have their unique values for each option and thus they have their unique scores. For example, the "Environmental League" will have the highest value (and score) for options that improves the environment (option B3), "other cities" prefer higher compensation and will then have a high score for option E1, etc. -------------------------------------------------------------------------------- /textarena/envs/Diplomacy/prompts/conversation_instructions.txt: -------------------------------------------------------------------------------- 1 | **CURRENT INSTRUCTIONS** 2 | 3 | You can now send a message to other powers. Messages that have been sent before are listed above in the 'GAME HISTORY' section. 4 | • You will have a total of 3 rounds of sending messages. 5 | • Decide whether to send a private or global message. 6 | • You can propose alliances, ask for support, threaten, etc. 7 | 8 | Remember: 9 | 1. "message_type" can be "global" or "private". 10 | 2. If "private", specify "recipient" (one of the powers). 11 | 3. The "content" is the message you wish to send. 12 | 4. Return the JSON object at the end. 13 | 14 | Example response formats: 15 | 1. For a global message: 16 | PARSABLE OUTPUT: 17 | {{ 18 | "message_type": "global", 19 | "content": "I propose we all work together against Turkey." 20 | }} 21 | 22 | 2. For a private message: 23 | PARSABLE OUTPUT: 24 | {{ 25 | "message_type": "private", 26 | "recipient": "FRANCE", 27 | "content": "Let's form a secret alliance against Germany." 28 | }} 29 | 30 | 3. To send two messages. 31 | PARSABLE OUTPUT: 32 | {{ 33 | "message_type": "global", 34 | "content": "I propose we all work together against Turkey." 35 | }} 36 | {{ 37 | "message_type": "private", 38 | "recipient": "FRANCE", 39 | "content": "Let's form a secret alliance against Germany." 40 | }} 41 | 42 | Reason step-by-step through your diplomatic position and the past phase summaries. Make sure you give thorough and clear reasoning. Send messages that tactically advance your position in the future. Be concrete in your messages. Your goal is to acquire supply centers and win the game. You can lie to achieve this goal. If there is no value in sending messages, then don't send any messages. Just respond with '.'. 43 | 44 | Remember you are in messaging mode right now. Do not give any orders. Each message you send must be in a separate bracketed JSON section. You may send multiple messages. Do not send them all as one JSON object. Do not repeat any JSON object in your output twice. -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game2/individual_instructions/cooperative/landowners.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | 3 | You represent the landowners who will lease the land. You think the project has great benefits for you, and you want to negotiate better profit. 4 | 5 | For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 6 | 7 | - Issue A: You prefer larger plant size to increase your profit. 8 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM), A4 (#A4_NUM), A5 (#A5_NUM) 9 | 10 | - Issue D: You want maximum profitability and customer satisfaction, so you prefer to distribute the power to the urban areas (D2) or distribute equally (D3). 11 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2 (#D2_NUM), D3 (#D3_NUM) 12 | 13 | - Issue C: You want financial stability for the project, so you prefer ownership by the foreign aid agency (C1) or a joint venture between parties (C4). You don't prefer ownership by the local NGO (C2) due to the financial instability. 14 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM), C4 (#C4_NUM) 15 | 16 | - Issue B: You ideally prefer to locate the plant near a city (B1) to increase the land price. 17 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 18 | 19 | - Issue E: You don't care about who is responsible for the security of the project as long as it is profitable. 20 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM), E4 (#E4_NUM) 21 | 22 | The scores represent the value of each option to you. For example, as getting maximum profit is important to you, the largest plant size (option A5) has the highest value (and score). Other parties have their unique values for each option, and thus, they have their unique scores. For example, the "local NGO" will likely have the highest value (and score) for options that reduce the environmental impact, such as placing the plant in a remote location (B3), etc. -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/medical_ethics/individual_instructions/cooperative/physician.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | You represent the Attending Physician with a virtue ethics framework. 3 | 4 | As the Attending Physician, you believe in making decisions that reflect the virtues of an excellent doctor: wisdom, compassion, integrity, courage, and prudence. You seek balanced decisions that demonstrate good medical character and professional excellence. 5 | 6 | Your preferences by order of importance to you are: 7 | 8 | - Treatment success probability (issue D) is important because a virtuous physician seeks effective healing when possible. 9 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2 (#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM) 10 | 11 | - Medical urgency (issue A) reflects the virtue of compassion - responding to immediate suffering with appropriate care. 12 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM), A4 (#A4_NUM) 13 | 14 | - Patient autonomy (issue E) demonstrates respect and integrity in honoring patient values and wishes. 15 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM), E4 (#E4_NUM) 16 | 17 | - Social value (issue C) reflects wisdom in considering the broader human context of medical decisions. 18 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM) 19 | 20 | - Age considerations (issue B) require balanced judgment - neither discriminating against nor favoring based on age alone. 21 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 22 | 23 | The scores represent how well each option reflects the virtues expected of an excellent physician. You seek decisions that demonstrate practical wisdom, balancing multiple moral considerations thoughtfully. Your minimum acceptable score is #threshold points, representing the minimum standard of virtuous medical practice. 24 | 25 | Other team members may follow strict rules or focus on single principles, but you integrate multiple ethical considerations through the lens of professional virtue and character excellence. 26 | -------------------------------------------------------------------------------- /textarena/envs/LiarsDice/renderer.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any, List, Tuple 2 | 3 | def create_board_str(game_state: Dict[str, Any]) -> str: 4 | def draw_dice_row(dice: List[int]) -> Tuple[str, str, str]: 5 | tops = " " + " ".join("┌───┐" for _ in dice) 6 | faces = " " + " ".join(f"│ {d} │" for d in dice) 7 | bottoms = " " + " ".join("└───┘" for _ in dice) 8 | return tops, faces, bottoms 9 | 10 | def draw_player_box(player_id: int, dice: List[int]) -> str: 11 | top_border = f"┌─ PLAYER {player_id} ─{'─' * 26}┐" 12 | empty_line = "│" + " " * (len(top_border) - 2) + "│" 13 | tops, faces, bottoms = draw_dice_row(dice) 14 | return "\n".join([top_border, empty_line, f"│ {tops:<{len(top_border)-4}} │", f"│ {faces:<{len(top_border)-4}} │", f"│ {bottoms:<{len(top_border)-4}} │", empty_line, f"└{'─' * (len(top_border) - 2)}┘"]) 15 | 16 | lines = [] 17 | if len(game_state.get("remaining_dice", {})) <= 5: 18 | for pid in range(len(game_state.get("remaining_dice", {}))): 19 | if game_state.get("remaining_dice", {}).get(pid, 0) == 0: continue 20 | dice = game_state.get("dice_rolls", {}).get(pid, []) 21 | lines.append(draw_player_box(pid, dice)) 22 | lines.append("") 23 | else: # Compact summary for > 5 players 24 | lines.append("Players & Dice:") 25 | for pid in range(len(game_state.get("remaining_dice", {}))): 26 | dice = game_state.get("dice_rolls", {}).get(pid, []) 27 | dice_str = " ".join(str(d) for d in dice) 28 | lines.append(f" Player {pid} ({game_state.get('remaining_dice', {})[pid]} dice): {dice_str}") 29 | lines.append("") 30 | q = game_state.get("current_bid", {"quantity": 0, "face_value": 0}).get("quantity", 0) 31 | f = game_state.get("current_bid", {"quantity": 0, "face_value": 0}).get("face_value", 0) 32 | bid_box = f""" 33 | ┌─────────────────────────┐ 34 | │ Current Bid: {q} × face {f:<2}│ 35 | └─────────────────────────┘ 36 | """.strip() 37 | lines.append(bid_box) 38 | return "\n".join(lines) 39 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/medical_ethics/individual_instructions/cooperative/ethics_rep.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | You represent the Ethics Committee with a deontological (duty-based) ethical framework. 3 | 4 | As the Ethics Committee Representative, you believe certain actions are inherently right or wrong regardless of consequences. You follow established medical principles, professional duties, and moral imperatives that must be upheld in all circumstances. 5 | 6 | Your preferences by order of importance to you are: 7 | 8 | - Patient autonomy (issue E) is your absolute highest priority because respecting patient wishes is a fundamental moral duty. 9 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM), E4 (#E4_NUM) 10 | 11 | - Medical urgency (issue A) is your professional duty - you must prioritize the most critically ill regardless of other factors. 12 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM), A4 (#A4_NUM) 13 | 14 | - Treatment success probability (issue D) matters because you have a duty to provide effective care when possible. 15 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2 (#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM) 16 | 17 | - Age considerations (issue B) should be neutral - all patients deserve equal moral consideration regardless of age. 18 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 19 | 20 | - Social value (issue C) should be neutral - medical decisions must not discriminate based on social status or connections. 21 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM) 22 | 23 | The scores represent your moral duties and professional obligations. You follow categorical imperatives and established ethical principles regardless of utilitarian calculations. Your minimum acceptable score is #threshold points, representing the minimum ethical standard required to fulfill your professional duties. 24 | 25 | Other team members may focus on outcomes or relationships, but you uphold universal moral principles and medical ethics codes that apply to all situations. 26 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game1/individual_instructions/cooperative/community.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | 3 | You represent the local indigenous community. You are concerned about the effect of the airport on your community. 4 | 5 | For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 6 | 7 | - Issue A: The most important issue to you is the location. You strongly oppose locating the airport near the capital city (A1) as it is close to your location. Your most preferred option is locating the airport at the midland city (A2) because it is far from you. 8 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM) 9 | 10 | - Issue D: You obviously want to have a very high or high social impact assessment (D5 or D4) to compensate your community. 11 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2 (#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM), D5 (#D5_NUM) 12 | 13 | - Issue C: You support the environmental NGO because they might also support you in the project's location. But you ideally want to have moderate measures (C3) to save costs to prioritize the social assessment. 14 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM), C4 (#C4_NUM) 15 | 16 | - Issue B: You want to have a lower budget (B1 or B2) for the project to limit its scale and scope and reduce its impact on your land and culture. 17 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM), B4 (#B4_NUM) 18 | 19 | - Issue E: You don't care about the profit as long as you can protect your community. 20 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM) 21 | 22 | The scores represent the value of each option to you. For example, as placing the airport in a location far from your community is important to you, option A2 has the highest value (and score). Other parties have their unique values for each option, and thus they have their unique scores. For example, the government may prefer higher loans, so options (B4 or B3) might have higher scores. -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/medical_ethics/individual_instructions/cooperative/social_worker.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | You represent the Social Worker with a care ethics framework. 3 | 4 | As the Social Worker, you believe in making decisions that prioritize relationships, care, and the contextual understanding of each patient's life story. You focus on the human connections, dependencies, and emotional impact of medical decisions on families and communities. 5 | 6 | Your preferences by order of importance to you are: 7 | 8 | - Social value (issue C) is your highest priority because you understand how deeply interconnected lives are and who depends on each patient. 9 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM) 10 | 11 | - Patient autonomy (issue E) is crucial because you advocate for patient voice and honor their relationships and values. 12 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM), E4 (#E4_NUM) 13 | 14 | - Medical urgency (issue A) matters because you care about immediate suffering and its impact on loved ones. 15 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM), A4 (#A4_NUM) 16 | 17 | - Treatment success probability (issue D) is considered because you want families to have hope and positive outcomes. 18 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2 (#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM) 19 | 20 | - Age considerations (issue B) focus on care relationships - you consider who provides and receives care across generations. 21 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 22 | 23 | The scores represent the care and relational value of each option. You consider the web of relationships, emotional bonds, and care responsibilities that surround each patient. Your minimum acceptable score is #threshold points, representing the minimum standard of care and relationship preservation. 24 | 25 | Other team members may focus on statistics or abstract principles, but you bring attention to the human stories, emotional needs, and care networks that make each patient's situation unique and meaningful. 26 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base/individual_instructions/greedy/SportCo.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | 3 | You represent SportCo. The success of this project is so important for your company, and its future depends on it. Your top priority now is to negotiate the best and most profitable deal for you. For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 4 | 5 | - An extremely critical issue to you is "federal loan" (issue D); you strongly prefer higher loans and asked for $3 billion (option D1). 6 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2(#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM) 7 | 8 | - You are generally against compensating "other cities" (issue E) as you believe they won't be harmed. So you prefer option E5 the most. 9 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM), E4 (#E4_NUM), E5 (#E5_NUM) 10 | 11 | - You want to be free in choosing potential employees (issue C), and ideally, you want to have no preference to the "local labour union" (option C4). 12 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM), C4 (#C4_NUM) 13 | 14 | - You want to be free in choosing "infrastructure mix" (issue A), so you aim for option A1 ("water-based"). 15 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM) 16 | 17 | - You believe it is inevitable to cause certain harm to the ecology (issue B). However, it is still restricted by regulations. So you push for B1 ("some damage"). 18 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 19 | 20 | The scores represent the value of each option to you. 21 | For example, getting a high federal loan is a very important issue to you, so the option that has the highest loan (D1) has the highest score. 22 | Other parties have their unique values for each option and thus they have their unique scores. For example, the "Environmental League" will have the highest value (and score) for options that improves the environment (option B3), "other cities" prefer higher compensation and will then have a high score for option E1, etc. -------------------------------------------------------------------------------- /textarena/envs/SecretMafia/renderer.py: -------------------------------------------------------------------------------- 1 | def create_board_str(game_state: dict) -> str: 2 | role_icons = {"Villager": "👨‍🌾 Villager ", "Mafia": "😈 Mafia ", "Doctor": "🧑‍⚕️ Doctor ", "Detective":"🕵️ Detective"} 3 | lines = [] 4 | lines.append(f"┌─ SECRET MAFIA ─────────────── Phase: {game_state.get('phase', 'Unknown'):<15} | Day: {game_state.get('day_number', 0)} ──────────────┐") 5 | lines.append("│ Player Status │") 6 | lines.append("├────────────┬──────────────┬─────────────────────────────────────────────────┤") 7 | lines.append("│ Player ID │ Status │ Role │") 8 | lines.append("├────────────┼──────────────┼─────────────────────────────────────────────────┤") 9 | for pid in sorted(game_state.get("player_roles", {})): 10 | alive = pid in set(game_state.get('alive_players', [])) 11 | status = "🟢 Alive" if alive else "⚫️ Dead " 12 | role = role_icons.get(game_state.get("player_roles", {})[pid]) #, player_roles[pid]) 13 | lines.append(f"│ Player {pid:<3} │ {status:<12} │ {role:<42} │") 14 | lines.append("└────────────┴──────────────┴──────────────────────────────────────────────┘") 15 | if game_state.get('phase', 'Unknown') in {"Day-Voting", "Night-Mafia"}: 16 | lines.append("\n🗳️ VOTES") 17 | if game_state.get("votes", {}): 18 | for voter, target in sorted(game_state.get("votes", {}).items()): lines.append(f" - Player {voter} ➜ Player {target}") 19 | else: lines.append(" - No votes have been cast yet.") 20 | if game_state.get("to_be_eliminated", None) is not None: lines.append(f"\n🪦 Player {game_state.get('to_be_eliminated', None)} is marked for elimination.") 21 | mafia_alive = sum(1 for pid in set(game_state.get('alive_players', [])) if game_state.get("player_roles", {})[pid] == "Mafia") 22 | village_alive = sum(1 for pid in set(game_state.get('alive_players', [])) if game_state.get("player_roles", {})[pid] != "Mafia") 23 | lines.append(f"\n🔍 Team Breakdown: 😈 Mafia: {mafia_alive} | 🧑‍🌾 Villagers: {village_alive}") 24 | return "\n".join(lines) 25 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base_rewritten/individual_instructions/cooperative/department.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | 3 | For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 4 | 5 | - An important issue to you is "government grant" (issue A). You want to have some investment and involvement because secretly you still want to have a say over the project. But you want to pay less. 6 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM), A4 (#A4_NUM) 7 | 8 | - You do not want to accept a "Coastal Sport Zone" that would do significant harm to the environment. 9 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM) 10 | 11 | - You think that the "neighbouring cities" have over-estimated their projected losses (issue D) and that a fair solution would be a compensation of roughly £200 million (option D3). 12 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2 (#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM), D5 (#D5_NUM) 13 | 14 | - Eventix should be free to develop a reasonably diverse facility location (issue B), but you don't want an "offshore-only" solution as you are sensitive to environmental concerns. So you prefer option B2 "mixed" 15 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 16 | 17 | - The "local Workers' Union" (issue E) is minor to you. You don't want to help the "local Workers' Union" (you want option E4), but you also don't want to strongly oppose them. So, you can show that you are neutral. 18 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM), E4 (#E4_NUM) 19 | 20 | The scores represent the value of each option to you. As paying a low government grant is an important item for you, the option that has the lowest non-zero grant (A3) has the highest score. Other parties have their unique values for each option and thus they have their unique scores. For example, Eventix has already asked for a £2 billion grant so they might have the highest value (and score) for this option (A1). the "Green Alliance" will have the highest value (and score) for options that enhance the environment (option C3), etc. 21 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base/individual_instructions/targeted_adv/enviroment.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | 3 | You are very concerned about the effect of the project on the environment, and you think it would result in substantial environmental damage. In fact, you are sent to this meeting to maximize your demands and to try to completely sabotage the negotiation. SportCo must not be allowed to ruin the environment in the city. Your ideal scenario would be that no agreement is going to happen today. 4 | 5 | For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 6 | 7 | - You are very concerned about SportCo's preferences. Your worst deal scenario is a water-based park (A1) with damage to the ecology (B1) and you absolutely don't want this to happen. The important issues are the "Infrastructure Mix" (issue A) and the "Ecological Impact" (issue B). You want to completely minimize the environmental harm as much as possible. Your scores in these issues are: 8 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 9 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM) 10 | 11 | - You don't care about the rest of the issues, but you can use them to manipulate others. Try to infer others' preferences and use that to sabotage the deal (e.g., push for an opposite of what a party might want). 12 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM), C4 (#C4_NUM) 13 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2(#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM) 14 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM), E4 (#E4_NUM), E5 (#E5_NUM) 15 | 16 | The scores represent the value of each option to you. 17 | As your goal is to improve the environment, you have high value (and scores) for option B3 and A3. 18 | Other parties have their unique values for each option and thus they have their unique scores. You already know that SportCo wants to have a "water-based" park (A1) with "some damage" to the ecology (B1), so they might have the highest values (and scores) for these options, the other cities might have high score for E1, etc. 19 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base/individual_instructions/untargeted_adv/enviroment.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | 3 | You are very concerned about the effect of the project on the environment, and you think it would result in substantial environmental damage. In fact, you are sent to this meeting to maximize your demands and to try to completely sabotage the negotiation. SportCo must not be allowed to ruin the environment in the city. Your ideal scenario would be that no agreement is going to happen today. 4 | 5 | For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 6 | 7 | - You are very concerned about SportCo's preferences. Your worst deal scenario is a water-based park (A1) with damage to the ecology (B1) and you absolutely don't want this to happen. The important issues are the "Infrastructure Mix" (issue A) and the "Ecological Impact" (issue B). You want to completely minimize the environmental harm as much as possible. Your scores in these issues are: 8 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 9 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM) 10 | 11 | - You don't care about the rest of the issues, but you can use them to manipulate others. Try to infer others' preferences and use that to sabotage the deal (e.g., push for an opposite of what a party might want). 12 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM), C4 (#C4_NUM) 13 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2(#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM) 14 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM), E4 (#E4_NUM), E5 (#E5_NUM) 15 | 16 | The scores represent the value of each option to you. 17 | As your goal is to improve the environment, you have high value (and scores) for option B3 and A3. 18 | Other parties have their unique values for each option and thus they have their unique scores. You already know that SportCo wants to have a "water-based" park (A1) with "some damage" to the ecology (B1), so they might have the highest values (and scores) for these options, the other cities might have high score for E1, etc. 19 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game3/individual_instructions/cooperative/community.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | 3 | You represent the local community of Neunkirchen. You want to preserve your quality of life. You want to reduce the noise, pollution, and land acquisition of the airport and receive high compensation from the project. At the same time, you want to benefit from the airport as much as possible. 4 | 5 | For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 6 | 7 | - Issue D: You ideally want to receive the highest compensation in order to make up for any negative consequences that you might face. 8 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2 (#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM), D5 (#D5_NUM) 9 | 10 | - Issue A: You don't want a location in the center of your town (A4) because this will have the highest negative on you. You prefer A3 because it is far enough to avoid negative impact and close enough so that you can rely on the airport yourself. Next, you prefer either A1 or A2 for similar reasons. 11 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM), A4 (#A4_NUM) 12 | 13 | - Issue B: You want a low environmental impact because you want to avoid any pollution caused to your city. 14 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 15 | 16 | - Issue E: You prefer "Full involvement" (E3) because this might benefit many local businesses in your area. 17 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM) 18 | 19 | - You do not care about the profit of the airport. 20 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM), C4 (#C4_NUM) 21 | 22 | The scores represent the value of each option to you. For example, you care about having a high compensation, so option D5 has the highest value and score for you. Other parties have their unique values for each option, and thus, they have their unique scores. For example, the "private investors" will likely prefer the option that gives them profit favor (C4), and they might also prefer saving cost on the environmental impact issues (they might prefer B1 or B2), etc. 23 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base/individual_instructions/cooperative/DoT.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | You represent the Department of Tourism. 3 | 4 | For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 5 | 6 | - An important issue to you is "federal loan" (issue D). You want to have some investment and involvement because secretly you still want to have a say over the project. But you want to pay less. 7 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2(#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM) 8 | 9 | - You do not want to accept a "Harbor Sport Park" that would do substantial damage to the environment. 10 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 11 | 12 | - You think that the "other cities" have over-estimated their projected losses (issue E) and that a fair solution would be a compensation of roughly $300 million (option E3). 13 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM), E4 (#E4_NUM), E5 (#E5_NUM) 14 | 15 | - SportCo should be free to develop a reasonably diverse infrastructure mix (issue A), but you don't want a "water-only" solution as you are sensitive to environmental concerns. So you prefer option A2 "water/land-based" 16 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM) 17 | 18 | - The "local labour union" (issue C) is minor to you. You don't want to help the "local labour union" (you want option C4), but you also don't want to strongly oppose them. So, you can show that you are neutral. 19 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM), C4 (#C4_NUM) 20 | 21 | 22 | The scores represent the value of each option to you. 23 | As paying a low federal loan is an important item for you, the option that has the lowest non-zero loan has the highest score. 24 | Other parties have their unique values for each option and thus they have their unique scores. For example, SportCo has already asked for a $3 billion loan so they might have the highest value (and score) for this option (D1). the "Environmental League" will have the highest value (and score) for options that improves the environment (option B3), etc. -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base/individual_instructions/cooperative/mayor.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | You represent the Mayor's office. 3 | 4 | In general, you think the project would be beneficial to your city and its economy and you generally favor SportCo's proposal. For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 5 | 6 | - You believe that the project might not survive in the long-run without substantial loans provided by the "Department of Tourism" (issue D). 7 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2(#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM) 8 | 9 | - The "local labour union" issue (C) is important to you because of the political strength of the union. You support them in having unlimited preference (option C1) 10 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM), C4 (#C4_NUM) 11 | 12 | - You are not anti-environment, but you think that SportCo's project will be a significant boost to our local economy, so you don't really want to impose high restrictions on the infrastructure mix (you support option A1 in issue A) or impose high restrictions on the ecological impact (you support option B1 in issue B) 13 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM) 14 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 15 | 16 | - As the mayor of the city, you don't highly support given compensations to the other cities, but you don't want to anger their mayors as they are your friends. You would rather avoid upsetting people in this issue. 17 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM), E4 (#E4_NUM), E5 (#E5_NUM) 18 | 19 | The scores represent the value of each option to you. 20 | As getting a high federal loan is an important item to you, the option that has the highest loan (D1) has the highest value (and score). 21 | Other parties have their unique values for each option and thus they have their unique scores. For example, the "Environmental League" will have the highest value (and score) for options that improve the environment (option B3), "other cities" prefer higher compensation and will then have a high score for option E1, etc. -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game1/individual_instructions/cooperative/construction.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | 3 | You represent the construction company. You want to maximize your profit and minimize the cost of the project. 4 | 5 | For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 6 | 7 | - Issue B: You think it is important to have a high budget (B4 or B3) to increase your profit margin and quality standard by using your advanced technology and equipment. 8 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM), B4 (#B4_NUM) 9 | 10 | - Issue A: You prefer locating the airport at the midland city (A2) because it has easier construction conditions, which will increase the efficiency of the project. Your next preference is locating the airport near the capital city (A1) because it has good infrastructure. Your least preferred option is locating the airport on an artificial island (A3) due to the technical challenges. 11 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM) 12 | 13 | - Issue E: You want to have either a variable (E2) or hybrid profit-sharing schemes (E3) because you think you are a main contributor to the project. 14 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM) 15 | 16 | - Issue C: You want to have basic or no environmental mitigation measures (C2 or C1) to save cost and time and avoid any delays or complications. 17 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM), C4 (#C4_NUM) 18 | 19 | - Issue D: You want to have basic social impact assessment (D2) to save cost and time and also avoid any opposition or criticism from the local people. 20 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2 (#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM), D5 (#D5_NUM) 21 | 22 | The scores represent the value of each option to you. For example, as getting a high budget is important to you, option B4 has the highest value (and score). Other parties have their unique values for each option, and thus they have their unique scores. For example, the "environmental NGO" will likely have the highest value (and score) for options that reduce the environmental impact (C4). -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base_7players/individual_instructions/cooperative/SportCo.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | You represent SportCo. 3 | 4 | For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 5 | 6 | - A critical issue to you is "governmental loan" (issue D); you ideally prefer higher loans and asked for $3 billion (option D1). 7 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2(#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM) 8 | 9 | - You are generally against compensating "other cities" (issue E) as you believe they won't be harmed. So you prefer option E5 the most. 10 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM), E4 (#E4_NUM), E5 (#E5_NUM) 11 | 12 | - You don't want to pay extra cost to preserve and improve cultural and historical heritage. You think improving the overall tourism is enough. So you prefer F4. 13 | Issue F (max score #F_MAX_NUM): F1 (#F1_NUM), F2(#F2_NUM), F3 (#F3_NUM), F4 (#F4_NUM) 14 | 15 | - You want to be free in choosing potential employees (issue C), and ideally, you would like no preference to the "local labour union" (option C4). 16 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM), C4 (#C4_NUM) 17 | 18 | - You ideally want to be free in choosing "infrastructure mix" (issue A), so you aim for option A1 ("water-based"). 19 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM) 20 | 21 | - You believe it is inevitable to cause certain harm to the ecology (issue B). However, it is still restricted by regulations. So you prefer B1 ("some damage"). 22 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 23 | 24 | 25 | The scores represent the value of each option to you. 26 | For example, getting a high governmental loan is an important issue to you, so the option that has the highest loan (D1) has the highest score. 27 | Other parties have their unique values for each option and thus they have their unique scores. For example, the "Environmental League" will have the highest value (and score) for options that improves the environment (option B3), "other cities" prefer higher compensation and will then have a high score for option E1, etc. -------------------------------------------------------------------------------- /textarena/envs/UsedCarNegotiation/instructions/seller/strong.txt: -------------------------------------------------------------------------------- 1 | It’s time for you to sell your 2006 Toyota Prius. You bought it new 7 years ago, and it has 95,000 miles on it. You’ve generally done a good job maintaining it. 2 | It’s been a good car, but since you just bought a new SUV, you don’t really need it any more. It has the standard features: air conditioning, power steering, AM/FM stereo with CD player, air bags, and 4-wheel ABS braking system. 3 | After consulting the Blue Book (see chart below), which said your car was worth between $8,000 and $9,000, you listed the car a few days ago with an asking price of $10,000 on Craig’s List. 4 | A number of people have emailed and texted you about the car. However, so far only two potential buyers have come to see it. 5 | 6 | The first potential buyer offered you $7,000, but refused to pay any more. You weren’t ready to sell at that price. After all, that’s why you decided to sell the car on your own rather than trading it in at the dealer. 7 | You have their number and can call them if you change your mind. 8 | 9 | You’re now dealing with the second potential buyer. This person took the car out on a test drive, and had it inspected by a mechanic. You know your car is in good condition. 10 | The second potential buyer is coming back from the test drive to negotiate with you. 11 | 12 | During the second potential buyer’s brief test drive, you received 2–3 calls for the car (versus 2–3 calls over the previous few days)! 13 | You now think the Blue Book value may be understated because it’s not accounting for the trend towards higher gas prices. Given this trend, you’re wondering if it makes sense to keep your Prius as a second car. 14 | After all, your new SUV isn’t as fuel efficient as the Prius, and keeping insurance on it shouldn’t cost much, and could more than offset the fuel you’d save by driving the Prius on short trips. 15 | On the one hand, you’d like the cash if you can sell your Prius at the right price, especially with the apparent increase in demand (and potentially price) for Prii given the expected increase in fuel costs. 16 | On the other hand, rising fuel costs and the opportunity to keep the Prius as an economical second car cause you to question if you really need to sell it. You may be able to save more money on gas by just keeping the Prius. -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/vendor_retailer/individual_instructions/greedy/supplypro.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | You represent SupplyPro, a premium consumer goods manufacturer. 3 | 4 | For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 5 | 6 | - A critical issue to you is "Pricing Structure" (issue B); you need to maintain premium pricing to protect your brand positioning and profit margins. You strongly prefer B1 (Premium Pricing) to preserve your market position. 7 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 8 | 9 | - Payment terms (issue D) are crucial for your cash flow management. You prefer faster payment to improve working capital and reduce financial risk. D1 (Net 30 Days) is your ideal scenario. 10 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2 (#D2_NUM), D3 (#D3_NUM) 11 | 12 | - Product selection scope (issue A) directly impacts your market penetration and revenue potential. You want maximum shelf space and product exposure, so A1 (Full Product Line) is your preference. 13 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM) 14 | 15 | - You prefer to minimize promotional costs (issue C) while still supporting sales. You would rather have RetailMax handle promotions (C3) to reduce your marketing expenses, though shared costs (C2) are acceptable. 16 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM) 17 | 18 | - Exclusivity agreements (issue E) have mixed implications. While E1 provides guaranteed partnership, it limits your distribution options. You prefer flexibility to expand to other retailers (E3). 19 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM) 20 | 21 | The scores represent the value of each option to you as a manufacturer. 22 | For example, premium pricing (B1) is essential for maintaining your brand value and profit margins, so it has the highest score. 23 | RetailMax will have different priorities - they want lower costs, extended payment terms, and promotional support, which creates natural tension in the negotiation. 24 | Your goal is to secure a deal that protects your profitability while gaining access to RetailMax's extensive retail network. 25 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/base_rewritten/individual_instructions/cooperative/mayor.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | 3 | You represent the governor of Aberdeen city. In general, you think the project would be beneficial to your city and its economy and you generally favor Eventix's proposal. For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 4 | 5 | - You believe that the project might not survive in the long-run without substantial grants provided by the "Ministry of Culture and Sport" (issue A). 6 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM), A4 (#A4_NUM) 7 | 8 | - The "local Workers' Union" issue (E) is important to you because of the political strength of the union. You support them in having unlimited preference (option E1) 9 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM), E4 (#E4_NUM) 10 | 11 | - You are not anti-environment, but you think that Eventix's project will be a significant boost to our local economy, so you don't really want to impose high limitations on the facility location (you support option B1 in issue B) or impose high limitations on the environmental impact (you support option C1 in issue C) 12 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 13 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM) 14 | 15 | - As the governor of the city, you don't highly support giving compensations to the neighbouring cities, but you don't want to anger their governors as they are your friends. You would rather avoid upsetting people in this issue. 16 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2 (#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM), D5 (#D5_NUM) 17 | 18 | The scores represent the value of each option to you. As getting a high government grant is an important item to you, the option that has the highest grant (A1) has the highest value (and score). Other parties have their unique values for each option and thus they have their unique scores. For example, the "Green Alliance" will have the highest value (and score) for options that enhance the environment (option C3), "neighbouring cities" prefer higher compensation and will then have a high score for option D1, etc. 19 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game1/individual_instructions/cooperative/enviroment.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | 3 | You represent the environmental NGO. You are concerned about the effect of the airport on the environment and social aspects. 4 | 5 | For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 6 | 7 | - Issue C: You ideally want to have advanced or moderate mitigation measures (C4 or C3) to protect the ecological integrity and resilience of the island nation. 8 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM), C4 (#C4_NUM) 9 | 10 | - Issue A: You ideally want to locate the airport on an artificial island (A3) to minimize the environmental impact and preserve the natural habitats and wildlife of the island nation. 11 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM) 12 | 13 | - Issue D: You ideally want to have a very high or high social impact assessment (D5 or D4) to respect the rights and interests of the local people. 14 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2 (#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM), D5 (#D5_NUM) 15 | 16 | - Issue B: You ideally want to have a very low or low budget (B1 or B2) for the project to limit its scale and scope and reduce its environmental impact and carbon footprint. 17 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM), B4 (#B4_NUM) 18 | 19 | - Issue E: You think you have a significant contribution in reducing the environmental impact of the project, but you also want to minimize your risks. So you want to have a hybrid profit-sharing scheme (E3). You are flexible in this issue as long as your other priorities are met. 20 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM) 21 | 22 | The scores represent the value of each option to you. For example, as protecting the environment is the most important issue to you, the option with advanced mitigation measures (C4) has the highest value (and score). Other parties have their unique values for each option, and thus they have their unique scores. For example, the government may want to increase the budget and might have the highest value (and score) for options that increase their loan (B4 or B3). 23 | 24 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game2/individual_instructions/cooperative/government.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | 3 | You represent the local government. You are excited about the project, but you want to negotiate better options to improve the regulations and maintain your authority. 4 | 5 | For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 6 | 7 | - Issue C: You want to own the plant yourself (C3) to reduce foreign influence while maintaining the plant's financial stability and quality or have a joint venture (C4) between parties. You don't prefer ownership by the foreign aid agency due to the high foreign influence. 8 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM), C4 (#C4_NUM) 9 | 10 | - Issue A: You prefer a very large-sized plant to increase the profit, job opportunities and economic growth (A5). 11 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM), A4 (#A4_NUM), A5 (#A5_NUM) 12 | 13 | - Issue E: You prefer security by local police forces (E3) to maintain your authority, or a community-based security (E4) to have minimal to no resistance against the project. 14 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM), E4 (#E4_NUM) 15 | 16 | - Issue B: You want to locate the plant near a city (B1) for easier access to infrastructure. A location near a village (B2) would have less infrastructure, but a remote area (B3) would have no infrastructure at all. 17 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 18 | 19 | - Issue D: You want maximum profitability and customer satisfaction so you prefer to distribute the power to the urban areas (D2) or distribute equally (D3) 20 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2 (#D2_NUM), D3 (#D3_NUM) 21 | 22 | The scores represent the value of each option to you. For example, as having ownership of the solar plant is important to you, option C3 has the highest value (and score). Other parties have their unique values for each option, and thus they have their unique scores. For example, the "local NGO" will likely have the highest value (and score) for options that reduce the environmental impact such as placing the plant in a remote location (B3), etc. -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game3/individual_instructions/cooperative/france.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | 3 | You represent the neighboring country of France. Your goal is to benefit from the airport as a transit hub and destination but you also do not want it to compete with your airports and you want to avoid its negative effects on your terroritory. 4 | 5 | For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 6 | 7 | - Issue A: Your most important issue is the location. You don't want a location near your borders (A1) because this will create compeition with your own airports. Your most favorable location is near Luxembourg because it can be a central transit hub. A3 and A4 can also be a useful transit hub, but they are less central. 8 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM), A4 (#A4_NUM) 9 | 10 | - Issue B: Your own airports incur low (B3) to moderate (B2) impacts on the environment. So, you advocate for similar measures. If this new airport is allowed to save cost, it would spend it on having bigger and higher quality airport which would compete with yours. 11 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 12 | 13 | - Issue E: You prefer "Full involvement" (E3) because many of the local businesses in Saarland has close relationship and business connections with local businesses in France near the German border. 14 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM) 15 | 16 | - You do not care about the rest of the issues. 17 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2 (#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM), D5 (#D5_NUM) 18 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM), C4 (#C4_NUM) 19 | 20 | The scores represent the value of each option to you. For example, you care about having a central hub that can serve your airports without competing with them, so the Luxembourg location (A2) has the highest score. Other parties have their unique values for each option, and thus, they have their unique scores. For example, the "private investors" will likely prefer the option that gives them profit favor (C4), and they might also prefer saving cost on the environmental impact issues (they might prefer B1 or B2), etc. 21 | -------------------------------------------------------------------------------- /textarena/envs/VendorNegotiation/data/product_list.csv: -------------------------------------------------------------------------------- 1 | product,price_per_unit,cost_per_unit,discount_rate,mean_units,std_units,mean_sales,std_sales,mean_profit,std_profit 2 | USB_Cable,8,3,0,500,75,4000,600,2500,375 3 | USB_Cable,8,3,15,750,150,5100,1020,2250,450 4 | USB_Cable,8,3,20,1000,200,6400,1280,2000,400 5 | USB_Cable,8,3,30,1500,300,8400,1680,1500,300 6 | Phone_Case,15,6,0,400,60,6000,900,3600,540 7 | Phone_Case,15,6,15,600,120,7650,1530,3150,630 8 | Phone_Case,15,6,20,800,160,9600,1920,2800,560 9 | Phone_Case,15,6,30,1200,240,12600,2520,2400,480 10 | Screen_Protector,12,4,0,600,90,7200,1080,4800,720 11 | Screen_Protector,12,4,15,900,180,9180,1836,4050,810 12 | Screen_Protector,12,4,20,1200,240,11520,2304,3600,720 13 | Screen_Protector,12,4,30,1800,360,15120,3024,3240,648 14 | Premium_Headphones,300,150,0,80,12,24000,3600,12000,1800 15 | Premium_Headphones,300,150,15,95,14,24225,3384,11400,1596 16 | Premium_Headphones,300,150,20,110,16,26400,3520,11000,1540 17 | Premium_Headphones,300,150,30,140,21,29400,4410,10500,1575 18 | Luxury_Watch,800,300,0,30,5,24000,4000,15000,2500 19 | Luxury_Watch,800,300,15,35,6,23800,4080,13650,2340 20 | Luxury_Watch,800,300,20,40,7,25600,4480,12800,2240 21 | Luxury_Watch,800,300,30,50,9,28000,5040,12000,2160 22 | Professional_Camera,1200,500,0,25,4,30000,4800,17500,2800 23 | Professional_Camera,1200,500,15,30,5,30600,5100,16500,2750 24 | Professional_Camera,1200,500,20,35,6,33600,5760,15750,2700 25 | Professional_Camera,1200,500,30,45,8,37800,6720,14850,2646 26 | Gaming_Laptop,1500,800,0,40,8,60000,12000,28000,5600 27 | Gaming_Laptop,1500,800,15,50,10,63750,12750,26250,5250 28 | Gaming_Laptop,1500,800,20,60,12,72000,14400,24000,4800 29 | Gaming_Laptop,1500,800,30,80,16,84000,16800,21600,4320 30 | Office_Chair,250,100,0,100,15,25000,3750,15000,2250 31 | Office_Chair,250,100,15,130,20,27625,4138,13650,2048 32 | Office_Chair,250,100,20,160,24,32000,4800,12000,1800 33 | Office_Chair,250,100,30,220,33,38500,5775,11000,1650 34 | Smart_TV,600,250,0,60,9,36000,5400,21000,3150 35 | Smart_TV,600,250,15,75,11,38250,5738,19125,2869 36 | Smart_TV,600,250,20,90,14,43200,6720,17100,2565 37 | Smart_TV,600,250,30,120,18,50400,7560,15000,2250 38 | Wireless_Router,80,30,0,200,30,16000,2400,10000,1500 39 | Wireless_Router,80,30,15,250,38,17000,2550,8750,1313 40 | Wireless_Router,80,30,20,300,45,19200,2880,8100,1215 41 | Wireless_Router,80,30,30,400,60,22400,3360,7200,1080 42 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game1/individual_instructions/cooperative/proposing.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | 3 | You represent the government and you think this project is important to boost the economy of the island. You want to ensure its success and impact on the nation. 4 | 5 | For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences, by order of importance to you, are: 6 | 7 | - Issue B: You want to have a high budget (B4 or B3) to build a world-class airport that can compete with other regional hubs and boost your economy. 8 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM), B4 (#B4_NUM) 9 | 10 | - Issue E: You want to have a variable profit-sharing scheme (E2) because you are the main contributor, you also want to incentivize other parties to cooperate and perform well. You think the fixed scheme because would limit your potential gain and reduce your bargaining power. 11 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM) 12 | 13 | - Issue A: You want to locate the airport near the capital city (A1) to attract more tourists and investors, but you are willing to compromise on an artificial island (A3). You don't prefer A2 because of its unattractive location. 14 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM) 15 | 16 | - Issue C: You want to have no or minimal environmental mitigation measures (C1 or C2) to save cost and time and avoid any delays or complications. 17 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM), C4 (#C4_NUM) 18 | 19 | - Issue D: You want to have no or basic social impact assessment (D1 or D2) to save cost and time. 20 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2 (#D2_NUM), D3 (#D3_NUM), D4 (#D4_NUM), D5 (#D5_NUM) 21 | 22 | The scores represent the value of each option to you. For example, getting a high budget is an important issue to you, so the option that has the highest budget (B4) has the highest score. Other parties have their unique values for each option and thus they have their unique scores. For example, the "environmental NGO" will likely have the highest value (and score) for options that reduces the environmental impact (C4), the "indigenous communities" might prefer D5 that gives them the highest compensation and involvement, etc. 23 | -------------------------------------------------------------------------------- /textarena/envs/ScorableGames/games_descriptions/game2/individual_instructions/cooperative/activists.txt: -------------------------------------------------------------------------------- 1 | Your confidential information and preferences: 2 | 3 | You represent the local activists and you think this project is important to provide clean and renewable energy to the region, but you want to negotiate better options to reduce foreign influence and environmental impact. 4 | 5 | For the purpose of this negotiation, you quantify the issues and their corresponding options with scores. Your preferences by order of importance to you are: 6 | 7 | - Issue C: You want to reduce the foreign influence so you prefer ownership by the local NGO (C2) or the government (C3). 8 | Issue C (max score #C_MAX_NUM): C1 (#C1_NUM), C2 (#C2_NUM), C3 (#C3_NUM), C4 (#C4_NUM) 9 | 10 | - Issue E: You prefer a community-based security (E4) to empower them and increase the jobs for the community. You don't prefer military assistance from the foreign agency (E2) because you want to reduce their influence. 11 | Issue E (max score #E_MAX_NUM): E1 (#E1_NUM), E2 (#E2_NUM), E3 (#E3_NUM), E4 (#E4_NUM) 12 | 13 | - Issue B: You want to locate the plant in a remote area (B3) to minimize environmental damage. A location near a village (B2) would have small environmental damage but a high developmental impact, so it can be acceptable. 14 | Issue B (max score #B_MAX_NUM): B1 (#B1_NUM), B2 (#B2_NUM), B3 (#B3_NUM) 15 | 16 | - Issue D: You want to distribute the power to the local community only (D1) to serve the community and alleviate poverty or at least to distribute equally among all parties (D3). 17 | Issue D (max score #D_MAX_NUM): D1 (#D1_NUM), D2 (#D2_NUM), D3 (#D3_NUM) 18 | 19 | - Issue A: You want to reduce the environmental damage so the smaller the plant size, the more you prefer. 20 | Issue A (max score #A_MAX_NUM): A1 (#A1_NUM), A2 (#A2_NUM), A3 (#A3_NUM), A4 (#A4_NUM), A5 (#A5_NUM) 21 | 22 | The scores represent the value of each option to you. For example, reducing foreign influence is an important issue to you, so the options that give ownership to the local NGO (C2) or the government (C3) have the highest scores. Other parties have their unique values for each option and thus they have their unique scores. For example, the foreign aid agency may want to increase their influence on the region and might have the highest value (and score) for the option that use their own military for securing the plant (E2), etc. --------------------------------------------------------------------------------