• ⚠️ Mod Release Rules now apply to this board.

    All mods must include a license, source code (for executable mods), and proper attribution.

    Read the full rules here before posting.

How to use StarMap Mod Loader

Orangutanion

New Member
Nov 14, 2025
4
8
Credit to @klasswhite for writing StarMap!
Right now the community is trying to decide on one community modloader to use. I'm writing this guide both to make the case for StarMap (which is in active development) and just to save new modders time. I will give information both for users and for mod developers.

Part 1: Installing KSA and Starmap
Obviously you need Kitten Space Agency installed. Either install location (Program Files or %LOCALAPPDATA%\Programs) is fine. Once you have KSA installed, download the latest release (screenshot is out of date) for StarMap: https://github.com/StarMapLoader/StarMap/releases:
1763242157696.png

Once you have it downloaded, extract it to its own folder. For instance I have mine in a dedicated ksamodding\StarMapLoader directory:
1763242499703.png

Run StarMap.exe once. This should create a terminal popup and a new file called StarMapConfig.json. Open that up in your text editor of choice (notepad, vscode, etc.) and put the root KSA directory into GameLocation. Should either be "C:\\Program Files\\Kitten Space Agency" or "C:\\Users\\username\\AppData\\Local\\Programs\\Kitten Space Agency" depending on where you installed the game:
1763242897325.png

After saving the change and exiting the text editor, run StarMap.exe a second time. If Kitten Space Agency boots, you've done it correctly. You'll need to run it from StarMap.exe in order for code mods to work. I recommend making a shortcut on your desktop to StarMap.exe (and remove any existing shortcuts to the vanilla KSA.exe if you did that).

Part 2: Installing a mod
For this part I will be using StarMapLoader's example SimpleMod: https://github.com/StarMapLoader/StarMap-ExampleMods/releases
All mods go into Kitten Space Agency\Content\modname. Core is the vanilla mod. You must set it up so that there exists Kitten Space Agency\Content\modname\mod.toml. The name of the directory is the same name as the name of the mod in the toml file, and for code mods it is the same name as the .dll file. For the example mod, it should be Kitten Space Agency\Content\StarMap.SimpleMod with the following file contents:
1763243552133.png

YOU ARE NOT DONE YET. After adding the mod to content, you must additionally add it to "C:\Users\username\Documents\My Games\Kitten Space Agency\manifest.toml" (in your Windows Documents folder) like so:
Code:
[[mods]]
id = "Core"
enabled = true

[[mods]]
id = "StarMap.SimpleMod"
enabled = true

Each new mod will need a new entry. Core is vanilla, and then the id for each subsequent mod is the same as the id in that mod's mod.toml file.

Now run StarMap.exe, enter a world, and hopefully you will see the message from the mod:
1763244322390.png

Note: for future updates to StarMap you can simply paste the contents of the new StarMap release over your old StarMap install. This is because the default starmap zip doesn't contain the .json file, so it will not overwrite your config file. When uninstalling mods make sure to clear unused entries in manifest.toml.


==================== Ignore the rest if you're not a mod dev ====================

Part 3: (for mod devs only) How to make a code mod
I'm including this segment so that people are able to write their own code mods. This way you can make your own mod template and get started. You will need all the previous steps completed, which is why this is at the end. Note that I'm using Visual Studio Community 2026, but the process will be similar for JetBrains Rider.

The very first step is to create a C# Class Library project. Then you want to link to the following dlls:
1763246072373.png

Next you want to create a mod.toml in the same directory as your source code and put the mod id like so:
Code:
name = "ExampleMod"
Make sure to set your mod.toml to Copy to Output Directory: Always Copy.

You need to make a Personal Access Token (classic) in your Github account with the following perms:
1763246811533.png
(MAKE SURE TO SAVE THE KEY TO A TEXT FILE OR SOMETHING)

Then you want to include the nuget package. To do this you go Tools > NuGet Package Manager > Package Manager Settings > Package Sources and you then add the package link: https://nuget.pkg.github.com/StarMapLoader/index.json:
1763246854272.png
At some point you'll be prompted to log in with your Github username and key from earlier. I hope you saved it.

Now you need to add the NuGet package to the repo. In NuGet Package Manger you can select Package Source: StarMapLoader:
1763247177903.png

Also add the Lib.Harmony package.

