{"id":34988931,"url":"https://github.com/zivmax/rimworld-combat-agent-server","last_synced_at":"2026-05-25T05:01:52.316Z","repository":{"id":273075037,"uuid":"901796842","full_name":"zivmax/rimworld-combat-agent-server","owner":"zivmax","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-18T13:30:53.000Z","size":491,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-18T14:38:39.165Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zivmax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-11T10:31:57.000Z","updated_at":"2025-01-18T13:30:55.000Z","dependencies_parsed_at":"2025-01-18T14:38:43.096Z","dependency_job_id":"552decd9-385f-4022-8471-a4050994afab","html_url":"https://github.com/zivmax/rimworld-combat-agent-server","commit_stats":null,"previous_names":["zivmax/rimworld-combat-agent-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zivmax/rimworld-combat-agent-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zivmax%2Frimworld-combat-agent-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zivmax%2Frimworld-combat-agent-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zivmax%2Frimworld-combat-agent-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zivmax%2Frimworld-combat-agent-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zivmax","download_url":"https://codeload.github.com/zivmax/rimworld-combat-agent-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zivmax%2Frimworld-combat-agent-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33461090,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-25T02:24:28.008Z","status":"ssl_error","status_checked_at":"2026-05-25T02:23:23.339Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-27T01:47:46.205Z","updated_at":"2026-05-25T05:01:52.299Z","avatar_url":"https://github.com/zivmax.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Combat Agent for RimWorld\n\nA reinforcement learning project that trains combat agents for RimWorld using various algorithms including DQN, PPO, and PGM. The agents learn optimal combat strategies in simulated RimWorld environments.\n\n## Prerequisites\n- [Combat Agent Client](https://github.com/zivmax/rimworld-combat-agent-client) installed and activate on RimWorld\n- A legal copy of RimWorld, Linux version required.\n- [Docker Desktop](https://www.docker.com/products/docker-desktop/)\n- [Visual Studio Code](https://code.visualstudio.com/)\n- [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) for VSCode\n\n## Setup the files\n\n1. Create a empty folder\n```sh\nmkdir combat-agent\n```\n\n2. Clone the repository into the folder\n```sh\ngit clone https://github.com/zivmax/rimworld-combat-agent-server.git combat-agent/agent-server\n```\n\n3. Put the game into the folder and make sure the game folder just named `game`, and `game/RimWorldLinux` is the game executable.\n```sh\nif [ -x combat-agent/game/RimWorldLinux ]; then\n  echo \"Game is ready.\"\nelse\n  echo \"Game not found or misnamed.\"\nfi\n```\n\n4. Clone the `agent-client` repo into game's mod folder\n\n```sh\ngit clone https://github.com/zivmax/rimworld-combat-agent-client.git combat-agent/game/Mods/agent-client\n```\n\n## Quick Start with Dev Container\n\n1. Open the project in VSCode\n2. When prompted, click \"Reopen in Container\" or:\n   - Press F1\n   - Select \"Dev Containers: Reopen in Container\"\n\nThe devcontainer will automatically:\n- Build the Docker environment\n- Install all Python dependencies\n- Configure Git settings\n- Set up RimWorld mod configurations\n3. Open the file `.vscode/combat-agent.code-workspace` and open the multi-root workspace.\n4. Run the Debug Configuration `Build-Linux (agent-client)` to build and install the agent-client mod.\n\n## Project Structure\n\n```\n.\n├── agents/               # RL agent implementations\n│   ├── dqn-cnn/         # DQN with CNN architecture\n│   ├── dqn-naive/       # Basic DQN implementation  \n│   ├── dqn-resnet/      # DQN with ResNet\n│   ├── pgm/             # Policy Gradient Methods\n│   ├── ppo/             # Proximal Policy Optimization\n│   └── random/          # Random action baseline\n├── env/                 # Environment implementation\n│   ├── wrappers/        # Gym environment wrappers\n│   ├── action.py        # Action space definition\n│   ├── game.py          # Game interface\n│   └── state.py         # State representation\n└── utils/              # Utility functions\n```\n\n## Training Agents\n\nChoose an agent type and run its training script:\n\n```bash\n# Train DQN with ResNet\npython -m agents.dqn-resnet.train\n\n# Train PPO agent\npython -m agents.ppo.train\n\n# Train baseline random agent\npython -m agents.random.train\n```\n\n## Deploying Trained Agents\n\nRun the deployment script for a trained agent:\n\n```bash\npython -m agents.dqn-resnet.deploy\n```\n\n## Development\n\n### Key Dependencies\n\n- PyTorch\n- Gymnasium\n- Pandas\n- Matplotlib\n- Seaborn\n\n### Code Organization\n\n- `agents/`: Each agent type has its own implementation with:\n  - `agent.py`: Core agent class\n  - `model.py`: Neural network architecture\n  - `train.py`: Training loop\n  - `deploy.py`: Evaluation script\n\n### Training Artifacts\n\nResults are saved under agent-specific directories:\n\n- `models/`: Saved model weights\n- `plots/`: Training visualizations\n- `histories/`: Raw csv data of the plots\n\n### Utility Scripts\n\nClean up generated files:\n```bash\n# Clean training plots\n./utils/clean-plots.sh\n\n# Clean history files\n./utils/clean-histories.sh\n\n# Clean log files\n./utils/clean-logs.sh\n\n# Clean tracing files\n./utils/clean-tracing.sh\n```\n\n## Environment Configuration\n\nThe RimWorld environment can be configured through `EnvOptions` in training scripts:\n- Map size and features\n- Team sizes\n- Reward structures\n- Game speed and intervals\n\n## Monitoring\n\nTraining progress can be monitored through:\n- Real-time progress in console\n- Saved history plots\n- Episode statistics\n- Model checkpoints\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzivmax%2Frimworld-combat-agent-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzivmax%2Frimworld-combat-agent-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzivmax%2Frimworld-combat-agent-server/lists"}