Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .github/workflows/attachReleaseArtifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
release:
types: [published]

env:
KSP_ROOT: /tmp/ksp

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
attach-release-artifacts:
Expand All @@ -27,16 +30,14 @@ jobs:

- name: Download required assemblies
id: download-assemblies
shell: bash
env:
uses: KSP-RO/BuildTools/download-assemblies-v2@master
with:
KSP_ZIP_PASSWORD: ${{ secrets.KSP_ZIP_PASSWORD }}
run: |
curl https://ksp-ro.s3-us-west-2.amazonaws.com/KSPAssemblies-1.12.zip --output /tmp/bins.zip
KSP_DLL_PATH="/opt/ksp/assembly"
echo "::set-output name=ksp-dll-path::${KSP_DLL_PATH}"
mkdir -p "${KSP_DLL_PATH}"
unzip -P "${KSP_ZIP_PASSWORD}" '/tmp/bins.zip' -d "${KSP_DLL_PATH}"
rm '/tmp/bins.zip'
dependency-identifiers: |
Harmony2
Kopernicus
KSPBurst-Lite
BurstPQS

- name: Build mod solution
env:
Expand All @@ -63,8 +64,7 @@ jobs:
grep AssemblyFileVersion ${GITHUB_WORKSPACE}/Source/Properties/AssemblyInfo.cs

