RimWorld

RimWorld

41 ratings
OpenRimWorldAI
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.5
File Size
Posted
Updated
456.329 KB
Jan 21 @ 9:20am
Feb 15 @ 9:07pm
15 Change Notes ( view )

Subscribe to download
OpenRimWorldAI

Description
Dear Developers:
packageId = OpenRimWorldAI.Base
Use 'await OpenRimWorldAI.AI.SendPromptAsync(prompt,[rules,identity,instructions,showAlert:True])' to send prompts. Outputs will be returned as string and create an alert. (showAlert is False by default)
Character Limitation: 128,000 characters max (About 32,000 Tokens)
public static async Task<string> SendPromptAsync(string prompt, string promptRules = "Do not repeat sentences. Don't explain yourself. Never break character. ", string identity = "", string promptInstruction = "Include your name in a subject/header. Respond to the following and wrap your subject/header in tildes(~): ") //You can use these for data dumps: string itemList = AI_Information.GetStorageItems(); string completedResearchList = AI_Information.GetCompletedResearch(); string allpawnStatsList = AI_Information.GetAllPawnStats(); string pawnStatsList = AI_Information.GetPawnStats(pawn); string colony = AI_Information.GetColonyInfo();
OpenRimWorldAI.AskAPawn
was created to provide a simple example: https://steamcommunity.com/sharedfiles/filedetails/?id=3412825218

OpenRimWorldAI

What is it?
Originally posted by Developer:
OpenRimWorldAI is a RimWorld mod that adds AI using OpenRouter's API. OpenRouter offers both free & paid services.
What does it add to the game?
Originally posted by Developer:
OpenRimWorldAI will act as my base for future AI work. With base, you will get a daily report from one of your pawns regarding the status of your colony.
Things you can do:
  • Receive Daily Reports from a random Pawn
  • Pre-loaded with Free API keys (Recommend getting your own due to quotas)
  • Chose your own model!
Any Setup Required?
Originally posted by Developer:
No, it'll work out of the box. I do recommend applying your own API Key. Each key has a 200 request per day limit. Optionally with your own key, you can can add funds to use paid models.
What's the recommended LLM/Model?
Originally posted by Developer:
Everything has been tested to work with "google/gemini-2.0-flash-exp:free" with "OpenRouter". Gemini already has context that relates to RimWorld which greatly compliments this mod.

OpenRouter (Recommended) vs Ollama (Not Recommended)
Originally posted by Developer:
OpenRouter offers API services to some of the best LLMs out there. They offer both free & paid services. This mod has been tested to work with OpenRouter using the "gemini-2.0-flash-exp:free" model. It requires no additional hardware constraints to the user. It also accepts up to 128,000 characters.

Ollama is a locally ran server. For top models, it requires some serious hardware and due to my own hardware constraints testing has been limited. In testing I've tried a few models:
Deepseek yielding poor results
LLama3.3 requires more memory than I can afford
LLama3.2 3b was similiar to Deepseek in the sense that neither were trained with RimWorld knowledge.
Updates
v.1.1: Updates to support "AskAPawn" Updates: - Mirrored "FindPawnByName()" from Overlord to "AI_Information" to support "AskAPawn" - Added new parameters, "includePawnDetails" & "internalThoughts", for SendPromptAsync(): includePawnDetails: Attempts to find pawn based name in header/subject if possible and includes additional details. internalThoughts: If true, looks for a semi-colon and parses that part of the response as internal thoughts. public static async Task<string> SendPromptAsync( string prompt, string promptRules = "useDefaultDef", string identity = "useDefaultDef", string promptInstruction = "useDefaultDef", bool showAlert=false, LetterDef letterType = null, bool includePawnDetails=false, bool internalThoughts=false ) v.1.0: - Added Ollama as an option for AI. I do not recommend it especially if your computer can not process large amounts of data. For Daily Reports the character length is usually around 4000 characters. - Added a new setting "RimWorld Background" which will front-load "What RimWorld Is" to the AI. Adds ~1200 characters. (This is useful for models that do not have RimWorld as part of their training data) - RimWorld_Background can also be modified in the Defs. (Historical updates move to "Change Notes")
59 Comments
Rage Jun 21 @ 11:17pm 
request you make a api adaption for anthropic itself. claude systems would do wonders and i refuse to constantly pay for shoddymiddlemen everytime its ai related. at the current moment anthropic is the only dev of a good ai system.
Krypt May 23 @ 8:53pm 
I can't restrain myself from making this absolutely unconstructiove comment:
> OpenRouter (Recommended) vs Ollama (Not Recommended)

Aaand this line is the reason I will not use this mod, but rather implement my own.
GrimStrider Apr 15 @ 12:27am 
The ai seems to be very confused about what gender my pawns are XD
SenjuWoo Mar 10 @ 2:23pm 
All good
LoneLemone  [author] Mar 10 @ 2:17pm 
I don't really have the time right now. Between vacation and business travel I'm a little too busy right now.
Bleeding Eyes Mcgee Mar 8 @ 1:33pm 
It seems to have been removed, but a while ago the description mentioned plans for another addon that deals with moods, relationships and conversations. Is there still a chance that it might come out eventually, or was it fully cancelled?
SenjuWoo Feb 18 @ 9:06pm 
Ir would be nice if you made an other expantion where the ai could generate names for pawns and stuff knowing their names and all their info from the game and well seed names, world names, tribe names ect...
LoneLemone  [author] Feb 15 @ 6:21pm 
Hey everyone,

The base mod here functions pretty well. I've been putting a lot of work into the "Overlord" expansion and being entertained with how chaotic the AI is. See: https://steamcommunity.com/sharedfiles/filedetails/?id=3420778796

With the base mod performing well with OpenRouter, I'm considering adding a few additional API Sources:
- Google (Gemini)
- OpenAI (GPT)
- Microsoft (Copilot)

Not sure if OpenAI/Microsoft offer a dev key with free usage, but I know Google does for Gemini.

OpenRouter will still remain the default due it's capability of supporting a broad range of models and easy pay-model for those that choose to use it.
2922608187 Feb 12 @ 11:35am 
thanks,got it
LoneLemone  [author] Feb 12 @ 11:29am 
@2922608187
Not sure this mod really warrants a discord, but if you want to reach me outside of Steam, here's my personal discord channel: discord (.) gg/BbxXCqsW