Skip to content
xADDBx edited this page Jan 27, 2025 · 28 revisions

Pins

This wiki page contains a compilation of resources and tools shared in the mod-dev-technical channel of the Owlcat Games Discord. See Modding Resources for more resources.

Modding Starter Guide (Wolfie)

OwlcatNuGetTemplates (ADDB)

  • Description: NuGet templates for UnityModManager mods. Allows creating modding projects in one command. For KM, Wrath and RT.
  • Link: OwlcatNuGetTemplates

Modding Tools

Open

WW-Blueprint-Core (Wolfie)

BubblePrints (bubbles)

UnityExplorerLoader (Microsoftenator)

  • Description: Compatible version of UnityExplorer with untested improvements for KM, Wrath and RT.
  • Link: UnityExplorer Loader

SpriteGallery.Avalonia (Microsoftenator)

  • Description: A completed version of SpriteGallery with all features of the original.
  • Link: SpriteGallery.Avalonia

Unity2Debug (hambeard)

BlueprintPurge (Fumihiko)

  • Description: Tool for removing blueprints/guids from save files. Wrath only I think...
  • Link: BlueprintPurge v0.5.0

Kingmaker DataViewer (Spacehamster)

dnSpy Debug Mono Runtime (Spacehamster)

  • Description: Debug mono runtime for dnSpy.
  • Link (Kingmaker): 2018.4.10
  • Link (Wrath): 2019.4.0

BubbleGauntlet-PRE (kadyn)

MewsifierConsole (Wolfie)

Resources and Tutorials

Open

Unity and Wwise versions (ADDB)

Repository containing decompiled RogueTrader code (ADDB)

Official Documentation for Modding Rogue Trader

Debugging with Unity Debugger (Narria)

  • Description: Instructions for debugging using Unity Debugger in Visual Studio.
  • Link: Debugging Guide

Unity UI Layout Crash Course (Narria)

Environment Variables Setup Guide

Open

C# Tutorials Series (Wolfie)

Profiling with dotTrace (Narria)

  • Description: Just set it up to launch WoTR under unity profiling and it works great. You don't even need to use the debug binary or anything.
  • Link: dotTrace Profiler

Tutorial Canvas(hambeard)

BubbleTeachesLesson (bubbles)

  • Description: Step-by-Step guide for creating a Wrath Owlcat Template mod.
  • Link: BubbleTeachesLesson0

Character Textures (Aberiu)

Open If we are talking about character textures:

D is diffuse
RGB - diffuse
A - opacity

M is mask
R - roughness
G - emissive
B - metalness
A - translucency (thickness map)

N - normals
RGB - normals
A - none

S - shadow mask
It used to contain only shadows, now it also has masks for painting stuff in unity (like class outfit colors)
R - color 1
G - color 2
B - shadow mask
A - none

Shadow is basically a black diffuse layer that we place between multiple regular diffuse layers. For example, if you put on some robe and an armor, on your character's skirt bodypart they will be both painted on the same mesh. To make the top layer (armor in this case) stand out better, we add a shadow between the two layers. Shadow only appears where you can see the bottom layer sticking out. Shadow is a mask, and it does 2 things: paints diffuse with black and fills roughness with white to remove any reflections in the shadow area.

Thickness is for our fake SSS shader. Lets the light pass through the mesh and light up the texture a bit. Like the real skin. Leave it black for anything except skin. For skin you have to bake a thickness map (xnormal does that, for example). If you fill it with white, it will cause a weird subtle shine all over your texture.

WotR Character Atlas Layout (Aberiu)

Open

WotR Character Atlas Layout

WotR Race stuff (bubbles)

Unity Modding Template Adjustments/Fixes

Open
Edit Bundle Creation Script (microsoftenator2022)

Open \Assets\Editor\Build\Tasks\PrepareBundles.cs and change

	string assetPath = AssetDatabase.GUIDToAssetPath(assetGuid);
	string bundleName = m_LayoutManager.GetBundleForAssetPath(assetPath, m_ModificationParameters.TargetFolderName);
	if (bundleName == null)
	{
		continue;
	}

to

	string assetPath = AssetDatabase.GUIDToAssetPath(assetGuid);
	string bundleName = m_LayoutManager.GetBundleForAssetPath(assetPath, m_ModificationParameters.TargetFolderName);
	if (bundleName == null || bundleName.EndsWith("_content"))
	{
		bundleName = $"{m_ModificationParameters.TargetFolderName}_assets_all";
	}
Replace RT Template's Blueprint Patch Editor Script (microsoftenator2022)

Download the edited script and replace the original in \Assets\Code\GameCore\Editor\Blueprints\.

Fix the RT Template's FileNotFound Exception for references.xml on Startup (microsoftenator2022)

Open \Assets\Code\GameCore\Editor\Validation\ReferenceGraph.cs and change

        static ReferenceGraph()
        {
	        BlueprintsDatabase.OnPreSave += Graph.CleanReferencesInBlueprintWithId;
	        BlueprintsDatabase.OnSavedId += Graph.ParseFileWithId;
        }

