Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
The pages in this section will guide you through setting up your modding environment and installing essential mod developer tools.
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
How to discover new mods to play with.
You can browse available mods via the in-game UI (accessible via the main menu) or the mod.io site:
Use the Filters system to focus what mods are displayed. For example, filter by only the latest Game Version to see only mods compatible with the current version of the game. There is a chance that mods without the latest version tag could still be working, but you'd be trying them at your own risk.
All mods on Thunderstore (https://thunderstore.io/c/core-keeper/) are outdated and will not work on modern Core Keeper versions.
Welcome to the Core Keeper Modding wiki.
This wiki is an accumulation of the work of several people. To keep this wiki in the best state possible we ask of you to contribute wherever you think possible.
So you want to contribute to our wiki! Great!
Step 1: Follow this link to join as an editor of the wiki.
Step 2: Sign into GitBook using whatever account you'd like your edits to be credited too
Step 3: Click the big EDIT button in the top right hand corner of your screen.
Step 4: Edit the pages to your hearts content. If you would like to bring your edits to the next level, consider reading up on the markdown format GitBook uses.
Step 5: Submit your changes for review using the button in the lower right corner.
If everything looks good to us, we'll add your changes to the wiki! Thanks for helping the community by spreading your knowledge!
How to install mods!
First, how are you playing the game?
How to remove mods! This can become troublesome if your install is broken.
If you want to uninstall mods, try these different approaches in order from top to bottom. Each step is more "drastic" than the last, but you might need to use a more drastic solution if your install is broken.
If you're using an external tool to manage your mods, make sure to try using its methods of uninstalling mods before trying these, otherwise it might put them back again.
As long as you can open the game, you can use the in-game mods menu to Unsubscribe from the mod you wish to uninstall.
It's best practice to restart the game after changing your installed mods in case some of the effects from a mod linger during the game session.
You might need to use this approach if one of your installed mods is making the Mods screen inoperable or inaccessible.
In Steam, open the game's Properties, then choose the following launch variant: Play Core Keeper (no mods)
. This will force the game to not load any mods when it opens.
In this state you will be able to unsubscribe broken mods from the main menu and return your game back to working state. Remember to switch back after you're done, or any mods you install later won't load!
If unsubscribing from mods in-game isn't working, try unsubscribing from them on the mod.io website. The "My Subscriptions" filter makes it easy to find them.
Try deleting any mod files present in your computer's 2 mod folders.
Remember, any mods you are still subscribed to on mod.io will be automatically re-downloaded by the game's mod.io integration!
Sorry... Core Keeper console editions do not support modding, and probably never will.
See this message from the developers:
... there will not be any mod support on consoles at launch, and we will most likely never support mods on consoles in the same way we do on PC. The platform owners (Sony in this case) have strict requirements for all games that are released on their consoles, and there is no reasonable way to comply with them if players can modify the game to any meaningful extent. If there are mod features that you would like to have on consoles, feel free to post a suggestion in 📋-feedback-suggestions to potentially have it added to the main game 🤠 -Herman on the Core Keeper discord
The following approaches are available:
The in-game mod integration can be rather finicky, so you may want to try another approach instead. It has the following problems:
Does not show you the list of mod dependencies (mods that must be installed for other mods to function)
Sometimes does not automatically install mod dependencies for you
Poor UX - for example, in order to scroll the screen, you must click and drag the mouse, as the mouse wheel does nothing
If you still want to use this approach, simply launch the game and access the Mods screen from the main menu. To start using a mod, Subscribe to it. The game should automatically check for and install mod updates every launch.
It is highly suggested that you subscribe to each mod dependency individually to ensure it is downloaded correctly. You will have to view the mod on the mod.io website to see what they are.
For the best results, relaunch your game after installing or removing mods.
Core Launcher is a 3rd party tool that makes it easy to manage mods. Check out its page on GitHub for further directions.
Once you have installed it and set it up, create a Profile with the +
button to start installing mods.
Core Launcher has a dedicated discussion thread on the Core Keeper discord.
If you'd rather manage mod files manually, you can download them from the mod's mod.io page and place them in the mods folder yourself. Mods installed in this manner will never be automatically updated.
To do this:
Unsubscribe from all mods you are subscribed to on mod.io to prevent conflicts between the two approaches
Open your game installation folder
On a default windows Steam installation, this is:
If that path doesn't work for you, use the above link to find out where that is on your system
Go to the CoreKeeper_Data\StreamingAssets\Mods
subfolder, creating any folders along the way if they do not already exist.
On a default windows Steam installation, this is:
Download the mods you want from the mod.io website using the Download File button
Unzip each of the mod zips you downloaded inside the folder so that each mod is in its own subfolder.
The name of each mod folder does not matter as long as it is unique, but you probably want it to include the name of the mod for later reference.
Ensure that each mod subfolder has a ModManifest.json
file.
Good to go - launch the game and start playing!
Some mods do not use Core Keeper's modding system to interface with the game and cannot be installed using the means described above. In this case, it is up to the individual mod developer to explain how to install the mod.
Dedicated servers do not have mod.io integration, so mod files must be managed manually.
Download the mods you want from the mod.io website using the Download File button
Open the game server installation folder and navigate to the mods folder: <server-install-folder>/CoreKeeperServer_Data/StreamingAssets/Mods/
. You may need to create the Mods/
folder if it doesn't already exist.
Unzip each of the mod zips you downloaded inside the folder so that each mod is in its own subfolder.
The name of each mod folder does not matter as long as it is unique, but you probably want it to include the name of the mod for later reference.
Ensure that each mod subfolder has a ModManifest.json
file.
Remember to read the general multiplayer notes if you haven't yet. Continue to the next section to help clients get their mods.
The easiest way to ensure that players have exactly the same mods as the server is to use manual mod installation. This means automatic updates don't cause problems with version mismatches.
Set up all of your mods on the server
Zip the server's mods directory
Have all players unsubscribe from every mod in the game's mod.io integration
Send your players the zip file and have them unzip it into their manual mod installation folder.
In general, all players (and the server) should have exactly the same mods installed.
Some mods only need to be installed client side (or server side), refer to the mod's "Application Type" tags, if they exist. If they don't, it's up to the mod developer to tell you this somehow - usually in the description text. If it's not 100% clear, just assume it should be on all sides.
The easiest way to achieve this is to use manual mod installation and for the host to create a zip file of their installed mods and share it with players containing all of the mods they are using.
In cases where mods mismatch, the game will give the error message "Game version mismatch"
If you see this message, make sure your server and client have exactly the same mods and mod versions. Ensure all mods loaded successfully by - sometimes one of the mods fails to load on one side.
Check out the for more help with this issue.
As described in , the modding SDK comes with some examples packaged in a zip file. Let's take a look at some of them.
After your SDK project is set up, go to your file explorer and unzip the /Assets/Examples.zip
file into the Assets folder such that you have a folder /Assets/Examples
with a bunch of example subfolders.
In the Unity Editor, use a Project browser to navigate to the /Assets/Examples/ItemExample
folder. Here you can see the files used by this example, which introduces a new weapon called "Sword1".
By inspecting SpawnItemOnStart.cs
you can learn that the example is coded to create a dropped item instance of the custom item near spawn every time the game is loaded. This obviously is not what an end user would want, but it works well enough for our testing purposes.
To package the mod and try it out in-game, first open the Mod SDK tab. If you've lost it, you can open a new one via (Top bar) PugMod
> Open Mod SDK Window
.
Click the Mod Settings
button to open the packaging UI, select ItemExample
from the "Mod" dropdown, then click Install Mod
. This will open a popup prompt and take at least a few seconds to execute. Once it's complete you'll see this popup:
Launch the game and notice that the main menu's Mods button says you have 1 mod loaded (assuming you don't currently have any other mods loaded). If you were to go into this mods menu, the ItemExample mod would not show up because it has been installed outside of the mod.io ecosystem. This is to be expected for locally installed mods.
Load into a world and go near the Core - you'll find a Sword1 item on the ground.
If you think you've found a bug with a mod, share it with the mod developer so it can be fixed!
Make sure you've followed the steps on the Troubleshooting page first to make sure it's actually a bug and not something specific to your setup!
Check the mod's page on mod.io to see if the developer has specified a specific place to report bugs. If you don't use the place they asked, there's a good chance they won't see your report.
If you want to remove this mod, go to your and delete the ItemExample
folder.
These mods and utilities can greatly enhance your modding experience.
Check out each tool's individual sub-page for more information.
An IDE (Integrated Development Environment) is a tool that allows you to write code.
Visual Studio is one of the IDE's you can use to develop mods. While basic in its features, it will allow you to make content. You probably already installed a copy of Visual Studio while installing Unity. If not, you can install one from the Unity Hub by modifying your installation.
A correctly configured Visual Studio project will give you intelligent suggestions and syntax checking as you write mod C# files.
To use it, in the Unity editor, open Edit
> Preferences...
, go to the External Tools
heading, select Visual Studio in the "External Script Editor" dropdown.
Unity can automatically generate a Visual Studio solution file for you to work in. If you have issues with that, you can click Regenerate project files
(In External Tools menu). This will create a .sln file in the root folder of your Unity project.
JetBrains Rider is another IDE you can use. It is not free, however, students and some other people can get access to it for free. Rider features are much more advanced than Visual Studio, and it is recommended that if you can get access to it, you use it (IE you're a student).
Rider has smart auto-completions, code generation and a slew of suggestions on how to write your code better.
To use it, in the Unity editor, open Edit
> Preferences...
, go to the External Tools
heading, select JetBrains Rider in the "External Script Editor" dropdown.
As you may have noticed when inspecting the ItemExample's SpawnItemOnStart script, in addition to spawning an item, it also prints "Spawn Sword1" to the game's debug logs. This section will explain how to view those logs.
The Player.log
file in your contains log messages from the active (or previous, if the game is currently closed) game session. Open it up and ensure you can find the "Spawn Sword1" message using your favorite text editor's Find utility.
A recommend way to easily view logs in real time is using BepInEx console. It will open together with the game and you will be able to see all logs there.
Setup steps:
Ensure you see CoreKeeper.exe
and a folder on the same level called BepInEx
Note: BepInEx console has some limitations, specifically if you log from threads other than main (That often happens if you log from jobs) you won't see them. To see them you will have to watch Player.log
How to look at how other mods have implemented things and learn from them.
These tutorials and guides are only capable of covering so much. If you want to become a real modder you will have to learn how to inspect other mods and the base game's files to implement your ideas.
Core Keeper mods are compiled at runtime, so you can simply open a mod's files to view contained C# code. Download the mod from the mod.io website, open the zip file, and check out the Scripts directory. Or directly open .
A number of mods have their sources posted on GitHub. Example: . It's up to the individual mod developer to somehow provide links to their repositories, as mod.io does not have a "field" for communicating it.
An in-game UI for exploring, debugging and modifying Unity games.
If you're encountering problems using mods, this page might have the solution.
TIP: Use your browser's Find feature (usually Ctrl
+F
) to search this page for error messages you've encountered.
Each entry in this section has a list of clickable links to directions on trying that fix approach.
to find out how to access its features.
Check the tags on the mod.io page - is the mod not updated for this game version yet?
- sometimes mods can error in ways that don't get caught by Mod Reporter
See below.
Game version mismatch
when playing multiplayerRead the
Ensure that all players have exactly the same mods installed
If you're using mod.io interation, did it automatically update a mod on you? This means your installed mod version doesn't match the host's. One of you needs to update. Consider switching to to avoid the possibility of unexpected updates.
The most common cause of this is installing broken or outdated mods.
If you are playing from the Xbox Game Pass version, some mods can crash, even if they work on a normal PC install. Best solution if you want to play with these mods is to get the game on Steam.
Failed to Fetch
)Failed to create mod on mod.io: Api failed to complete the request
Command give does not exist!
You did not properly install the chat commands mod, or something is preventing it from loading.
Are you sure you've subscribed to Chat Commands and not just CoreLib.Commands?
Quantum Processor Error: Command <something> could not be found.
Run chat commands in the game's chat window, not the debug Quantum Console. If you still want to use the quantum console, prefix your commands with the word chat
so they are executed as chat commands.
This section contains troubleshooting approaches for the above problems to link to.
The Mod Reporter mod provides a GUI on the main menu to view the current state of your installed mods and see any issues easily.
Check for directions on how to use the mod, known issues, etc. on the mod's page on mod.io.
Mention what mods you are using.
Say what you expected to happen, and what actually happened. Screenshots help too.
Say if you're playing in singleplayer, multiplayer, or a dedicated server, and if you're the host or the client.
Remember to communicate what you fixes have already tried. People are a lot more willing to help if you make it clear you've already put in some effort!
Use this page to temper your expectations about what Core Keeper modding can achieve.
Because of how the game is implemented and how modding API requires modders to define and register content, many concepts and ideas you have about modding from other games do not carry over well.
This game is implemented with so most Object Oriented Programming principles do not apply. As you might have noticed when , if you want to make a tweaked copy of the Copper Sword, you can't just extend the base-game one and change some things. You must create a totally new copper sword from scratch and redefine all of its properties and behaviors on your version.
Things in this section are possible to mod, but are harder than they seem.
Adding generic texture packs can be rather painful. The issue stems from the fact there is no single place you could replace the textures in. You will have to write specific code for each kind of object. Very specific texture altering mods however are relatively easy to create.
Things in this section are technically possible to mod, but a massive pain.
World generation in 1.0 is implemented with GPU shaders. Altering said shader atm is not possible. However custom world generation could theoretically be done after the fact.
If you are interested in this, here's a tip from game developer Fewes:
What you can likely do right now is use the new API functions
PugWorld.RequestArea
andPugWorld.RequestPoints
, along with their callbacksPugWorld.onAreaRequestComplete
andPugWorld.onPointsRequestComplete
to sample the world generation shader and get data back which you can use however you want.
There are definitely things that are impossible to mod but no one has written them down yet.
Download BepInEx 6.0.0-pre.2 from ()
Open game installation , and extract downloaded archive into game folder.
Viewing the logs in real time requires a text editor that can handle opening a file read-only without locking it. Consider or .
- remove mods until the problem stops to track down what mod was causing the problem.
Once you find out what mod in specific is the cause -
- remove mods until the problem stops to track down what mod was causing the problem.
Try .
Try then .
Take a look at your to see if any mods are reporting errors.
The game's mod.io integration often fails to download mod dependencies. Visit the mod's page on the to see what they are and manually subscribe to each of them.
Join the and ask for help in the #modding-help
channel. Make sure to:
Include your ! It will be the first thing people ask for if you don't provide it.
A number of sections of the code are compiled with Burst for performance reasons, making modifying them a massive pain. More info .
Limitations in the modding API make it basically impossible to modify these things. Have you found a way to modify them despite this? and explain how!
Discussions on the discord claim that attaching a traditional debugger is possible. But this guide has not been written yet! If you know how to do this, add it!
Due to the limited scope of the out-of-the-box functionality offered by the Mod SDK, a number of libraries have been created to assist with developing more complex mods. This section will cover some of those libraries and how to get started using them.
DnSpy is a tool that allows inspection of the game code.
Max at Pugstorm maintains a guide for accessing and installing the modding SDK on mod.io guides.
Follow Max's guide up until you reach the "Creating new objects" header. You can keep reading from there if you'd like, but it may not make sense without further context. This site will walk through some more specific examples in the next few pages.
As Max is the only person with edit permissions, the mod.io guide can easily fall out of date. If something needs to be updated, discuss it in the #mod-creators channel on the official Core Keeper Discord.
There are a few extra steps you need to take that Max's guide doesn't mention.
In the Unity Hub, add the -disable-assembly-updater
command line argument to your SDK project. If you don't do this, the Pug.Other.dll
and Pug.ECS.Components.dll
will not load correctly, meaning you will be missing some important script components.
A tool that assists with fixing scripts on imported assets.
There is currently a bug with NG Tools Missing Script recovery causing all Manual Pick UIs to not work correctly. In the case where you must use a Manual Pick, you will have to delete the broken script components then add them back manually, then find out what the values were using Unity Explorer.
We do not have access to the source of NG Tools to fix this bug, but we have contacted the original developer.
CoreLib is a set of libraries developed by Limoka/Kremnev to make modding Core Keeper easier.
CoreLib can be found on mod.io here:
Source code for CoreLib (and all submodules) is public on GitHub:
When creating a mod that depends on CoreLib, make sure to list every module dependency and the root CoreLib mod as a direct dependency of your mod. The game's mod.io integration sucks at downloading dependencies correctly, let alone transitive dependencies, and doing this helps ensure it correctly downloads everything.
To install CoreLib in your modding SDK, follow the directions in its . You can find out the latest version number to pin by looking at the .
Unique string identifiers used to distinguish modded content.
These IDs must be unique across your mod AND all other mods. The easiest way to do that is to follow this naming pattern: ModName:ContentNameHere
. This will reduce the possibility of cross-mod conflicts to pretty much zero.
Not to be confused with Object Names, Object IDs are integer identifiers used to refer to base-game items. You can find a list of all item IDs in your <game install directory>
\CoreKeeper_Data\StreamingAssets\Conf\ID\ObjectID.json
.
Note that mod content Object Names will be given IDs at runtime, but these IDs could change depending on what mods are installed, so never hardcode a modded Object ID.
This guide has not been written yet! If you know how to do this, add it!
This section contains various examples on how to create things in Core Keeper
Check these guides out if you are new to modding.
Do you know how to create something that isn't explained here? Please add it!
Follow the steps in the generic item guide first to define the other required properties of your item.
The CoreLib.Equipment submodule is required for this guide section.
To make armor you need to:
Set the ObjectType
to armor type
Add DurabilityAuthoring
, ModEquipmentSkinAuthoring
, GivesConditionsWhenEquipedAuthoring
and LevelAuthoring
component authorings and configure them correctly
Make a armor spite sheet. Examples of such sheets can be found in the Unity Editor. Now assign your texture to ModEquipmentSkinAuthoring
(CoreLib feature). The component will automatically set everything up.
Follow the steps in the generic item guide first to define the other required properties of your item.
This guide has not been written yet! If you know how to do this, add it!
Follow the steps in the generic item guide first to define the other required properties of your item.
To make a equipable item with use animation you need to:
Set the ObjectType
to tool or weapon type
Add DurabilityAuthoring
, GivesConditionsWhenEquipedAuthoring
, CooldownAuthoring
, WeaponDamageAuthoring
and LevelAuthoring
component authorings and configure them correctly
Assign both icons to first sprite in item animation sheet.
Sprite sheets should be 120x120px and have 7 sprites showing item in different states. You can find such sheets for all base game weapons and tools by ripping game content via Asset Ripper.
The CoreLib.Entity submodule is required for this guide section.
To make a ranged weapon you mostly need to do the same as with any other weapon. Except for the fact that you will need a custom projectile entity added. To hook modded projectile entity use ModRangeWeaponAuthoring
component instead of RangeWeaponAuthoring
(CoreLib feature)
This section describes ways you can make your items obtainable
This page describes how to create various item archetypes. For example: ingredients, tools and weapons, etc.
Item are the simplest form of content you can add to the game. These range from things like wood to sword and armor.
To create an item, first create a new Prefab (Right click in the project tab, Create
-> Prefab
).
Open the prefab and add following components: ObjectAuthoring
, InventoryItemAuthoring
.
This component defines what this object is.
First field you must fill out is Object Name
. Following the naming pattern: ModName:ItemName
. Learn more about Object Names here.
Next field you must set is the Object Type. This field defines the kind of item this is. For this example set it to Non Usable
.
You may fill other fields on your own discretion.
This component defines information about the item for display in the inventory.
You must fill out fields Icon
and Small Icon
. These are the icons the player will see ingame. Both need to be 16x16
px.
Here you can also define item's crafting recipe, sell and buy values, and whether it can be stacked. Crafting recipes will be covered in another guide.
To set item's localized name create folder named Localization in your mod root folder. Now create a file in there called Localization.csv. This file will define all of your mod localization strings. Here you can add both English texts and other languages.
The file is encoded as Tab Separated Values (TSV). Initialize the file with the following content (Choose one of these two):
From the next line starts the actual content which needs to be tab separated. I would recommend to get a good CSV editor. One good option is Rons Data Edit, which can be used for free.
Add following content:
Key: Items/ExampleMod:ExampleItem
, English: Example Item
Key: Items/ExampleMod:ExampleItemDesc
, English: My first item.
Fill other fields on your own discretion. Please note that ExampleMod:ExampleItem
here is your Object Name as set in ObjectAuthoring.
Once you have created your new item you will need to get it to test the mod.
Unfortunately, at the moment, the only way to get an item if it wasn't explicitly added to a workbench, drop table or other source is by using cheats like Chat Commands.
With Chat Commands you can acquire any item like so: /give ExampleMod:ExampleItem [optional amount]
This page describes how to create a tile item.
The are required for this guide section.
Tiles are special items whose appearance is defined by a tileset. Tiles are not entities and are grouped together by the Tilemap. Tiles cannot have any logic. Exception are tile-entities
, which are entities with a tile as a visual
When placed they are displayed by a tile system instead of a graphical prefab. This is how one placeable (like walls, floors, bridges, fences, etc) can have many appearances depending on neighbor tiles.
To make custom tileset(s) create a ModTileset
asset in your Unity project.
Layers
is a reference to a tileset definition asset. CoreLib includes reference assets for three definition assets:
tileset_main
Used by biome tilesets. Includes most tiletypes.
tileset_base_building
Reduced tileset made specifically for player built things.
tileset_extras
Contains various other tiles.
You can make your own Layer asset and assign it here. (Please note that assets provided with core lib are empty placeholders and are replaced at runtime.)
Tileset Texture
is first texture field. It contains a reference texture for tileset, and contains a variety of different things. Look at vanilla textures to figure out what is what.
Adaptive Textures
dict contains set of adaptive textures. These are important, as they store variations of your tile as it contacts other tiles. Usually these textures are autogenerated by the game developers of the game. Unfortunately, the modding community does not have info on how they are made, so you will need to reference some of existing ones to make yours.
After setting up the asset add following code to your ModObjectLoaded()
method:
Now you can use ModTileAuthoring
component to set the tileset and tile type in Editor.
This page describes how to create various objects that can be placed by player
The is highly recommended for this guide section.
A placeable object is a item with a graphical prefab that can be placed into the world. Player can interact with said object, and it can do various things in the world.
First, follow the steps in the generic item guide to define the other required properties of your entity.
Set the Object Type
to Placeable Prefab
.
Add following components:
Placeable Object Authoring
. This component allows to set various properties of the object. For example here you can make the object take up more than one tile. It also allows to set on what the object can be placed.
Physics Shape
. This will define the collision of the object
Ghost Authoring Component
. This is a component that controls your object ghost settings. Ghosts are a NetCode concept and really mean networked object. For most objects keep setting as defaults.
Mineable Authoring
Health Authoring
. Set Health
and Max Health
to 2
Health Regeneration Authoring
Damage Reduction Authoring
. Set Max Damage Per Hit
to 1
State Authoring
Idle State Authoring
Death State Authoring
Took Damage State Authoring
Animation Authoring
Ignore Vertex Offsets
Optional components:
Interactable Authoring
. Enables your object to be interacted with. Ensure your graphical prefab has a Interactable Object component
Rotation Authoring
. Allows your object to be rotated
Electricity Authoring
. Allows your object to be powered and to power things
Supports Pooling
(CoreLib). Fixes issues you will encounter with Graphical Prefabs. HIGHLY recommended.
Graphical prefab is a Game Object that represents the entity on screen. It is important to understand that Graphical prefabs live only on clients, and are only responsible for visual appearance of an entity. They should never encode core behavior of an entity. The only exceptions to this are UI and inventory logic.
To make a graphical prefab create a new Prefab. On the root of it you need to place a EntityMonoBehaviour
deriven class.
Warning: Do NOT use existing classes that derive from EntityMonoBehaviour in your prefabs. You will have issues if you do. If you want to use a specific class, make a new class deriving from it, and use that
Then in the hierarchy create a GameObject called XScaler
. Then inside of it create two GameObjects: SpriteObject
, ShadowSprite
and particleSpawnLocation
. Optionally you can create GameObject Interactable
, if your object will need to be interacted with. The resulting prefab should look like this:
On sprite GameObjects add a new component called SpriteObject. On the root component assign fields X Scaler
, Shadow
and set list Sprite Objects
Now create two Sprite Assets
(Create -> 2D -> Sprite Asset), one for main sprite, one for shadow. In the main one assign your main texture, and in the shadow one assign a shadow texture. Now set these Sprite Assets as the Asset
field on each of the sprites.
If you want the object to be rotatable create 3 more static variations: up
(When facing away from camera), side
(Facing right) and side2
(Facing left). Assign their texture to relevant textures. To the root of the prefab add component Sprite Variation From Entity Direction
. Assign both sprites.
If you want the object to be interactable, on the Interactable
GameObject a new component Interactable Object
. Assign field Entity Mono
, set sprites in Sprite Objects
field (Except shadow) and wire up Unity Events On Use Actions
and On Trigger Exit Actions
to your root component methods. On the root component assign its field Interactable
.
At the end the root of the prefab should look something like this:
Once you are done with the prefab, link it to the Object Authoring
component.
Also don't forget to add following code to ModObjectLoaded()
method in order to fix issues caused by lack of pooling support by default: (CoreLib)
Also ensure you have requested CoreLib to be loaded:
Make sure to call CoreLibMod.LoadModules(typeof(EntityModule));
to in your mod EarlyInit()
function, before using the module. This will load the submodule.
If you have Chat Commands installed try watching logs for a log from CoreLib in a format like this: objectName -> number
. If you see your name in here, your object is ingame.
You might have some issues with the object name working from Chat Commands, to fix this either add a localized name or try using the number you see in that log message from CoreLib.
This is a known issue that devs could fix, but so far don't. Your only way to solve this is to use CoreLib's Entity module, and it's component SupportsPooling
.
Ensure you have added this component to your entity prefab, and that the grahpical prefab has a unqiue root script that derives from EntityMonoBehaviour
. (Note: this script MUST be custom, you CANNOT reuse existing scripts)
To a basic crafting recipe open Item Entity prefab and expand Required Objects To Craft. Increase the size of the list to the needed amount and then proceed to select each item.
To add a modded item as a crafting ingredient enter its Object Name
in the field.
Warning: defining the crafting recipe does not mean players will now be able to obtain it.
For that to happen you must assign it to one of many existing workbenches or make your own.
Tileset Id
is a unique identifier of your tileset that you will need later. Use the format ModName:TilesetName
. Learn more about Tileset Ids .
Firstly ensure that your mod is indeed is loading. For that make your IMod class log this, and look for
Lastly ensure you have done
This page describes implementing various features that allow user to interact with the mod. For example: keybinds, custom interfaces, etc.
This guide has not been written yet! If you know how to do this, add it!
This section contains concepts that are utilized by multiple systems. They are here in one place to avoid duplicating information or having one section fall out of date.
This page describes how to handle various things related to client-server communications. This includes sending messages, implementing prediction, etc.
Core Keeper is a server authoritative game. This means for an action to occur, the server must be aware of it and approve. When we write mods we must be able to create logic that allows for Client-Server communication to occur.
Note that Unity uses extensive code gen to implement features outlined here. If you ever get errors regarding CodeGen ensure your mod output Scripts folder has Generated folder. If it doesn't your Unity project might have an error. A restart usually helps
Additionally you might want to utilize Burst
Ghost component is one of the simplest ways to transfer data between Client and server. In its essence Ghost Component is just a normal ECS component that is synced over network.
To make a Ghost Component first Create IComponentData deriving ECS component:
To make this component a Ghost Component all you have to do is add a GhostComponent
attribute to it. Additionally you must mark every field you want to be synced with GhostField
attribute:
Making Ghost Components is just as easy as this. Now any data set to this component of the server will be automatically replicated to all clients. Refer to this guide to learn more
Remote Procedure Calls (or RPC's) are a way to send information to the Server or clients in one-shot manner. They allow you to send arbitrary data or commands to the other side, be it requests or data
This example will focus on Client to Server communication, as that is the most common scenario, however you can send RPC from Server to Clients or even both ways
To make a RPC first add RPC command data definition:
Now define two systems. One for Clients:
And one for Server:
Now to use these systems you just have to add this code in your IMod class:
Now you can use MyMod.clientSystem.DoVeryImportantThing()
from anywhere in your code
This guide has not been written yet! If you know how to do this, add it!
This page describes how to create NPC's (Non Playable Characters) and enemies.
This guide has not been written yet! If you know how to do this, add it!
One way to make your item obtainable is to add it to already existing workbench. Please be aware that each workbench can have AT MOST 18 slots. You cannot exceed this value. As such this approach isn't too scaleable.
To do so add the following code to your IMod
class:
Following snippet makes use of CoreLib library
Please note that values returned by API.Authoring.GetObjectID() are not static and will change between game launches. Do not try to hardcode it or save it.
The CoreLib.Entity submodule is required for this guide section.
CoreLib.Entity submodule allows to easily add custom workbenches. All you have to do is define it via a special Scriptable Object.
Create a new Workbench definition by right clicking in project tab and selecting Create -> CoreLib -> New Workbench Definition
There are following fields to fill out:
Item ID - the same as Object Name in Object Authoring, refer to this
Icons - two sprites the player will see in inventory
Asset Skin - An Asset skin for a workbench, defines how the workbench will look in the world
Recipe - What is required to make the workbench
Can Craft - Most important section. Here you can list everything players will be able to find in the workbench. You can only at most 18 slots!
Related Workbenches - Any workbenches listed here (Modded via Workbench Definition) will be considered related and ingame you will see up and down arrows that allow switching between these.
Titles - Text that will be displayed on top of workbench UI. Must be localized, refer to this
Skin - Visual appearance of workbench UI
Ensure you have added localization texts for your workbench as described here
To create Sprite Asset Skin open create menu and select Create -> 2D -> Sprite Asset Skin
. Assign Target Asset
property. The sprite you want to select is Workbench
, and is bundled with CoreLib Package.
Assign main texture (Emmisive optionally) and three variants textures. Refer to original Sprite Asset for how these should look like.
In order for CoreLib to find your mod workbenches add following code to your IMod
class:
You are done! Now you should see your workbench in CoreLib's Root Workbench, which can be crafted in player inventory.
This section covers how to look at how content built into the base game was implemented. Use this knowledge to build your own content, understand where to hook the code to implement new behaviors, etc.
Use additional tools to inspect properties and values while the game is running.
This example talks about fixing an imported prefab ripped from the game using info in Unity Explorer.
Install Unity Explorer and relaunch the game
Open the "Object Explorer" window from the newly added top bar
Switch to "Object Search" mode and type MinecartEntity
into the "Name contains:" search box, then press Search
Find the entry "MinecartEntity" (UnityEngine.GameObject)
and double click it
In the "Components" column you can see a list of script components on the prefab. The default sorting order should be exactly the same as the sorting order of the scripts in the Unity editor.
Use NG Tools Missing Script Recovery to fix as many Perfect Matches as you can, then use the entries in the Components column to specify what the rest of the scripts are.
This guide talks about how to release a mod for end users to download on mod.io.
A tool for extracting assets from Unity serialized files and converting them into the native Unity engine format.
Asset Ripper will allow you to extract the base game's assets and load imitations of them in your modding SDK project.
After importing the assets you'll have to use the Missing Script Recovery Tool to be able to view components and their settings.
Download AssetRipper from its releases page
Unzip the download and run AssetRipper.GUI.Free.exe
Follow the directions in the console window to access the GUI if it didn't already open in your browser automatically
Access File
> Settings
and ensure the following Options are checked, then click Save
Skip StreamingAssets Folder
- to avoid dumping mods
Use File
> Open Folder
to select your game install directory folder
Go to Export
> Export All Files
Type or select (using the Select Folder
button) a folder path to place the exported files at
Press the Export Unity Project
button to start the export. The webpage displays no indication that anything is happening but the console window should be printing a bunch of stuff. Once the export is finished it will take you back to the Asset Ripper home page and the console log will end with "Export : Finished post-export"
Close the console window and browser tab
Audio Files are located in StreamingAssets\aa
. If you want to export them, either un-check the "Skip StreamingAssets Folder" option, or directly open this subfolder of your game install directory: CoreKeeper_Data\StreamingAssets\aa
The ExportedProject
folder contains all files we're interested in. Within this folder, you probably care about these subfolders:
Textures can be found in Assets\Texture2D
. Their respective sprites can be found in Assets\Sprite
.
Item and Entity prefabs can be found in Assets\PrefabInstance
. These are usually not useful until they are imported into the Mod SDK project and have their missing scripts fixed.
Sprite Assets can be found in Assets\MonoBehaviour
, along with some other Scriptable Objects
Audio files can be found in Assets\Audio
(assuming you exported them)
Bring base-game assets into your editor for quick reference.
First, run Asset Ripper to export assets from the game.
Next, time to import them into your editor. Close the Unity editor first to keep it from wasting time hot refreshing as stuff is still being imported.
Go to the <export folder>\ExportedProject\Assets\
folder and copy only the following folders into your SDK project's assets folder. Copying anything not listed here risks bricking it.
AnimationClip
AnimatorController
AnimatorOverrideController
Font
Material
MonoBehaviour
PrefabInstance
Scenes
Shader
Sprite
Texture2D
TODO what in the Resources directory is safe to bring in?
Reopen the Unity editor to allow it to rebuild its records, which will take a while.
You will probably want to access the Prefabs you have imported. However, on prefabs, all scripts will be broken. Use the NG Tools Missing Script Recovery to restore them. Follow this guide to install it and use it:
You'll also have to use Unity Explorer to inspect the prefabs in-game to figure out what things are when Missing Script Recovery doesn't have enough context to work.
You should have already created a mod.io account as part of . Now it's time to create a page for your mod. This is what end users will see when they are looking at your mod for the first time, so make it professional if you want to leave a good impression.
Make sure that your mod complies with the guidelines described here:
Here is the bare minimum information you should describe in your mod page description:
Directions on how to access and configure your mod's features.
What crafting bench are the items made in?
Where do you configure keybinds, and what are the defaults?
How users should report bugs
A GitHub issue tracker? Contact you on discord? The mod.io comments section?
If the mod is required by all users in multiplayer, just the client, or just the server
Here is other stuff to consider including:
Screenshots of the mod in action. People like pictures!
Known bugs (or a link to a bug tracker)
Link to mod source repository (ex. GitHub)
"Special Thanks" to list other people that helped your mod come to be
Tags help categorize your mod and assist users with finding it. Some tags also have special functionality.
Use the "Game Version" tags to indicate what versions your mod supports. If a user doesn't see the latest game version tag on your mod, they might think it's broken, and the game may report the mod as out of date to the user.
Use the "Type" tags as categories for summarizing what kinds of content your mod adds and changes it makes. You can select as many or as few as you want.
"Access Type" tags control mod loading behavior. Only one should be selected at a time.
List any other mods or libraries that your mod depends on. The Mod SDK upload utility might have automatically filled this out for you.
Use a decompiler to look at an approximation of the game's C# code.
This guide has not been written yet! If you know how to do this, !
This guide has not been written yet! If you know how to do this, !
Use the Mod SDK's Upload Mod utility.
TODO: How to upload files manually so the zips don't get an awful auto-generated name?
It sounds like you can zip the file produced by the mod SDK package task yourself and upload that, just make sure it contains the mod manifest file in the root of the zip file.
How to update your already installed Modding SDK project after a game update.
After updates to the Modding SDK repository (usually announced on the Discord) you will probably have to update your local copy for mods to work on the latest version.
Unfortunately, arbitrary things breaking between releases seems to be a very common occurrence in Core Keeper modding. Instead of trying to update your modding SDK, it is best to clone and set up a new one from scratch every time an update is released.
Read the Modding SDK Changelog to see what things Pugstorm is confident have changed between versions!
In the case you still want to manually update your mod SDK, follow these steps:
In your old Unity project delete following folders from the root of the project (It contains Assets
folder): Packages
, Assets/Graphics
, Assets/ModSDK
, Assets/Resources
, Assets/Unity
. If you have stored anything in there first move your files somewhere else.
Now proceed to copy all files from downloaded archive into your project folder (It contains Assets
folder). Replace any existing files.
You're done. Try to open the project and see if it works. If you're getting errors you don't recognize, try cloning a fresh SDK instead.
%userprofile%\appdata\locallow\Pugstorm\Core Keeper
Placed in same folder as the server executable. No past logs are kept.
%USERPROFILE%\AppData\LocalLow\Pugstorm\Core Keeper\Steam\<user-id>\saves
$HOME/.config/unity3d/Pugstorm/Core Keeper/Steam/<user-id>/saves
Not applicable - characters exist client side.
%USERPROFILE%\AppData\LocalLow\Pugstorm\Core Keeper\Steam\<user-id>\worlds
$HOME/.config/unity3d/Pugstorm/Core Keeper/Steam/<user-id>/worlds
/Save/worlds
subfolder of the server install directory.
There are 2 locations where mod files are stored:
This is where the game's mod.io integration downloads the mods you are subscribed to.
C:\Users\Public\mod.io\5289
The folder contains:
state.json
, a file that encodes subscribed mods and their state.
mods/
, a folder which contains all downloaded mods. The folder names are mod.io IDs and are not human readable unless you lookup the IDs using the API. You can edit or delete files in this folder to remove or unsubscribe from mods.
If you want to downloads mods manually, this is where you should put them. This is also where mod developers can find the mods packaged by the Unity editor during mod development.
For example:
CoreKeeperServer_Data\StreamingAssets\Mods
subfolder of the server install directory.
%USERPROFILE%\AppData\LocalLow\Pugstorm\Core Keeper\Steam\<user-id>\mods
/Save/mods
subfolder of the server install directory.
Use tags "Application Type" to help users understand where the mod needs to be installed in .
Tag Combination | Purpose |
---|
Tag Combination | Purpose |
---|
Make sure to check the to see if you need to install a new Unity version, and make sure to install Linux Mono build support on any new versions you install.
Download latest Mod SDK from . Click on Code
, then click Download zip
If you know where to find the Xbox desktop install files, to add this info!
TODO - do you know where it is? !
TODO - do you know where it is? !
Not applicable - servers can't use the mod.io integration. See the section.
CoreKeeper_Data\StreamingAssets\Mods
subfolder of your .
CoreKeeper_Data\StreamingAssets\Mods
subfolder of your .
TODO - do you know where it is? !
Client | Mod must be installed on game clients to function correctly. |
Server | Mod must be installed on host-and-play servers and dedicated servers to function correctly. |
Client, Server | Mod must be installed for on all sides to function correctly. |
(No Application Type tags) | Don't do this, it makes it unclear where the mod should be installed. |
This guide was made for IL2CPP version of Core Keeper and no longer applies. Please refer to: https://mod.io/g/corekeeper/r/core-keeper-mod-sdk-introduction
To start modding this game follow these steps. This guide assumes you know C# language and familiar with it's tools.
Install Visual Studio
or Jet Brains Rider
IDE. Both of these will work fine, however I personally would recommend Rider as its much better if you can get it.
Follow BepInEx staring guide to setup your basic .NET project
Install DnSpy and setup source viewing
Make sure to use CoreLib in your mod. It will make adding custom content easier
If you intent to make custom blocks, enemies, etc follow Unity project setup guide
Also below you can find the list of commonly used libraries and tools.
BepInEx is a plugin framework for Unity and .NET framework games. We use BepInEx to load the mods into the game.
Be sure to select the IL2CPP code examples when you're creating your mod!
Link: https://docs.bepinex.dev/master/articles/user_guide/installation/index.html
Download the latest IL2CPP build here: https://builds.bepinex.dev/projects/bepinex_be
CoreLib is a modding library made specifically for Core Keeper. It provides a lot of features that make it easier creating your mods. This includes, but not limited to:
Custom items, blocks, enemies, NPC, etc.
Adding items using JSON
Easier access to Rewired input system, localization
Custom chat commands
To use it in your mods just add the NuGet to your project references
Link: https://github.com/Jrprogrammer/CoreLib
Harmony is a library for patching, replacing and decorating existing classes and methods in the game. The patching is done in runtime, which means you don't have to change the existing code! We use harmony to run our code before or after game methods. This allows us to modify game behavior.
It is recommended to read through the Introduction, basics, patching and annotations chapters. Also please note that transpilers are not apllicable with Il2Cpp
Link: https://harmony.pardeike.net/articles/intro.html
DnSpy is a tool that allows to read .NET assemblies code with ease. Unfortunately Core Keeper is made with the IL2CPP backend. This means we can't use DnSpy itself to view the source code. However it can be useful to view assemblies generated with Cpp2Il.
Important! If you look for a dnSpy tutorial, most will tell you to look for Assembly-CSharp.dll. This is NOT the case with Core Keeper and the relevant DLLs all begin with Pug
(Pug.Core
, Pug.Other
and PugWorldGen
)
Link: https://github.com/dnSpy/dnSpy
Cpp2Il is a tool that attempts to reconstruct game assemblies, such that DnSpy would be able to read them. The tool is currently WIP and does not provide full and accurate output, however it is still useful.
Link: https://github.com/SamboyCoding/Cpp2IL
Ghidra is a free and open source reverse engineering tool developed by the National Security Agency (NSA) of the United States. This tool allows us to read the GameAssembly.dll
directly. This assembly contains compiled machine game code. To make it easier to find relevant code we can add Il2Cpp metadata. To do so we can use Il2CppInspector or Il2CppDumper
Link: https://github.com/NationalSecurityAgency/ghidra/releases
UnityExplorer is a BepInEx plugin that lets you inspect game objects and classes at the runtime. The main use for this tool is to figure out how to change something or check if your code worked correctly. It also has a C# REPL console which allows to execute code right in the game.
This page is intended to serve as a reference while no other tutorials have been made. It is basically a pastebin.
Getting the main manager instance opens a lot of doors to the rest of the game's functionality! Almost everything related to the game is stored in this object instance.
Basic patch:
Use this boolean to see if the game is in its main loop: Manager.currentSceneHandler.isInGame
The normal Unity Input system works so it's possible to assign functionalities to keys that haven't been defined by the game itself. A Input.GetKeyDown()
in an Update
method should be enough.
Also CoreLib provides an API to add new Rewired keybinds. These keybinds will be rebindable by the user.
In your plugin Load()
method call:
Then in your MonoBehavior Update()
method you can check the button:
It is possible to change the recipe of an item by changing the requiredObjectsToCraft
value.
BepInEx allows to run normal MonoBehaviour classes through the IL2CPP BasePlugin.
The way it is set up is through an AddComponent<T>()
statement in the Load()
method. <T>
is your custom MonoBehaviour
class.
This is handy for when you need to run code every frame without patching into an existing class' lifecycle.
All guides in this section are outdated as the game is now Mono built.
(No Access Type tags) | Legacy compatibility behavior - does the same thing as the Script tag. Don't do this. |
Asset | No mod scripts will be loaded. |
Script | Mod scripts will be loaded. Most mods involve some scripts; this is the most commonly used option. |
Script (Elevated Access) |
This game is using a few tools that are important to understand while modding. Specifically these are DOTS, ECS, Jobs system and Burst
Game Object represents anything which can exist in a Scene. Please note that in Core Keeper only graphical prefabs and UI uses Game Objects at runtime. Players, placeables and enemies are NOT Game Objects, they are ECS Entities.
Mono Behaviour is a class that can be attached to Game Objects. This component can give Game Objects behaviour.
A data container that you can use to save large amounts of data. Scriptable objects live outside of scenes and can be accessed by any code. In this game many lookup tables are stored as Scriptable Objects. Another notable Scriptable object are Sprite Assets.
Data-Oriented Technology Stack (DOTS) is a feature of Unity, which is currently in pre release. It uses completely different way of thinking about game state than usual Game Object based approach.
With DOTS also come ECS, Job Systems and Burst.
Entity Component System (ECS) is the main package for DOTS. It provides the core feature of DOTS: Entities, Components and Systems
Entities are containers for many Components. The class itself is just a identifier into the ECS state.
Components are structs, which hold component data. However they don't hold any behavior.
Systems hold the actual behavior. They can perform operations of group of components in bulk, utilizing Job Systems and Burst to do so in multi-threaded way
Limoka has created an overview of the game's ECS components on mod.io, although it may be out of date: https://mod.io/g/corekeeper/r/ecs-component-compendium
Resources:
When making the game and it's prefabs, devs are using Hybrid system, which allows to author the content using typical game objects and MonoBehavior based components.
After the game is loaded each Authoring component performs conversion from game object world to ECS world and ECS components.
Jobs are the way devs write system behavior which allows to easy multi-threading.
Unfortunately for us, we can't create custom Jobs. And patching such jobs also currently poses an issue due to Burst compilation.
Burst compiler is very similar to Il2Cpp in the way it takes C# and converts it to Native code. This code is stored in a native library called lib_burst_generated.dll
. The difference is burst uses a very limited subset of the C# language, which allows it to have simpler and faster native code.
Unfortunately currently we are not able to patch Burst compiled methods.
Ghosts part of the multiplayer client/server communication system. A ghost is a networked object that the server simulates. Read more on the Unity docs.
Harmony is a library for patching, replacing and decorating existing classes and methods in the game. The patching is done in runtime, which means you don't have to change the existing code! We use harmony to run our code before or after game methods. This allows us to modify game behavior.
Core Keeper already ships with a version of Harmony included. Any class with the [HarmonyPatch]
annotation will be used as a patch.
Elevated-access mods have increased access to resources outside the game like user files and internet.
Mods that require elevated access should explain why they need it on their mod.io page.
When installed, these mods have increased access to resources outside of the game such as user files and the internet. Because of this, we strongly recommend that players only install mods from reputable sources such as trusted mod creators.
To support this, we have added a new category to Mod.io called “Access Type” and, any mod that needs to run with elevated access will require the Access Type “Script (Elevated Access)”.
Users will also experience a warning pop-up that appears when they subscribe to elevated-access mods that reads:
“Caution: 'Elevated Access' mods have increased access to resources outside the game like user files and the internet. For the best experience, install only from reputable sources.”
This page includes instructions prior to release of Mono build of the game
Download the latest version of AssetRipper from their GitHub repository at . The name is pretty descriptive of what it does.
Extract the zipfile and open AssetRipper.exe.
Leave all the settings on default except for Script Export Format
and Script Content Level
, these should respectively be set to Dll Export Without Renaming
and Level 2
Then drag and drop your game folder (The whole folder called Core Keeper
) into AssetRipper.
Wait until AssetRipper is done loading the game content and then click on Export > Export all files
in the left upper corner, and select a temporary folder.
You should now have a folder with all the assets of the game. It is recommended to copy this to your "projects" folder. The folder you need should have Assets
folder in it. You can also rename this folder to your liking.
Go into the folder in the project root and open folder with the name Packages
.
Create or open file with the name manifest.json
in the Packages
folder and paste this into the file:
Save manifest.json
and go back into project root. Make sure that you have git installed and it's executable is in your PATH environment variable. After installing git make sure to close Unity and Unity hub completely!
Move all the files in the Assets/Plugins
folder to somewhere safe and make sure the folder is empty.
Note: Plugins
could be called differently. Devs of Asset Ripper change it's name all the time. If you can't see it, look for a folder in Assets
folder with .dll
files in it.
To prevent your project from crashing go to ProjectSettings
folder and delete file named ProjectSettings.asset
. This file seems to contain some broken settings, so deleting it fixes the issue
Go through the standard Unity installation and wait until it's done.
Open the Unity hub and select the folder you created when exporting the AssetRipper files.
Open the project with Unity version 2021.3.14f1
and wait for it to load. This can take a while.
Find the temp folder in where you placed files from Plugins folder earlier. Copy paste all contents from the script EXCEPT the following:
All Unity assemblies which start with Unity.
(errors will occur due to duplicate assemblies if these are pasted in)
Assembly-CSharp
back into Assets/MonoScript
.
Note: keep assemblies with Sentry
in the name, even if they have Unity
in the name
Make sure that you are doing this while Unity is RUNNING. Otherwise it will crash!
In your project settings change URP rendering asset from PugRP to one in the Editor Kit package.
Restart Unity to fully get the project assembled.
You should now be able to see the assets in the Unity editor.
Enjoy and make some cool stuff.
Recently Pugstorm released a mono version of Core Keeper. You might need it to reference it's assemblies. Here is how to get it.
This guide was made for IL2CPP version of Core Keeper and no longer applies. Normal build of the game already uses mono
Right-click the game's name in Steam and select Properties
from the menu
Select Betas
Enter the following password: monobuildsmightnotbeuptodate
Click Check Code
Click the dropdown menu, select the mono branch, and click opt in
Wait for the game to automatically update (or manually update it yourself)
If you wish to have both the mono build and il2cpp one use steamcmd to install and update the mono build. Follow this , replacing values for Core Keeper. Core Keeper appId is 1621690
This guide was made for IL2CPP version of Core Keeper and no longer applies. Please refer to:
This guide provides step by step guide on how to setup your Unity project to create custom assets or view game assets
With the release of Quality of Love update devs have changed Unity version to 2021.3.14
and switched to Universal Rendering Pipeline. Both of these changes complicate Unity project setup.
With the release of the Desert update devs have changed Unity version to 2020.3.37
and also have refactored their assemblies. These changes will heavily break existing setups.
If you have setup Unity project before and there was Unity version update, I HIGHLY recommend to back it up, and start from scratch. After you setup the project from scratch you will need NG Tools Missing Script Recovery tool to fix scripts in your assets.
With release of the mono build of the game it is now possible to use ThunderKit to setup our Unity project.
Go through the standard Unity installation and wait until it's done.
Make sure that you have git installed and it's executable is in your PATH environment variable. After installing git make sure to close Unity and Unity hub completely!
Create a new project from 2D Core template using Unity Hub. Wait until project is created and imported.
Now in the menu bar click on Window/Package Manager
. A window will appear. In the top left corner click install button, select add package from git URL
and paste in this link: https://github.com/kremnev8/ThunderKit.git#master
Wait for ThunderKit to be installed
In the menu bar go to Tools/ThunderKit/Packages
. Now install Core Keeper Import Extensions
package.
Once it is installed in the ThunderKit settings tab Import Configuration
. You should see a bunch of new importers.
In ThunderKit settings tab ThunderKit Settings
. Click on the Browse
button. Select the executable of your Mono Core Keeper. Now click on the Import
button
This step might take a while to complete. Once it's done, you will be asked to restart Unity, click Restart Project
At this point your project is functional. You can create custom assets and export them. Next steps are optional.
Extract the zipfile and open AssetRipper.exe.
Leave all the settings on default except for Script Export Format
and Script Content Level
, these should respectively be set to Dll Export Without Renaming
and Level 2
Then drag and drop your game folder (The whole folder called Core Keeper
) into AssetRipper.
Wait until AssetRipper is done loading the game content and then click on Export > Export all files
in the left upper corner, and select a temporary folder.
You should now have a folder with all the assets of the game.
In the extracted folder look for Assets
folder. From it you want every folder APART from Plugins
.
In your project Assets
folder create a folder to house these assets, for example Core Keeper
and move all files from exported Assets
there.
Now Unity will start to import these. This will take a while to complete.
You can use DnSpy to view game code. To set this up follow these steps:
Using DnSpy navigate to the game's asseblies, which can be found in <game path>/CoreKeeper_Data/Managed
folder
This guide was made for IL2CPP version of Core Keeper and no longer applies. Please refer to:
can generate .NET assemblies which can be open with DnSpy.
To generate these assemblies you need to use the tool in the command line with following options: .\Cpp2IL.exe --game-path "<path to your core keeper installation>" --just-give-me-dlls-asap-dammit
Note that the source code is divided into three assemblies (Pug.Core
, Pug.Other
and PugWorldGen
) and to let Cpp2Il know you want to analyze them you need to use one of these:
--run-analysis-for-assembly <assembly name>
. When using it you will need to run the tool three times and combine the output.
--analyze-all
. This option will analyze all the assemblies, but it will take much longer.
After running the tool you will see new folder cpp2il_out
. You can now use DnSpy to read the source code.
Using a binary reverse engineering tool we can get more precise output. You can use both Ghidra and IDA for this, but since Ghidra is free this guide will be focused on it.
GameAssembly.dll
is the executable file you need, and you will find global metadata file in Core Keeper\CoreKeeper_Data\il2cpp_data\Metadata\
.
After the tool is done executing you should see il2cpp.h
, dump.cs
and script.json
files. These files contain metadata information we need. To import it into Ghidra first open the GameAssembly.dll
with ghidra.
NOTE: For best results, choose No when Ghidra asks if you would like to perform auto-analysis when the binary is first loaded. If you receive a Conflicting data exists at address
error when running the script below, re-load the binary into the project and choose No at the auto-analysis prompt.
NOTE: To significantly speed up analysis for ELF files, set the image base to zero (0x00000000
) in the load options for the binary.
To import metadata into an existing Ghidra project:
From the Code Browser, choose File -> Parse C Source...
Create a new profile and add the generated C++ type header file. This is il2cpp.h
.
Ensure the Parse Options are set exactly as follows:
-D_GHIDRA_
Click Parse to Program and accept any warnings. This may take a long time to complete.
Open the Script Manager and add the output folder of the Il2CppDumper.
Click Refresh to make the script appear in Script Manager.
Right-click the script and choose Run. The script is going to ask for script.json
file, which you can find in the Il2CppDumper output folder. This may take a while to complete.
Loads mod scripts in mode.
Install Unity version 2021.3.14f1
from the Unity Download Archive: .
Download Editor Kit package from github: and place it's contents in the assets folder.
There might be missing script references. will help with the missing script references.
Install Unity Hub from
Install Unity version 2021.3.14f1
from the Unity Download Archive: using Unity Hub
Install
Download the latest version of AssetRipper from their GitHub repository at . The name is pretty descriptive of what it does.
There might be missing script references. will help with the missing script references.
Previous version of this guide can be found
This guide was made for IL2CPP version of Core Keeper and no longer applies. Please refer to:
Unfortunately using these tools alone would also provide bad results. We need to add Il2Cpp metadata (Which contains information about all types, methods and fields) to the Ghidra. To do so we will use , in your command line type: