Unity editor setup for KSP - kurgut/KSP-IVA-modding-Guide GitHub Wiki

0. All downloads needed :

It is good rule of thumb to use 7zip to extract any archives in general, instead of Winrar, or Windows built in archive extractor.


1. Unity Hub


2. Unity 2019.4.18f1 installation and project creation

  • go to the Unity download archive, navigate to the 2019.4.18f1 version, download it, and run the installer.
  • Note the installed location of Unity
  • open Unity Hub, select Installs from left menu, then select Locate, then specify the installed location of Unity. Notice that the list should show “2019.4.18f1”
  • Select New Project, then 3D Core. Name your project and choose its location. Then select Create Project and Unity will open
Alt Text

3. Unity Configuration Part 1

  • Download PartTools_AssetBundles 2019.4.18f1 from : https://forum.kerbalspaceprogram.com/topic/160487-official-parttools/, and extract the downloaded archive somewhere on your drive
  • Select Assets > Import Package > Custom Package > Navigate to previously extracted archive and select it (PartTools_PackageForModders.unitypackage)
  • A little window will pop up, make sure everything is checked (it should be already), then select Import
  • On the bottom navigation window, go to Assets > Plugins > KSPAssets, Highlight KSPAssetCompiler.dll, then look at the right menu Inspector panel, and make sure that the Validate References checkbox is Unchecked. Do the same for the KSPAssets.dll (make sure that the checkbox is Unchecked) Screenshot 2024-12-23 152838

4. Unity Configuration Part 2 - KSP Gamedata setup

4.1 ImageMagick

First we will need to install ImageMagick.

  • Download it from here : https://imagemagick.org/script/download.php
  • Run the ImageMagick installer
  • If the installer offers you an option to do something like, “Add application to your system path”, select that option

4.2 KSP Gamedata setup for Unity

We will now need to setup a special Gamedata folder, which will be solely dedicated to use within Unity, to modify IVAs.

  • Copy a Gamedata folder from a clean KSP 1.12.5 installation, and paste it the location of your choice :
Alt Text

--> For ease of understanding, and to avoid future confusions in this guide, we will now refer to this Gamedata folder as "UNITYGamedata"

4.2.1 Deleting not needed stuff

  • Inside its /Squad folder, delete everything except the /Spaces and /Props folder.
    If you have the DLCs, do the same for the SquadExpansion/MakingHistory/ folder.
    You can simply delete the SquadExpansion/Serenity folder (Breaking Ground DLC), since it doesn't have any props or internals.
    You should now have this :
Alt Text

4.3 Conversion from .dds to .png

To have textures correctly displayed in Unity, we now need to convert all the .dds textures present in the "UNITYGamedata" folder to .png
This is done in seconds with ImageMagick :

  • Open File Explorer, and navigate to your "UNITYGamedata" folder
  • In the File Explorer address bar, type CMD to get a command prompt window
  • Copy and paste the following into the command prompt window, then execute it by hitting Enter.
    FOR /R %f IN (*.dds) DO magick mogrify -verbose -flip -format png "%f"
Alt Text
  • Let ImageMagick run, it will affect all folders and sub folder, so everything inside basically

  • Personally, I then delete all the .dds textures from the "UNITYGamedata" which aren't needed anymore, since I think it makes Unity slower on large Gamedatas when you refresh Part Tools, but 1. I'm not sure, and 2. this is an optional step.

  • If you ever wish to modify an IVA from a mod, simply add the mod folder to your "UNITYGamedata" folder, and repeat the steps 4.2.1 and 4.3 for this mod folder


4. Unity Configuration Part 3 - Part Tools

  • From the Unity top menu bar, select Tools > KSP Part Tools
  • In the Part Tools window that appeared, select "Set Data Dir", then select the location of your "UNITYGamedata" folder
    Screenshot 2024-12-23 170118
  • The Part Tools window should now be populated with the Spaces and Props sub windows, from which you can now spawn internals and props into Unity
Alt Text

You can now start working on your IVA ! --> Modifying existing IVAs

⚠️ **GitHub.com Fallback** ⚠️