And now you're off to the races! Currently to actually interface with the game you need the name of the class to be the same as the mod id and then to extend the class IStarMapMod, but this format is subject to change.

Here is my .csproj, you can find yours by going to solution explorer and double clicking the mod name (the thing directly beneath the solution in the tree). Don't copy mine verbatim as your dll locations are probably different:

XML:
<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <TargetFramework>net9.0</TargetFramework>
        <ImplicitUsings>enable</ImplicitUsings>
        <Nullable>enable</Nullable>
        <CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="Lib.Harmony" Version="2.4.2">
            <PrivateAssets>all</PrivateAssets>
        </PackageReference>
        <PackageReference Include="StarMap.API" Version="0.1.5">
            <PrivateAssets>all</PrivateAssets>
        </PackageReference>
    </ItemGroup>

    <ItemGroup>
        <Reference Include="Brutal.Core.Numerics">
            <HintPath>$(LOCALAPPDATA)\Programs\Kitten Space Agency\Brutal.Core.Numerics.dll</HintPath>
            <Private>false</Private>
        </Reference>
        <Reference Include="Brutal.Glfw">
            <HintPath>$(LOCALAPPDATA)\Programs\Kitten Space Agency\Brutal.Glfw.dll</HintPath>
            <Private>false</Private>
        </Reference>
        <Reference Include="Brutal.ImGui">
            <HintPath>$(LOCALAPPDATA)\Programs\Kitten Space Agency\Brutal.ImGui.dll</HintPath>
            <Private>false</Private>
        </Reference>
        <Reference Include="Brutal.ImGui.Extensions">
            <HintPath>$(LOCALAPPDATA)\Programs\Kitten Space Agency\Brutal.ImGui.Extensions.dll</HintPath>
            <Private>false</Private>
        </Reference>
        <Reference Include="KSA">
            <HintPath>$(LOCALAPPDATA)\Programs\Kitten Space Agency\KSA.dll</HintPath>
            <Private>false</Private>
        </Reference>
    </ItemGroup>

    <ItemGroup>
        <None Update="mod.toml">
            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
        </None>
    </ItemGroup>

</Project>

Currently with the model for extending the interfaces you want something that starts like this:
C#:
using StarMap.API;

namespace ExampleMod
{
    [StarMapMod]
    public class ExampleMod
    {
        [StarMapImmediateLoad]
        public void ImmediateAfterLoad(KSA.Mod mod)
        {
            Console.WriteLine("ExampleMod Immediate After Load");
        }

        [StarMapAllModsLoaded]
        public void AllModsLoaded()
        {
            Console.WriteLine("ExampleMod All Mods Loaded");
        }

        [StarMapUnload]
        public void Unload()
        {
            Console.WriteLine("ExampleMod Unload phase");
        }
    }
}

Beyond this I recommend reading the files in https://github.com/StarMapLoader/StarMap-ExampleMods/tree/main/StarMap.SimpleMod . Good luck.
 

Attachments

  • 1763257425766.png
    1763257425766.png
    128.1 KB · Views: 0
Last edited:
I'm currntly trying to adapt this to rider, but I'm struggling with atting the StarMap.API nugget.

I see the nuget, but when I try to install it I get an unauthorized error:

Install failed (project: StarMap.SimpleMod, package: StarMap.API v0.1.5)
Package restore failed. Rolling back package changes for 'StarMap.SimpleMod'.
Your request could not be authenticated by the GitHub Packages service. Please ensure your access token is valid and has the appropriate scopes configured.
Your request could not be authenticated by the GitHub Package ... nsure your access token is valid and has the appropriate scopes configured.
Failed to retrieve information about 'StarMap.API' from remote source 'https://nuget.pkg.github.com/StarMapLoader/download/starmap.api/index.json'.
Response status code does not indicate success: 401 (Unauthorized).

I I try to do this with a token with the permissions from above.
Did anybody suceed with this in VS?

I will post a full description of adding this in rider, when I suceeded...
 
I couldn't get Nuget to work either, much less hassle to just put the StarMap.API.dll in the imports folder imo
 
I'm currntly trying to adapt this to rider, but I'm struggling with atting the StarMap.API nugget.

I see the nuget, but when I try to install it I get an unauthorized error:

