Pins - WittleWolfie/OwlcatModdingWiki GitHub Wiki
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.
- Description: Beginner's guide to modding.
- Link: Modding Starter Guide
- Description: NuGet templates for UnityModManager mods. Allows creating modding projects in one command. For KM, Wrath and RT.
- Link: OwlcatNuGetTemplates
Open
- Description: Wrath Library to better work with Blueprints.
- Link: WW-Blueprint-Core v2.8.5
- Description: Tool to browse Blueprints for KM, Wrath and RT
- Link: BubblePrints Releases
- Description: Compatible version of UnityExplorer with untested improvements for KM, Wrath and RT.
- Link: GitHub Releases
- Description: A completed version of SpriteGallery with all features of the original.
- Link: SpriteGallery.Avalonia
- Description: Working fork of AssetStudio, a tool that lets you inspect and dump Unity Bundle contents
- Link: GitHub
- Description: Tool for debugging
- Link: Unity2Debug
- Description: Tool for removing blueprints/guids from save files. Wrath only I think...
- Link: BlueprintPurge v0.5.0
- Description: Harmony2.0 beta compatible version of DataViewer.
- Link: DataViewer v0.9.3a-beta
- Description: BubbleGauntlet.
- Link: BubbleGauntlet-PRE
- Description: ???
- Link: MewsifierConsole v1.1.1
Open
- Unity Version:
- Kingmaker:
2018.4.10f1
- https://unity.com/releases/editor/whats-new/2018.4.10#installs - Wrath:
2020.3.48f1
- https://unity.com/releases/editor/whats-new/2020.3.48#installs - RT:
2022.3.44f1
- https://unity.com/releases/editor/whats-new/2022.3.44#installs
- Kingmaker:
- Wwise Version:
- Kingmaker:
2016.2
- Wrath:
2019.2
- RT:
2022.1
- Kingmaker:
- Description: Title
- Link: RT Decompiled Source Code
- Description: Title
- Link: RT Modding Docs
- Description: Instructions for debugging using Unity Debugger in Visual Studio.
- Link: Debugging Guide
- Description: Title
- Link: UI Crash Course
Open
-
Description: Guide for setting environment variables on Windows.
- Link: Environment Variables Setup Guide
- Description: General coding tutorials for beginners.
- Link: C# Tutorials Series
- 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
- Description: Tutorial on how to make UIs in WotR.
- Link: Tutorial Canvas
- Description: Step-by-Step guide for creating a Wrath Owlcat Template mod.
- Link: BubbleTeachesLesson0
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.
Open
- drag'n'drop the model into the project. Create a GameObject for it and add a MeshRenderer to it. Drag'n'drop your model model onto it. Add "Bones" as children Game Objects - those are special-named game objects that will govern the skeleton animation. You generally wanna steal it from an existing body part such as some body. Save as prefab.
- Create a Scriptable Object of the Color Profile type. Import textures for coloring. Those are "ramps" - ramps are kind of Brightness thingy where n-th pixel (on the X axis) shows the visible color at n% light intensity where the intensity level is taken from the ramp mask as average luminosity or whatever it is called. Create a Scriptable Object of the Ramp Color Preset type. Each profile contains 2 indecies (primary and secondary color) pointing to one of color in the Color Profile.
- Create a Scriptable Object of Equipment Entity type. Drag'n'drop your colors onto its fields. You can add more ramps specific to this single EE, but generally you want to go with presets. Expand BodyParts array and press "+" to create new entries.
- Drag'n'drop the prefab of a body part from step 1 onto the Body Part's RendererPrefab field. Create a Material with Owlcat/Lit shader and drag'n'drop onto the Material field. Add more TextureDescriptions to the Textures array. Fill with imported Difuse, Normal, Mask. Shadow textures and assign Diffuse as Active texture. Set up flags to use those textures. Add primary and secondary ramps if needed as well as ramp mask (). You may use ramps for all 3 channels and you may have several Texture Descriptions for layering (for example, face body parts uses one description for skin and one more for lipstick and rouges). Rinse and repeat for all body parts.
- Create a blueprint of Kingmaker Equipment entity type and shove EE into it. You will need 1 EE for each race you need (in case you do equipment and not base bodies) for each gender
Open
Open
- STEP -2: Add this to Editor: https://gist.github.com/cstamford/1173cfdecf8ae7194e8ec5fcaaf2b9a1 . It will add two new menu options in the Assets top main menu thingy (apparently I can't remember how to words).
- STEP -1: Put this file somewhere: https://gist.github.com/cstamford/95a37739c97df172ae3656df617824ba It lists all the variants used by all the shaders in the game - update the code above to load this file, since the path is hardcoded.
- STEP 0: For any shader you wish to compile, you need to create a
ShaderVariantCollection
for it and include it in your asset bundle. This will force Unity to include all those variants. The code above will create one for you matching retail shader variants viaAssets/Create ShaderVariantCollection
. Note that the code is hardcoded to doOwlcat/Lit
, just look forLit.shader
andOwlcatLitSVC
to know what to edit!
.Append("Assets/RenderPipeline/CustomShaders/OwlcatLitSVC.asset")
.Append("Assets/RenderPipeline/OwlcatShaders/Shaders/Lit/Lit.shader")
- STEP 1: Create your asset bundle via
Assets/Build MyAssetBundle
. NOTE: If you build it any other way, it will include about 100x more variants and it will take several hours to build. - STEP 2: Tadaa! It works! Minimal example in game:
if (Button("Swap Material Test")) {
foreach (Renderer renderer in GameObject.FindObjectsOfType<Renderer>()) {
Material[] materials = renderer.sharedMaterials;
for (int i = 0; i < materials.Length; i++) {
Material mat = materials[i];
if (mat.shader.name == "Owlcat/Lit") {
mat.shader = Shaders.LitReplacement; // you should load this from your asset bundle via the regular API
materials[i] = mat;
}
}
renderer.sharedMaterials = materials;
}
}
- Description: Code related to race things?
- Link (Gist): Race Nonsense
- Link (Project): Project
- Link (Setup Guide) Discord Message
- Description: Changing a value on a weapon via RT template
- Link: YouTube
- Description: Documents the vertex groups of the RT human base body to help rigging new equipment; bones labeled ADJ have vertex groups
- Link: Google Drive
- Description: Notes created someone on how to do enGB.json
- Link: Pastebin
- Description: MicroPatches has bugfixes and new features for RT Template; this is an installation video
- Link: YouTube
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);
}
}
}
}
Open
- Description: Dump created with KingmakerDataminer.
- Link: dump
- 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
- Description: JSON dumps of blueprints for Kingmaker and Wrath.
- Links: Kingmaker Blueprints, Wrath Blueprints
- Description: AssetId to bundle mapping file.
- Link: AssetId to Bundle Mapping File
- Description: All variants per shader, and metadata per shader including all properties and paths inside bundles
- Link: Gist
- Description: AssetId to bundle mapping file.
- Link: AssetId to Bundle Mapping File
- Description: CAB to bundle mapping file.
- Link: CAB to Bundle Mapping File