to

        static ReferenceGraph()
        {
	        BlueprintsDatabase.OnPreSave += id => Graph?.CleanReferencesInBlueprintWithId(id);
	        BlueprintsDatabase.OnSavedId += id => Graph?.ParseFileWithId(id);
        }

        [InitializeOnLoadMethod]
        static void InitGraph()
        {
            if (!File.Exists("references.xml"))
            {
                Debug.LogWarning("references.xml does not exist. Creating reference graph.");
                CollectMenu();
            }
        }
Create a Bundle Assets Mapping File on Build for the Wrath Template (microsoftenator2022)

Open Assets\Editor\Build\Tasks\PrepareArtifacts.cs, find:

			return ReturnCode.Success;
		}
	}
}

and replace with:

            const string bundlesLayoutFileName = "BundlesLayout.json";

            File.Copy(
                Path.Combine(intermediateFolderPath, bundlesLayoutFileName),
                Path.Combine(targetFolderPath, bundlesLayoutFileName));

			return ReturnCode.Success;
		}
	}
}

Open Assets\Editor\Build\Tasks\CreateManifestAndSettings.cs, find:

			return ReturnCode.Success;
		}
	}
}

and replace with:

            var values = m_ModificationSettings.Settings.BundlesLayout.GuidToBundle.Values.ToArray();

            File.WriteAllText(Path.Combine(buildFolderPath, "BundlesLayout.json"),
                JsonConvert.SerializeObject(values.Distinct()
                    .ToDictionary(
                        value => value,
                        value => m_ModificationSettings.Settings.BundlesLayout.GuidToBundle.Keys
                            .Where(key => m_ModificationSettings.Settings.BundlesLayout.GuidToBundle[key] == value)
                            .Select(guid => new { AssetPath = AssetDatabase.GUIDToAssetPath(guid), AssetGuid = guid }))));
			
			return ReturnCode.Success;
		}
	}
}

Add using Newtonsoft.Json; to the list at the top of the file.

Add labelled drop-down drawers for enum-based fields for Wrath template (Kurufinve)

Go the template's Assets\Editor\ folder and create a new script named LongAsEnumAttributePropertyDrawer.cs. Edit it and paste in the following:

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

namespace MyOwlcatModification
{
    [CustomPropertyDrawer(typeof(LongAsEnumAttribute), true)]
    public class LongAsEnumAttributePropertyDrawer : PropertyDrawer
    {
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            var type = (attribute as LongAsEnumAttribute).EnumType;
            var result = EditorGUI.EnumPopup(position, label, Enum.ToObject(type, property.longValue) as Enum);
            property.longValue = (long)Enum.ToObject(type, result);
        }
        public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
        {
            return EditorGUIUtility.singleLineHeight;
        }
    }
}

Create a new script named LongAsEnumFlagsAttributeAsDropdownDrawer.cs and paste in the following:

using UnityEngine;
using UnityEditor;
using System;
using System.Collections;
using System.Collections.Generic;

namespace Kingmaker.Utility
{
    [CustomPropertyDrawer(typeof(LongAsEnumFlagsAttribute))]
    public class LongAsEnumFlagsAttributeAsDropdownDrawer : PropertyDrawer
    {
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            EditorGUI.LabelField(new Rect(position.x, position.y, EditorGUIUtility.labelWidth, position.height), label);

            string text = property.hasMultipleDifferentValues ? "-multiple-  " : property.longValue == 0 ? "None  " : "";
            var enumType = (attribute as LongAsEnumFlagsAttribute).EnumType;
            var names = System.Enum.GetNames(enumType);

            foreach (string name in names)
            {
                long value = (long)System.Enum.Parse(enumType, name);
                if ((property.longValue & value) == value) text += string.Format("{0}, ", name);
            }
            text = text.Remove(text.Length - 2, 2);
            Rect popupRect = new Rect(position.x + EditorGUIUtility.labelWidth, position.y, position.width - EditorGUIUtility.labelWidth, position.height);
            if (GUI.Button(popupRect, new GUIContent(text), (GUIStyle)"miniPopup"))
            {
                GenericMenu menu = new GenericMenu();
                foreach (var name in names)
                {
                    long value = (long)System.Enum.Parse(enumType, name);
                    bool has = (property.longValue & value) == value;
                    menu.AddItem(new GUIContent("None"), property.longValue == 0, () =>
                    {
                        property.longValue = 0;
                        property.serializedObject.ApplyModifiedProperties();
                    });
                    menu.AddItem(new GUIContent(name), has, () =>
                    {
                        if (has) property.longValue ^= value;
                        else property.longValue |= value;
                        property.serializedObject.ApplyModifiedProperties();
                    });
                }
                menu.DropDown(popupRect);
            }
        }
    }
}

Dumps

Open

Kingmaker 2.1.7b dump (ADDB)

  • Description: Dump created with KingmakerDataminer.
  • Link: dump

Kingmaker GUID Database (Spacehamster)

  • Description: Here is the current database of GUIDs found in mods, these are new GUIDs and in game ones. It's unknown if the original blueprint is modified by the mod author. If you have any troubles with a certain GUID this should help you narrow it down.
  • Link: GUID Database

Kingmaker Blueprint JSON Dumps (Spacehamster)

Wrath AssetId to Bundle Mapping File (Microsoftenator)

RogueTrader AssetId to Bundle Mapping File (Microsoftenator)

RogueTrader CAB to Bundle Mapping File (Microsoftenator)

Clone this wiki locally