Install failed (project: StarMap.SimpleMod, package: StarMap.API v0.1.5)
Package restore failed. Rolling back package changes for 'StarMap.SimpleMod'.
Your request could not be authenticated by the GitHub Packages service. Please ensure your access token is valid and has the appropriate scopes configured.
Your request could not be authenticated by the GitHub Package ... nsure your access token is valid and has the appropriate scopes configured.
Failed to retrieve information about 'StarMap.API' from remote source 'https://nuget.pkg.github.com/StarMapLoader/download/starmap.api/index.json'.
Response status code does not indicate success: 401 (Unauthorized).

I I try to do this with a token with the permissions from above.
Did anybody suceed with this in VS?

I will post a full description of adding this in rider, when I suceeded...
I don't remember how I did it, but a gotcha with gitlab is that it want the user, and not email in the authentication.
 
I first want to say how much I appreciate that you took the time to put this together. I think it really helped me get a foothold on this. 🙏🎊

But I'm having some issues. I can follow all the way through Part 2 and I can get the mod to load and it logs to the terminal and the window appears! Great stuff!
Then when I start following part 3 I have some questions/issues.

1. I notice that in the SimpleMod example, they are using the StarMapMod attribute as well as some others on the methods as opposed to inheriting as seen in your screen shot. Is this just that the 'best practices' are shifting quickly right now or is there a meaningful difference there?
Also I see that your screen shot and the recent history on the github seems to indicate the use of IStarMap, but when I try that I get build errors. Is IStarMap just the "Inherited" version of that code? (already deprecated?)

2. The SimpleMod also has a Patcher.cs that isn't discussed in the above walkthrough or the readme. Is it needed?

3. I seem to have found myself in a spot where I can build without errors, but the mod doesn't do anything when I boot up. It says it's found it, but I've tested and I get the same behavior even if I only put the mod.toml file in the directory. So I'm not sure what's going on there. The manifest is correct, but the mod doesn't print anything out.

Maybe my issues/questions are a result of me not being familiar with C#. I have plenty of experience coding, just new to C#, nuget, dotnet, etc.

Any help would be greatly appreciated.
And thanks again for making the write-up! 😃
 
I first want to say how much I appreciate that you took the time to put this together. I think it really helped me get a foothold on this. 🙏🎊

But I'm having some issues. I can follow all the way through Part 2 and I can get the mod to load and it logs to the terminal and the window appears! Great stuff!
Then when I start following part 3 I have some questions/issues.

1. I notice that in the SimpleMod example, they are using the StarMapMod attribute as well as some others on the methods as opposed to inheriting as seen in your screen shot. Is this just that the 'best practices' are shifting quickly right now or is there a meaningful difference there?
Also I see that your screen shot and the recent history on the github seems to indicate the use of IStarMap, but when I try that I get build errors. Is IStarMap just the "Inherited" version of that code? (already deprecated?)

2. The SimpleMod also has a Patcher.cs that isn't discussed in the above walkthrough or the readme. Is it needed?

3. I seem to have found myself in a spot where I can build without errors, but the mod doesn't do anything when I boot up. It says it's found it, but I've tested and I get the same behavior even if I only put the mod.toml file in the directory. So I'm not sure what's going on there. The manifest is correct, but the mod doesn't print anything out.

Maybe my issues/questions are a result of me not being familiar with C#. I have plenty of experience coding, just new to C#, nuget, dotnet, etc.

Any help would be greatly appreciated.
And thanks again for making the write-up! 😃
Yeah StarMap just changed from an interface (The `IStarMap` format) to an attribute based format. Because of that mods using the interface method need to be changed to the attributes and if they are using the interface, they can only be run with StarMap Release v0.1.6. If you have an error accessing the KSA.dll path in your `.csproj` file, checkout the issues tab on the StarMap GitHub page as there is a temp fix there.
 
  • Like
Reactions: namesnonames
I'm not sure if I have issues accessing the KSA.dll yet, I'll have to try accessing some component of that later.

But I did find my issue! I got unlucky with the timing and had downloaded StarMap 0.1.6 got the SimpleMod running, called it a day.
Came back the next day and started trying to following along with code from above and the github (which had been updated by that point), and had issues presumably because of mixing versions.

I updated StarMap this morning to 0.2.3 and now my mod works fine, but it's super simple so I'll keep in mind the KSA.dll path fix.

Thanks for the response!