rm -f ${GITHUB_WORKSPACE}/GameData/RealSolarSystem/Plugins/*.dll
msbuild /p:Configuration=Release /p:ReferencePath="${{ steps.download-assemblies.outputs.ksp-dll-path }}" ${GITHUB_WORKSPACE}/Source/RealSolarSystem.sln
cp -v ${GITHUB_WORKSPACE}/Source/obj/Release/RealSolarSystem.dll ${GITHUB_WORKSPACE}/GameData/RealSolarSystem/Plugins/RealSolarSystem.dll
msbuild /p:Configuration=Release /p:ReferencePath="${{ steps.download-assemblies.outputs.ksp-dll-path }}" /p:KSPRoot="${{ env.KSP_ROOT }}" ${GITHUB_WORKSPACE}/Source/RealSolarSystem.sln

- name: Remove excess DLLs
uses: KSP-RO/BuildTools/remove-excess-dlls@master
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
KSP_ROOT: /tmp/ksp

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
check-secret:
Expand Down Expand Up @@ -49,22 +52,19 @@ jobs:

- name: Download required assemblies
id: download-assemblies
shell: bash
env:
uses: KSP-RO/BuildTools/download-assemblies-v2@master
with:
KSP_ZIP_PASSWORD: ${{ secrets.KSP_ZIP_PASSWORD }}
run: |
curl https://ksp-ro.s3-us-west-2.amazonaws.com/KSPAssemblies-1.12.zip --output /tmp/bins.zip
KSP_DLL_PATH="/opt/ksp/assembly"
echo "::set-output name=ksp-dll-path::${KSP_DLL_PATH}"
mkdir -p "${KSP_DLL_PATH}"
unzip -P "${KSP_ZIP_PASSWORD}" '/tmp/bins.zip' -d "${KSP_DLL_PATH}"
rm '/tmp/bins.zip'
dependency-identifiers: |
Harmony2
Kopernicus
KSPBurst-Lite
BurstPQS

- name: Build mod solution
run: |
rm -f ${GITHUB_WORKSPACE}/GameData/RealSolarSystem/Plugins/*.dll
msbuild /p:Configuration=Release /p:ReferencePath="${{ steps.download-assemblies.outputs.ksp-dll-path }}" ${GITHUB_WORKSPACE}/Source/RealSolarSystem.sln
cp -v ${GITHUB_WORKSPACE}/Source/obj/Release/RealSolarSystem.dll ${GITHUB_WORKSPACE}/GameData/RealSolarSystem/Plugins/RealSolarSystem.dll
msbuild /p:Configuration=Release /p:ReferencePath="${{ steps.download-assemblies.outputs.ksp-dll-path }}" /p:KSPRoot="${{ env.KSP_ROOT }}" ${GITHUB_WORKSPACE}/Source/RealSolarSystem.sln

- name: Remove excess DLLs
uses: KSP-RO/BuildTools/remove-excess-dlls@master
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using System;
using BurstPQS;
using BurstPQS.Util;
using RealSolarSystem;
using Unity.Burst;

[BurstCompile]
[BatchPQSMod(typeof(PQSMod_VertexDefineCoastSmooth))]
public class BatchPQSMod_VertexDefineCoastSmooth : BatchPQSMod<PQSMod_VertexDefineCoastSmooth>
{
public BatchPQSMod_VertexDefineCoastSmooth(PQSMod_VertexDefineCoastSmooth mod) : base(mod)
{
}

public override void OnQuadPreBuild(PQ quad, BatchPQSJobSet jobSet)
{
base.OnQuadPreBuild(quad, jobSet);
jobSet.Add(new BuildJob
{
minHeightOffset = Mod.minHeightOffset,
maxHeightOffset = Mod.maxHeightOffset,
slopeScale = Mod.slopeScale,
});
}

[BurstCompile]
struct BuildJob : IBatchPQSHeightJob
{
public double minHeightOffset;
public double maxHeightOffset;
public double slopeScale;

public void BuildHeights(in BuildHeightsData data)
{
var minHeight = data.sphere.radius + minHeightOffset;
var maxHeight = data.sphere.radius + maxHeightOffset;

for (int i = 0; i < data.VertexCount; ++i)
{
if (data.vertHeight[i] > minHeight && data.vertHeight[i] < maxHeight)
{
// 7th order polynomial smoothstep.
double x = (data.vertHeight[i] - minHeight) / (maxHeight - minHeight);
x = MathUtil.Clamp01((x - 0.5) * slopeScale + 0.5);
double y = -20.0 * Math.Pow(x, 7.0) + 70 * Math.Pow(x, 6.0) - 84.0 * Math.Pow(x, 5.0) +
35.0 * Math.Pow(x, 4.0);
data.vertHeight[i] = y * (maxHeight - minHeight) + minHeight;
}
}
}
}
}
46 changes: 46 additions & 0 deletions Source/RealSolarSystem.BurstPQS/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("RealSolarSystem.BurstPQS")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RealSolarSystem.BurstPQS")]
[assembly: AssemblyCopyright("Copyright © 2026, KSP-RO Team")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("40818121-9CD4-4452-8583-CDFD7528724F")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
#if CIBUILD
[assembly: AssemblyVersion("@MAJOR@.@MINOR@.@PATCH@.@BUILD@")]
[assembly: AssemblyFileVersion("@MAJOR@.@MINOR@.@PATCH@.@BUILD@")]
[assembly: KSPAssembly("RealSolarSystem.BurstPQS", @MAJOR@, @MINOR@)]
[assembly: KSPAssemblyDependency("RealSolarSystem", @MAJOR@, @MINOR@)]
#else
[assembly: AssemblyVersion("18.5.0.0")]
[assembly: AssemblyFileVersion("18.5.0.0")]
[assembly: KSPAssembly("RealSolarSystem.BurstPQS", 21, 0, 0)]
[assembly: KSPAssemblyDependency("RealSolarSystem", 21, 0, 0)]
#endif

[assembly: KSPAssemblyDependency("BurstPQS", 0, 1)]
86 changes: 86 additions & 0 deletions Source/RealSolarSystem.BurstPQS/RealSolarSystem.BurstPQS.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{40818121-9CD4-4452-8583-CDFD7528724F}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RealSolarSystem.BurstPQS</RootNamespace>
<AssemblyName>RealSolarSystem.BurstPQS</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\GameData\RealSolarSystem\Plugins</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\GameData\RealSolarSystem\Plugins</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<KSPRoot Condition=" '$(KSPRoot)' == '' ">
$(ReferencePath.TrimEnd([System.IO.Path]::DirectorySeparatorChar))</KSPRoot>
</PropertyGroup>
<ItemGroup>
<Reference Include="$(KSPRoot)/KSP_x64_Data/Managed/System.dll">
<HintPath>$(ReferencePath)/System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="$(KSPRoot)/KSP_x64_Data/Managed/System.Core.dll">
<HintPath>$(ReferencePath)/System.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="$(KSPRoot)/KSP_x64_Data/Managed/Assembly-CSharp.dll">
<HintPath>$(ReferencePath)/Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="$(KSPRoot)/KSP_x64_Data/Managed/UnityEngine.dll">
<HintPath>$(ReferencePath)/UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="$(KSPRoot)/KSP_x64_Data/Managed/UnityEngine.CoreModule.dll">
<HintPath>$(ReferencePath)/UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="$(KSPRoot)/GameData/000_KSPBurst/Plugins/Unity.Burst.dll">
<HintPath>$(ReferencePath)/Unity.Burst.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="$(KSPRoot)/GameData/BurstPQS/Plugins/BurstPQS.dll">
<HintPath>$(ReferencePath)/BurstPQS.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="BatchPQSMod_VertexDefineCoastSmooth.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RealSolarSystem.csproj">
<Project>{685bbbd5-86fa-43b0-bcad-72328d37ac94}</Project>
<Name>RealSolarSystem</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
34 changes: 24 additions & 10 deletions Source/RealSolarSystem.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,35 +56,49 @@
<Compile Include="VesselGroundPositionEnhancer.cs" />
<Compile Include="Watchdogs.cs" />
</ItemGroup>
<PropertyGroup>
<KSPRoot Condition=" '$(KSPRoot)' == '' ">
$(ReferencePath.TrimEnd([System.IO.Path]::DirectorySeparatorChar))</KSPRoot>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony">
<Reference Include="$(KSPRoot)/GameData/000_Harmony/0Harmony.dll">
<HintPath>$(ReferencePath)/0Harmony.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp">
<Reference Include="$(KSPRoot)/KSP_x64_Data/Managed/Assembly-CSharp.dll">
<HintPath>$(ReferencePath)/Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Kopernicus">
<Reference Include="$(KSPRoot)/GameData/Kopernicus/Plugins/Kopernicus.dll">
<HintPath>$(ReferencePath)/Kopernicus.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Kopernicus.Parser">
<Reference Include="$(KSPRoot)/GameData/Kopernicus/Plugins/Kopernicus.Parser.dll">
<HintPath>$(ReferencePath)/Kopernicus.Parser.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System">
<Reference Include="$(KSPRoot)/KSP_x64_Data/Managed/System.dll">
<HintPath>$(ReferencePath)/System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine">
<Reference Include="$(KSPRoot)/KSP_x64_Data/Managed/UnityEngine.dll">
<HintPath>$(ReferencePath)/UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="$(KSPRoot)/KSP_x64_Data/Managed/UnityEngine.CoreModule.dll">
<HintPath>$(ReferencePath)/UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.IMGUIModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="$(KSPRoot)/KSP_x64_Data/Managed/UnityEngine.IMGUIModule.dll">
<HintPath>$(ReferencePath)/UnityEngine.IMGUIModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="$(KSPRoot)/KSP_x64_Data/Managed/UnityEngine.InputLegacyModule.dll">
<HintPath>$(ReferencePath)/UnityEngine.InputLegacyModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="$(KSPRoot)/KSP_x64_Data/Managed/UnityEngine.PhysicsModule.dll">
<HintPath>$(ReferencePath)/UnityEngine.PhysicsModule.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions Source/RealSolarSystem.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ VisualStudioVersion = 15.0.28010.2048
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RealSolarSystem", "RealSolarSystem.csproj", "{685BBBD5-86FA-43B0-BCAD-72328D37AC94}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RealSolarSystem.BurstPQS", "RealSolarSystem.BurstPQS\RealSolarSystem.BurstPQS.csproj", "{40818121-9CD4-4452-8583-CDFD7528724F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -15,6 +17,10 @@ Global
{685BBBD5-86FA-43B0-BCAD-72328D37AC94}.Debug|Any CPU.Build.0 = Debug|Any CPU
{685BBBD5-86FA-43B0-BCAD-72328D37AC94}.Release|Any CPU.ActiveCfg = Release|Any CPU
{685BBBD5-86FA-43B0-BCAD-72328D37AC94}.Release|Any CPU.Build.0 = Release|Any CPU
{40818121-9CD4-4452-8583-CDFD7528724F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{40818121-9CD4-4452-8583-CDFD7528724F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{40818121-9CD4-4452-8583-CDFD7528724F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{40818121-9CD4-4452-8583-CDFD7528724F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Loading