ElysiumKSP MDK is an unofficial lightweight modding development kit for Kerbal Space Program 1.12.5, built on .NET Framework 4.2 and C# 5.
v0.0.1-prerelease-4
This is an early release aimed at making KSP API calls shorter and easier to use.
🚀 Designed for mod developers who want to prototype faster without writing long boilerplate KSP API calls.# ElysiumKSP MDK
ElysiumKSP MDK is an unofficial Mod Development Kit for KSP that adds a compact event system, configuration menus, a performance optimizer, and utilities for handling game objects.
Low fuel & low electric charge events
⚙️ Configuration Menu
Logging options and internal settings
📂 Mod Manager
Detects configs
🚀 Performance Optimizer
Controls rigidbody settings for optimization
🌐 Optional Networking API
Custom inter-mod messaging
New
SteamAPI and Optimized loading system
onComplete
optionIn current version, mod have a Steam API.
In using ElysiumKSP.SteamAPI
and use class Steam64
Example:
using System.Threading.Tasks;
using ElysiumKSP.SteamAPI;
using UnityEngine;
// Steam64 use a `async` tasks for CPU optimized tasks
public class MySteamAPI : MonoBehaviour
{
private Steam64 api;
// Initialize a Steam API
void Start()
{
api = new Steam64("you_steamapi_key");
}
// API Usage
void Update()
{
Task<string[]> playerInfo;
// For example find all steam accounts by ID from 1 to 65535
for (int id = 1; id < 65535; id++)
{
playerInfo = async api.GetPlayerSummaryAsync(id);
}
}
}
This is a new fuction of this KSP 1.12.5 MDK, Optimized method calls!!!
In this version added a using ElysiumKSP.OptimizedCalls;
for optimized methor running
Async file text reading, have a one method LoadAsync(string path, Action<string> onComplete): void
Example of using
using ElysiumKSP.OptimizedCalls;
using KSP;
// Other usings...
// Classes, namespaces and other...
void LoadSomewhere()
{
AsyncLoader al = new AsyncLoader();
al.LoadAsync(KSPUtils.ApplicationRootPath + "\\MyMod\\Keys\\SHA-256.txt", (s) => { ... });
}
ElysiumKSP.cginc
is the main shader include for ElysiumKSP MDK,
containing math utilities, PBR lighting functions, Fresnel reflections, and compute shader support.
File location: KSPPath
/GameData/Elysium/Kernel32/ElysiumKSP.cginc
UnityCG.cginc
In your shader file, add:
#include "Elysium/Kernel32/ElysiumKSP.cginc"
Then you can use built-in lighting functions, for example:
float3 color = PBR_Shade(normal, viewDir, albedo, metallic, roughness);
return float4(color, 1);
or the simplified variant:
fixed4 frag(v2f i) : SV_Target
{
return ElysiumPBR(i);
}
License This file distributed the EMDK Mod License (see LICENSE
Example:
Shader "Elysium/ExamplePBR"
{
Properties
{
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_NormalMap ("Normal Map", 2D) = "bump" {}
_MetallicRoughnessMap ("MetallicRoughness", 2D) = "black" {}
_AOMap ("AO", 2D) = "white" {}
_EmissionMap ("Emission", 2D) = "black" {}
_Metallic ("Metallic", Range(0,1)) = 0.0
_Roughness ("Roughness", Range(0.04,1)) = 0.6
_AO ("AO", Range(0,1)) = 1.0
_Exposure ("Exposure", Float) = 1.0
}
SubShader
{
Tags { "RenderType" = "Opaque" }
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "ElysiumKSP.cginc"
struct appdata
{
float4 vertex : POSITION;
float3 normal : NORMAL;
float4 tangent : TANGENT;
float2 uv : TEXCOORD0;
};
struct v2f
{
float4 pos : SV_POSITION;
float3 worldPos : TEXCOORD0;
float3 worldNormal : TEXCOORD1;
float4 tangent : TEXCOORD2;
float2 uv : TEXCOORD3;
};
float4 _MainTex_ST;
float _Metallic;
float _Roughness;
float _AO;
float _Exposure;
float3 _EmissionColor;
v2f vert(appdata v)
{
v2f o;
o.pos = UnityObjectToClipPos(v.vertex);
o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
o.worldNormal = UnityObjectToWorldNormal(v.normal);
o.tangent = v.tangent;
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
return o;
}
// Simple forward-light (main directional light) for example
fixed4 frag(v2f i) : SV_Target
{
float3 V = normalize(_WorldSpaceCameraPos - i.worldPos);
float3 Ldir = normalize(_WorldSpaceLightPos0.xyz);
float3 lightColor = _LightColor0.rgb;
float NdotL;
// call our PBR shade utility
float3 col = PBR_Shade(i.uv, i.worldNormal, i.tangent, V, Ldir, lightColor, NdotL); // From ElysiumKSP.cginc
return float4(col, 1.0);
}
ENDCG
}
}
FallBack "Diffuse"
}
Raw stats are from the beginning of time until now. Each follower and download entry represents one hour of data. Uneventful hours are omitted.