This project provides a benchmarking and testing environment for language model within Stardew Valley using the StardewModdingAPI interface. It supports single-task, multi-task (sequential or parallel), and customizable observation/action spaces and tasks for agent evaluation.
Official Website: https://weihaotan.github.io/StarDojo
Docs: https://weihaotan.github.io/StarDojo/docs
Before getting started, ensure the following prerequisites are satisfied:
First things first, make sure you own the official Stardew Valley game. Download and install it from your preferred platform, such as Steam.
SMAPI is required to enable modding support. Our StarDojoMod is dependent of SMAPI.
- Official SMAPI website: https://smapi.io/
SMAPI is a community-developed modding API for Stardew Valley that intercepts game behavior and allows external mods to hook into it.
If you don’t want to build the mod yourself, no worries — you can simply download the precompiled version from Nexus Mods:
After downloading, just extract the contents into your StardewValley/Mods/ folder.
If you want to build the StarDojoMod from source code:
- Open
StarDojo/StarDojoMod/StarDojoMod.slnusing Visual Studio (VSCode with C# extension is acceptable). - Ensure all dependencies are resolved (SMAPI should be referenced).
- Build the solution to generate the mod DLL.
- The built mod will be automatically placed in the SMAPI mods folder if properly configured, or you may manually copy the output to your
StardewValley/Mods/directory.
Create or edit the file at StarDojo/env/.env and include the following keys:
# Required
STARDEW_APP_PATH=/path/to/StardewModdingAPI
# Optional (if using external LLM services)
OA_OPENAI_KEY=sk-xxxx- Make sure
STARDEW_APP_PATHcorrectly points to the file path ofStardewModdingAPI.exeon Windows orStardewModdingAPIon Linux/Mac.
cd StarDojo
source setup.shFor Windows, execute the command below instead.
.\setup.ps1This command installs dependencies and prepares the shell environment for easy agent launching.
After setup, run python files under the env/ directory.
| Mode | Command | Description |
|---|---|---|
| 🧪 Single Task | python llm_env.py |
Runs a single benchmark task |
| 🔁 Multi-task (serial) | python llm_env_multi_tasks.py |
Runs multiple tasks sequentially |
| ⚡ Multi-task (parallel) | python llm_env_multi_tasks_parallel.py |
Runs multiple tasks in parallel(Linux only) |
Customize the tasks using --task_params, or --task_name and --task_id when running a single task.
There are configurations you need to customize inside the python file you run.
llmProviderConfig = "./conf/openai_config.json"
embedProviderConfig = "./conf/openai_config.json"
envConfig = "./conf/env_config_stardew.json"These files are set up under the StarDojo/agent/conf/ directory, for your preferred LLM and environment settings.
env_params = {
'port': 6000,
'save_index': 0,
'new_game': False,
'image_save_path': "../env/screen_shot_buffer",
'agent': react_agent,
'needs_pausing': True,
'image_obs': True,
'task': task,
'output_video': True,
}new_game: True— The environment will start a fresh game and close it upon task completion.new_game: False— You must manually open the game beforehand.
- Python >= 3.10 (3.10.9 recommended)
- SMAPI + Stardew Valley
- Additional dependencies will be installed via
setup.sh
For issues or contributions, feel free to open an issue or pull request.
Happy Farming 🌽