Compare commits

..
551 changed files with 37355 additions and 70049 deletions

View file

@ -1,5 +0,0 @@
---
default: patch
---
Ballistic guns and the mine launcher are priced from what they are built from, and the heavier guns need rarer metals: rifled barrels from titanium, lined barrels from tungsten, charged scatter barrels from niobium, rare earths and platinum; flak and point defence guns take a tracking feed.

View file

@ -1,5 +0,0 @@
---
default: patch
---
The map screen and the minimap draw gravity contours and slope rays as smooth anti-aliased lines, and the rays flow slowly downhill into each well.

View file

@ -1,5 +0,0 @@
---
default: patch
---
Belts hold named ores by body class and province, mining stations name them, and gear, hull and consumable prices and the starting purse are a hundredth of what they were.

View file

@ -1,5 +0,0 @@
---
default: patch
---
Stations carry facility gear on a new Facility mount: every recipe names the facility that runs it, every station kind lists the facilities it is fitted with, and every station hull that serves a kind has the Facility row to take them (Zenith and the Arsenal Depot each have one). Nothing runs a recipe yet. Because the hardpoint tints spread across one more type, every hardpoint on the schematic turns a little around the colour wheel.

View file

@ -1,5 +0,0 @@
---
default: patch
---
Releases are built and published by a pipeline.

View file

@ -1,5 +0,0 @@
---
default: patch
---
Shields are on sale: a light 1x1 and a heavy 2x2 projector fit the Djinni's and the Nakovalnya's shield mounts and every starter ship's, and the Zenith's fourth radiator mount takes radiators again.

View file

@ -1,5 +0,0 @@
---
default: patch
---
The starting purse is 4000 credits: one first upgrade, not the ladder.

View file

@ -1,5 +0,0 @@
---
default: patch
---
The tactical view is a camera of its own: scroll out past a bump to a three-quarters top-down view over the grid, drag to move it, scroll back in through the bump to return to your ship.

View file

@ -1,117 +0,0 @@
# The one actor that turns .changeset/ files and VERSION into a tag and a forge release (docs/release-checklist.md).
# Dispatch by hand on the branch to release. Runs on the Starfire runner in host mode, as the operator's Windows user,
# because the Unity Personal licence lives there. Every host prerequisite is checked by the first step, before any build or
# push (list: docs/release-checklist.md, One-time setup). Nothing is pushed until both players have built: a failed
# preflight or build leaves the forge untouched. After the push, a failed forge release has a recovery in the checklist.
name: release
on:
workflow_dispatch:
concurrency:
group: release
cancel-in-progress: false
jobs:
release:
runs-on: starfire
env:
UNITY_EDITOR: ${{ vars.UNITY_EDITOR }}
CULTLIB_ROOT: ${{ vars.CULTLIB_ROOT }}
CULTMATH_ROOT: ${{ vars.CULTMATH_ROOT }}
BUILD_NAME: release-${{ github.run_id }}
defaults:
run:
shell: '"C:/Program Files/Git/bin/bash.exe" -e {0}'
steps:
# The composite forgejo-release action runs its steps with `shell: bash`, resolved through PATH, where System32's WSL
# bash.exe can win. Git's bin goes first for every later step of this job.
- name: Put Git Bash first on PATH
run: printf '%s\n' 'C:\Program Files\Git\bin' >> "$GITHUB_PATH"
- name: Preflight host prerequisites
env:
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: |
set -u
missing=""
first_bash="$(cmd.exe //c where bash 2>/dev/null | head -n 1 | tr -d '\r')"
case "${first_bash//$'\x5c'//}" in
"C:/Program Files/Git/"*) ;;
*) missing="$missing"$'\n'" PATH resolves bash to '$first_bash', not Git Bash (the forgejo-release action would run WSL bash)" ;;
esac
note() { missing="$missing"$'\n'" $1"; }
for tool in jq curl knope git tar dotnet; do
command -v "$tool" >/dev/null || note "$tool is not on PATH"
done
test -x /c/Windows/System32/tar.exe || note "C:/Windows/System32/tar.exe is missing"
test -n "$RELEASE_TOKEN" || note "secret RELEASE_TOKEN is not set"
test -f "$UNITY_EDITOR" || note "repo variable UNITY_EDITOR is unset or not a file: '$UNITY_EDITOR'"
test -d "$CULTLIB_ROOT" || note "repo variable CULTLIB_ROOT is unset or not a directory: '$CULTLIB_ROOT'"
test -d "$CULTMATH_ROOT" || note "repo variable CULTMATH_ROOT is unset or not a directory: '$CULTMATH_ROOT'"
if test -n "$missing"; then echo "release preflight failed, nothing was built or pushed:$missing"; exit 1; fi
- uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 0
token: ${{ secrets.RELEASE_TOKEN }}
- name: Prepare release
id: prepare
run: |
set -euo pipefail
knope prepare-release
version="$(tr -d '\r\n' < VERSION)"
if git rev-parse -q --verify "refs/tags/v$version" >/dev/null; then
echo "v$version already exists: no change file asked for a new version"; exit 1
fi
awk -v heading="## $version " 'index($0, heading) == 1 { found = 1; next } /^## / { if (found) exit } found' CHANGELOG.md > "$RUNNER_TEMP/notes.md"
test -s "$RUNNER_TEMP/notes.md" || { echo "CHANGELOG.md has no section for $version"; exit 1; }
git add VERSION CHANGELOG.md .changeset
git -c user.name="Aetheria release" -c user.email="release@gamecult.invalid" commit -m "Release $version"
git -c user.name="Aetheria release" -c user.email="release@gamecult.invalid" tag -a "v$version" -m "Aetheria $version"
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
echo "notes=$RUNNER_TEMP/notes.md" >> "$GITHUB_OUTPUT"
- name: Build and zip players
run: |
set -euo pipefail
version="${{ steps.prepare.outputs.version }}"
build="$(cd .. && pwd)/$BUILD_NAME"
mkdir -p "$build/dist"
project="$(pwd -W)"
for target in win64 linux64; do
name="Aetheria-$version-$target"
"$UNITY_EDITOR" -batchmode -quit -projectPath "$project" -executeMethod AetheriaBuild.Build \
-aetheriaVersion "$version" -aetheriaOut "$(cd "$build" && pwd -W)/$name" -aetheriaTarget "$target" \
-logFile "$(cd "$build" && pwd -W)/$target.log"
/c/Windows/System32/tar.exe -a -c -f "$build/dist/$name.zip" -C "$build" "$name"
size="$(stat -c %s "$build/dist/$name.zip")"
test "$size" -le 2147483648 || { echo "$name.zip is $size bytes: over the forge's 2048 MB attachment limit"; exit 1; }
done
- name: Publish tag and release commit
run: |
set -euo pipefail
git push --atomic origin "HEAD:refs/heads/${{ github.ref_name }}" "refs/tags/v${{ steps.prepare.outputs.version }}"
- name: Forge release
uses: actions/forgejo-release@v2.13.4
with:
direction: upload
tag: v${{ steps.prepare.outputs.version }}
sha: ${{ steps.prepare.outputs.sha }}
title: Aetheria ${{ steps.prepare.outputs.version }}
token: ${{ secrets.RELEASE_TOKEN }}
release-dir: ../${{ env.BUILD_NAME }}/dist
release-notes-file: ${{ steps.prepare.outputs.notes }}
- name: Show build logs on failure
if: failure()
run: tail -n 40 ../"$BUILD_NAME"/*.log || true
- name: Remove build directory
if: success()
run: rm -rf ../"$BUILD_NAME"

4
.gitattributes vendored
View file

@ -55,10 +55,6 @@
GameData/*.cc filter=lfs diff=lfs merge=lfs -text GameData/*.cc filter=lfs diff=lfs merge=lfs -text
GameData/Mods/**/*.cc filter=lfs diff=lfs merge=lfs -text GameData/Mods/**/*.cc filter=lfs diff=lfs merge=lfs -text
GameData/Mods/**/*.glb filter=lfs diff=lfs merge=lfs -text GameData/Mods/**/*.glb filter=lfs diff=lfs merge=lfs -text
Assets/Content/**/*.springrig filter=lfs diff=lfs merge=lfs -text
"Asset Sources/**/*.glb" filter=lfs diff=lfs merge=lfs -text
tests/fixtures/mods/**/*.cc filter=lfs diff=lfs merge=lfs -text
tests/fixtures/mods/**/*.glb filter=lfs diff=lfs merge=lfs -text
tools/blender/tests/fixtures/*.glb filter=lfs diff=lfs merge=lfs -text tools/blender/tests/fixtures/*.glb filter=lfs diff=lfs merge=lfs -text
*.a filter=lfs diff=lfs merge=lfs -text *.a filter=lfs diff=lfs merge=lfs -text
*AkSoundEngine filter=lfs diff=lfs merge=lfs -text *AkSoundEngine filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored
View file

@ -113,4 +113,3 @@ tests/_scratch_*
# Stryker.NET mutation reports (regenerated per run) # Stryker.NET mutation reports (regenerated per run)
StrykerOutput/ StrykerOutput/
native/aetherlight/target/

View file

@ -26,8 +26,6 @@
<ItemGroup> <ItemGroup>
<!-- Tests record reveals through Entity.RecordReveal, the book's one writer --> <!-- Tests record reveals through Entity.RecordReveal, the book's one writer -->
<InternalsVisibleTo Include="Aetheria.Shared.Tests" /> <InternalsVisibleTo Include="Aetheria.Shared.Tests" />
<!-- The economy loop harness fires weapons and sets targets as the player's handlers do: Weapon.Activate and Entity.SetTarget -->
<InternalsVisibleTo Include="AetherDb" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="$(CultMathRoot)\packages\cultmath\src\CultMath\CultMath.csproj" /> <ProjectReference Include="$(CultMathRoot)\packages\cultmath\src\CultMath\CultMath.csproj" />

View file

@ -1,11 +0,0 @@
[
{"action": "importGltf", "filepath": "leviathan.source.glb"},
{"action": "brokkr_mesh_polish.repair", "object_name": "d10f161a_8820_489f_9754_0aa0ebd51d44"},
{"action": "brokkr_mesh_polish.orient", "object_name": "RootNode", "length": 1.0, "flip_forward": true},
{"action": "brokkr_rig.body", "object_name": "d10f161a_8820_489f_9754_0aa0ebd51d44", "spine_bones": 8, "head": "-y",
"seeds": "jaw=-0.2323,-0.39,0; sac_a=-0.2498,-0.026,0.0519; sac_b=-0.2597,-0.234,0.0364; fin=-0.1845,0.221,0.1037"},
{"action": "brokkr_rig.tendrils", "object_name": "d10f161a_8820_489f_9754_0aa0ebd51d44", "tau": 0.04, "band": 0.04, "dilate": 0.04,
"stiffness": 1.5, "stiffness_tip_ratio": 0.3, "drag": 0.08},
{"action": "brokkr_rig.colliders", "object_name": "d10f161a_8820_489f_9754_0aa0ebd51d44"},
{"action": "exportGltf", "filepath": "leviathan.glb"}
]

BIN
Asset Sources/Fauna/leviathan.source.glb (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

View file

@ -1,19 +0,0 @@
fileFormatVersion: 2
guid: c3c31de84cff91c419b3d8e5f848b0d2
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 467b0d4c17afeb24e8a27b9be8f80f59, type: 3}
Swim:
AmplitudeDegrees: 9
PeriodSeconds: 3.2
PhasePerBone: 0.1
Axis:
x: 1
y: 0
z: 0
MaxTextureSize: 4096

View file

@ -8,10 +8,11 @@ Material:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: Map Gravity Lines m_Name: Map Gravity Lines
m_Shader: {fileID: 4800000, guid: 16ca943590e909145a2f5b7aaeef334e, type: 3} m_Shader: {fileID: 4800000, guid: f5505d3747493e24c91b7cb141fd7b8c, type: 3}
m_Parent: {fileID: 0} m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0 m_ModifiedSerializedProperties: 0
m_ValidKeywords: [] m_ValidKeywords:
- SCREEN_SPACE
m_InvalidKeywords: [] m_InvalidKeywords: []
m_LightmapFlags: 4 m_LightmapFlags: 4
m_EnableInstancingVariants: 0 m_EnableInstancingVariants: 0
@ -48,7 +49,7 @@ Material:
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _MainTex: - _MainTex:
m_Texture: {fileID: 0} m_Texture: {fileID: 8400000, guid: ed3d896ce7cb4a84aa4de8515a60f59c, type: 2}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _MetallicGlossMap: - _MetallicGlossMap:
@ -63,34 +64,55 @@ Material:
m_Texture: {fileID: 0} m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _TintTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: [] m_Ints: []
m_Floats: m_Floats:
- _Angle2Fade: 1.1
- _Angle2Width: 0.5
- _AngleFade: 1.15
- _AngleWidth: 0.05
- _BumpScale: 1 - _BumpScale: 1
- _ClipDistance: 1000
- _ColorMask: 15 - _ColorMask: 15
- _Cutoff: 0.5 - _Cutoff: 0.5
- _DetailGamma: 1 - _DangerSteepness: 1.5
- _DepthRange: 228.79605
- _DetailNormalMapScale: 1 - _DetailNormalMapScale: 1
- _DstBlend: 0 - _DstBlend: 0
- _GlossMapScale: 1 - _GlossMapScale: 1
- _Glossiness: 0.5 - _Glossiness: 0.5
- _GlossyReflections: 1 - _GlossyReflections: 1
- _HeightRange: 50
- _LineFade: 5
- _LineWidth: 0.3
- _Metallic: 0 - _Metallic: 0
- _Mode: 0 - _Mode: 0
- _OcclusionStrength: 1 - _OcclusionStrength: 1
- _Parallax: 0.02 - _Parallax: 0.02
- _Scale: 2.6924083
- _SmoothnessTextureChannel: 0 - _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1 - _SpecularHighlights: 1
- _SrcBlend: 1 - _SrcBlend: 1
- _StartDepth: 2.310401
- _StartHeight: 0
- _Stencil: 0 - _Stencil: 0
- _StencilComp: 8 - _StencilComp: 8
- _StencilOp: 0 - _StencilOp: 0
- _StencilReadMask: 255 - _StencilReadMask: 255
- _StencilWriteMask: 255 - _StencilWriteMask: 255
- _TintExponent: 3
- _TintIntensity: 4.54
- _UVSec: 0 - _UVSec: 0
- _UseScreenSpace: 1
- _UseUIAlphaClip: 0 - _UseUIAlphaClip: 0
- _ZWrite: 1 - _ZWrite: 1
m_Colors: m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1} - _AngleColor: {r: 0.248, g: 0, b: 0.21104322, a: 1}
- _Color: {r: 0, g: 0.4, b: 0.6, a: 1}
- _DangerColor: {r: 2.9960785, g: 0.26666668, b: 0, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: [] m_BuildTextureStacks: []
m_AllowLocking: 1 m_AllowLocking: 1

View file

@ -0,0 +1,111 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Minimap Gravity Lines
m_Shader: {fileID: 4800000, guid: f5505d3747493e24c91b7cb141fd7b8c, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailTex:
m_Texture: {fileID: 8400000, guid: ed3d896ce7cb4a84aa4de8515a60f59c, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 8400000, guid: ed3d896ce7cb4a84aa4de8515a60f59c, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Angle2Fade: 1.1
- _Angle2Width: 0.5
- _AngleFade: 1.15
- _AngleWidth: 0.05
- _BumpScale: 1
- _ClipDistance: 1000
- _ColorMask: 15
- _Cutoff: 0.5
- _DangerSteepness: 1.5
- _DepthRange: 228.79605
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _HeightRange: 50
- _LineFade: 5
- _LineWidth: 0.15
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Scale: 10
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StartDepth: 2.310401
- _StartHeight: 0
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UVSec: 0
- _UseScreenSpace: 0
- _UseUIAlphaClip: 0
- _ZWrite: 1
m_Colors:
- _AngleColor: {r: 1.4980392, g: 0, b: 1.2705883, a: 0.5019608}
- _Color: {r: 0, g: 0.4, b: 0.6, a: 1}
- _DangerColor: {r: 2.670157, g: 0.22367807, b: 0, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View file

@ -1,7 +1,8 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 31ef7108234b45d4f8639d22197cea27 guid: a92fc6d958edb9f46b6e58134f609cc0
ComputeShaderImporter: NativeFormatImporter:
externalObjects: {} externalObjects: {}
mainObjectFileID: 2100000
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:

View file

@ -0,0 +1,90 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Zone
m_Shader: {fileID: 4800000, guid: 0ec0ecdb30ff1614698ae885ebcd873d, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 8400000, guid: ed3d896ce7cb4a84aa4de8515a60f59c, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AngleFade: 5
- _AngleWidth: 100
- _BumpScale: 1
- _ClipDistance: 1000
- _Cutoff: 0.5
- _DangerSteepness: 5
- _DepthRange: 268.43512
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _HeightRange: 50
- _LineFade: 5
- _LineWidth: 100
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _StartDepth: 423.4922
- _StartHeight: 0
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _AngleColor: {r: 0.103773594, g: 0, b: 0.088093735, a: 1}
- _Color: {r: 0, g: 0.4, b: 0.6, a: 1}
- _DangerColor: {r: 2.9803922, g: 0.2509804, b: 0, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 90cead50364300d47bb35194fb52c117
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View file

@ -28,7 +28,6 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: m_Children:
- {fileID: 8249320701965103923} - {fileID: 8249320701965103923}
- {fileID: 7100000000000000014}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -113,443 +112,3 @@ MeshRenderer:
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0} m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &7100000000000000007
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7100000000000000014}
m_Layer: 0
m_Name: Anchor Beacon
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &7100000000000000014
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7100000000000000007}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: -15, z: 110}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 7100000000000000028}
- {fileID: 7100000000000000056}
- {fileID: 7100000000000000084}
- {fileID: 7100000000000000112}
- {fileID: 7100000000000000140}
m_Father: {fileID: 463084220523011477}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &7100000000000000021
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7100000000000000028}
- component: {fileID: 7100000000000000035}
- component: {fileID: 7100000000000000042}
m_Layer: 0
m_Name: Base
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7100000000000000028
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7100000000000000021}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: -4, z: 0}
m_LocalScale: {x: 36, y: 1.5, z: 36}
m_Children: []
m_Father: {fileID: 7100000000000000014}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &7100000000000000035
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7100000000000000021}
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &7100000000000000042
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7100000000000000021}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 0635cf2d392265944afa2b9ce2aab35f, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &7100000000000000049
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7100000000000000056}
- component: {fileID: 7100000000000000063}
- component: {fileID: 7100000000000000070}
m_Layer: 0
m_Name: Spire
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7100000000000000056
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7100000000000000049}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 5, y: 5, z: 5}
m_Children: []
m_Father: {fileID: 7100000000000000014}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &7100000000000000063
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7100000000000000049}
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &7100000000000000070
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7100000000000000049}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 0635cf2d392265944afa2b9ce2aab35f, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &7100000000000000077
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7100000000000000084}
- component: {fileID: 7100000000000000091}
- component: {fileID: 7100000000000000098}
m_Layer: 0
m_Name: Crown
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7100000000000000084
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7100000000000000077}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 8, z: 0}
m_LocalScale: {x: 10, y: 10, z: 10}
m_Children: []
m_Father: {fileID: 7100000000000000014}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &7100000000000000091
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7100000000000000077}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &7100000000000000098
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7100000000000000077}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 0635cf2d392265944afa2b9ce2aab35f, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &7100000000000000105
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7100000000000000112}
- component: {fileID: 7100000000000000119}
- component: {fileID: 7100000000000000126}
m_Layer: 0
m_Name: Arm X
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7100000000000000112
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7100000000000000105}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 4, z: 0}
m_LocalScale: {x: 34, y: 1, z: 3}
m_Children: []
m_Father: {fileID: 7100000000000000014}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &7100000000000000119
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7100000000000000105}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &7100000000000000126
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7100000000000000105}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 0635cf2d392265944afa2b9ce2aab35f, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &7100000000000000133
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7100000000000000140}
- component: {fileID: 7100000000000000147}
- component: {fileID: 7100000000000000154}
m_Layer: 0
m_Name: Arm Z
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7100000000000000140
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7100000000000000133}
m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 4, z: 0}
m_LocalScale: {x: 34, y: 1, z: 3}
m_Children: []
m_Father: {fileID: 7100000000000000014}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &7100000000000000147
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7100000000000000133}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &7100000000000000154
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7100000000000000133}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 0635cf2d392265944afa2b9ce2aab35f, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}

File diff suppressed because it is too large Load diff

View file

@ -36,36 +36,6 @@
"initialStateCheck": false, "initialStateCheck": false,
"priority": 0 "priority": 0
}, },
{
"name": "Zoom",
"type": "Value",
"id": "47ee174a-e711-4dd1-885c-f1cfbdd3681e",
"expectedControlType": "Axis",
"processors": "",
"interactions": "",
"initialStateCheck": true,
"priority": 0
},
{
"name": "Pan",
"type": "Button",
"id": "591eacf3-8726-4393-8a6d-f09410b745a4",
"expectedControlType": "Button",
"processors": "",
"interactions": "",
"initialStateCheck": false,
"priority": 0
},
{
"name": "Point",
"type": "Value",
"id": "f0ec75bc-84a5-4ea4-8e0f-e72f725e6b9d",
"expectedControlType": "Vector2",
"processors": "",
"interactions": "",
"initialStateCheck": true,
"priority": 0
},
{ {
"name": "Target Reticle", "name": "Target Reticle",
"type": "Button", "type": "Button",
@ -383,50 +353,6 @@
"isComposite": false, "isComposite": false,
"isPartOfComposite": false "isPartOfComposite": false
}, },
{
"name": "",
"id": "c2b6406d-0c48-47e1-ad45-9f05fc7b7017",
"path": "<Mouse>/scroll/y",
"interactions": "",
"processors": "",
"groups": "Keyboard&Mouse",
"action": "Zoom",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "e4e6d330-0963-4690-8e53-a1b52c5c6bce",
"path": "<Mouse>/leftButton",
"interactions": "",
"processors": "",
"groups": "Keyboard&Mouse",
"action": "Pan",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "fe708e7d-0f9e-4b03-b983-d60e769e4292",
"path": "<Mouse>/middleButton",
"interactions": "",
"processors": "",
"groups": "Keyboard&Mouse",
"action": "Pan",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "8ad98e17-f4bd-4d92-8300-f562b96f3750",
"path": "<Pointer>/position",
"interactions": "",
"processors": "",
"groups": "Keyboard&Mouse",
"action": "Point",
"isComposite": false,
"isPartOfComposite": false
},
{ {
"name": "", "name": "",
"id": "5211a58c-428b-4ee6-820d-2f67789806d6", "id": "5211a58c-428b-4ee6-820d-2f67789806d6",

View file

@ -0,0 +1,39 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!84 &8400000
RenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: MinimapGravity
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_IsAlphaChannelOptional: 0
serializedVersion: 6
m_Width: 128
m_Height: 128
m_AntiAliasing: 1
m_MipCount: -1
m_DepthStencilFormat: 0
m_ColorFormat: 49
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_UseDynamicScaleExplicit: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_EnableRandomWrite: 0
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 0
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1
m_ShadowSamplingMode: 2

View file

@ -1,8 +1,8 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 7f592f693bf509d4990685519d0cc371 guid: ed3d896ce7cb4a84aa4de8515a60f59c
folderAsset: yes NativeFormatImporter:
DefaultImporter:
externalObjects: {} externalObjects: {}
mainObjectFileID: 0
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:

BIN
Assets/Resources/Settings.asset (Stored with Git LFS)

Binary file not shown.

View file

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 2f7f18edd4c10644ca54e15ecd169c9e guid: 9430390b391327546960fd1b0303f494
folderAsset: yes folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}

BIN
Assets/Resources/Sprites/Flat UI/Nodes/Nodes8.png (Stored with Git LFS) Normal file

Binary file not shown.

File diff suppressed because it is too large Load diff

BIN
Assets/Resources/Sprites/Flat UI/Nodes/Nodes8.psd (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,94 @@
fileFormatVersion: 2
guid: 900623fedce2bb240a11e066dc9708e7
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Resources/Sprites/Flat UI/Nodes/Nodes8BG.png (Stored with Git LFS) Normal file

Binary file not shown.

File diff suppressed because it is too large Load diff

BIN
Assets/Resources/Sprites/Flat UI/pipes.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,96 @@
fileFormatVersion: 2
guid: 2328bcc7bc4840b438d5d2500c562a17
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Resources/Sprites/Flat UI/pipes.psd (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,510 @@
fileFormatVersion: 2
guid: a53955671598f6b4a8b23b245fc38605
TextureImporter:
internalIDToNameTable:
- first:
213: 3624413539235301459
second: pipes_0
- first:
213: 7631404538767374335
second: pipes_1
- first:
213: -4752754735582442470
second: pipes_2
- first:
213: -2120189714087908947
second: pipes_3
- first:
213: -8507936627233245176
second: pipes_4
- first:
213: -2508138221163281763
second: pipes_5
- first:
213: -9264146362022084
second: pipes_6
- first:
213: -4505807909773429587
second: pipes_7
- first:
213: 1571344320749704877
second: pipes_8
- first:
213: -6624953910322571867
second: pipes_9
- first:
213: -7524521870618806978
second: pipes_10
- first:
213: -551590714208027187
second: pipes_11
- first:
213: -2054774350801148439
second: pipes_12
- first:
213: 2949637312520497048
second: pipes_13
- first:
213: 6572578204425805008
second: pipes_14
- first:
213: -2189814545099003515
second: pipes_15
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: pipes_0
rect:
serializedVersion: 2
x: 1
y: 103
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 3588c3539e08c4230800000000000000
internalID: 3624413539235301459
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_1
rect:
serializedVersion: 2
x: 35
y: 103
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: ff7788ebef138e960800000000000000
internalID: 7631404538767374335
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_2
rect:
serializedVersion: 2
x: 69
y: 103
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: a1c8d09cfb2da0eb0800000000000000
internalID: -4752754735582442470
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_3
rect:
serializedVersion: 2
x: 103
y: 103
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: da96a5330b29392e0800000000000000
internalID: -2120189714087908947
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_4
rect:
serializedVersion: 2
x: 1
y: 69
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 8083a3ae6bcbde980800000000000000
internalID: -8507936627233245176
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_5
rect:
serializedVersion: 2
x: 35
y: 69
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: d928bf7939d413dd0800000000000000
internalID: -2508138221163281763
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_6
rect:
serializedVersion: 2
x: 69
y: 69
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: c37c1f6de461fdff0800000000000000
internalID: -9264146362022084
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_7
rect:
serializedVersion: 2
x: 103
y: 69
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: da43fcf24972871c0800000000000000
internalID: -4505807909773429587
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_8
rect:
serializedVersion: 2
x: 1
y: 35
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: da61d1a95598ec510800000000000000
internalID: 1571344320749704877
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_9
rect:
serializedVersion: 2
x: 35
y: 35
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 5a553e1e48f6f04a0800000000000000
internalID: -6624953910322571867
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_10
rect:
serializedVersion: 2
x: 69
y: 35
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: e35bb1da937839790800000000000000
internalID: -7524521870618806978
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_11
rect:
serializedVersion: 2
x: 103
y: 35
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: dcdf93afa2b5858f0800000000000000
internalID: -551590714208027187
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_12
rect:
serializedVersion: 2
x: 1
y: 1
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 9e5e9e65d99fb73e0800000000000000
internalID: -2054774350801148439
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_13
rect:
serializedVersion: 2
x: 35
y: 1
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 897a50502873fe820800000000000000
internalID: 2949637312520497048
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_14
rect:
serializedVersion: 2
x: 69
y: 1
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 0dc564dcd0d763b50800000000000000
internalID: 6572578204425805008
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: pipes_15
rect:
serializedVersion: 2
x: 103
y: 1
width: 32
height: 32
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 589e36bf5473c91e0800000000000000
internalID: -2189814545099003515
vertices: []
indices:
edges: []
weights: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable:
pipes_13: 2949637312520497048
pipes_8: 1571344320749704877
pipes_5: -2508138221163281763
pipes_15: -2189814545099003515
pipes_0: 3624413539235301459
pipes_7: -4505807909773429587
pipes_4: -8507936627233245176
pipes_14: 6572578204425805008
pipes_10: -7524521870618806978
pipes_1: 7631404538767374335
pipes_9: -6624953910322571867
pipes_11: -551590714208027187
pipes_3: -2120189714087908947
pipes_6: -9264146362022084
pipes_2: -4752754735582442470
pipes_12: -2054774350801148439
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 1
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load diff

View file

@ -122,36 +122,6 @@ public partial class @AetheriaInput: IInputActionCollection2, IDisposable
""initialStateCheck"": false, ""initialStateCheck"": false,
""priority"": 0 ""priority"": 0
}, },
{
""name"": ""Zoom"",
""type"": ""Value"",
""id"": ""47ee174a-e711-4dd1-885c-f1cfbdd3681e"",
""expectedControlType"": ""Axis"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": true,
""priority"": 0
},
{
""name"": ""Pan"",
""type"": ""Button"",
""id"": ""591eacf3-8726-4393-8a6d-f09410b745a4"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false,
""priority"": 0
},
{
""name"": ""Point"",
""type"": ""Value"",
""id"": ""f0ec75bc-84a5-4ea4-8e0f-e72f725e6b9d"",
""expectedControlType"": ""Vector2"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": true,
""priority"": 0
},
{ {
""name"": ""Target Reticle"", ""name"": ""Target Reticle"",
""type"": ""Button"", ""type"": ""Button"",
@ -469,50 +439,6 @@ public partial class @AetheriaInput: IInputActionCollection2, IDisposable
""isComposite"": false, ""isComposite"": false,
""isPartOfComposite"": false ""isPartOfComposite"": false
}, },
{
""name"": """",
""id"": ""c2b6406d-0c48-47e1-ad45-9f05fc7b7017"",
""path"": ""<Mouse>/scroll/y"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard&Mouse"",
""action"": ""Zoom"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""e4e6d330-0963-4690-8e53-a1b52c5c6bce"",
""path"": ""<Mouse>/leftButton"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard&Mouse"",
""action"": ""Pan"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""fe708e7d-0f9e-4b03-b983-d60e769e4292"",
""path"": ""<Mouse>/middleButton"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard&Mouse"",
""action"": ""Pan"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""8ad98e17-f4bd-4d92-8300-f562b96f3750"",
""path"": ""<Pointer>/position"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard&Mouse"",
""action"": ""Point"",
""isComposite"": false,
""isPartOfComposite"": false
},
{ {
""name"": """", ""name"": """",
""id"": ""5211a58c-428b-4ee6-820d-2f67789806d6"", ""id"": ""5211a58c-428b-4ee6-820d-2f67789806d6"",
@ -1377,9 +1303,6 @@ public partial class @AetheriaInput: IInputActionCollection2, IDisposable
m_Player_Move = m_Player.FindAction("Move", throwIfNotFound: true); m_Player_Move = m_Player.FindAction("Move", throwIfNotFound: true);
m_Player_Look = m_Player.FindAction("Look", throwIfNotFound: true); m_Player_Look = m_Player.FindAction("Look", throwIfNotFound: true);
m_Player_MinimapZoom = m_Player.FindAction("Minimap Zoom", throwIfNotFound: true); m_Player_MinimapZoom = m_Player.FindAction("Minimap Zoom", throwIfNotFound: true);
m_Player_Zoom = m_Player.FindAction("Zoom", throwIfNotFound: true);
m_Player_Pan = m_Player.FindAction("Pan", throwIfNotFound: true);
m_Player_Point = m_Player.FindAction("Point", throwIfNotFound: true);
m_Player_TargetReticle = m_Player.FindAction("Target Reticle", throwIfNotFound: true); m_Player_TargetReticle = m_Player.FindAction("Target Reticle", throwIfNotFound: true);
m_Player_TargetPrevious = m_Player.FindAction("Target Previous", throwIfNotFound: true); m_Player_TargetPrevious = m_Player.FindAction("Target Previous", throwIfNotFound: true);
m_Player_TargetNext = m_Player.FindAction("Target Next", throwIfNotFound: true); m_Player_TargetNext = m_Player.FindAction("Target Next", throwIfNotFound: true);
@ -1499,9 +1422,6 @@ public partial class @AetheriaInput: IInputActionCollection2, IDisposable
private readonly InputAction m_Player_Move; private readonly InputAction m_Player_Move;
private readonly InputAction m_Player_Look; private readonly InputAction m_Player_Look;
private readonly InputAction m_Player_MinimapZoom; private readonly InputAction m_Player_MinimapZoom;
private readonly InputAction m_Player_Zoom;
private readonly InputAction m_Player_Pan;
private readonly InputAction m_Player_Point;
private readonly InputAction m_Player_TargetReticle; private readonly InputAction m_Player_TargetReticle;
private readonly InputAction m_Player_TargetPrevious; private readonly InputAction m_Player_TargetPrevious;
private readonly InputAction m_Player_TargetNext; private readonly InputAction m_Player_TargetNext;
@ -1541,18 +1461,6 @@ public partial class @AetheriaInput: IInputActionCollection2, IDisposable
/// </summary> /// </summary>
public InputAction @MinimapZoom => m_Wrapper.m_Player_MinimapZoom; public InputAction @MinimapZoom => m_Wrapper.m_Player_MinimapZoom;
/// <summary> /// <summary>
/// Provides access to the underlying input action "Player/Zoom".
/// </summary>
public InputAction @Zoom => m_Wrapper.m_Player_Zoom;
/// <summary>
/// Provides access to the underlying input action "Player/Pan".
/// </summary>
public InputAction @Pan => m_Wrapper.m_Player_Pan;
/// <summary>
/// Provides access to the underlying input action "Player/Point".
/// </summary>
public InputAction @Point => m_Wrapper.m_Player_Point;
/// <summary>
/// Provides access to the underlying input action "Player/TargetReticle". /// Provides access to the underlying input action "Player/TargetReticle".
/// </summary> /// </summary>
public InputAction @TargetReticle => m_Wrapper.m_Player_TargetReticle; public InputAction @TargetReticle => m_Wrapper.m_Player_TargetReticle;
@ -1647,15 +1555,6 @@ public partial class @AetheriaInput: IInputActionCollection2, IDisposable
@MinimapZoom.started += instance.OnMinimapZoom; @MinimapZoom.started += instance.OnMinimapZoom;
@MinimapZoom.performed += instance.OnMinimapZoom; @MinimapZoom.performed += instance.OnMinimapZoom;
@MinimapZoom.canceled += instance.OnMinimapZoom; @MinimapZoom.canceled += instance.OnMinimapZoom;
@Zoom.started += instance.OnZoom;
@Zoom.performed += instance.OnZoom;
@Zoom.canceled += instance.OnZoom;
@Pan.started += instance.OnPan;
@Pan.performed += instance.OnPan;
@Pan.canceled += instance.OnPan;
@Point.started += instance.OnPoint;
@Point.performed += instance.OnPoint;
@Point.canceled += instance.OnPoint;
@TargetReticle.started += instance.OnTargetReticle; @TargetReticle.started += instance.OnTargetReticle;
@TargetReticle.performed += instance.OnTargetReticle; @TargetReticle.performed += instance.OnTargetReticle;
@TargetReticle.canceled += instance.OnTargetReticle; @TargetReticle.canceled += instance.OnTargetReticle;
@ -1721,15 +1620,6 @@ public partial class @AetheriaInput: IInputActionCollection2, IDisposable
@MinimapZoom.started -= instance.OnMinimapZoom; @MinimapZoom.started -= instance.OnMinimapZoom;
@MinimapZoom.performed -= instance.OnMinimapZoom; @MinimapZoom.performed -= instance.OnMinimapZoom;
@MinimapZoom.canceled -= instance.OnMinimapZoom; @MinimapZoom.canceled -= instance.OnMinimapZoom;
@Zoom.started -= instance.OnZoom;
@Zoom.performed -= instance.OnZoom;
@Zoom.canceled -= instance.OnZoom;
@Pan.started -= instance.OnPan;
@Pan.performed -= instance.OnPan;
@Pan.canceled -= instance.OnPan;
@Point.started -= instance.OnPoint;
@Point.performed -= instance.OnPoint;
@Point.canceled -= instance.OnPoint;
@TargetReticle.started -= instance.OnTargetReticle; @TargetReticle.started -= instance.OnTargetReticle;
@TargetReticle.performed -= instance.OnTargetReticle; @TargetReticle.performed -= instance.OnTargetReticle;
@TargetReticle.canceled -= instance.OnTargetReticle; @TargetReticle.canceled -= instance.OnTargetReticle;
@ -2211,27 +2101,6 @@ public partial class @AetheriaInput: IInputActionCollection2, IDisposable
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" /> /// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnMinimapZoom(InputAction.CallbackContext context); void OnMinimapZoom(InputAction.CallbackContext context);
/// <summary> /// <summary>
/// Method invoked when associated input action "Zoom" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnZoom(InputAction.CallbackContext context);
/// <summary>
/// Method invoked when associated input action "Pan" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnPan(InputAction.CallbackContext context);
/// <summary>
/// Method invoked when associated input action "Point" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
void OnPoint(InputAction.CallbackContext context);
/// <summary>
/// Method invoked when associated input action "Target Reticle" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />. /// Method invoked when associated input action "Target Reticle" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
/// </summary> /// </summary>
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" /> /// <seealso cref="UnityEngine.InputSystem.InputAction.started" />

View file

@ -0,0 +1,966 @@
using System;
using UnityEngine;
public static class XKCDColors
{
internal class ColorTranslator
{
public static Color FromHtml(string hexString)
{
return new Color(Convert.ToInt32(hexString.Substring(1, 2), 16) / 255f,
Convert.ToInt32(hexString.Substring(3, 2), 16) / 255f,
Convert.ToInt32(hexString.Substring(5, 2), 16) / 255f);
}
}
public static Color CloudyBlue { get { return ColorTranslator.FromHtml("#acc2d9"); } }
public static Color DarkPastelGreen { get { return ColorTranslator.FromHtml("#56ae57"); } }
public static Color Dust { get { return ColorTranslator.FromHtml("#b2996e"); } }
public static Color ElectricLime { get { return ColorTranslator.FromHtml("#a8ff04"); } }
public static Color FreshGreen { get { return ColorTranslator.FromHtml("#69d84f"); } }
public static Color LightEggplant { get { return ColorTranslator.FromHtml("#894585"); } }
public static Color NastyGreen { get { return ColorTranslator.FromHtml("#70b23f"); } }
public static Color ReallyLightBlue { get { return ColorTranslator.FromHtml("#d4ffff"); } }
public static Color Tea { get { return ColorTranslator.FromHtml("#65ab7c"); } }
public static Color WarmPurple { get { return ColorTranslator.FromHtml("#952e8f"); } }
public static Color YellowishTan { get { return ColorTranslator.FromHtml("#fcfc81"); } }
public static Color Cement { get { return ColorTranslator.FromHtml("#a5a391"); } }
public static Color DarkGrassGreen { get { return ColorTranslator.FromHtml("#388004"); } }
public static Color DustyTeal { get { return ColorTranslator.FromHtml("#4c9085"); } }
public static Color GreyTeal { get { return ColorTranslator.FromHtml("#5e9b8a"); } }
public static Color MacaroniAndCheese { get { return ColorTranslator.FromHtml("#efb435"); } }
public static Color PinkishTan { get { return ColorTranslator.FromHtml("#d99b82"); } }
public static Color Spruce { get { return ColorTranslator.FromHtml("#0a5f38"); } }
public static Color StrongBlue { get { return ColorTranslator.FromHtml("#0c06f7"); } }
public static Color ToxicGreen { get { return ColorTranslator.FromHtml("#61de2a"); } }
public static Color WindowsBlue { get { return ColorTranslator.FromHtml("#3778bf"); } }
public static Color BlueBlue { get { return ColorTranslator.FromHtml("#2242c7"); } }
public static Color BlueWithAHintOfPurple { get { return ColorTranslator.FromHtml("#533cc6"); } }
public static Color Booger { get { return ColorTranslator.FromHtml("#9bb53c"); } }
public static Color BrightSeaGreen { get { return ColorTranslator.FromHtml("#05ffa6"); } }
public static Color DarkGreenBlue { get { return ColorTranslator.FromHtml("#1f6357"); } }
public static Color DeepTurquoise { get { return ColorTranslator.FromHtml("#017374"); } }
public static Color GreenTeal { get { return ColorTranslator.FromHtml("#0cb577"); } }
public static Color StrongPink { get { return ColorTranslator.FromHtml("#ff0789"); } }
public static Color Bland { get { return ColorTranslator.FromHtml("#afa88b"); } }
public static Color DeepAqua { get { return ColorTranslator.FromHtml("#08787f"); } }
public static Color LavenderPink { get { return ColorTranslator.FromHtml("#dd85d7"); } }
public static Color LightMossGreen { get { return ColorTranslator.FromHtml("#a6c875"); } }
public static Color LightSeafoamGreen { get { return ColorTranslator.FromHtml("#a7ffb5"); } }
public static Color OliveYellow { get { return ColorTranslator.FromHtml("#c2b709"); } }
public static Color PigPink { get { return ColorTranslator.FromHtml("#e78ea5"); } }
public static Color DeepLilac { get { return ColorTranslator.FromHtml("#966ebd"); } }
public static Color Desert { get { return ColorTranslator.FromHtml("#ccad60"); } }
public static Color DustyLavender { get { return ColorTranslator.FromHtml("#ac86a8"); } }
public static Color PurpleyGrey { get { return ColorTranslator.FromHtml("#947e94"); } }
public static Color Purply { get { return ColorTranslator.FromHtml("#983fb2"); } }
public static Color CandyPink { get { return ColorTranslator.FromHtml("#ff63e9"); } }
public static Color LightPastelGreen { get { return ColorTranslator.FromHtml("#b2fba5"); } }
public static Color BoringGreen { get { return ColorTranslator.FromHtml("#63b365"); } }
public static Color KiwiGreen { get { return ColorTranslator.FromHtml("#8ee53f"); } }
public static Color LightGreyGreen { get { return ColorTranslator.FromHtml("#b7e1a1"); } }
public static Color OrangePink { get { return ColorTranslator.FromHtml("#ff6f52"); } }
public static Color TeaGreen { get { return ColorTranslator.FromHtml("#bdf8a3"); } }
public static Color VeryLightBrown { get { return ColorTranslator.FromHtml("#d3b683"); } }
public static Color EggShell { get { return ColorTranslator.FromHtml("#fffcc4"); } }
public static Color EggplantPurple { get { return ColorTranslator.FromHtml("#430541"); } }
public static Color PowderPink { get { return ColorTranslator.FromHtml("#ffb2d0"); } }
public static Color ReddishGrey { get { return ColorTranslator.FromHtml("#997570"); } }
public static Color BabyShitBrown { get { return ColorTranslator.FromHtml("#ad900d"); } }
public static Color Liliac { get { return ColorTranslator.FromHtml("#c48efd"); } }
public static Color StormyBlue { get { return ColorTranslator.FromHtml("#507b9c"); } }
public static Color UglyBrown { get { return ColorTranslator.FromHtml("#7d7103"); } }
public static Color Custard { get { return ColorTranslator.FromHtml("#fffd78"); } }
public static Color DarkishPink { get { return ColorTranslator.FromHtml("#da467d"); } }
public static Color DeepBrown { get { return ColorTranslator.FromHtml("#410200"); } }
public static Color GreenishBeige { get { return ColorTranslator.FromHtml("#c9d179"); } }
public static Color Manilla { get { return ColorTranslator.FromHtml("#fffa86"); } }
public static Color OffBlue { get { return ColorTranslator.FromHtml("#5684ae"); } }
public static Color BattleshipGrey { get { return ColorTranslator.FromHtml("#6b7c85"); } }
public static Color BrownyGreen { get { return ColorTranslator.FromHtml("#6f6c0a"); } }
public static Color Bruise { get { return ColorTranslator.FromHtml("#7e4071"); } }
public static Color KelleyGreen { get { return ColorTranslator.FromHtml("#009337"); } }
public static Color SicklyYellow { get { return ColorTranslator.FromHtml("#d0e429"); } }
public static Color SunnyYellow { get { return ColorTranslator.FromHtml("#fff917"); } }
public static Color Azul { get { return ColorTranslator.FromHtml("#1d5dec"); } }
public static Color Darkgreen { get { return ColorTranslator.FromHtml("#054907"); } }
public static Color Green_Yellow { get { return ColorTranslator.FromHtml("#b5ce08"); } }
public static Color Lichen { get { return ColorTranslator.FromHtml("#8fb67b"); } }
public static Color LightLightGreen { get { return ColorTranslator.FromHtml("#c8ffb0"); } }
public static Color PaleGold { get { return ColorTranslator.FromHtml("#fdde6c"); } }
public static Color SunYellow { get { return ColorTranslator.FromHtml("#ffdf22"); } }
public static Color TanGreen { get { return ColorTranslator.FromHtml("#a9be70"); } }
public static Color Burple { get { return ColorTranslator.FromHtml("#6832e3"); } }
public static Color Butterscotch { get { return ColorTranslator.FromHtml("#fdb147"); } }
public static Color Toupe { get { return ColorTranslator.FromHtml("#c7ac7d"); } }
public static Color DarkCream { get { return ColorTranslator.FromHtml("#fff39a"); } }
public static Color IndianRed { get { return ColorTranslator.FromHtml("#850e04"); } }
public static Color LightLavendar { get { return ColorTranslator.FromHtml("#efc0fe"); } }
public static Color PoisonGreen { get { return ColorTranslator.FromHtml("#40fd14"); } }
public static Color BabyPukeGreen { get { return ColorTranslator.FromHtml("#b6c406"); } }
public static Color BrightYellowGreen { get { return ColorTranslator.FromHtml("#9dff00"); } }
public static Color CharcoalGrey { get { return ColorTranslator.FromHtml("#3c4142"); } }
public static Color Squash { get { return ColorTranslator.FromHtml("#f2ab15"); } }
public static Color Cinnamon { get { return ColorTranslator.FromHtml("#ac4f06"); } }
public static Color LightPeaGreen { get { return ColorTranslator.FromHtml("#c4fe82"); } }
public static Color RadioactiveGreen { get { return ColorTranslator.FromHtml("#2cfa1f"); } }
public static Color RawSienna { get { return ColorTranslator.FromHtml("#9a6200"); } }
public static Color BabyPurple { get { return ColorTranslator.FromHtml("#ca9bf7"); } }
public static Color Cocoa { get { return ColorTranslator.FromHtml("#875f42"); } }
public static Color LightRoyalBlue { get { return ColorTranslator.FromHtml("#3a2efe"); } }
public static Color Orangeish { get { return ColorTranslator.FromHtml("#fd8d49"); } }
public static Color RustBrown { get { return ColorTranslator.FromHtml("#8b3103"); } }
public static Color SandBrown { get { return ColorTranslator.FromHtml("#cba560"); } }
public static Color Swamp { get { return ColorTranslator.FromHtml("#698339"); } }
public static Color TealishGreen { get { return ColorTranslator.FromHtml("#0cdc73"); } }
public static Color BurntSiena { get { return ColorTranslator.FromHtml("#b75203"); } }
public static Color Camo { get { return ColorTranslator.FromHtml("#7f8f4e"); } }
public static Color DuskBlue { get { return ColorTranslator.FromHtml("#26538d"); } }
public static Color Fern { get { return ColorTranslator.FromHtml("#63a950"); } }
public static Color OldRose { get { return ColorTranslator.FromHtml("#c87f89"); } }
public static Color PaleLightGreen { get { return ColorTranslator.FromHtml("#b1fc99"); } }
public static Color PeachyPink { get { return ColorTranslator.FromHtml("#ff9a8a"); } }
public static Color RosyPink { get { return ColorTranslator.FromHtml("#f6688e"); } }
public static Color LightBluishGreen { get { return ColorTranslator.FromHtml("#76fda8"); } }
public static Color LightBrightGreen { get { return ColorTranslator.FromHtml("#53fe5c"); } }
public static Color LightNeonGreen { get { return ColorTranslator.FromHtml("#4efd54"); } }
public static Color LightSeafoam { get { return ColorTranslator.FromHtml("#a0febf"); } }
public static Color TiffanyBlue { get { return ColorTranslator.FromHtml("#7bf2da"); } }
public static Color WashedOutGreen { get { return ColorTranslator.FromHtml("#bcf5a6"); } }
public static Color BrownyOrange { get { return ColorTranslator.FromHtml("#ca6b02"); } }
public static Color NiceBlue { get { return ColorTranslator.FromHtml("#107ab0"); } }
public static Color Sapphire { get { return ColorTranslator.FromHtml("#2138ab"); } }
public static Color GreyishTeal { get { return ColorTranslator.FromHtml("#719f91"); } }
public static Color OrangeyYellow { get { return ColorTranslator.FromHtml("#fdb915"); } }
public static Color Parchment { get { return ColorTranslator.FromHtml("#fefcaf"); } }
public static Color Straw { get { return ColorTranslator.FromHtml("#fcf679"); } }
public static Color VeryDarkBrown { get { return ColorTranslator.FromHtml("#1d0200"); } }
public static Color Terracota { get { return ColorTranslator.FromHtml("#cb6843"); } }
public static Color UglyBlue { get { return ColorTranslator.FromHtml("#31668a"); } }
public static Color ClearBlue { get { return ColorTranslator.FromHtml("#247afd"); } }
public static Color Creme { get { return ColorTranslator.FromHtml("#ffffb6"); } }
public static Color FoamGreen { get { return ColorTranslator.FromHtml("#90fda9"); } }
public static Color Grey_Green { get { return ColorTranslator.FromHtml("#86a17d"); } }
public static Color LightGold { get { return ColorTranslator.FromHtml("#fddc5c"); } }
public static Color SeafoamBlue { get { return ColorTranslator.FromHtml("#78d1b6"); } }
public static Color Topaz { get { return ColorTranslator.FromHtml("#13bbaf"); } }
public static Color VioletPink { get { return ColorTranslator.FromHtml("#fb5ffc"); } }
public static Color Wintergreen { get { return ColorTranslator.FromHtml("#20f986"); } }
public static Color YellowTan { get { return ColorTranslator.FromHtml("#ffe36e"); } }
public static Color DarkFuchsia { get { return ColorTranslator.FromHtml("#9d0759"); } }
public static Color IndigoBlue { get { return ColorTranslator.FromHtml("#3a18b1"); } }
public static Color LightYellowishGreen { get { return ColorTranslator.FromHtml("#c2ff89"); } }
public static Color PaleMagenta { get { return ColorTranslator.FromHtml("#d767ad"); } }
public static Color RichPurple { get { return ColorTranslator.FromHtml("#720058"); } }
public static Color SunflowerYellow { get { return ColorTranslator.FromHtml("#ffda03"); } }
public static Color Green_Blue { get { return ColorTranslator.FromHtml("#01c08d"); } }
public static Color Leather { get { return ColorTranslator.FromHtml("#ac7434"); } }
public static Color RacingGreen { get { return ColorTranslator.FromHtml("#014600"); } }
public static Color VividPurple { get { return ColorTranslator.FromHtml("#9900fa"); } }
public static Color DarkRoyalBlue { get { return ColorTranslator.FromHtml("#02066f"); } }
public static Color Hazel { get { return ColorTranslator.FromHtml("#8e7618"); } }
public static Color MutedPink { get { return ColorTranslator.FromHtml("#d1768f"); } }
public static Color BoogerGreen { get { return ColorTranslator.FromHtml("#96b403"); } }
public static Color Canary { get { return ColorTranslator.FromHtml("#fdff63"); } }
public static Color CoolGrey { get { return ColorTranslator.FromHtml("#95a3a6"); } }
public static Color DarkTaupe { get { return ColorTranslator.FromHtml("#7f684e"); } }
public static Color DarkishPurple { get { return ColorTranslator.FromHtml("#751973"); } }
public static Color TrueGreen { get { return ColorTranslator.FromHtml("#089404"); } }
public static Color CoralPink { get { return ColorTranslator.FromHtml("#ff6163"); } }
public static Color DarkSage { get { return ColorTranslator.FromHtml("#598556"); } }
public static Color DarkSlateBlue { get { return ColorTranslator.FromHtml("#214761"); } }
public static Color FlatBlue { get { return ColorTranslator.FromHtml("#3c73a8"); } }
public static Color Mushroom { get { return ColorTranslator.FromHtml("#ba9e88"); } }
public static Color RichBlue { get { return ColorTranslator.FromHtml("#021bf9"); } }
public static Color DirtyPurple { get { return ColorTranslator.FromHtml("#734a65"); } }
public static Color Greenblue { get { return ColorTranslator.FromHtml("#23c48b"); } }
public static Color IckyGreen { get { return ColorTranslator.FromHtml("#8fae22"); } }
public static Color LightKhaki { get { return ColorTranslator.FromHtml("#e6f2a2"); } }
public static Color WarmBlue { get { return ColorTranslator.FromHtml("#4b57db"); } }
public static Color DarkHotPink { get { return ColorTranslator.FromHtml("#d90166"); } }
public static Color DeepSeaBlue { get { return ColorTranslator.FromHtml("#015482"); } }
public static Color Carmine { get { return ColorTranslator.FromHtml("#9d0216"); } }
public static Color DarkYellowGreen { get { return ColorTranslator.FromHtml("#728f02"); } }
public static Color PalePeach { get { return ColorTranslator.FromHtml("#ffe5ad"); } }
public static Color PlumPurple { get { return ColorTranslator.FromHtml("#4e0550"); } }
public static Color GoldenRod { get { return ColorTranslator.FromHtml("#f9bc08"); } }
public static Color NeonRed { get { return ColorTranslator.FromHtml("#ff073a"); } }
public static Color OldPink { get { return ColorTranslator.FromHtml("#c77986"); } }
public static Color VeryPaleBlue { get { return ColorTranslator.FromHtml("#d6fffe"); } }
public static Color BloodOrange { get { return ColorTranslator.FromHtml("#fe4b03"); } }
public static Color Grapefruit { get { return ColorTranslator.FromHtml("#fd5956"); } }
public static Color SandYellow { get { return ColorTranslator.FromHtml("#fce166"); } }
public static Color ClayBrown { get { return ColorTranslator.FromHtml("#b2713d"); } }
public static Color DarkBlueGrey { get { return ColorTranslator.FromHtml("#1f3b4d"); } }
public static Color FlatGreen { get { return ColorTranslator.FromHtml("#699d4c"); } }
public static Color LightGreenBlue { get { return ColorTranslator.FromHtml("#56fca2"); } }
public static Color WarmPink { get { return ColorTranslator.FromHtml("#fb5581"); } }
public static Color DodgerBlue { get { return ColorTranslator.FromHtml("#3e82fc"); } }
public static Color GrossGreen { get { return ColorTranslator.FromHtml("#a0bf16"); } }
public static Color Ice { get { return ColorTranslator.FromHtml("#d6fffa"); } }
public static Color MetallicBlue { get { return ColorTranslator.FromHtml("#4f738e"); } }
public static Color PaleSalmon { get { return ColorTranslator.FromHtml("#ffb19a"); } }
public static Color SapGreen { get { return ColorTranslator.FromHtml("#5c8b15"); } }
public static Color Algae { get { return ColorTranslator.FromHtml("#54ac68"); } }
public static Color BlueyGrey { get { return ColorTranslator.FromHtml("#89a0b0"); } }
public static Color GreenyGrey { get { return ColorTranslator.FromHtml("#7ea07a"); } }
public static Color HighlighterGreen { get { return ColorTranslator.FromHtml("#1bfc06"); } }
public static Color LightLightBlue { get { return ColorTranslator.FromHtml("#cafffb"); } }
public static Color LightMint { get { return ColorTranslator.FromHtml("#b6ffbb"); } }
public static Color RawUmber { get { return ColorTranslator.FromHtml("#a75e09"); } }
public static Color VividBlue { get { return ColorTranslator.FromHtml("#152eff"); } }
public static Color DeepLavender { get { return ColorTranslator.FromHtml("#8d5eb7"); } }
public static Color DullTeal { get { return ColorTranslator.FromHtml("#5f9e8f"); } }
public static Color LightGreenishBlue { get { return ColorTranslator.FromHtml("#63f7b4"); } }
public static Color MudGreen { get { return ColorTranslator.FromHtml("#606602"); } }
public static Color Pinky { get { return ColorTranslator.FromHtml("#fc86aa"); } }
public static Color RedWine { get { return ColorTranslator.FromHtml("#8c0034"); } }
public static Color ShitGreen { get { return ColorTranslator.FromHtml("#758000"); } }
public static Color TanBrown { get { return ColorTranslator.FromHtml("#ab7e4c"); } }
public static Color Darkblue { get { return ColorTranslator.FromHtml("#030764"); } }
public static Color Rosa { get { return ColorTranslator.FromHtml("#fe86a4"); } }
public static Color Lipstick { get { return ColorTranslator.FromHtml("#d5174e"); } }
public static Color PaleMauve { get { return ColorTranslator.FromHtml("#fed0fc"); } }
public static Color Claret { get { return ColorTranslator.FromHtml("#680018"); } }
public static Color Dandelion { get { return ColorTranslator.FromHtml("#fedf08"); } }
public static Color Orangered { get { return ColorTranslator.FromHtml("#fe420f"); } }
public static Color PoopGreen { get { return ColorTranslator.FromHtml("#6f7c00"); } }
public static Color Ruby { get { return ColorTranslator.FromHtml("#ca0147"); } }
public static Color Dark { get { return ColorTranslator.FromHtml("#1b2431"); } }
public static Color GreenishTurquoise { get { return ColorTranslator.FromHtml("#00fbb0"); } }
public static Color PastelRed { get { return ColorTranslator.FromHtml("#db5856"); } }
public static Color PissYellow { get { return ColorTranslator.FromHtml("#ddd618"); } }
public static Color BrightCyan { get { return ColorTranslator.FromHtml("#41fdfe"); } }
public static Color DarkCoral { get { return ColorTranslator.FromHtml("#cf524e"); } }
public static Color AlgaeGreen { get { return ColorTranslator.FromHtml("#21c36f"); } }
public static Color DarkishRed { get { return ColorTranslator.FromHtml("#a90308"); } }
public static Color ReddyBrown { get { return ColorTranslator.FromHtml("#6e1005"); } }
public static Color BlushPink { get { return ColorTranslator.FromHtml("#fe828c"); } }
public static Color CamouflageGreen { get { return ColorTranslator.FromHtml("#4b6113"); } }
public static Color LawnGreen { get { return ColorTranslator.FromHtml("#4da409"); } }
public static Color Putty { get { return ColorTranslator.FromHtml("#beae8a"); } }
public static Color VibrantBlue { get { return ColorTranslator.FromHtml("#0339f8"); } }
public static Color DarkSand { get { return ColorTranslator.FromHtml("#a88f59"); } }
public static Color Purple_Blue { get { return ColorTranslator.FromHtml("#5d21d0"); } }
public static Color Saffron { get { return ColorTranslator.FromHtml("#feb209"); } }
public static Color Twilight { get { return ColorTranslator.FromHtml("#4e518b"); } }
public static Color WarmBrown { get { return ColorTranslator.FromHtml("#964e02"); } }
public static Color Bluegrey { get { return ColorTranslator.FromHtml("#85a3b2"); } }
public static Color BubbleGumPink { get { return ColorTranslator.FromHtml("#ff69af"); } }
public static Color DuckEggBlue { get { return ColorTranslator.FromHtml("#c3fbf4"); } }
public static Color GreenishCyan { get { return ColorTranslator.FromHtml("#2afeb7"); } }
public static Color Petrol { get { return ColorTranslator.FromHtml("#005f6a"); } }
public static Color Royal { get { return ColorTranslator.FromHtml("#0c1793"); } }
public static Color Butter { get { return ColorTranslator.FromHtml("#ffff81"); } }
public static Color DustyOrange { get { return ColorTranslator.FromHtml("#f0833a"); } }
public static Color OffYellow { get { return ColorTranslator.FromHtml("#f1f33f"); } }
public static Color PaleOliveGreen { get { return ColorTranslator.FromHtml("#b1d27b"); } }
public static Color Orangish { get { return ColorTranslator.FromHtml("#fc824a"); } }
public static Color Leaf { get { return ColorTranslator.FromHtml("#71aa34"); } }
public static Color LightBlueGrey { get { return ColorTranslator.FromHtml("#b7c9e2"); } }
public static Color DriedBlood { get { return ColorTranslator.FromHtml("#4b0101"); } }
public static Color LightishPurple { get { return ColorTranslator.FromHtml("#a552e6"); } }
public static Color RustyRed { get { return ColorTranslator.FromHtml("#af2f0d"); } }
public static Color LavenderBlue { get { return ColorTranslator.FromHtml("#8b88f8"); } }
public static Color LightGrassGreen { get { return ColorTranslator.FromHtml("#9af764"); } }
public static Color LightMintGreen { get { return ColorTranslator.FromHtml("#a6fbb2"); } }
public static Color Sunflower { get { return ColorTranslator.FromHtml("#ffc512"); } }
public static Color Velvet { get { return ColorTranslator.FromHtml("#750851"); } }
public static Color BrickOrange { get { return ColorTranslator.FromHtml("#c14a09"); } }
public static Color LightishRed { get { return ColorTranslator.FromHtml("#fe2f4a"); } }
public static Color PureBlue { get { return ColorTranslator.FromHtml("#0203e2"); } }
public static Color TwilightBlue { get { return ColorTranslator.FromHtml("#0a437a"); } }
public static Color VioletRed { get { return ColorTranslator.FromHtml("#a50055"); } }
public static Color YellowyBrown { get { return ColorTranslator.FromHtml("#ae8b0c"); } }
public static Color Carnation { get { return ColorTranslator.FromHtml("#fd798f"); } }
public static Color MuddyYellow { get { return ColorTranslator.FromHtml("#bfac05"); } }
public static Color DarkSeafoamGreen { get { return ColorTranslator.FromHtml("#3eaf76"); } }
public static Color DeepRose { get { return ColorTranslator.FromHtml("#c74767"); } }
public static Color DustyRed { get { return ColorTranslator.FromHtml("#b9484e"); } }
public static Color Grey_Blue { get { return ColorTranslator.FromHtml("#647d8e"); } }
public static Color LemonLime { get { return ColorTranslator.FromHtml("#bffe28"); } }
public static Color Purple_Pink { get { return ColorTranslator.FromHtml("#d725de"); } }
public static Color BrownYellow { get { return ColorTranslator.FromHtml("#b29705"); } }
public static Color PurpleBrown { get { return ColorTranslator.FromHtml("#673a3f"); } }
public static Color Wisteria { get { return ColorTranslator.FromHtml("#a87dc2"); } }
public static Color BananaYellow { get { return ColorTranslator.FromHtml("#fafe4b"); } }
public static Color LipstickRed { get { return ColorTranslator.FromHtml("#c0022f"); } }
public static Color WaterBlue { get { return ColorTranslator.FromHtml("#0e87cc"); } }
public static Color BrownGrey { get { return ColorTranslator.FromHtml("#8d8468"); } }
public static Color VibrantPurple { get { return ColorTranslator.FromHtml("#ad03de"); } }
public static Color BabyGreen { get { return ColorTranslator.FromHtml("#8cff9e"); } }
public static Color BarfGreen { get { return ColorTranslator.FromHtml("#94ac02"); } }
public static Color EggshellBlue { get { return ColorTranslator.FromHtml("#c4fff7"); } }
public static Color SandyYellow { get { return ColorTranslator.FromHtml("#fdee73"); } }
public static Color CoolGreen { get { return ColorTranslator.FromHtml("#33b864"); } }
public static Color Pale { get { return ColorTranslator.FromHtml("#fff9d0"); } }
public static Color Blue_Grey { get { return ColorTranslator.FromHtml("#758da3"); } }
public static Color HotMagenta { get { return ColorTranslator.FromHtml("#f504c9"); } }
public static Color Greyblue { get { return ColorTranslator.FromHtml("#77a1b5"); } }
public static Color Purpley { get { return ColorTranslator.FromHtml("#8756e4"); } }
public static Color BabyShitGreen { get { return ColorTranslator.FromHtml("#889717"); } }
public static Color BrownishPink { get { return ColorTranslator.FromHtml("#c27e79"); } }
public static Color DarkAquamarine { get { return ColorTranslator.FromHtml("#017371"); } }
public static Color Diarrhea { get { return ColorTranslator.FromHtml("#9f8303"); } }
public static Color LightMustard { get { return ColorTranslator.FromHtml("#f7d560"); } }
public static Color PaleSkyBlue { get { return ColorTranslator.FromHtml("#bdf6fe"); } }
public static Color TurtleGreen { get { return ColorTranslator.FromHtml("#75b84f"); } }
public static Color BrightOlive { get { return ColorTranslator.FromHtml("#9cbb04"); } }
public static Color DarkGreyBlue { get { return ColorTranslator.FromHtml("#29465b"); } }
public static Color GreenyBrown { get { return ColorTranslator.FromHtml("#696006"); } }
public static Color LemonGreen { get { return ColorTranslator.FromHtml("#adf802"); } }
public static Color LightPeriwinkle { get { return ColorTranslator.FromHtml("#c1c6fc"); } }
public static Color SeaweedGreen { get { return ColorTranslator.FromHtml("#35ad6b"); } }
public static Color SunshineYellow { get { return ColorTranslator.FromHtml("#fffd37"); } }
public static Color UglyPurple { get { return ColorTranslator.FromHtml("#a442a0"); } }
public static Color MediumPink { get { return ColorTranslator.FromHtml("#f36196"); } }
public static Color PukeBrown { get { return ColorTranslator.FromHtml("#947706"); } }
public static Color VeryLightPink { get { return ColorTranslator.FromHtml("#fff4f2"); } }
public static Color Viridian { get { return ColorTranslator.FromHtml("#1e9167"); } }
public static Color Bile { get { return ColorTranslator.FromHtml("#b5c306"); } }
public static Color FadedYellow { get { return ColorTranslator.FromHtml("#feff7f"); } }
public static Color VeryPaleGreen { get { return ColorTranslator.FromHtml("#cffdbc"); } }
public static Color VibrantGreen { get { return ColorTranslator.FromHtml("#0add08"); } }
public static Color BrightLime { get { return ColorTranslator.FromHtml("#87fd05"); } }
public static Color Spearmint { get { return ColorTranslator.FromHtml("#1ef876"); } }
public static Color LightAquamarine { get { return ColorTranslator.FromHtml("#7bfdc7"); } }
public static Color LightSage { get { return ColorTranslator.FromHtml("#bcecac"); } }
public static Color Yellowgreen { get { return ColorTranslator.FromHtml("#bbf90f"); } }
public static Color BabyPoo { get { return ColorTranslator.FromHtml("#ab9004"); } }
public static Color DarkSeafoam { get { return ColorTranslator.FromHtml("#1fb57a"); } }
public static Color DeepTeal { get { return ColorTranslator.FromHtml("#00555a"); } }
public static Color Heather { get { return ColorTranslator.FromHtml("#a484ac"); } }
public static Color RustOrange { get { return ColorTranslator.FromHtml("#c45508"); } }
public static Color DirtyBlue { get { return ColorTranslator.FromHtml("#3f829d"); } }
public static Color FernGreen { get { return ColorTranslator.FromHtml("#548d44"); } }
public static Color BrightLilac { get { return ColorTranslator.FromHtml("#c95efb"); } }
public static Color WeirdGreen { get { return ColorTranslator.FromHtml("#3ae57f"); } }
public static Color PeacockBlue { get { return ColorTranslator.FromHtml("#016795"); } }
public static Color AvocadoGreen { get { return ColorTranslator.FromHtml("#87a922"); } }
public static Color FadedOrange { get { return ColorTranslator.FromHtml("#f0944d"); } }
public static Color GrapePurple { get { return ColorTranslator.FromHtml("#5d1451"); } }
public static Color HotGreen { get { return ColorTranslator.FromHtml("#25ff29"); } }
public static Color LimeYellow { get { return ColorTranslator.FromHtml("#d0fe1d"); } }
public static Color Mango { get { return ColorTranslator.FromHtml("#ffa62b"); } }
public static Color Shamrock { get { return ColorTranslator.FromHtml("#01b44c"); } }
public static Color Bubblegum { get { return ColorTranslator.FromHtml("#ff6cb5"); } }
public static Color PurplishBrown { get { return ColorTranslator.FromHtml("#6b4247"); } }
public static Color VomitYellow { get { return ColorTranslator.FromHtml("#c7c10c"); } }
public static Color PaleCyan { get { return ColorTranslator.FromHtml("#b7fffa"); } }
public static Color KeyLime { get { return ColorTranslator.FromHtml("#aeff6e"); } }
public static Color TomatoRed { get { return ColorTranslator.FromHtml("#ec2d01"); } }
public static Color Lightgreen { get { return ColorTranslator.FromHtml("#76ff7b"); } }
public static Color Merlot { get { return ColorTranslator.FromHtml("#730039"); } }
public static Color NightBlue { get { return ColorTranslator.FromHtml("#040348"); } }
public static Color PurpleishPink { get { return ColorTranslator.FromHtml("#df4ec8"); } }
public static Color Apple { get { return ColorTranslator.FromHtml("#6ecb3c"); } }
public static Color BabyPoopGreen { get { return ColorTranslator.FromHtml("#8f9805"); } }
public static Color GreenApple { get { return ColorTranslator.FromHtml("#5edc1f"); } }
public static Color Heliotrope { get { return ColorTranslator.FromHtml("#d94ff5"); } }
public static Color Yellow_Green { get { return ColorTranslator.FromHtml("#c8fd3d"); } }
public static Color AlmostBlack { get { return ColorTranslator.FromHtml("#070d0d"); } }
public static Color CoolBlue { get { return ColorTranslator.FromHtml("#4984b8"); } }
public static Color LeafyGreen { get { return ColorTranslator.FromHtml("#51b73b"); } }
public static Color MustardBrown { get { return ColorTranslator.FromHtml("#ac7e04"); } }
public static Color Dusk { get { return ColorTranslator.FromHtml("#4e5481"); } }
public static Color DullBrown { get { return ColorTranslator.FromHtml("#876e4b"); } }
public static Color FrogGreen { get { return ColorTranslator.FromHtml("#58bc08"); } }
public static Color VividGreen { get { return ColorTranslator.FromHtml("#2fef10"); } }
public static Color BrightLightGreen { get { return ColorTranslator.FromHtml("#2dfe54"); } }
public static Color FluroGreen { get { return ColorTranslator.FromHtml("#0aff02"); } }
public static Color Kiwi { get { return ColorTranslator.FromHtml("#9cef43"); } }
public static Color Seaweed { get { return ColorTranslator.FromHtml("#18d17b"); } }
public static Color NavyGreen { get { return ColorTranslator.FromHtml("#35530a"); } }
public static Color UltramarineBlue { get { return ColorTranslator.FromHtml("#1805db"); } }
public static Color Iris { get { return ColorTranslator.FromHtml("#6258c4"); } }
public static Color PastelOrange { get { return ColorTranslator.FromHtml("#ff964f"); } }
public static Color YellowishOrange { get { return ColorTranslator.FromHtml("#ffab0f"); } }
public static Color Perrywinkle { get { return ColorTranslator.FromHtml("#8f8ce7"); } }
public static Color Tealish { get { return ColorTranslator.FromHtml("#24bca8"); } }
public static Color DarkPlum { get { return ColorTranslator.FromHtml("#3f012c"); } }
public static Color Pear { get { return ColorTranslator.FromHtml("#cbf85f"); } }
public static Color PinkishOrange { get { return ColorTranslator.FromHtml("#ff724c"); } }
public static Color MidnightPurple { get { return ColorTranslator.FromHtml("#280137"); } }
public static Color LightUrple { get { return ColorTranslator.FromHtml("#b36ff6"); } }
public static Color DarkMint { get { return ColorTranslator.FromHtml("#48c072"); } }
public static Color GreenishTan { get { return ColorTranslator.FromHtml("#bccb7a"); } }
public static Color LightBurgundy { get { return ColorTranslator.FromHtml("#a8415b"); } }
public static Color TurquoiseBlue { get { return ColorTranslator.FromHtml("#06b1c4"); } }
public static Color UglyPink { get { return ColorTranslator.FromHtml("#cd7584"); } }
public static Color Sandy { get { return ColorTranslator.FromHtml("#f1da7a"); } }
public static Color ElectricPink { get { return ColorTranslator.FromHtml("#ff0490"); } }
public static Color MutedPurple { get { return ColorTranslator.FromHtml("#805b87"); } }
public static Color MidGreen { get { return ColorTranslator.FromHtml("#50a747"); } }
public static Color Greyish { get { return ColorTranslator.FromHtml("#a8a495"); } }
public static Color NeonYellow { get { return ColorTranslator.FromHtml("#cfff04"); } }
public static Color Banana { get { return ColorTranslator.FromHtml("#ffff7e"); } }
public static Color CarnationPink { get { return ColorTranslator.FromHtml("#ff7fa7"); } }
public static Color Tomato { get { return ColorTranslator.FromHtml("#ef4026"); } }
public static Color Sea { get { return ColorTranslator.FromHtml("#3c9992"); } }
public static Color MuddyBrown { get { return ColorTranslator.FromHtml("#886806"); } }
public static Color TurquoiseGreen { get { return ColorTranslator.FromHtml("#04f489"); } }
public static Color Buff { get { return ColorTranslator.FromHtml("#fef69e"); } }
public static Color Fawn { get { return ColorTranslator.FromHtml("#cfaf7b"); } }
public static Color MutedBlue { get { return ColorTranslator.FromHtml("#3b719f"); } }
public static Color PaleRose { get { return ColorTranslator.FromHtml("#fdc1c5"); } }
public static Color DarkMintGreen { get { return ColorTranslator.FromHtml("#20c073"); } }
public static Color Amethyst { get { return ColorTranslator.FromHtml("#9b5fc0"); } }
public static Color Blue_Green { get { return ColorTranslator.FromHtml("#0f9b8e"); } }
public static Color Chestnut { get { return ColorTranslator.FromHtml("#742802"); } }
public static Color SickGreen { get { return ColorTranslator.FromHtml("#9db92c"); } }
public static Color Pea { get { return ColorTranslator.FromHtml("#a4bf20"); } }
public static Color RustyOrange { get { return ColorTranslator.FromHtml("#cd5909"); } }
public static Color Stone { get { return ColorTranslator.FromHtml("#ada587"); } }
public static Color RoseRed { get { return ColorTranslator.FromHtml("#be013c"); } }
public static Color PaleAqua { get { return ColorTranslator.FromHtml("#b8ffeb"); } }
public static Color DeepOrange { get { return ColorTranslator.FromHtml("#dc4d01"); } }
public static Color Earth { get { return ColorTranslator.FromHtml("#a2653e"); } }
public static Color MossyGreen { get { return ColorTranslator.FromHtml("#638b27"); } }
public static Color GrassyGreen { get { return ColorTranslator.FromHtml("#419c03"); } }
public static Color PaleLimeGreen { get { return ColorTranslator.FromHtml("#b1ff65"); } }
public static Color LightGreyBlue { get { return ColorTranslator.FromHtml("#9dbcd4"); } }
public static Color PaleGrey { get { return ColorTranslator.FromHtml("#fdfdfe"); } }
public static Color Asparagus { get { return ColorTranslator.FromHtml("#77ab56"); } }
public static Color Blueberry { get { return ColorTranslator.FromHtml("#464196"); } }
public static Color PurpleRed { get { return ColorTranslator.FromHtml("#990147"); } }
public static Color PaleLime { get { return ColorTranslator.FromHtml("#befd73"); } }
public static Color GreenishTeal { get { return ColorTranslator.FromHtml("#32bf84"); } }
public static Color Caramel { get { return ColorTranslator.FromHtml("#af6f09"); } }
public static Color DeepMagenta { get { return ColorTranslator.FromHtml("#a0025c"); } }
public static Color LightPeach { get { return ColorTranslator.FromHtml("#ffd8b1"); } }
public static Color MilkChocolate { get { return ColorTranslator.FromHtml("#7f4e1e"); } }
public static Color Ocher { get { return ColorTranslator.FromHtml("#bf9b0c"); } }
public static Color OffGreen { get { return ColorTranslator.FromHtml("#6ba353"); } }
public static Color PurplyPink { get { return ColorTranslator.FromHtml("#f075e6"); } }
public static Color Lightblue { get { return ColorTranslator.FromHtml("#7bc8f6"); } }
public static Color DuskyBlue { get { return ColorTranslator.FromHtml("#475f94"); } }
public static Color Golden { get { return ColorTranslator.FromHtml("#f5bf03"); } }
public static Color LightBeige { get { return ColorTranslator.FromHtml("#fffeb6"); } }
public static Color ButterYellow { get { return ColorTranslator.FromHtml("#fffd74"); } }
public static Color DuskyPurple { get { return ColorTranslator.FromHtml("#895b7b"); } }
public static Color FrenchBlue { get { return ColorTranslator.FromHtml("#436bad"); } }
public static Color UglyYellow { get { return ColorTranslator.FromHtml("#d0c101"); } }
public static Color GreenyYellow { get { return ColorTranslator.FromHtml("#c6f808"); } }
public static Color OrangishRed { get { return ColorTranslator.FromHtml("#f43605"); } }
public static Color ShamrockGreen { get { return ColorTranslator.FromHtml("#02c14d"); } }
public static Color OrangishBrown { get { return ColorTranslator.FromHtml("#b25f03"); } }
public static Color TreeGreen { get { return ColorTranslator.FromHtml("#2a7e19"); } }
public static Color DeepViolet { get { return ColorTranslator.FromHtml("#490648"); } }
public static Color Gunmetal { get { return ColorTranslator.FromHtml("#536267"); } }
public static Color Blue_Purple { get { return ColorTranslator.FromHtml("#5a06ef"); } }
public static Color Cherry { get { return ColorTranslator.FromHtml("#cf0234"); } }
public static Color SandyBrown { get { return ColorTranslator.FromHtml("#c4a661"); } }
public static Color WarmGrey { get { return ColorTranslator.FromHtml("#978a84"); } }
public static Color DarkIndigo { get { return ColorTranslator.FromHtml("#1f0954"); } }
public static Color Midnight { get { return ColorTranslator.FromHtml("#03012d"); } }
public static Color BlueyGreen { get { return ColorTranslator.FromHtml("#2bb179"); } }
public static Color GreyPink { get { return ColorTranslator.FromHtml("#c3909b"); } }
public static Color SoftPurple { get { return ColorTranslator.FromHtml("#a66fb5"); } }
public static Color Blood { get { return ColorTranslator.FromHtml("#770001"); } }
public static Color BrownRed { get { return ColorTranslator.FromHtml("#922b05"); } }
public static Color MediumGrey { get { return ColorTranslator.FromHtml("#7d7f7c"); } }
public static Color Berry { get { return ColorTranslator.FromHtml("#990f4b"); } }
public static Color Poo { get { return ColorTranslator.FromHtml("#8f7303"); } }
public static Color PurpleyPink { get { return ColorTranslator.FromHtml("#c83cb9"); } }
public static Color LightSalmon { get { return ColorTranslator.FromHtml("#fea993"); } }
public static Color Snot { get { return ColorTranslator.FromHtml("#acbb0d"); } }
public static Color EasterPurple { get { return ColorTranslator.FromHtml("#c071fe"); } }
public static Color LightYellowGreen { get { return ColorTranslator.FromHtml("#ccfd7f"); } }
public static Color DarkNavyBlue { get { return ColorTranslator.FromHtml("#00022e"); } }
public static Color Drab { get { return ColorTranslator.FromHtml("#828344"); } }
public static Color LightRose { get { return ColorTranslator.FromHtml("#ffc5cb"); } }
public static Color Rouge { get { return ColorTranslator.FromHtml("#ab1239"); } }
public static Color PurplishRed { get { return ColorTranslator.FromHtml("#b0054b"); } }
public static Color SlimeGreen { get { return ColorTranslator.FromHtml("#99cc04"); } }
public static Color BabyPoop { get { return ColorTranslator.FromHtml("#937c00"); } }
public static Color IrishGreen { get { return ColorTranslator.FromHtml("#019529"); } }
public static Color Pink_Purple { get { return ColorTranslator.FromHtml("#ef1de7"); } }
public static Color DarkNavy { get { return ColorTranslator.FromHtml("#000435"); } }
public static Color GreenyBlue { get { return ColorTranslator.FromHtml("#42b395"); } }
public static Color LightPlum { get { return ColorTranslator.FromHtml("#9d5783"); } }
public static Color PinkishGrey { get { return ColorTranslator.FromHtml("#c8aca9"); } }
public static Color DirtyOrange { get { return ColorTranslator.FromHtml("#c87606"); } }
public static Color RustRed { get { return ColorTranslator.FromHtml("#aa2704"); } }
public static Color PaleLilac { get { return ColorTranslator.FromHtml("#e4cbff"); } }
public static Color OrangeyRed { get { return ColorTranslator.FromHtml("#fa4224"); } }
public static Color PrimaryBlue { get { return ColorTranslator.FromHtml("#0804f9"); } }
public static Color KermitGreen { get { return ColorTranslator.FromHtml("#5cb200"); } }
public static Color BrownishPurple { get { return ColorTranslator.FromHtml("#76424e"); } }
public static Color MurkyGreen { get { return ColorTranslator.FromHtml("#6c7a0e"); } }
public static Color Wheat { get { return ColorTranslator.FromHtml("#fbdd7e"); } }
public static Color VeryDarkPurple { get { return ColorTranslator.FromHtml("#2a0134"); } }
public static Color BottleGreen { get { return ColorTranslator.FromHtml("#044a05"); } }
public static Color Watermelon { get { return ColorTranslator.FromHtml("#fd4659"); } }
public static Color DeepSkyBlue { get { return ColorTranslator.FromHtml("#0d75f8"); } }
public static Color FireEngineRed { get { return ColorTranslator.FromHtml("#fe0002"); } }
public static Color YellowOchre { get { return ColorTranslator.FromHtml("#cb9d06"); } }
public static Color PumpkinOrange { get { return ColorTranslator.FromHtml("#fb7d07"); } }
public static Color PaleOlive { get { return ColorTranslator.FromHtml("#b9cc81"); } }
public static Color LightLilac { get { return ColorTranslator.FromHtml("#edc8ff"); } }
public static Color LightishGreen { get { return ColorTranslator.FromHtml("#61e160"); } }
public static Color CarolinaBlue { get { return ColorTranslator.FromHtml("#8ab8fe"); } }
public static Color Mulberry { get { return ColorTranslator.FromHtml("#920a4e"); } }
public static Color ShockingPink { get { return ColorTranslator.FromHtml("#fe02a2"); } }
public static Color Auburn { get { return ColorTranslator.FromHtml("#9a3001"); } }
public static Color BrightLimeGreen { get { return ColorTranslator.FromHtml("#65fe08"); } }
public static Color Celadon { get { return ColorTranslator.FromHtml("#befdb7"); } }
public static Color PinkishBrown { get { return ColorTranslator.FromHtml("#b17261"); } }
public static Color PooBrown { get { return ColorTranslator.FromHtml("#885f01"); } }
public static Color BrightSkyBlue { get { return ColorTranslator.FromHtml("#02ccfe"); } }
public static Color Celery { get { return ColorTranslator.FromHtml("#c1fd95"); } }
public static Color DirtBrown { get { return ColorTranslator.FromHtml("#836539"); } }
public static Color Strawberry { get { return ColorTranslator.FromHtml("#fb2943"); } }
public static Color DarkLime { get { return ColorTranslator.FromHtml("#84b701"); } }
public static Color Copper { get { return ColorTranslator.FromHtml("#b66325"); } }
public static Color MediumBrown { get { return ColorTranslator.FromHtml("#7f5112"); } }
public static Color MutedGreen { get { return ColorTranslator.FromHtml("#5fa052"); } }
public static Color RobinSEgg { get { return ColorTranslator.FromHtml("#6dedfd"); } }
public static Color BrightAqua { get { return ColorTranslator.FromHtml("#0bf9ea"); } }
public static Color BrightLavender { get { return ColorTranslator.FromHtml("#c760ff"); } }
public static Color Ivory { get { return ColorTranslator.FromHtml("#ffffcb"); } }
public static Color VeryLightPurple { get { return ColorTranslator.FromHtml("#f6cefc"); } }
public static Color LightNavy { get { return ColorTranslator.FromHtml("#155084"); } }
public static Color PinkRed { get { return ColorTranslator.FromHtml("#f5054f"); } }
public static Color OliveBrown { get { return ColorTranslator.FromHtml("#645403"); } }
public static Color PoopBrown { get { return ColorTranslator.FromHtml("#7a5901"); } }
public static Color MustardGreen { get { return ColorTranslator.FromHtml("#a8b504"); } }
public static Color OceanGreen { get { return ColorTranslator.FromHtml("#3d9973"); } }
public static Color VeryDarkBlue { get { return ColorTranslator.FromHtml("#000133"); } }
public static Color DustyGreen { get { return ColorTranslator.FromHtml("#76a973"); } }
public static Color LightNavyBlue { get { return ColorTranslator.FromHtml("#2e5a88"); } }
public static Color MintyGreen { get { return ColorTranslator.FromHtml("#0bf77d"); } }
public static Color Adobe { get { return ColorTranslator.FromHtml("#bd6c48"); } }
public static Color Barney { get { return ColorTranslator.FromHtml("#ac1db8"); } }
public static Color JadeGreen { get { return ColorTranslator.FromHtml("#2baf6a"); } }
public static Color BrightLightBlue { get { return ColorTranslator.FromHtml("#26f7fd"); } }
public static Color LightLime { get { return ColorTranslator.FromHtml("#aefd6c"); } }
public static Color DarkKhaki { get { return ColorTranslator.FromHtml("#9b8f55"); } }
public static Color OrangeYellow { get { return ColorTranslator.FromHtml("#ffad01"); } }
public static Color Ocre { get { return ColorTranslator.FromHtml("#c69c04"); } }
public static Color Maize { get { return ColorTranslator.FromHtml("#f4d054"); } }
public static Color FadedPink { get { return ColorTranslator.FromHtml("#de9dac"); } }
public static Color BritishRacingGreen { get { return ColorTranslator.FromHtml("#05480d"); } }
public static Color Sandstone { get { return ColorTranslator.FromHtml("#c9ae74"); } }
public static Color MudBrown { get { return ColorTranslator.FromHtml("#60460f"); } }
public static Color LightSeaGreen { get { return ColorTranslator.FromHtml("#98f6b0"); } }
public static Color RobinEggBlue { get { return ColorTranslator.FromHtml("#8af1fe"); } }
public static Color AquaMarine { get { return ColorTranslator.FromHtml("#2ee8bb"); } }
public static Color DarkSeaGreen { get { return ColorTranslator.FromHtml("#11875d"); } }
public static Color SoftPink { get { return ColorTranslator.FromHtml("#fdb0c0"); } }
public static Color OrangeyBrown { get { return ColorTranslator.FromHtml("#b16002"); } }
public static Color CherryRed { get { return ColorTranslator.FromHtml("#f7022a"); } }
public static Color BurntYellow { get { return ColorTranslator.FromHtml("#d5ab09"); } }
public static Color BrownishGrey { get { return ColorTranslator.FromHtml("#86775f"); } }
public static Color Camel { get { return ColorTranslator.FromHtml("#c69f59"); } }
public static Color PurplishGrey { get { return ColorTranslator.FromHtml("#7a687f"); } }
public static Color Marine { get { return ColorTranslator.FromHtml("#042e60"); } }
public static Color GreyishPink { get { return ColorTranslator.FromHtml("#c88d94"); } }
public static Color PaleTurquoise { get { return ColorTranslator.FromHtml("#a5fbd5"); } }
public static Color PastelYellow { get { return ColorTranslator.FromHtml("#fffe71"); } }
public static Color BlueyPurple { get { return ColorTranslator.FromHtml("#6241c7"); } }
public static Color CanaryYellow { get { return ColorTranslator.FromHtml("#fffe40"); } }
public static Color FadedRed { get { return ColorTranslator.FromHtml("#d3494e"); } }
public static Color Sepia { get { return ColorTranslator.FromHtml("#985e2b"); } }
public static Color Coffee { get { return ColorTranslator.FromHtml("#a6814c"); } }
public static Color BrightMagenta { get { return ColorTranslator.FromHtml("#ff08e8"); } }
public static Color Mocha { get { return ColorTranslator.FromHtml("#9d7651"); } }
public static Color Ecru { get { return ColorTranslator.FromHtml("#feffca"); } }
public static Color Purpleish { get { return ColorTranslator.FromHtml("#98568d"); } }
public static Color Cranberry { get { return ColorTranslator.FromHtml("#9e003a"); } }
public static Color DarkishGreen { get { return ColorTranslator.FromHtml("#287c37"); } }
public static Color BrownOrange { get { return ColorTranslator.FromHtml("#b96902"); } }
public static Color DuskyRose { get { return ColorTranslator.FromHtml("#ba6873"); } }
public static Color Melon { get { return ColorTranslator.FromHtml("#ff7855"); } }
public static Color SicklyGreen { get { return ColorTranslator.FromHtml("#94b21c"); } }
public static Color Silver { get { return ColorTranslator.FromHtml("#c5c9c7"); } }
public static Color PurplyBlue { get { return ColorTranslator.FromHtml("#661aee"); } }
public static Color PurpleishBlue { get { return ColorTranslator.FromHtml("#6140ef"); } }
public static Color HospitalGreen { get { return ColorTranslator.FromHtml("#9be5aa"); } }
public static Color ShitBrown { get { return ColorTranslator.FromHtml("#7b5804"); } }
public static Color MidBlue { get { return ColorTranslator.FromHtml("#276ab3"); } }
public static Color Amber { get { return ColorTranslator.FromHtml("#feb308"); } }
public static Color EasterGreen { get { return ColorTranslator.FromHtml("#8cfd7e"); } }
public static Color SoftBlue { get { return ColorTranslator.FromHtml("#6488ea"); } }
public static Color CeruleanBlue { get { return ColorTranslator.FromHtml("#056eee"); } }
public static Color GoldenBrown { get { return ColorTranslator.FromHtml("#b27a01"); } }
public static Color BrightTurquoise { get { return ColorTranslator.FromHtml("#0ffef9"); } }
public static Color RedPink { get { return ColorTranslator.FromHtml("#fa2a55"); } }
public static Color RedPurple { get { return ColorTranslator.FromHtml("#820747"); } }
public static Color GreyishBrown { get { return ColorTranslator.FromHtml("#7a6a4f"); } }
public static Color Vermillion { get { return ColorTranslator.FromHtml("#f4320c"); } }
public static Color Russet { get { return ColorTranslator.FromHtml("#a13905"); } }
public static Color SteelGrey { get { return ColorTranslator.FromHtml("#6f828a"); } }
public static Color LighterPurple { get { return ColorTranslator.FromHtml("#a55af4"); } }
public static Color BrightViolet { get { return ColorTranslator.FromHtml("#ad0afd"); } }
public static Color PrussianBlue { get { return ColorTranslator.FromHtml("#004577"); } }
public static Color SlateGreen { get { return ColorTranslator.FromHtml("#658d6d"); } }
public static Color DirtyPink { get { return ColorTranslator.FromHtml("#ca7b80"); } }
public static Color DarkBlueGreen { get { return ColorTranslator.FromHtml("#005249"); } }
public static Color Pine { get { return ColorTranslator.FromHtml("#2b5d34"); } }
public static Color YellowyGreen { get { return ColorTranslator.FromHtml("#bff128"); } }
public static Color DarkGold { get { return ColorTranslator.FromHtml("#b59410"); } }
public static Color Bluish { get { return ColorTranslator.FromHtml("#2976bb"); } }
public static Color DarkishBlue { get { return ColorTranslator.FromHtml("#014182"); } }
public static Color DullRed { get { return ColorTranslator.FromHtml("#bb3f3f"); } }
public static Color PinkyRed { get { return ColorTranslator.FromHtml("#fc2647"); } }
public static Color Bronze { get { return ColorTranslator.FromHtml("#a87900"); } }
public static Color PaleTeal { get { return ColorTranslator.FromHtml("#82cbb2"); } }
public static Color MilitaryGreen { get { return ColorTranslator.FromHtml("#667c3e"); } }
public static Color BarbiePink { get { return ColorTranslator.FromHtml("#fe46a5"); } }
public static Color BubblegumPink { get { return ColorTranslator.FromHtml("#fe83cc"); } }
public static Color PeaSoupGreen { get { return ColorTranslator.FromHtml("#94a617"); } }
public static Color DarkMustard { get { return ColorTranslator.FromHtml("#a88905"); } }
public static Color Shit { get { return ColorTranslator.FromHtml("#7f5f00"); } }
public static Color MediumPurple { get { return ColorTranslator.FromHtml("#9e43a2"); } }
public static Color VeryDarkGreen { get { return ColorTranslator.FromHtml("#062e03"); } }
public static Color Dirt { get { return ColorTranslator.FromHtml("#8a6e45"); } }
public static Color DuskyPink { get { return ColorTranslator.FromHtml("#cc7a8b"); } }
public static Color RedViolet { get { return ColorTranslator.FromHtml("#9e0168"); } }
public static Color LemonYellow { get { return ColorTranslator.FromHtml("#fdff38"); } }
public static Color Pistachio { get { return ColorTranslator.FromHtml("#c0fa8b"); } }
public static Color DullYellow { get { return ColorTranslator.FromHtml("#eedc5b"); } }
public static Color DarkLimeGreen { get { return ColorTranslator.FromHtml("#7ebd01"); } }
public static Color DenimBlue { get { return ColorTranslator.FromHtml("#3b5b92"); } }
public static Color TealBlue { get { return ColorTranslator.FromHtml("#01889f"); } }
public static Color LightishBlue { get { return ColorTranslator.FromHtml("#3d7afd"); } }
public static Color PurpleyBlue { get { return ColorTranslator.FromHtml("#5f34e7"); } }
public static Color LightIndigo { get { return ColorTranslator.FromHtml("#6d5acf"); } }
public static Color SwampGreen { get { return ColorTranslator.FromHtml("#748500"); } }
public static Color BrownGreen { get { return ColorTranslator.FromHtml("#706c11"); } }
public static Color DarkMaroon { get { return ColorTranslator.FromHtml("#3c0008"); } }
public static Color HotPurple { get { return ColorTranslator.FromHtml("#cb00f5"); } }
public static Color DarkForestGreen { get { return ColorTranslator.FromHtml("#002d04"); } }
public static Color FadedBlue { get { return ColorTranslator.FromHtml("#658cbb"); } }
public static Color DrabGreen { get { return ColorTranslator.FromHtml("#749551"); } }
public static Color LightLimeGreen { get { return ColorTranslator.FromHtml("#b9ff66"); } }
public static Color SnotGreen { get { return ColorTranslator.FromHtml("#9dc100"); } }
public static Color Yellowish { get { return ColorTranslator.FromHtml("#faee66"); } }
public static Color LightBlueGreen { get { return ColorTranslator.FromHtml("#7efbb3"); } }
public static Color Bordeaux { get { return ColorTranslator.FromHtml("#7b002c"); } }
public static Color LightMauve { get { return ColorTranslator.FromHtml("#c292a1"); } }
public static Color Ocean { get { return ColorTranslator.FromHtml("#017b92"); } }
public static Color Marigold { get { return ColorTranslator.FromHtml("#fcc006"); } }
public static Color MuddyGreen { get { return ColorTranslator.FromHtml("#657432"); } }
public static Color DullOrange { get { return ColorTranslator.FromHtml("#d8863b"); } }
public static Color Steel { get { return ColorTranslator.FromHtml("#738595"); } }
public static Color ElectricPurple { get { return ColorTranslator.FromHtml("#aa23ff"); } }
public static Color FluorescentGreen { get { return ColorTranslator.FromHtml("#08ff08"); } }
public static Color YellowishBrown { get { return ColorTranslator.FromHtml("#9b7a01"); } }
public static Color Blush { get { return ColorTranslator.FromHtml("#f29e8e"); } }
public static Color SoftGreen { get { return ColorTranslator.FromHtml("#6fc276"); } }
public static Color BrightOrange { get { return ColorTranslator.FromHtml("#ff5b00"); } }
public static Color Lemon { get { return ColorTranslator.FromHtml("#fdff52"); } }
public static Color PurpleGrey { get { return ColorTranslator.FromHtml("#866f85"); } }
public static Color AcidGreen { get { return ColorTranslator.FromHtml("#8ffe09"); } }
public static Color PaleLavender { get { return ColorTranslator.FromHtml("#eecffe"); } }
public static Color VioletBlue { get { return ColorTranslator.FromHtml("#510ac9"); } }
public static Color LightForestGreen { get { return ColorTranslator.FromHtml("#4f9153"); } }
public static Color BurntRed { get { return ColorTranslator.FromHtml("#9f2305"); } }
public static Color KhakiGreen { get { return ColorTranslator.FromHtml("#728639"); } }
public static Color Cerise { get { return ColorTranslator.FromHtml("#de0c62"); } }
public static Color FadedPurple { get { return ColorTranslator.FromHtml("#916e99"); } }
public static Color Apricot { get { return ColorTranslator.FromHtml("#ffb16d"); } }
public static Color DarkOliveGreen { get { return ColorTranslator.FromHtml("#3c4d03"); } }
public static Color GreyBrown { get { return ColorTranslator.FromHtml("#7f7053"); } }
public static Color GreenGrey { get { return ColorTranslator.FromHtml("#77926f"); } }
public static Color TrueBlue { get { return ColorTranslator.FromHtml("#010fcc"); } }
public static Color PaleViolet { get { return ColorTranslator.FromHtml("#ceaefa"); } }
public static Color PeriwinkleBlue { get { return ColorTranslator.FromHtml("#8f99fb"); } }
public static Color LightSkyBlue { get { return ColorTranslator.FromHtml("#c6fcff"); } }
public static Color Blurple { get { return ColorTranslator.FromHtml("#5539cc"); } }
public static Color GreenBrown { get { return ColorTranslator.FromHtml("#544e03"); } }
public static Color Bluegreen { get { return ColorTranslator.FromHtml("#017a79"); } }
public static Color BrightTeal { get { return ColorTranslator.FromHtml("#01f9c6"); } }
public static Color BrownishYellow { get { return ColorTranslator.FromHtml("#c9b003"); } }
public static Color PeaSoup { get { return ColorTranslator.FromHtml("#929901"); } }
public static Color Forest { get { return ColorTranslator.FromHtml("#0b5509"); } }
public static Color BarneyPurple { get { return ColorTranslator.FromHtml("#a00498"); } }
public static Color Ultramarine { get { return ColorTranslator.FromHtml("#2000b1"); } }
public static Color Purplish { get { return ColorTranslator.FromHtml("#94568c"); } }
public static Color PukeYellow { get { return ColorTranslator.FromHtml("#c2be0e"); } }
public static Color BluishGrey { get { return ColorTranslator.FromHtml("#748b97"); } }
public static Color DarkPeriwinkle { get { return ColorTranslator.FromHtml("#665fd1"); } }
public static Color DarkLilac { get { return ColorTranslator.FromHtml("#9c6da5"); } }
public static Color Reddish { get { return ColorTranslator.FromHtml("#c44240"); } }
public static Color LightMaroon { get { return ColorTranslator.FromHtml("#a24857"); } }
public static Color DustyPurple { get { return ColorTranslator.FromHtml("#825f87"); } }
public static Color TerraCotta { get { return ColorTranslator.FromHtml("#c9643b"); } }
public static Color Avocado { get { return ColorTranslator.FromHtml("#90b134"); } }
public static Color MarineBlue { get { return ColorTranslator.FromHtml("#01386a"); } }
public static Color TealGreen { get { return ColorTranslator.FromHtml("#25a36f"); } }
public static Color SlateGrey { get { return ColorTranslator.FromHtml("#59656d"); } }
public static Color LighterGreen { get { return ColorTranslator.FromHtml("#75fd63"); } }
public static Color ElectricGreen { get { return ColorTranslator.FromHtml("#21fc0d"); } }
public static Color DustyBlue { get { return ColorTranslator.FromHtml("#5a86ad"); } }
public static Color GoldenYellow { get { return ColorTranslator.FromHtml("#fec615"); } }
public static Color BrightYellow { get { return ColorTranslator.FromHtml("#fffd01"); } }
public static Color LightLavender { get { return ColorTranslator.FromHtml("#dfc5fe"); } }
public static Color Umber { get { return ColorTranslator.FromHtml("#b26400"); } }
public static Color Poop { get { return ColorTranslator.FromHtml("#7f5e00"); } }
public static Color DarkPeach { get { return ColorTranslator.FromHtml("#de7e5d"); } }
public static Color JungleGreen { get { return ColorTranslator.FromHtml("#048243"); } }
public static Color Eggshell { get { return ColorTranslator.FromHtml("#ffffd4"); } }
public static Color Denim { get { return ColorTranslator.FromHtml("#3b638c"); } }
public static Color YellowBrown { get { return ColorTranslator.FromHtml("#b79400"); } }
public static Color DullPurple { get { return ColorTranslator.FromHtml("#84597e"); } }
public static Color ChocolateBrown { get { return ColorTranslator.FromHtml("#411900"); } }
public static Color WineRed { get { return ColorTranslator.FromHtml("#7b0323"); } }
public static Color NeonBlue { get { return ColorTranslator.FromHtml("#04d9ff"); } }
public static Color DirtyGreen { get { return ColorTranslator.FromHtml("#667e2c"); } }
public static Color LightTan { get { return ColorTranslator.FromHtml("#fbeeac"); } }
public static Color IceBlue { get { return ColorTranslator.FromHtml("#d7fffe"); } }
public static Color CadetBlue { get { return ColorTranslator.FromHtml("#4e7496"); } }
public static Color DarkMauve { get { return ColorTranslator.FromHtml("#874c62"); } }
public static Color VeryLightBlue { get { return ColorTranslator.FromHtml("#d5ffff"); } }
public static Color GreyPurple { get { return ColorTranslator.FromHtml("#826d8c"); } }
public static Color PastelPink { get { return ColorTranslator.FromHtml("#ffbacd"); } }
public static Color VeryLightGreen { get { return ColorTranslator.FromHtml("#d1ffbd"); } }
public static Color DarkSkyBlue { get { return ColorTranslator.FromHtml("#448ee4"); } }
public static Color Evergreen { get { return ColorTranslator.FromHtml("#05472a"); } }
public static Color DullPink { get { return ColorTranslator.FromHtml("#d5869d"); } }
public static Color Aubergine { get { return ColorTranslator.FromHtml("#3d0734"); } }
public static Color Mahogany { get { return ColorTranslator.FromHtml("#4a0100"); } }
public static Color ReddishOrange { get { return ColorTranslator.FromHtml("#f8481c"); } }
public static Color DeepGreen { get { return ColorTranslator.FromHtml("#02590f"); } }
public static Color VomitGreen { get { return ColorTranslator.FromHtml("#89a203"); } }
public static Color PurplePink { get { return ColorTranslator.FromHtml("#e03fd8"); } }
public static Color DustyPink { get { return ColorTranslator.FromHtml("#d58a94"); } }
public static Color FadedGreen { get { return ColorTranslator.FromHtml("#7bb274"); } }
public static Color CamoGreen { get { return ColorTranslator.FromHtml("#526525"); } }
public static Color PinkyPurple { get { return ColorTranslator.FromHtml("#c94cbe"); } }
public static Color PinkPurple { get { return ColorTranslator.FromHtml("#db4bda"); } }
public static Color BrownishRed { get { return ColorTranslator.FromHtml("#9e3623"); } }
public static Color DarkRose { get { return ColorTranslator.FromHtml("#b5485d"); } }
public static Color Mud { get { return ColorTranslator.FromHtml("#735c12"); } }
public static Color Brownish { get { return ColorTranslator.FromHtml("#9c6d57"); } }
public static Color EmeraldGreen { get { return ColorTranslator.FromHtml("#028f1e"); } }
public static Color PaleBrown { get { return ColorTranslator.FromHtml("#b1916e"); } }
public static Color DullBlue { get { return ColorTranslator.FromHtml("#49759c"); } }
public static Color BurntUmber { get { return ColorTranslator.FromHtml("#a0450e"); } }
public static Color MediumGreen { get { return ColorTranslator.FromHtml("#39ad48"); } }
public static Color Clay { get { return ColorTranslator.FromHtml("#b66a50"); } }
public static Color LightAqua { get { return ColorTranslator.FromHtml("#8cffdb"); } }
public static Color LightOliveGreen { get { return ColorTranslator.FromHtml("#a4be5c"); } }
public static Color BrownishOrange { get { return ColorTranslator.FromHtml("#cb7723"); } }
public static Color DarkAqua { get { return ColorTranslator.FromHtml("#05696b"); } }
public static Color PurplishPink { get { return ColorTranslator.FromHtml("#ce5dae"); } }
public static Color DarkSalmon { get { return ColorTranslator.FromHtml("#c85a53"); } }
public static Color GreenishGrey { get { return ColorTranslator.FromHtml("#96ae8d"); } }
public static Color Jade { get { return ColorTranslator.FromHtml("#1fa774"); } }
public static Color UglyGreen { get { return ColorTranslator.FromHtml("#7a9703"); } }
public static Color DarkBeige { get { return ColorTranslator.FromHtml("#ac9362"); } }
public static Color Emerald { get { return ColorTranslator.FromHtml("#01a049"); } }
public static Color PaleRed { get { return ColorTranslator.FromHtml("#d9544d"); } }
public static Color LightMagenta { get { return ColorTranslator.FromHtml("#fa5ff7"); } }
public static Color Sky { get { return ColorTranslator.FromHtml("#82cafc"); } }
public static Color LightCyan { get { return ColorTranslator.FromHtml("#acfffc"); } }
public static Color YellowOrange { get { return ColorTranslator.FromHtml("#fcb001"); } }
public static Color ReddishPurple { get { return ColorTranslator.FromHtml("#910951"); } }
public static Color ReddishPink { get { return ColorTranslator.FromHtml("#fe2c54"); } }
public static Color Orchid { get { return ColorTranslator.FromHtml("#c875c4"); } }
public static Color DirtyYellow { get { return ColorTranslator.FromHtml("#cdc50a"); } }
public static Color OrangeRed { get { return ColorTranslator.FromHtml("#fd411e"); } }
public static Color DeepRed { get { return ColorTranslator.FromHtml("#9a0200"); } }
public static Color OrangeBrown { get { return ColorTranslator.FromHtml("#be6400"); } }
public static Color CobaltBlue { get { return ColorTranslator.FromHtml("#030aa7"); } }
public static Color NeonPink { get { return ColorTranslator.FromHtml("#fe019a"); } }
public static Color RosePink { get { return ColorTranslator.FromHtml("#f7879a"); } }
public static Color GreyishPurple { get { return ColorTranslator.FromHtml("#887191"); } }
public static Color Raspberry { get { return ColorTranslator.FromHtml("#b00149"); } }
public static Color AquaGreen { get { return ColorTranslator.FromHtml("#12e193"); } }
public static Color SalmonPink { get { return ColorTranslator.FromHtml("#fe7b7c"); } }
public static Color Tangerine { get { return ColorTranslator.FromHtml("#ff9408"); } }
public static Color BrownishGreen { get { return ColorTranslator.FromHtml("#6a6e09"); } }
public static Color RedBrown { get { return ColorTranslator.FromHtml("#8b2e16"); } }
public static Color GreenishBrown { get { return ColorTranslator.FromHtml("#696112"); } }
public static Color Pumpkin { get { return ColorTranslator.FromHtml("#e17701"); } }
public static Color PineGreen { get { return ColorTranslator.FromHtml("#0a481e"); } }
public static Color Charcoal { get { return ColorTranslator.FromHtml("#343837"); } }
public static Color BabyPink { get { return ColorTranslator.FromHtml("#ffb7ce"); } }
public static Color Cornflower { get { return ColorTranslator.FromHtml("#6a79f7"); } }
public static Color BlueViolet { get { return ColorTranslator.FromHtml("#5d06e9"); } }
public static Color Chocolate { get { return ColorTranslator.FromHtml("#3d1c02"); } }
public static Color GreyishGreen { get { return ColorTranslator.FromHtml("#82a67d"); } }
public static Color Scarlet { get { return ColorTranslator.FromHtml("#be0119"); } }
public static Color GreenYellow { get { return ColorTranslator.FromHtml("#c9ff27"); } }
public static Color DarkOlive { get { return ColorTranslator.FromHtml("#373e02"); } }
public static Color Sienna { get { return ColorTranslator.FromHtml("#a9561e"); } }
public static Color PastelPurple { get { return ColorTranslator.FromHtml("#caa0ff"); } }
public static Color Terracotta { get { return ColorTranslator.FromHtml("#ca6641"); } }
public static Color AquaBlue { get { return ColorTranslator.FromHtml("#02d8e9"); } }
public static Color SageGreen { get { return ColorTranslator.FromHtml("#88b378"); } }
public static Color BloodRed { get { return ColorTranslator.FromHtml("#980002"); } }
public static Color DeepPink { get { return ColorTranslator.FromHtml("#cb0162"); } }
public static Color Grass { get { return ColorTranslator.FromHtml("#5cac2d"); } }
public static Color Moss { get { return ColorTranslator.FromHtml("#769958"); } }
public static Color PastelBlue { get { return ColorTranslator.FromHtml("#a2bffe"); } }
public static Color BluishGreen { get { return ColorTranslator.FromHtml("#10a674"); } }
public static Color GreenBlue { get { return ColorTranslator.FromHtml("#06b48b"); } }
public static Color DarkTan { get { return ColorTranslator.FromHtml("#af884a"); } }
public static Color GreenishBlue { get { return ColorTranslator.FromHtml("#0b8b87"); } }
public static Color PaleOrange { get { return ColorTranslator.FromHtml("#ffa756"); } }
public static Color Vomit { get { return ColorTranslator.FromHtml("#a2a415"); } }
public static Color ForrestGreen { get { return ColorTranslator.FromHtml("#154406"); } }
public static Color DarkLavender { get { return ColorTranslator.FromHtml("#856798"); } }
public static Color DarkViolet { get { return ColorTranslator.FromHtml("#34013f"); } }
public static Color PurpleBlue { get { return ColorTranslator.FromHtml("#632de9"); } }
public static Color DarkCyan { get { return ColorTranslator.FromHtml("#0a888a"); } }
public static Color OliveDrab { get { return ColorTranslator.FromHtml("#6f7632"); } }
public static Color Pinkish { get { return ColorTranslator.FromHtml("#d46a7e"); } }
public static Color Cobalt { get { return ColorTranslator.FromHtml("#1e488f"); } }
public static Color NeonPurple { get { return ColorTranslator.FromHtml("#bc13fe"); } }
public static Color LightTurquoise { get { return ColorTranslator.FromHtml("#7ef4cc"); } }
public static Color AppleGreen { get { return ColorTranslator.FromHtml("#76cd26"); } }
public static Color DullGreen { get { return ColorTranslator.FromHtml("#74a662"); } }
public static Color Wine { get { return ColorTranslator.FromHtml("#80013f"); } }
public static Color PowderBlue { get { return ColorTranslator.FromHtml("#b1d1fc"); } }
public static Color OffWhite { get { return ColorTranslator.FromHtml("#ffffe4"); } }
public static Color ElectricBlue { get { return ColorTranslator.FromHtml("#0652ff"); } }
public static Color DarkTurquoise { get { return ColorTranslator.FromHtml("#045c5a"); } }
public static Color BluePurple { get { return ColorTranslator.FromHtml("#5729ce"); } }
public static Color Azure { get { return ColorTranslator.FromHtml("#069af3"); } }
public static Color BrightRed { get { return ColorTranslator.FromHtml("#ff000d"); } }
public static Color PinkishRed { get { return ColorTranslator.FromHtml("#f10c45"); } }
public static Color CornflowerBlue { get { return ColorTranslator.FromHtml("#5170d7"); } }
public static Color LightOlive { get { return ColorTranslator.FromHtml("#acbf69"); } }
public static Color Grape { get { return ColorTranslator.FromHtml("#6c3461"); } }
public static Color GreyishBlue { get { return ColorTranslator.FromHtml("#5e819d"); } }
public static Color PurplishBlue { get { return ColorTranslator.FromHtml("#601ef9"); } }
public static Color YellowishGreen { get { return ColorTranslator.FromHtml("#b0dd16"); } }
public static Color GreenishYellow { get { return ColorTranslator.FromHtml("#cdfd02"); } }
public static Color MediumBlue { get { return ColorTranslator.FromHtml("#2c6fbb"); } }
public static Color DustyRose { get { return ColorTranslator.FromHtml("#c0737a"); } }
public static Color LightViolet { get { return ColorTranslator.FromHtml("#d6b4fc"); } }
public static Color MidnightBlue { get { return ColorTranslator.FromHtml("#020035"); } }
public static Color BluishPurple { get { return ColorTranslator.FromHtml("#703be7"); } }
public static Color RedOrange { get { return ColorTranslator.FromHtml("#fd3c06"); } }
public static Color DarkMagenta { get { return ColorTranslator.FromHtml("#960056"); } }
public static Color Greenish { get { return ColorTranslator.FromHtml("#40a368"); } }
public static Color OceanBlue { get { return ColorTranslator.FromHtml("#03719c"); } }
public static Color Coral { get { return ColorTranslator.FromHtml("#fc5a50"); } }
public static Color Cream { get { return ColorTranslator.FromHtml("#ffffc2"); } }
public static Color ReddishBrown { get { return ColorTranslator.FromHtml("#7f2b0a"); } }
public static Color BurntSienna { get { return ColorTranslator.FromHtml("#b04e0f"); } }
public static Color Brick { get { return ColorTranslator.FromHtml("#a03623"); } }
public static Color Sage { get { return ColorTranslator.FromHtml("#87ae73"); } }
public static Color GreyGreen { get { return ColorTranslator.FromHtml("#789b73"); } }
public static Color White { get { return ColorTranslator.FromHtml("#ffffff"); } }
public static Color RobinSEggBlue { get { return ColorTranslator.FromHtml("#98eff9"); } }
public static Color MossGreen { get { return ColorTranslator.FromHtml("#658b38"); } }
public static Color SteelBlue { get { return ColorTranslator.FromHtml("#5a7d9a"); } }
public static Color Eggplant { get { return ColorTranslator.FromHtml("#380835"); } }
public static Color LightYellow { get { return ColorTranslator.FromHtml("#fffe7a"); } }
public static Color LeafGreen { get { return ColorTranslator.FromHtml("#5ca904"); } }
public static Color LightGrey { get { return ColorTranslator.FromHtml("#d8dcd6"); } }
public static Color Puke { get { return ColorTranslator.FromHtml("#a5a502"); } }
public static Color PinkishPurple { get { return ColorTranslator.FromHtml("#d648d7"); } }
public static Color SeaBlue { get { return ColorTranslator.FromHtml("#047495"); } }
public static Color PalePurple { get { return ColorTranslator.FromHtml("#b790d4"); } }
public static Color SlateBlue { get { return ColorTranslator.FromHtml("#5b7c99"); } }
public static Color BlueGrey { get { return ColorTranslator.FromHtml("#607c8e"); } }
public static Color HunterGreen { get { return ColorTranslator.FromHtml("#0b4008"); } }
public static Color Fuchsia { get { return ColorTranslator.FromHtml("#ed0dd9"); } }
public static Color Crimson { get { return ColorTranslator.FromHtml("#8c000f"); } }
public static Color PaleYellow { get { return ColorTranslator.FromHtml("#ffff84"); } }
public static Color Ochre { get { return ColorTranslator.FromHtml("#bf9005"); } }
public static Color MustardYellow { get { return ColorTranslator.FromHtml("#d2bd0a"); } }
public static Color LightRed { get { return ColorTranslator.FromHtml("#ff474c"); } }
public static Color Cerulean { get { return ColorTranslator.FromHtml("#0485d1"); } }
public static Color PalePink { get { return ColorTranslator.FromHtml("#ffcfdc"); } }
public static Color DeepBlue { get { return ColorTranslator.FromHtml("#040273"); } }
public static Color Rust { get { return ColorTranslator.FromHtml("#a83c09"); } }
public static Color LightTeal { get { return ColorTranslator.FromHtml("#90e4c1"); } }
public static Color Slate { get { return ColorTranslator.FromHtml("#516572"); } }
public static Color Goldenrod { get { return ColorTranslator.FromHtml("#fac205"); } }
public static Color DarkYellow { get { return ColorTranslator.FromHtml("#d5b60a"); } }
public static Color DarkGrey { get { return ColorTranslator.FromHtml("#363737"); } }
public static Color ArmyGreen { get { return ColorTranslator.FromHtml("#4b5d16"); } }
public static Color GreyBlue { get { return ColorTranslator.FromHtml("#6b8ba4"); } }
public static Color Seafoam { get { return ColorTranslator.FromHtml("#80f9ad"); } }
public static Color Puce { get { return ColorTranslator.FromHtml("#a57e52"); } }
public static Color SpringGreen { get { return ColorTranslator.FromHtml("#a9f971"); } }
public static Color DarkOrange { get { return ColorTranslator.FromHtml("#c65102"); } }
public static Color Sand { get { return ColorTranslator.FromHtml("#e2ca76"); } }
public static Color PastelGreen { get { return ColorTranslator.FromHtml("#b0ff9d"); } }
public static Color Mint { get { return ColorTranslator.FromHtml("#9ffeb0"); } }
public static Color LightOrange { get { return ColorTranslator.FromHtml("#fdaa48"); } }
public static Color BrightPink { get { return ColorTranslator.FromHtml("#fe01b1"); } }
public static Color Chartreuse { get { return ColorTranslator.FromHtml("#c1f80a"); } }
public static Color DeepPurple { get { return ColorTranslator.FromHtml("#36013f"); } }
public static Color DarkBrown { get { return ColorTranslator.FromHtml("#341c02"); } }
public static Color Taupe { get { return ColorTranslator.FromHtml("#b9a281"); } }
public static Color PeaGreen { get { return ColorTranslator.FromHtml("#8eab12"); } }
public static Color PukeGreen { get { return ColorTranslator.FromHtml("#9aae07"); } }
public static Color KellyGreen { get { return ColorTranslator.FromHtml("#02ab2e"); } }
public static Color SeafoamGreen { get { return ColorTranslator.FromHtml("#7af9ab"); } }
public static Color BlueGreen { get { return ColorTranslator.FromHtml("#137e6d"); } }
public static Color Khaki { get { return ColorTranslator.FromHtml("#aaa662"); } }
public static Color Burgundy { get { return ColorTranslator.FromHtml("#610023"); } }
public static Color DarkTeal { get { return ColorTranslator.FromHtml("#014d4e"); } }
public static Color BrickRed { get { return ColorTranslator.FromHtml("#8f1402"); } }
public static Color RoyalPurple { get { return ColorTranslator.FromHtml("#4b006e"); } }
public static Color Plum { get { return ColorTranslator.FromHtml("#580f41"); } }
public static Color MintGreen { get { return ColorTranslator.FromHtml("#8fff9f"); } }
public static Color Gold { get { return ColorTranslator.FromHtml("#dbb40c"); } }
public static Color BabyBlue { get { return ColorTranslator.FromHtml("#a2cffe"); } }
public static Color YellowGreen { get { return ColorTranslator.FromHtml("#c0fb2d"); } }
public static Color BrightPurple { get { return ColorTranslator.FromHtml("#be03fd"); } }
public static Color DarkRed { get { return ColorTranslator.FromHtml("#840000"); } }
public static Color PaleBlue { get { return ColorTranslator.FromHtml("#d0fefe"); } }
public static Color GrassGreen { get { return ColorTranslator.FromHtml("#3f9b0b"); } }
public static Color Navy { get { return ColorTranslator.FromHtml("#01153e"); } }
public static Color Aquamarine { get { return ColorTranslator.FromHtml("#04d8b2"); } }
public static Color BurntOrange { get { return ColorTranslator.FromHtml("#c04e01"); } }
public static Color NeonGreen { get { return ColorTranslator.FromHtml("#0cff0c"); } }
public static Color BrightBlue { get { return ColorTranslator.FromHtml("#0165fc"); } }
public static Color Rose { get { return ColorTranslator.FromHtml("#cf6275"); } }
public static Color LightPink { get { return ColorTranslator.FromHtml("#ffd1df"); } }
public static Color Mustard { get { return ColorTranslator.FromHtml("#ceb301"); } }
public static Color Indigo { get { return ColorTranslator.FromHtml("#380282"); } }
public static Color Lime { get { return ColorTranslator.FromHtml("#aaff32"); } }
public static Color SeaGreen { get { return ColorTranslator.FromHtml("#53fca1"); } }
public static Color Periwinkle { get { return ColorTranslator.FromHtml("#8e82fe"); } }
public static Color DarkPink { get { return ColorTranslator.FromHtml("#cb416b"); } }
public static Color OliveGreen { get { return ColorTranslator.FromHtml("#677a04"); } }
public static Color Peach { get { return ColorTranslator.FromHtml("#ffb07c"); } }
public static Color PaleGreen { get { return ColorTranslator.FromHtml("#c7fdb5"); } }
public static Color LightBrown { get { return ColorTranslator.FromHtml("#ad8150"); } }
public static Color HotPink { get { return ColorTranslator.FromHtml("#ff028d"); } }
public static Color Black { get { return ColorTranslator.FromHtml("#000000"); } }
public static Color Lilac { get { return ColorTranslator.FromHtml("#cea2fd"); } }
public static Color NavyBlue { get { return ColorTranslator.FromHtml("#001146"); } }
public static Color RoyalBlue { get { return ColorTranslator.FromHtml("#0504aa"); } }
public static Color Beige { get { return ColorTranslator.FromHtml("#e6daa6"); } }
public static Color Salmon { get { return ColorTranslator.FromHtml("#ff796c"); } }
public static Color Olive { get { return ColorTranslator.FromHtml("#6e750e"); } }
public static Color Maroon { get { return ColorTranslator.FromHtml("#650021"); } }
public static Color BrightGreen { get { return ColorTranslator.FromHtml("#01ff07"); } }
public static Color DarkPurple { get { return ColorTranslator.FromHtml("#35063e"); } }
public static Color Mauve { get { return ColorTranslator.FromHtml("#ae7181"); } }
public static Color ForestGreen { get { return ColorTranslator.FromHtml("#06470c"); } }
public static Color Aqua { get { return ColorTranslator.FromHtml("#13eac9"); } }
public static Color Cyan { get { return ColorTranslator.FromHtml("#00ffff"); } }
public static Color Tan { get { return ColorTranslator.FromHtml("#d1b26f"); } }
public static Color DarkBlue { get { return ColorTranslator.FromHtml("#00035b"); } }
public static Color Lavender { get { return ColorTranslator.FromHtml("#c79fef"); } }
public static Color Turquoise { get { return ColorTranslator.FromHtml("#06c2ac"); } }
public static Color DarkGreen { get { return ColorTranslator.FromHtml("#033500"); } }
public static Color Violet { get { return ColorTranslator.FromHtml("#9a0eea"); } }
public static Color LightPurple { get { return ColorTranslator.FromHtml("#bf77f6"); } }
public static Color LimeGreen { get { return ColorTranslator.FromHtml("#89fe05"); } }
public static Color Grey { get { return ColorTranslator.FromHtml("#929591"); } }
public static Color SkyBlue { get { return ColorTranslator.FromHtml("#75bbfd"); } }
public static Color Yellow { get { return ColorTranslator.FromHtml("#ffff14"); } }
public static Color Magenta { get { return ColorTranslator.FromHtml("#c20078"); } }
public static Color LightGreen { get { return ColorTranslator.FromHtml("#96f97b"); } }
public static Color Orange { get { return ColorTranslator.FromHtml("#f97306"); } }
public static Color Teal { get { return ColorTranslator.FromHtml("#029386"); } }
public static Color LightBlue { get { return ColorTranslator.FromHtml("#95d0fc"); } }
public static Color Red { get { return ColorTranslator.FromHtml("#e50000"); } }
public static Color Brown { get { return ColorTranslator.FromHtml("#653700"); } }
public static Color Pink { get { return ColorTranslator.FromHtml("#ff81c0"); } }
public static Color Blue { get { return ColorTranslator.FromHtml("#0343df"); } }
public static Color Green { get { return ColorTranslator.FromHtml("#15b01a"); } }
public static Color Purple { get { return ColorTranslator.FromHtml("#7e1e9c"); } }
}

View file

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: dfed2b8eaa234dd88ad6ada0315e6ee2 guid: 8ef7eeddb3a8c914193bbb946c482943
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2

View file

@ -88,6 +88,7 @@ public static class CapabilityPresentationSmoke
// The scene's map: an entity registers its icon with the ZoneRenderer's presenter, so each instance carries a quad. // The scene's map: an entity registers its icon with the ZoneRenderer's presenter, so each instance carries a quad.
var mapRenderer = new GameObject("Smoke Zone Renderer").AddComponent<ZoneRenderer>(); var mapRenderer = new GameObject("Smoke Zone Renderer").AddComponent<ZoneRenderer>();
mapRenderer.Settings = AssetDatabase.LoadAssetAtPath<GameSettings>("Assets/Resources/Settings.asset"); mapRenderer.Settings = AssetDatabase.LoadAssetAtPath<GameSettings>("Assets/Resources/Settings.asset");
mapRenderer.MapGravityMaterials = new Material[0];
Awaken(mapRenderer); Awaken(mapRenderer);
(GameObject Object, EntityInstance Instance, TractorBeam Beam) Bound(string name, Entity entity) (GameObject Object, EntityInstance Instance, TractorBeam Beam) Bound(string name, Entity entity)
{ {

View file

@ -32,11 +32,11 @@ namespace Aetheria.EditorTools
// single-precision floor of 1.5e-5 per unit strength against the CPU's, the quad's interpolated world position). The // single-precision floor of 1.5e-5 per unit strength against the CPU's, the quad's interpolated world position). The
// tolerance is 2.9x that. A band whose terms were drawn from the wrong edge (reference, inner or outer) moves the // tolerance is 2.9x that. A band whose terms were drawn from the wrong edge (reference, inner or outer) moves the
// drawn height by whole units. // drawn height by whole units.
internal const float Tolerance = 0.03f; const float Tolerance = 0.03f;
// The worst angle between the texture's central difference and GetForce (B28: 1.0 degrees median zone, 2.9 worst). // The worst angle between the texture's central difference and GetForce (B28: 1.0 degrees median zone, 2.9 worst).
internal const float GradientDegrees = 3f; const float GradientDegrees = 3f;
// Below this force (u/s^2) the drawn height differs between neighbouring texels by less than float32 resolves. // Below this force (u/s^2) the drawn height differs between neighbouring texels by less than float32 resolves.
internal const float FlatForce = 1e-3f; const float FlatForce = 1e-3f;
static float _maxError, _maxAngle, _maxTau; static float _maxError, _maxAngle, _maxTau;
static bool _ok = true; static bool _ok = true;
@ -369,61 +369,32 @@ namespace Aetheria.EditorTools
return found; return found;
} }
// Both isoline views: the map screen's Gravity Lines Image (UI/MaskedWorldSpaceUI, posed by MapRenderer.MapOverlayCamera) and
// the minimap's Gravity Fields RawImage (no material, posed by the minimap camera that targets Minimap).
static void CheckIsolineViews(MapRenderer map, ZoneRenderer renderer)
{
var views = UnityEngine.Object.FindObjectsByType<IsolineView>(FindObjectsInactive.Include, FindObjectsSortMode.None);
if (views.Length != 2) Fail("wiring", $"{views.Length} IsolineViews in ARPG.unity, expected 2");
foreach (var kind in new[] { IsolineView.Kind.Map, IsolineView.Kind.Minimap })
{
var view = views.FirstOrDefault(v => v.View == kind);
if (view == null) { Fail("wiring", $"no {kind} IsolineView in ARPG.unity"); continue; }
if (view.ZoneRenderer != renderer) Fail("wiring", $"{kind} IsolineView.ZoneRenderer is not the scene's ZoneRenderer");
if (view.Extract == null || view.Render == null) Fail("wiring", $"{kind} IsolineView lacks its compute shaders");
if (kind == IsolineView.Kind.Map)
{
if (view.name != "Gravity Lines" || !(view.GetComponent<UnityEngine.UI.Graphic>() is UnityEngine.UI.Image image))
Fail("wiring", "the Map IsolineView is not on the Image named Gravity Lines");
else if (image.material == null || image.material.shader.name != "UI/MaskedWorldSpaceUI")
Fail("wiring", "Gravity Lines does not draw with a UI/MaskedWorldSpaceUI material");
if (map == null || view.PoseCamera != map.MapOverlayCamera) Fail("wiring", "the Map IsolineView's PoseCamera is not MapRenderer.MapOverlayCamera");
}
else
{
if (view.name != "Gravity Fields" || !(view.GetComponent<UnityEngine.UI.Graphic>() is UnityEngine.UI.RawImage raw))
Fail("wiring", "the Minimap IsolineView is not on the RawImage named Gravity Fields");
else if (raw.material.shader.name != "UI/Default")
Fail("wiring", "Gravity Fields draws with a material other than UI/Default");
var pose = renderer == null ? null : renderer.MinimapCameras.FirstOrDefault(c => c.targetTexture != null && c.targetTexture.name == "Minimap");
if (pose == null || view.PoseCamera != pose) Fail("wiring", "the Minimap IsolineView's PoseCamera is not the minimap camera that targets Minimap");
}
}
}
static void CheckWiring(GameSettings settings) static void CheckWiring(GameSettings settings)
{ {
var scene = EditorSceneManager.OpenScene("Assets/Scenes/ARPG.unity", OpenSceneMode.Single); var scene = EditorSceneManager.OpenScene("Assets/Scenes/ARPG.unity", OpenSceneMode.Single);
try try
{ {
// The layer-9 cameras are exactly the fog's and the slime's: the isolines read no camera (cut isoline-wiring). var gravityTargets = new[] { "Fog Surface Displacement", "Slime Gravity", "MinimapGravity" };
var gravityTargets = new[] { "Fog Surface Displacement", "Slime Gravity" }; var seen = 0;
var seen = new List<string>();
foreach (var camera in UnityEngine.Object.FindObjectsByType<Camera>(FindObjectsInactive.Include, FindObjectsSortMode.None)) foreach (var camera in UnityEngine.Object.FindObjectsByType<Camera>(FindObjectsInactive.Include, FindObjectsSortMode.None))
{ {
if (camera.name == "Map Gravity") Fail("wiring", "a camera named Map Gravity is back in ARPG.unity"); if (camera.targetTexture == null || !gravityTargets.Contains(camera.targetTexture.name)) continue;
if (camera.cullingMask != 1 << GravityLowering.FieldLayer) continue; seen++;
seen.Add(camera.targetTexture != null ? camera.targetTexture.name : "(no target) " + camera.name); if (camera.cullingMask != 1 << GravityLowering.FieldLayer)
Fail("wiring", $"camera {camera.name} (target {camera.targetTexture.name}) culls mask {camera.cullingMask}, not layer {GravityLowering.FieldLayer} alone");
} }
if (seen.Count != gravityTargets.Length || gravityTargets.Any(t => !seen.Contains(t))) if (seen < gravityTargets.Length) Fail("wiring", $"only {seen} gravity cameras found in ARPG.unity");
Fail("wiring", $"the layer-9 cameras are [{string.Join(", ", seen)}], not exactly [{string.Join(", ", gravityTargets)}]");
// The patch texture is half-float: it holds the patch layers only, the nebula reads gravity from the R32 surface. // The patch texture is half-float: it holds the patch layers only, the nebula reads gravity from the R32 surface.
if (CheckPatchCameras("ARPG.unity") != 1) Fail("wiring", "ARPG.unity does not have exactly 1 Fog Patch Displacement camera"); if (CheckPatchCameras("ARPG.unity") != 1) Fail("wiring", "ARPG.unity does not have exactly 1 Fog Patch Displacement camera");
// The map screen's gravity camera has no target until MapRenderer gives it one at run time.
var map = UnityEngine.Object.FindFirstObjectByType<MapRenderer>(FindObjectsInactive.Include); var map = UnityEngine.Object.FindFirstObjectByType<MapRenderer>(FindObjectsInactive.Include);
if (map == null || map.GravityCamera == null) Fail("wiring", "no MapRenderer.GravityCamera in ARPG.unity");
else if (map.GravityCamera.cullingMask != 1 << GravityLowering.FieldLayer)
Fail("wiring", $"MapRenderer.GravityCamera culls mask {map.GravityCamera.cullingMask}, not layer {GravityLowering.FieldLayer} alone");
var renderer = UnityEngine.Object.FindFirstObjectByType<ZoneRenderer>(FindObjectsInactive.Include); var renderer = UnityEngine.Object.FindFirstObjectByType<ZoneRenderer>(FindObjectsInactive.Include);
CheckIsolineViews(map, renderer);
if (renderer == null) Fail("wiring", "no ZoneRenderer in ARPG.unity"); if (renderer == null) Fail("wiring", "no ZoneRenderer in ARPG.unity");
else if (renderer.GravityField == null || renderer.GravityField.shader.name != "Brushes/Gravity Field") else if (renderer.GravityField == null || renderer.GravityField.shader.name != "Brushes/Gravity Field")
Fail("wiring", "ZoneRenderer.GravityField is not a Brushes/Gravity Field material"); Fail("wiring", "ZoneRenderer.GravityField is not a Brushes/Gravity Field material");

View file

@ -1,243 +0,0 @@
using System;
using System.Collections;
using System.IO;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
using int2 = CultMath.int2;
// The inventory grid on a ScreenSpaceOverlay canvas, the kind the game's canvases are, which the camera rig of
// InventoryGridParityCapture cannot draw. An overlay canvas draws to the Game view's back buffer, so this enters play mode and
// reads the screen at the end of a frame, and compares the grid's crop with its golden PNG (tests/fixtures/inventory-grid/overlay-*.png).
//
// Unity -batchmode -projectPath <project> -executeMethod InventoryGridOverlayCapture.Run [-pngOut <dir>] [-goldenIn <dir>] [-goldenOut [<dir>]] -logFile <log>
//
// -goldenIn is where the goldens are read from and -goldenOut writes the grid's crop of each capture as overlay-<name>.png instead (both
// default to tests/fixtures/inventory-grid/); a run with -goldenOut compares nothing.
//
// Needs a GPU device; do not pass -nographics or -quit. Logs "[InventoryGridOverlay]" lines and exits 0 or 1.
public static class InventoryGridOverlayCapture
{
private const string Pending = "InventoryGridOverlayCapture.pending";
private const string PngKey = "InventoryGridOverlayCapture.png";
private const string GoldenKey = "InventoryGridOverlayCapture.golden";
private const string GoldenInKey = "InventoryGridOverlayCapture.goldenIn";
// The bound on the largest 8-bit channel difference of the grid's crop against its golden. lodur:ruling:deterministic-bound-margin: the
// shipped reading is 0 in both of two fresh runs, taken as 1 (the 8-bit quantum); the least claimed mutant is alpha-multiply-dropped at 43
// (concave-bracket-dropped reads 138); sqrt(1 x 43) = 6.6, bound 7, a separation of 7 below and 6.1 above.
private const int Bound = 7;
public static void Run()
{
var args = Environment.GetCommandLineArgs();
var i = Array.IndexOf(args, "-pngOut");
SessionState.SetString(PngKey, i >= 0 && i + 1 < args.Length ? args[i + 1] : "");
var golden = Array.IndexOf(args, "-goldenOut");
SessionState.SetString(GoldenKey, golden < 0 ? "" : golden + 1 < args.Length && !args[golden + 1].StartsWith("-") ? args[golden + 1]
: Path.Combine(Directory.GetParent(Application.dataPath)!.FullName, "tests", "fixtures", "inventory-grid"));
var goldenIn = Array.IndexOf(args, "-goldenIn");
SessionState.SetString(GoldenInKey, goldenIn >= 0 && goldenIn + 1 < args.Length ? args[goldenIn + 1]
: Path.Combine(Directory.GetParent(Application.dataPath)!.FullName, "tests", "fixtures", "inventory-grid"));
SessionState.SetBool(Pending, true);
EditorApplication.EnterPlaymode();
}
[InitializeOnLoadMethod]
private static void Hook()
{
EditorApplication.playModeStateChanged += state =>
{
if (state != PlayModeStateChange.EnteredPlayMode || !SessionState.GetBool(Pending, false)) return;
SessionState.SetBool(Pending, false);
new GameObject("Overlay parity").AddComponent<Runner>();
};
}
private static void Log(string line) => Debug.Log("[InventoryGridOverlay] " + line);
private sealed class Runner : MonoBehaviour
{
// An exception inside a coroutine would leave the session running, so any failure exits 1.
private IEnumerator Start()
{
var inner = Capture();
while (true)
{
try
{
if (!inner.MoveNext()) yield break;
}
catch (Exception exception)
{
Debug.LogException(exception);
EditorApplication.Exit(1);
yield break;
}
yield return inner.Current;
}
}
private IEnumerator Capture()
{
var failed = false;
var overallWorst = 0;
var png = SessionState.GetString(PngKey, "");
var goldenOut = SessionState.GetString(GoldenKey, "");
var goldenIn = SessionState.GetString(GoldenInKey, "");
var shader = AssetDatabase.LoadAssetAtPath<Shader>("Assets/Shaders/InventoryGrid.shader");
// An overlay canvas draws to the Game view's back buffer, which batch mode does not create on its own.
Log("Game view menu item: " + EditorApplication.ExecuteMenuItem("Window/General/Game"));
yield return null;
yield return null;
Log($"screen {Screen.width}x{Screen.height}");
var watchdog = gameObject.AddComponent<Watchdog>();
// The first frames of a freshly opened Game view are not drawn yet (solid cyan).
for (var warm = 0; warm < 5; warm++)
{
watchdog.Arm("warm-up end of frame");
yield return new WaitForEndOfFrame();
watchdog.Disarm();
}
foreach (var (name, size, multiplier, alpha) in new[] { ("S32m1", 32f, 1f, 1f), ("S16m1.5", 16f, 1.5f, 1f), ("S32m1-halfalpha", 32f, 1f, .5f) })
{
var canvasObject = new GameObject("Overlay canvas", typeof(RectTransform));
canvasObject.layer = LayerMask.NameToLayer("UI");
var canvas = canvasObject.AddComponent<Canvas>();
canvas.renderMode = RenderMode.ScreenSpaceOverlay;
canvas.vertexColorAlwaysGammaSpace = false;
canvas.sortingOrder = 5000;
// The Main Menu scene behind it moves, so the canvas lays an opaque black page under the cells.
var page = new GameObject("Page", typeof(RectTransform), typeof(CanvasRenderer), typeof(Image)) { layer = canvasObject.layer };
var pageRect = (RectTransform) page.transform;
pageRect.SetParent(canvasObject.transform, false);
pageRect.anchorMin = Vector2.zero;
pageRect.anchorMax = Vector2.one;
pageRect.offsetMin = pageRect.offsetMax = Vector2.zero;
page.GetComponent<Image>().color = Color.black;
var scaler = canvasObject.AddComponent<CanvasScaler>();
// The Game view of a batch session is small (321x531), so the canvas runs at the 1920 reference's own scale, one pixel
// to a canvas unit, which is where the camera rig's 1920 captures sit.
scaler.uiScaleMode = CanvasScaler.ScaleMode.ConstantPixelSize;
scaler.scaleFactor = 1;
scaler.referencePixelsPerUnit = 100;
var stride = size + 8;
var masks = new System.Collections.Generic.List<int>();
for (var m = 0; m < 512 && masks.Count < 96; m += 4)
if (m != 33 && m != 289 && m != 136 && m != 392) masks.Add(m);
var iconColor = new Color(.9f, .45f, .15f) * .7071f;
var bgColor = new Color(.6f, .2f, .1f, .8f);
Vector2 At(int k) => new Vector2(8 + k % 8 * stride, 8 + k / 8 * stride);
for (var k = 0; k < masks.Count; k++)
{
var go = new GameObject("Grid", typeof(RectTransform), typeof(CanvasRenderer)) { layer = canvasObject.layer };
var rect = (RectTransform) go.transform;
rect.SetParent(canvasObject.transform, false);
rect.anchorMin = rect.anchorMax = Vector2.zero;
rect.pivot = Vector2.zero;
rect.anchoredPosition = At(k);
rect.sizeDelta = new Vector2(size, size);
var grid = go.AddComponent<InventoryGrid>();
grid.Shader = shader;
grid.color = new Color(1, 1, 1, alpha);
grid.IconTexel = InventoryGrid.TexelOf(66f, multiplier);
grid.BgTexel = InventoryGrid.TexelOf(100f, 1f);
grid.Resize(1, 1, size, new RectOffset(), GridOrientation.LowerLeft);
grid.SetCell(new int2(0, 0), new CellRecord
{
Mask = (byte) (masks[k] & 255), Present = true, Item = masks[k] >= 256, Icon = iconColor, Background = bgColor
});
}
watchdog.Arm("end of frame, grid");
yield return new WaitForEndOfFrame();
watchdog.Disarm();
var fresh = ScreenCapture.CaptureScreenshotAsTexture();
var cropW = Mathf.Min(fresh.width, Mathf.CeilToInt(8 + 8 * stride));
var cropH = Mathf.Min(fresh.height, Mathf.CeilToInt(8 + 12 * stride));
var b = fresh.GetPixels32();
var crop = new Color32[cropW * cropH];
var lit = 0;
for (var y = 0; y < cropH; y++)
for (var x = 0; x < cropW; x++)
{
crop[y * cropW + x] = b[y * fresh.width + x];
if (crop[y * cropW + x].r + crop[y * cropW + x].g + crop[y * cropW + x].b > 30) lit++;
}
var worst = 0;
Color32[] a = null;
if (goldenOut != "")
{
Directory.CreateDirectory(goldenOut);
var written = new Texture2D(cropW, cropH, TextureFormat.RGBA32, false, true);
written.SetPixels32(crop);
File.WriteAllBytes(Path.Combine(goldenOut, $"overlay-{name}.png"), written.EncodeToPNG());
Destroy(written);
Log($"golden written: overlay-{name}.png {cropW}x{cropH}");
}
else
{
var path = Path.Combine(goldenIn, $"overlay-{name}.png");
var golden = new Texture2D(2, 2, TextureFormat.RGBA32, false, true);
if (!File.Exists(path) || !golden.LoadImage(File.ReadAllBytes(path)) || golden.width != cropW || golden.height != cropH)
{
failed = true;
Log($"BOUND BREACHED overlay {name}: no golden {path} of {cropW}x{cropH}");
}
else
{
a = golden.GetPixels32();
for (var i = 0; i < a.Length; i++)
worst = Mathf.Max(worst, Mathf.Abs(a[i].r - crop[i].r), Mathf.Abs(a[i].g - crop[i].g), Mathf.Abs(a[i].b - crop[i].b), Mathf.Abs(a[i].a - crop[i].a));
}
Destroy(golden);
}
overallWorst = Mathf.Max(overallWorst, worst);
Log($"overlay {name}: {masks.Count} masks, max8bitDiff against the golden={worst}, {lit} lit pixels");
if (lit == 0 || worst > Bound)
{
failed = true;
Log($"BOUND BREACHED overlay {name}: worst {worst} (bound {Bound}), lit {lit}");
}
if (png != "" && a != null)
{
Directory.CreateDirectory(png);
var sheet = new Texture2D(cropW * 3, cropH, TextureFormat.RGBA32, false);
var pixels = new Color32[cropW * 3 * cropH];
for (var y = 0; y < cropH; y++)
for (var x = 0; x < cropW; x++)
{
var i = y * cropW + x;
pixels[y * cropW * 3 + x] = new Color32(a[i].r, a[i].g, a[i].b, 255);
pixels[y * cropW * 3 + cropW + x] = new Color32(crop[i].r, crop[i].g, crop[i].b, 255);
pixels[y * cropW * 3 + 2 * cropW + x] = new Color32(
(byte) Mathf.Min(255, 8 * Mathf.Abs(a[i].r - crop[i].r)), (byte) Mathf.Min(255, 8 * Mathf.Abs(a[i].g - crop[i].g)),
(byte) Mathf.Min(255, 8 * Mathf.Abs(a[i].b - crop[i].b)), 255);
}
sheet.SetPixels32(pixels);
File.WriteAllBytes(Path.Combine(png, $"overlay-{name}.png"), sheet.EncodeToPNG());
}
Destroy(canvasObject);
yield return null;
}
Log($"SUMMARY overlayWorst={overallWorst} bound={Bound}");
Log(failed ? "FAIL" : "PASS");
EditorApplication.Exit(failed ? 1 : 0);
}
}
// Exits when an end of frame never comes: no Game view renders in this batch session, so an overlay canvas cannot be drawn.
private sealed class Watchdog : MonoBehaviour
{
private string _waiting;
private float _since;
public void Arm(string what) { _waiting = what; _since = Time.realtimeSinceStartup; }
public void Disarm() => _waiting = null;
private void Update()
{
if (_waiting == null || Time.realtimeSinceStartup - _since < 20f) return;
Log($"BLOCKED: no {_waiting} within 20 s; the Game view does not render in this session");
EditorApplication.Exit(2);
}
}
}

View file

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 88f470014ea5fdd43a80ec1eba54b42a

File diff suppressed because it is too large Load diff

View file

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: dd00afc599e4d704696448c5fec05990

View file

@ -1,303 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using int2 = CultMath.int2;
// The inventory panels in a real play session (map IG-S9): the Duel test arena (the player's Longinus carries a Store-All Plus cargo bay,
// a hostile Longinus is placed in the zone) is launched through MainMenu.Launch from the Main Menu scene, and each state of the panels is
// asserted and written as a PNG of the game's overlay canvases at 1920x1080 (hud, enemy, pulse, menu, cargo, highlight, drag, hover,
// thermal). The PNGs are the operator's evidence, not a gate; any failed assertion exits 1.
//
// Unity -batchmode -projectPath <project> -executeMethod InventoryPanelsPlayCapture.Run -pngOut <dir> -logFile <log>
//
// Needs a GPU device; do not pass -nographics or -quit. Run enters play mode (a domain reload), the check runs there as an
// EditorApplication.update stepper with a 300 s real-time budget, and the Editor exits itself, 0 or 1. The overlay canvases are switched to
// ScreenSpaceCamera for the frame a capture renders through a camera into a 1920x1080 RenderTexture, then restored.
[InitializeOnLoad]
public static class InventoryPanelsPlayCapture
{
private const string Flag = "InventoryPanelsPlayCapture.running";
private const string PngKey = "InventoryPanelsPlayCapture.png";
private const double Budget = 300;
// The check and the enumerators it yields (a state's capture), stepped one yield per editor update.
private static readonly Stack<IEnumerator> Steps = new Stack<IEnumerator>();
private static double _started;
private static string _png;
static InventoryPanelsPlayCapture()
{
if (SessionState.GetBool(Flag, false)) EditorApplication.playModeStateChanged += OnPlayMode;
}
private static void Log(string line) => Debug.Log("[InventoryPanelsPlayCapture] " + line);
public static void Run()
{
try
{
var args = Environment.GetCommandLineArgs();
var at = Array.IndexOf(args, "-pngOut");
if (at < 0 || at + 1 >= args.Length) throw new InvalidOperationException("-pngOut <dir> is required.");
Directory.CreateDirectory(args[at + 1]);
SessionState.SetString(PngKey, Path.GetFullPath(args[at + 1]));
EditorSceneManager.playModeStartScene = AssetDatabase.LoadAssetAtPath<SceneAsset>("Assets/Scenes/Main Menu.unity")
?? throw new InvalidOperationException("No Assets/Scenes/Main Menu.unity.");
SessionState.SetBool(Flag, true);
EditorApplication.EnterPlaymode();
}
catch (Exception exception)
{
Debug.LogException(exception);
EditorApplication.Exit(1);
}
}
private static void OnPlayMode(PlayModeStateChange change)
{
if (change != PlayModeStateChange.EnteredPlayMode) return;
_png = SessionState.GetString(PngKey, "");
_started = Time.realtimeSinceStartupAsDouble;
Steps.Push(Check());
EditorApplication.update += Step;
}
private static void Step()
{
try
{
if (Time.realtimeSinceStartupAsDouble - _started > Budget) throw new InvalidOperationException($"The capture did not finish in {Budget} seconds.");
while (Steps.Count > 0)
{
var top = Steps.Peek();
if (!top.MoveNext()) { Steps.Pop(); continue; }
if (top.Current is IEnumerator nested) { Steps.Push(nested); continue; }
return;
}
Finish(0);
}
catch (Exception exception)
{
Debug.LogException(exception);
Finish(1);
}
}
private static void Finish(int code)
{
EditorApplication.update -= Step;
SessionState.SetBool(Flag, false);
EditorSceneManager.playModeStartScene = null;
Log(code == 0 ? "PASS" : "FAILED");
ClearDirtyAssets();
EditorApplication.Exit(code);
}
// A play session modifies the assets it loads (render texture descriptors, material properties set from code) and the exit saves them.
// The capture leaves the project as it found it: the dirty flag of every persistent object is cleared first, and logged by path.
private static void ClearDirtyAssets()
{
var cleared = new SortedSet<string>();
foreach (var asset in Resources.FindObjectsOfTypeAll<UnityEngine.Object>())
{
if (!EditorUtility.IsPersistent(asset) || !EditorUtility.IsDirty(asset)) continue;
EditorUtility.ClearDirty(asset);
cleared.Add(AssetDatabase.GetAssetPath(asset));
}
Log($"cleared the dirty flag of persistent assets: {(cleared.Count == 0 ? "none" : string.Join(", ", cleared))}");
}
private static void Require(bool condition, string what)
{
if (!condition) throw new InvalidOperationException("assertion failed: " + what);
Log("ok: " + what);
}
private static int Present(InventoryGrid grid)
{
var count = 0;
for (var y = 0; y < grid.Height; y++)
for (var x = 0; x < grid.Width; x++)
if (grid.RecordAt(new int2(x, y)).Present) count++;
return count;
}
private static uint Pack(Color32 c) => (uint) c.r << 24 | (uint) c.g << 16 | (uint) c.b << 8 | c.a;
// The game's overlay canvases drawn through a camera into a 1920x1080 RenderTexture and written as <state>.png: each root canvas that
// is an overlay is switched to ScreenSpaceCamera for the frames the render needs, then restored.
private static IEnumerator Snap(string state)
{
for (var i = 0; i < 3; i++) yield return null;
var cameraObject = new GameObject("Capture camera");
var camera = cameraObject.AddComponent<Camera>();
camera.orthographic = true;
camera.orthographicSize = 5;
camera.clearFlags = CameraClearFlags.SolidColor;
camera.backgroundColor = new Color(.1f, .1f, .12f, 1f);
camera.cullingMask = 1 << LayerMask.NameToLayer("UI");
camera.enabled = false;
var target = new RenderTexture(1920, 1080, 24, RenderTextureFormat.ARGB32);
camera.targetTexture = target;
var canvases = UnityEngine.Object.FindObjectsByType<Canvas>(FindObjectsSortMode.None)
.Where(c => c.isRootCanvas && c.renderMode == RenderMode.ScreenSpaceOverlay && c.gameObject.activeInHierarchy).ToList();
var saved = canvases.Select(c => (c, c.worldCamera, c.planeDistance)).ToList();
foreach (var canvas in canvases)
{
canvas.renderMode = RenderMode.ScreenSpaceCamera;
canvas.worldCamera = camera;
canvas.planeDistance = 10;
}
for (var i = 0; i < 3; i++) yield return null;
Canvas.ForceUpdateCanvases();
foreach (var grid in UnityEngine.Object.FindObjectsByType<InventoryGrid>(FindObjectsSortMode.None)) grid.Flush();
camera.Render();
var previous = RenderTexture.active;
RenderTexture.active = target;
var read = new Texture2D(1920, 1080, TextureFormat.RGBA32, false);
read.ReadPixels(new Rect(0, 0, 1920, 1080), 0, 0);
RenderTexture.active = previous;
var path = Path.Combine(_png, $"play-{state}.png");
File.WriteAllBytes(path, read.EncodeToPNG());
UnityEngine.Object.Destroy(read);
foreach (var (canvas, worldCamera, plane) in saved)
{
canvas.renderMode = RenderMode.ScreenSpaceOverlay;
canvas.worldCamera = worldCamera;
canvas.planeDistance = plane;
}
UnityEngine.Object.Destroy(cameraObject);
target.Release();
UnityEngine.Object.Destroy(target);
Log($"wrote {path} ({canvases.Count} overlay canvases)");
yield return null;
}
private static PointerEventData Pointer(Vector2 position, Vector2? press = null) => new PointerEventData(EventSystem.current)
{
position = position, pressPosition = press ?? position, button = PointerEventData.InputButton.Left
};
// Overlay canvases: a cell's world position is its screen position.
private static Vector2 Centre(InventoryGrid grid, int2 v) => grid.rectTransform.TransformPoint(grid.CellRect(v).center);
private static IEnumerator Check()
{
// The Main Menu scene: launch the Duel arena, whose player ship carries a cargo bay and has another ship in the zone.
MainMenu menu = null;
while (!(menu = UnityEngine.Object.FindFirstObjectByType<MainMenu>())) yield return null;
for (var i = 0; i < 30; i++) yield return null;
var scenario = Scenarios.Tests.First(s => s.Id == "duel");
Log($"launching {scenario.Name} ({scenario.Id}): the player's Longinus fits a Store-All Plus cargo bay, a hostile Longinus is placed 900 m away");
menu.Launch(scenario);
ActionGameManager game = null;
while (!((game = ActionGameManager.Instance) && game.CurrentEntity != null && game.ShipPanel && game.ShipPanel.Grid.Width > 0)) yield return null;
for (var i = 0; i < 60; i++) yield return null;
var ship = game.CurrentEntity;
var other = game.Zone.Entities.First(e => e != ship && e is Ship);
var bay = ship.CargoBays.FirstOrDefault();
Require(bay != null, $"the player's {ship.Name} carries a cargo bay ({bay?.Data.Name})");
Log($"player {ship.Name}, other ship {other.Name}");
// hud
var hud = game.ShipPanel;
Require(Present(hud.Grid) > 0 && !hud.Interactive && hud.Grid.GetComponents<UniRx.Triggers.ObservableTriggerBase>().Length == 0, $"the HUD panel draws {Present(hud.Grid)} cells through its grid and takes no pointer input");
yield return Snap("hud");
// enemy: the one target slot names the other ship
typeof(Entity).GetMethod("SetTarget", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(ship, new object[] { new TargetRef(other) });
for (var i = 0; i < 10; i++) yield return null;
var enemy = game.TargetShipPanel;
Require(enemy.gameObject.activeInHierarchy && Present(enemy.Grid) > 0 && enemy.Flip, $"the enemy panel shows {other.Name} through a flipped grid ({Present(enemy.Grid)} cells)");
yield return Snap("enemy");
// pulse: an armor hit makes the cell's background differ from CellBackgroundColor until CellHitPulseTime has passed
var hit = FirstPresent(hud.Grid);
var background = (Color32) hud.CellBackgroundColor;
Require(Pack(hud.Grid.RecordAt(hit).Background) == Pack(background), "before the hit the cell's background is CellBackgroundColor");
ship.ArmorDamage.OnNext((hit, 5f));
Require(Pack(hud.Grid.RecordAt(hit).Background) != Pack(background), "an ArmorDamage hit makes the cell's RecordAt background differ from CellBackgroundColor");
yield return Snap("pulse");
var until = Time.time + hud.CellHitPulseTime + .5f;
while (Time.time < until) yield return null;
Require(Pack(hud.Grid.RecordAt(hit).Background) == Pack(background), $"after CellHitPulseTime ({hud.CellHitPulseTime:F2} s) it is CellBackgroundColor again");
// menu and cargo
game.Menu.ShowTab(MenuTab.Inventory);
for (var i = 0; i < 20; i++) yield return null;
var cargoPanel = game.Inventory.InventoryPanels[0];
var equipmentPanel = game.Inventory.InventoryPanels[1];
Require(Present(equipmentPanel.Grid) > 0 && equipmentPanel.Interactive, $"the menu's equipment panel draws {Present(equipmentPanel.Grid)} cells and takes pointer input");
yield return Snap("menu");
var items = game.ItemManager;
foreach (var commodity in items.ItemData.GetAll<SimpleCommodityData>().Take(3))
bay.TryStore(new SimpleCommodity { Data = items.ItemData.RefOf<ItemData>(commodity), Quantity = 1 });
cargoPanel.Display(bay);
for (var i = 0; i < 5; i++) yield return null;
Require(Present(cargoPanel.Grid) == bay.Data.InteriorShape.Coordinates.Length && cargoPanel.Grid.Thermal == false, $"the cargo panel draws the bay's {Present(cargoPanel.Grid)} cells, holding {bay.Occupancy.Cast<ItemInstance>().Where(i => i != null).Distinct().Count()} items");
yield return Snap("cargo");
// highlight: a click on an item cell
var fitted = ship.Equipment.Where(e => e.EquippableItem != null).OrderBy(e => e.Data.Shape.Coordinates.Length).First();
var hull = (HullData) game.ItemManager.GetData(ship.Hull);
var itemCells = hull.Shape.Inset(fitted.Data.Shape, fitted.Position, fitted.EquippableItem.Rotation).Coordinates;
var grid = equipmentPanel.Grid;
var click = Pointer(Centre(grid, itemCells[0]));
ExecuteEvents.Execute(grid.gameObject, click, ExecuteEvents.pointerClickHandler);
Require(itemCells.All(v => Pack(grid.RecordAt(v).Icon) == Pack(equipmentPanel.GetColor(v, true))) && itemCells.All(v => Pack(equipmentPanel.GetColor(v, true)) != Pack(equipmentPanel.GetColor(v))),
$"a click on {fitted.Data.Name} highlights its {itemCells.Length} cells");
yield return Snap("highlight");
// a click on a different item un-highlights the first: its cells draw their plain colour again, the second item's the highlight colour
var second = ship.Equipment.Where(e => e.EquippableItem != null && e.EquippableItem != fitted.EquippableItem).OrderBy(e => e.Data.Shape.Coordinates.Length).FirstOrDefault();
Require(second != null, "a second fitted item exists to click");
var secondCells = hull.Shape.Inset(second.Data.Shape, second.Position, second.EquippableItem.Rotation).Coordinates;
ExecuteEvents.Execute(grid.gameObject, Pointer(Centre(grid, secondCells[0])), ExecuteEvents.pointerClickHandler);
Require(itemCells.All(v => Pack(grid.RecordAt(v).Icon) == Pack(equipmentPanel.GetColor(v, false))) && secondCells.All(v => Pack(grid.RecordAt(v).Icon) == Pack(equipmentPanel.GetColor(v, true))),
$"a click on {second.Data.Name} un-highlights {fitted.Data.Name} and highlights its own {secondCells.Length} cells");
// drag: the ghost; hover: the other panel's FakeOccupancy
var press = Centre(grid, itemCells[0]);
ExecuteEvents.Execute(grid.gameObject, Pointer(press), ExecuteEvents.beginDragHandler);
var ghost = equipmentPanel.DragGhost;
Require(ghost.gameObject.activeSelf && Present(ghost) == itemCells.Length, "a begin drag shows the drag ghost with the item's cells");
ExecuteEvents.Execute(grid.gameObject, Pointer(press + new Vector2(120, 40), press), ExecuteEvents.dragHandler);
yield return Snap("drag");
var cargoGrid = cargoPanel.Grid;
var emptied = bay.Occupancy.Cast<ItemInstance>().Where(i => i != null).Distinct().ToArray();
foreach (var stored in emptied) bay.Remove(stored);
cargoPanel.RefreshCells();
var offset = fitted.Position - itemCells[0];
var target = bay.Data.InteriorShape.AllCoordinates.FirstOrDefault(h => bay.Data.InteriorShape[h] && bay.ItemFits(fitted.EquippableItem, h + offset));
Require(bay.ItemFits(fitted.EquippableItem, target + offset), "the dragged item fits the emptied bay");
ExecuteEvents.Execute(cargoGrid.gameObject, Pointer(Centre(cargoGrid, target)), ExecuteEvents.pointerMoveHandler);
Require(cargoPanel.FakeOccupancy != null && cargoPanel.FakeOccupancy.Coordinates.Length > 0, "the pointer over a fitting cell sets the other panel's FakeOccupancy");
yield return Snap("hover");
ExecuteEvents.Execute(cargoGrid.gameObject, Pointer(Centre(cargoGrid, target)), ExecuteEvents.pointerExitHandler);
ExecuteEvents.Execute(grid.gameObject, Pointer(press + new Vector2(120, 40), press), ExecuteEvents.endDragHandler);
Require(!ghost.gameObject.activeSelf && cargoPanel.FakeOccupancy == null, "the drag ends: ghost hidden, FakeOccupancy cleared");
// thermal: the Thermal button
equipmentPanel.Thermal.onClick.Invoke();
for (var i = 0; i < 5; i++) yield return null;
Require(equipmentPanel.Grid.Thermal && Enumerable.Range(0, grid.Height).SelectMany(y => Enumerable.Range(0, grid.Width).Select(x => grid.RecordAt(new int2(x, y)))).Any(r => r.Present && r.Conductivity != 0),
"the Thermal button switches the grid to the pipes view with conducting cells");
yield return Snap("thermal");
}
private static int2 FirstPresent(InventoryGrid grid)
{
for (var y = 0; y < grid.Height; y++)
for (var x = 0; x < grid.Width; x++)
if (grid.RecordAt(new int2(x, y)).Present) return new int2(x, y);
throw new InvalidOperationException("The grid has no present cell.");
}
}

View file

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 901479284564b1d44a6e766e7c8a0a46

File diff suppressed because it is too large Load diff

View file

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 961a55f8990ee804faf3edd6d76b3268

View file

@ -1,281 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Aetheria.EditorTools;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.UI;
// Batchmode play check for campaign aetheria-release, cut isoline-wiring (ported from the soul pass's IsolinePlayProbe): the only check that
// runs IsolineView.LateUpdate. It boots a Duel through MainMenu.Launch and asserts that both views draw (target, wiring, coverage), that
// the map screen releases on close and draws again on reopen, that a pan moves no contour on the live pose cameras (the bound of
// IsolineRenderSmoke's anchor check, many poses, the live terms), and that an overflow logs one warning per view.
//
// Needs a graphics device: run WITHOUT -nographics and without -quit; it exits the Editor itself, 0 on success.
// Unity -batchmode -projectPath <repo> -executeMethod IsolinePlayCheck.Run -logFile <path>
[InitializeOnLoad]
public static class IsolinePlayCheck
{
const string Tag = "[IsolinePlayCheck]";
const string Flag = "IsolinePlayCheck.running";
const double Budget = 540;
const BindingFlags Any = BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public;
static readonly Stack<IEnumerator> Steps = new Stack<IEnumerator>();
static readonly List<string> Fails = new List<string>();
static readonly List<string> Warnings = new List<string>();
static double _started;
static int _errors;
static IsolinePlayCheck()
{
if (SessionState.GetBool(Flag, false)) EditorApplication.playModeStateChanged += OnPlayMode;
}
static void Log(string line) => Debug.Log($"{Tag} {line}");
public static void Run()
{
try
{
EditorSceneManager.playModeStartScene = AssetDatabase.LoadAssetAtPath<SceneAsset>("Assets/Scenes/Main Menu.unity")
?? throw new InvalidOperationException("No Main Menu scene.");
SessionState.SetBool(Flag, true);
EditorApplication.EnterPlaymode();
}
catch (Exception exception) { Debug.LogException(exception); EditorApplication.Exit(1); }
}
static void OnPlayMode(PlayModeStateChange change)
{
if (change != PlayModeStateChange.EnteredPlayMode) return;
_started = Time.realtimeSinceStartupAsDouble;
Application.logMessageReceived += OnLog;
Steps.Push(Play());
EditorApplication.update += Step;
}
static void OnLog(string condition, string stack, LogType type)
{
// Other systems' errors (the console view, the editor's indexer) are counted, not failed: only an isoline error fails the check.
if (type == LogType.Error || type == LogType.Exception || type == LogType.Assert)
{
_errors++;
if (stack.Contains("Isoline") || condition.Contains("Isoline")) Fails.Add($"logged {type}: {condition}");
}
else if (type == LogType.Warning) Warnings.Add(condition);
}
static void Step()
{
try
{
if (Time.realtimeSinceStartupAsDouble - _started > Budget) throw new InvalidOperationException($"did not finish in {Budget} s");
while (Steps.Count > 0)
{
var top = Steps.Peek();
if (!top.MoveNext()) { Steps.Pop(); continue; }
if (top.Current is IEnumerator nested) { Steps.Push(nested); continue; }
return;
}
Finish();
}
catch (Exception exception) { Debug.LogException(exception); Fails.Add(exception.Message); Finish(); }
}
static void Finish()
{
EditorApplication.update -= Step;
Application.logMessageReceived -= OnLog;
SessionState.SetBool(Flag, false);
EditorSceneManager.playModeStartScene = null;
Log($"errors logged during the run: {_errors}; failures: {Fails.Count}");
foreach (var f in Fails) Log(" FAIL " + f);
Log(Fails.Count == 0 ? "PASS" : "FAILED");
EditorApplication.Exit(Fails.Count == 0 ? 0 : 1);
}
static void Check(bool condition, string what)
{
if (!condition) Fails.Add(what);
Log((condition ? "ok: " : "FAIL: ") + what);
}
static T Get<T>(object o, string field) => (T)o.GetType().GetField(field, Any).GetValue(o);
static int Covered(RenderTexture rt)
{
var previous = RenderTexture.active;
RenderTexture.active = rt;
var tex = new Texture2D(rt.width, rt.height, TextureFormat.RGBAHalf, false);
tex.ReadPixels(new Rect(0, 0, rt.width, rt.height), 0, 0);
RenderTexture.active = previous;
var covered = tex.GetPixels().Count(p => p.a > .05f);
UnityEngine.Object.Destroy(tex);
return covered;
}
static GameSettings.IsolineViewSettings SettingsOf(IsolineView view) =>
view.View == IsolineView.Kind.Map ? view.ZoneRenderer.Settings.MapIsolines : view.ZoneRenderer.Settings.MinimapIsolines;
static Vector2Int TargetSizeOf(IsolineView view) => (Vector2Int)typeof(IsolineView).GetMethod("TargetSize", Any).Invoke(view, null);
struct Frame { public Vector2 origin, perTexel; public Vector2Int size; public IsolineExtractor.IsoSegment[] segments; }
// The grid of the live pose camera extracted in this frame from the live terms: every pose reads the same field, so only the grid moves.
static Frame ExtractNow(IsolineView view)
{
var renderer = Get<IsolineRenderer>(view, "_renderer");
IsolineView.Grid(view.PoseCamera, TargetSizeOf(view), Mathf.Max(SettingsOf(view).CellPixels, 1), out var o, out var p, out var s);
var levels = new IsolineExtractor.IsolineLevels(0f, view.ZoneRenderer.Map.ContourRange, 1e-3f);
var command = new CommandBuffer { name = "IsolinePlayCheck" };
renderer.Extractor.Extract(command, view.ZoneRenderer.Terms, o, p, s, levels);
Graphics.ExecuteCommandBuffer(command);
command.Release();
var count = new uint[2];
renderer.Extractor.Count.GetData(count);
var n = (int)Mathf.Min(count[0], renderer.Extractor.Capacity);
var segments = new IsolineExtractor.IsoSegment[n];
renderer.Extractor.Segments.GetData(segments, 0, 0, n);
return new Frame { origin = o, perTexel = p, size = s, segments = segments };
}
static (Vector2 lo, Vector2 hi) Reach(Frame f)
{
var end = f.origin + new Vector2((f.size.x - 1) * f.perTexel.x, (f.size.y - 1) * f.perTexel.y);
return (Vector2.Min(f.origin, end), Vector2.Max(f.origin, end));
}
static float Distance(Vector2 p, Vector2 a, Vector2 b)
{
var ab = b - a;
var t = ab.sqrMagnitude < 1e-20f ? 0f : Mathf.Clamp01(Vector2.Dot(p - a, ab) / ab.sqrMagnitude);
return (p - (a + ab * t)).magnitude;
}
// Worst distance, in steps, of the moved grid's interior vertices (every 6th) from the first grid's polyline of the same key.
static double Deviation(Frame a, Frame b, double step, out int vertices)
{
var ra = Reach(a); var rb = Reach(b);
var margin = new Vector2((float)step, (float)step) * 2;
var lo = Vector2.Max(ra.lo, rb.lo) + margin;
var hi = Vector2.Min(ra.hi, rb.hi) - margin;
bool In(Vector2 q) => q.x >= lo.x && q.x <= hi.x && q.y >= lo.y && q.y <= hi.y;
var byKey = a.segments.Where(s => In(s.a) || In(s.b)).GroupBy(s => s.key).ToDictionary(g => g.Key, g => g.ToArray());
var sample = b.segments.Where(s => In(s.a) && In(s.b)).Where((_, k) => k % 6 == 0).ToArray();
vertices = sample.Length;
double worst = 0;
foreach (var s in sample)
{
if (!byKey.TryGetValue(s.key, out var list)) { worst = Math.Max(worst, 1e3); continue; }
var best = float.MaxValue;
foreach (var t in list) best = Mathf.Min(best, Distance(s.a, t.a, t.b));
worst = Math.Max(worst, best / step);
}
return worst;
}
// Grids of the live pose camera at poses around its home and at that pose moved by (0.37, 0.61) of a step, from the live terms.
static IEnumerator Pan(IsolineView view, string label, float radius, int poses)
{
yield return null;
var camera = view.PoseCamera;
var home = camera.transform.position;
Frame At(Vector2 p) { camera.transform.position = new Vector3(p.x, home.y, p.y); return ExtractNow(view); }
var rng = new System.Random(5);
var usable = 0;
double worst = 0;
for (var i = 0; i < poses; i++)
{
var p = new Vector2(home.x, home.z) + new Vector2((float)(rng.NextDouble() * 2 - 1) * radius, (float)(rng.NextDouble() * 2 - 1) * radius);
var a = At(p);
var b = At(p + new Vector2(.37f * Mathf.Abs(a.perTexel.x), .61f * Mathf.Abs(a.perTexel.y)));
var d = Deviation(a, b, Mathf.Abs(a.perTexel.x), out var vertices);
if (vertices < 30) continue;
usable++;
worst = Math.Max(worst, d);
}
camera.transform.position = home;
Log($"{label} pan: {usable} usable poses of {poses} within +-{radius} u, worst vertex deviation {worst:G3} step (bound {IsolineRenderSmoke.AnchorBound})");
Check(usable >= poses / 2, $"{label}: the pan test is not vacuous ({usable} usable poses)");
Check(worst <= IsolineRenderSmoke.AnchorBound, $"{label}: a pan by a fraction of a step moves no vertex off its contour ({worst:G3} step)");
yield return null;
}
static IEnumerator Play()
{
MainMenu menu = null;
while (!(menu = UnityEngine.Object.FindFirstObjectByType<MainMenu>())) yield return null;
for (var i = 0; i < 30; i++) yield return null;
var scenario = Scenarios.Tests.First(s => s.Id == "duel");
Log($"Screen {Screen.width}x{Screen.height}; device {SystemInfo.graphicsDeviceName}; launching {scenario.Name}");
menu.Launch(scenario);
ActionGameManager game = null;
while (!((game = ActionGameManager.Instance) && game.CurrentEntity != null && game.ShipPanel && game.ShipPanel.Grid.Width > 0)) yield return null;
for (var i = 0; i < 90; i++) yield return null;
Check(ActionGameManager.RunLive, "the game is live");
var views = UnityEngine.Object.FindObjectsByType<IsolineView>(FindObjectsInactive.Include, FindObjectsSortMode.None);
var mini = views.First(v => v.View == IsolineView.Kind.Minimap);
var map = views.First(v => v.View == IsolineView.Kind.Map);
// minimap: LateUpdate ran, the RawImage shows the target, the target carries contours
var miniTarget = Get<RenderTexture>(mini, "_target");
Check(miniTarget != null, "the minimap view's target exists: LateUpdate ran in play");
Check(miniTarget != null && ((RawImage)mini.GetComponent<Graphic>()).texture == miniTarget, "RawImage.texture is the minimap target");
Check(miniTarget != null && Covered(miniTarget) > 200, "the minimap target carries contours");
var follow = mini.PoseCamera.GetComponent<CopyTransform>();
if (follow != null) follow.enabled = false;
yield return Pan(mini, "minimap", 1500f, 20);
if (follow != null) follow.enabled = true;
// map screen: an instance of the template carries the target; the template is never written. The zone fills the screen at
// this scale whatever the Screen size (a batchmode Game view is 640 x 480).
game.Menu.ShowTab(MenuTab.Map);
var mapRenderer = UnityEngine.Object.FindFirstObjectByType<MapRenderer>();
mapRenderer.Scale = 4000f / Screen.height;
var enough = Screen.width * Screen.height / 400;
for (var i = 0; i < 30; i++) yield return null;
var mapTarget = Get<RenderTexture>(map, "_target");
Check(mapTarget != null, "the map view's target exists: LateUpdate ran in play");
var instance = Get<Material>(map, "_instance");
var template = Get<Material>(map, "_template");
var image = map.GetComponent<Graphic>();
Check(instance != null && image.material == instance && instance.GetTexture("_DetailTex") == mapTarget, "the Image draws a material instance whose _DetailTex is the target");
Check(template != null && template != instance && template.GetTexture("_DetailTex") != mapTarget, "the shared template material was never written");
Check(mapTarget != null && mapTarget.width == Screen.width && mapTarget.height == Screen.height, "the map target is Screen-sized");
Check(mapTarget != null && Covered(mapTarget) > enough, "the map target carries contours");
yield return Pan(map, "map", 1500f, 31);
// closing the map releases, reopening draws again
game.Menu.ShowTab(MenuTab.Inventory);
for (var i = 0; i < 20; i++) yield return null;
Check(Get<RenderTexture>(map, "_target") == null && Get<Material>(map, "_instance") == null, "closing the map releases the target and the instance");
Check(image.material == template, "closing the map puts the template material back on the Image");
game.Menu.ShowTab(MenuTab.Map);
for (var i = 0; i < 20; i++) yield return null;
var again = Get<RenderTexture>(map, "_target");
Check(again != null && Covered(again) > enough, "reopening the map draws again");
// overflow: one warning per view, then no second
var settings = mini.ZoneRenderer.Settings;
var saveMini = settings.MinimapIsolines;
var saveMap = settings.MapIsolines;
Warnings.Clear();
var m = saveMini; m.SegmentCapacity = 100; settings.MinimapIsolines = m;
for (var i = 0; i < 800; i++) yield return null;
var miniWarnings = Warnings.Where(w => w.Contains("isolines overflowed")).ToList();
Check(miniWarnings.Count == 1 && miniWarnings[0].StartsWith("Minimap"), $"the minimap view logs exactly one overflow warning in 800 frames ({miniWarnings.Count})");
settings.MinimapIsolines = saveMini;
Warnings.Clear();
var mm = saveMap; mm.PoolCapacity = 100; settings.MapIsolines = mm;
for (var i = 0; i < 400; i++) yield return null;
var mapWarnings = Warnings.Where(w => w.Contains("isolines overflowed")).ToList();
Check(mapWarnings.Count == 1 && mapWarnings[0].StartsWith("Map"), $"the map view logs exactly one overflow warning ({mapWarnings.Count})");
settings.MapIsolines = saveMap;
}
}

View file

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: e50d7fff7160807408e7ea2ddbe3f02a

File diff suppressed because it is too large Load diff

View file

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 87b6207c8e82c354b878bc6c6c6aee5d

View file

@ -63,7 +63,7 @@ public static class MapBeltPerf
}, pack, new GalaxyZone { Name = "Perf", Owner = null }, null); }, pack, new GalaxyZone { Name = "Perf", Owner = null }, null);
var transforms = new float4[count]; var transforms = new float4[count];
var presenter = new MapPresenter(AssetDatabase.LoadAssetAtPath<Material>("Assets/Materials/UI/MapAsteroid.mat"), 4, 4, 3f); var presenter = new MapPresenter(new Material[0], AssetDatabase.LoadAssetAtPath<Material>("Assets/Materials/UI/MapAsteroid.mat"), 4, 4, 3f);
presenter.RegisterBelt(beltKey, transforms); presenter.RegisterBelt(beltKey, transforms);
var baseBelt = new MapBeltPerfBase(zone, zone.AsteroidBelts[beltKey], 4, 4, 3f); var baseBelt = new MapBeltPerfBase(zone, zone.AsteroidBelts[beltKey], 4, 4, 3f);

View file

@ -136,7 +136,7 @@ public static class MapPresenterSmoke
ship.Direction = float2(Mathf.Sin(40 * Mathf.Deg2Rad), Mathf.Cos(40 * Mathf.Deg2Rad)); ship.Direction = float2(Mathf.Sin(40 * Mathf.Deg2Rad), Mathf.Cos(40 * Mathf.Deg2Rad));
typeof(Ship).GetProperty("Rotation", Any).GetSetMethod(true).Invoke(ship, new object[] { new CultMath.quaternion(pose.x, pose.y, pose.z, pose.w) }); typeof(Ship).GetProperty("Rotation", Any).GetSetMethod(true).Invoke(ship, new object[] { new CultMath.quaternion(pose.x, pose.y, pose.z, pose.w) });
var map = new MapPresenter(AssetDatabase.LoadAssetAtPath<Material>("Assets/Materials/UI/MapAsteroid.mat"), 4, 4, 3f); var map = new MapPresenter(new Material[0], AssetDatabase.LoadAssetAtPath<Material>("Assets/Materials/UI/MapAsteroid.mat"), 4, 4, 3f);
var roots = new GameObject("Smoke Roots").transform; var roots = new GameObject("Smoke Roots").transform;
EntityInstance Bound(Entity entity) EntityInstance Bound(Entity entity)
{ {
@ -152,6 +152,7 @@ public static class MapPresenterSmoke
instance.MapIcon = NewIcon(body.transform, flatIcons); instance.MapIcon = NewIcon(body.transform, flatIcons);
var zoneRenderer = new GameObject("Smoke Zone Renderer").AddComponent<ZoneRenderer>(); var zoneRenderer = new GameObject("Smoke Zone Renderer").AddComponent<ZoneRenderer>();
zoneRenderer.Settings = settings; zoneRenderer.Settings = settings;
zoneRenderer.MapGravityMaterials = new Material[0];
Awaken(zoneRenderer); Awaken(zoneRenderer);
typeof(ZoneRenderer).GetProperty("Map").GetSetMethod(true).Invoke(zoneRenderer, new object[] { map }); typeof(ZoneRenderer).GetProperty("Map").GetSetMethod(true).Invoke(zoneRenderer, new object[] { map });
instance.SetEntity(zoneRenderer, entity); instance.SetEntity(zoneRenderer, entity);

View file

@ -15,9 +15,6 @@ using UnityEngine;
// accepts it, so it composes, and the importer cannot build it, so Preload faults Loading with ImportFault naming it. // accepts it, so it composes, and the importer cannot build it, so Preload faults Loading with ImportFault naming it.
// RemovePackage then moves it aside and the next Compose leaves it out. // RemovePackage then moves it aside and the next Compose leaves it out.
// //
// A Station package takes the same path to an EntityInstance with no ShipInstance (a station does not fly), checked without
// thruster or weapon asserts; its .broken sibling swaps the map-icon anchor with the shield anchor, which has no mesh.
//
// Unity -batchmode -nographics -projectPath <project> -executeMethod ShipModPlaySmoke.Run // Unity -batchmode -nographics -projectPath <project> -executeMethod ShipModPlaySmoke.Run
// -shipModPath <mods>/<id>/ship.cc [-shippedCatalog GameData/Aetheria.cc] -logFile <log> // -shipModPath <mods>/<id>/ship.cc [-shippedCatalog GameData/Aetheria.cc] -logFile <log>
// //
@ -42,12 +39,11 @@ public static class ShipModPlaySmoke
if (packagePath == null) throw new InvalidOperationException("-shipModPath <package/ship.cc> is required"); if (packagePath == null) throw new InvalidOperationException("-shipModPath <package/ship.cc> is required");
var package = ShipModCatalog.ReadPackage(packagePath); var package = ShipModCatalog.ReadPackage(packagePath);
Install(package.Visual.Id, package, modsRoot, Path.GetFullPath(packagePath)); Install(package.Visual.Id, package, modsRoot, Path.GetFullPath(packagePath));
var station = package.Hull.HullType == HullType.Station;
var broken = InstallSibling(package, modsRoot, ".broken", ship => var broken = InstallSibling(package, modsRoot, ".broken", ship =>
{ {
var mapIcon = ship.Anchors.Single(anchor => anchor.Role == "map-icon"); var mapIcon = ship.Anchors.Single(anchor => anchor.Role == "map-icon");
var meshless = station ? ship.Anchors.Single(anchor => anchor.Role == "shield") : ship.Anchors.First(anchor => anchor.Role == "weapon-muzzle"); var muzzle = ship.Anchors.First(anchor => anchor.Role == "weapon-muzzle");
(mapIcon.ModelNodeId, meshless.ModelNodeId) = (meshless.ModelNodeId, mapIcon.ModelNodeId); (mapIcon.ModelNodeId, muzzle.ModelNodeId) = (muzzle.ModelNodeId, mapIcon.ModelNodeId);
}, null); }, null);
var shipped = Path.GetFullPath(Option("-shippedCatalog", "GameData/Aetheria.cc")); var shipped = Path.GetFullPath(Option("-shippedCatalog", "GameData/Aetheria.cc"));
var composition = ShipModCatalog.Compose(shipped, derived, modsRoot); var composition = ShipModCatalog.Compose(shipped, derived, modsRoot);
@ -64,23 +60,13 @@ public static class ShipModPlaySmoke
var hull = Hull(package.Hull.Name); var hull = Hull(package.Hull.Name);
zone = new GameObject("Play Smoke Zone"); zone = new GameObject("Play Smoke Zone");
var body = ShipModShips.Instantiate(hull, zone.transform); var ship = ShipModShips.Instantiate(hull, zone.transform).GetComponent<ShipInstance>();
var ship = body.GetComponent<EntityInstance>(); if (ship == null) throw new InvalidOperationException("The mod ship body has no ShipInstance.");
if (ship == null) throw new InvalidOperationException("The mod hull's body has no EntityInstance.");
var thrusters = ship.ThrusterHardpoints?.Length ?? 0; var thrusters = ship.ThrusterHardpoints?.Length ?? 0;
var weapons = ship.WeaponHardpoints?.Length ?? 0; var weapons = ship.WeaponHardpoints?.Length ?? 0;
if (station) if (thrusters == 0) throw new InvalidOperationException("ThrusterHardpoints is empty.");
{ if (weapons == 0 || ship.WeaponHardpoints.Any(node => node.FiringPoint == null || node.FiringPoint.Length == 0))
// A station renders as an EntityInstance: a ShipInstance would throw in Update (SetEntity returns before _thrusters). throw new InvalidOperationException("WeaponHardpoints is empty or a weapon has no muzzle.");
if (body.GetComponent<ShipInstance>() != null) throw new InvalidOperationException("A station body must not carry a ShipInstance.");
}
else
{
if (ship is not ShipInstance) throw new InvalidOperationException("The mod ship body has no ShipInstance.");
if (thrusters == 0) throw new InvalidOperationException("ThrusterHardpoints is empty.");
if (weapons == 0 || ship.WeaponHardpoints.Any(node => node.FiringPoint == null || node.FiringPoint.Length == 0))
throw new InvalidOperationException("WeaponHardpoints is empty or a weapon has no muzzle.");
}
if (ship.HullColliders == null || ship.HullColliders.Length != 1) if (ship.HullColliders == null || ship.HullColliders.Length != 1)
throw new InvalidOperationException("The ship needs exactly one hull collider."); throw new InvalidOperationException("The ship needs exactly one hull collider.");
var collider = ship.HullColliders[0].GetComponent<MeshCollider>(); var collider = ship.HullColliders[0].GetComponent<MeshCollider>();

View file

@ -47,24 +47,17 @@ public static class ShipModPreview
if (template == null) throw new InvalidOperationException($"{TemplatePath} is missing or has no ShipModTemplate."); if (template == null) throw new InvalidOperationException($"{TemplatePath} is missing or has no ShipModTemplate.");
var plan = ShipModPlan.Build(package.Hull, package.Visual); var plan = ShipModPlan.Build(package.Hull, package.Visual);
var ship = ShipModShips.Assemble(visual, package.Hull, package.Visual, template); var ship = ShipModShips.Assemble(visual, package.Hull, package.Visual, template);
// A station is a plain EntityInstance: ShipInstance flies, and SetEntity would read thrusters it does not have.
if ((package.Hull.HullType == HullType.Ship) != (ship is ShipInstance))
throw new InvalidOperationException($"assembled: a {package.Hull.HullType} hull got {ship.GetType().Name}; only a Ship gets a ShipInstance.");
CheckShip(ship, plan, "assembled"); CheckShip(ship, plan, "assembled");
// Instantiate clones the assembled root, and Unity must remap every array reference into the clone. // Instantiate clones the assembled root, and Unity must remap every array reference into the clone.
var clone = UnityEngine.Object.Instantiate(ship.gameObject).GetComponent<EntityInstance>(); var clone = UnityEngine.Object.Instantiate(ship.gameObject).GetComponent<ShipInstance>();
try try { CheckShip(clone, plan, "clone"); CheckExhaust(clone); }
{
CheckShip(clone, plan, "clone");
if (clone is ShipInstance flier) CheckExhaust(flier);
}
finally { UnityEngine.Object.DestroyImmediate(clone.gameObject); } finally { UnityEngine.Object.DestroyImmediate(clone.gameObject); }
Debug.Log($"SHIP_MOD_ASSEMBLY_SMOKE thrusters={plan.Thrusters.Length} exhaust=ok collider=hidden " + Debug.Log($"SHIP_MOD_ASSEMBLY_SMOKE thrusters={plan.Thrusters.Length} exhaust=ok collider=hidden " +
$"weapons={plan.Weapons.Length} radiators={plan.Radiators.Length}"); $"weapons={plan.Weapons.Length} radiators={plan.Radiators.Length}");
} }
private static void CheckShip(EntityInstance ship, ShipModPlan plan, string what) private static void CheckShip(ShipInstance ship, ShipModPlan plan, string what)
{ {
void Require(bool ok, string claim) { if (!ok) throw new InvalidOperationException($"{what}: {claim}"); } void Require(bool ok, string claim) { if (!ok) throw new InvalidOperationException($"{what}: {claim}"); }
bool Inside(Component part) => part != null && part.transform.IsChildOf(ship.transform); bool Inside(Component part) => part != null && part.transform.IsChildOf(ship.transform);
@ -73,8 +66,7 @@ public static class ShipModPreview
Require(ship.HullColliders[0].GetComponentsInChildren<Renderer>(true).All(renderer => Require(ship.HullColliders[0].GetComponentsInChildren<Renderer>(true).All(renderer =>
renderer.sharedMaterials.All(material => material == ship.InvisibleMaterial)), renderer.sharedMaterials.All(material => material == ship.InvisibleMaterial)),
"a hull collider that draws nothing"); "a hull collider that draws nothing");
Require(Inside(ship.MapIcon) && Inside(ship.Shield) && (ship is not ShipInstance flier || Inside(flier.TractorBeam)), Require(Inside(ship.MapIcon) && Inside(ship.Shield) && Inside(ship.TractorBeam), "map icon, shield and tractor inside the ship");
"map icon, shield and tractor inside the ship");
Require(ship.ThrusterHardpoints.Select(node => node.name).SequenceEqual(plan.Thrusters) && Require(ship.ThrusterHardpoints.Select(node => node.name).SequenceEqual(plan.Thrusters) &&
ship.ThrusterHardpoints.All(node => Inside(node) && Inside(node.Emitter) && ship.ThrusterHardpoints.All(node => Inside(node) && Inside(node.Emitter) &&
node.Emitter.sharedMaterials.All(material => material == ship.InvisibleMaterial)), node.Emitter.sharedMaterials.All(material => material == ship.InvisibleMaterial)),

View file

@ -1,252 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Aetheria.FaunaDisplay;
using Newtonsoft.Json.Linq;
using Unity.Mathematics;
using UnityEditor;
using UnityEditor.AssetImporters;
using UnityEngine;
using UnityEngine.Rendering;
namespace Aetheria.EditorTools
{
/// <summary>
/// A .springrig file is a rig GLB (Brokkr's recipe export: a mesh, one skin, VRMC_springBone) and the one committed source of a
/// fauna rig asset (campaign aetheria-fauna, cut whale-rig-leviathan-asset). The importer derives from its bytes, and commits
/// nothing derived: the mesh in SpringSkin's layout, the base colour as a BC7 texture with mips, a material on Aetheria/FaunaSkinned,
/// a TextAsset of the GLB with its image bytes zeroed (SpringRig parses it at Awake; the rig reads no image), and a main object with
/// MeshFilter, MeshRenderer and SpringRig. SpringRigData.FromGlb decides whether the rig is acceptable and adds no rule here; glTFast
/// supplies the mesh in the same handedness as the rig (SpringRigData's mirror) and is used here and in VerifyGlb only.
/// </summary>
// The version is bumped whenever the importer's product changes (a Library keeps what an older importer made); the dependency on this
// script's own file reimports on any edit of it, so a forgotten bump cannot leave a stale asset behind.
[ScriptedImporter(2, "springrig")]
public sealed class SpringRigImporter : ScriptedImporter
{
public SwimSettings Swim = new SwimSettings { AmplitudeDegrees = 9f, PeriodSeconds = 3.2f, PhasePerBone = 0.1f, Axis = new float3(1, 0, 0) };
[Tooltip("The base colour is scaled down to at most this many texels a side before it is compressed.")]
public int MaxTextureSize = 4096;
public override void OnImportAsset(AssetImportContext ctx)
{
byte[] glb = File.ReadAllBytes(ctx.assetPath);
try { SpringRigData.FromGlb(glb); }
catch (Exception e) { ctx.LogImportError($"{ctx.assetPath}: not an acceptable rig: {e.Message}"); return; }
var (json, binAt) = Chunks(glb);
var mesh = ImportMesh(glb, out string refusal);
if (mesh == null) { ctx.LogImportError($"{ctx.assetPath}: {refusal}"); return; }
mesh.name = "mesh";
ctx.DependsOnSourceAsset("Assets/Scripts/Editor/SpringRigImporter.cs");
ctx.DependsOnSourceAsset("Assets/Shaders/FaunaSkinned.shader"); // the material needs the shader imported first, and reimports with it
var material = new Material(Shader.Find("Aetheria/FaunaSkinned")) { name = "material" };
var materialIndex = json["meshes"]?[0]?["primitives"]?[0]?["material"];
var pbr = materialIndex == null ? null : json["materials"]?[(int)materialIndex]?["pbrMetallicRoughness"];
material.SetFloat("_Glossiness", 1f - ((float?)pbr?["roughnessFactor"] ?? 1f));
material.SetFloat("_Metallic", 0f);
Texture2D albedo = null;
var image = BaseColorImage(json, binAt, glb);
if (image != null)
{
albedo = Albedo(image, Math.Max(MaxTextureSize, 4));
albedo.name = "albedo";
material.SetTexture("_MainTex", albedo);
}
// The rig's bytes with every image's bytes zeroed: FromGlb reads JSON and BIN only, and zeros compress.
var rigBytes = (byte[])glb.Clone();
foreach (var each in json["images"] as JArray ?? new JArray())
if (each["bufferView"] != null)
{
var view = json["bufferViews"][(int)each["bufferView"]];
Array.Clear(rigBytes, binAt + ((int?)view["byteOffset"] ?? 0), (int)view["byteLength"]);
}
var rig = new TextAsset(rigBytes) { name = "rig" };
var go = new GameObject(Path.GetFileNameWithoutExtension(ctx.assetPath));
go.AddComponent<MeshFilter>().sharedMesh = mesh;
var renderer = go.AddComponent<MeshRenderer>();
renderer.sharedMaterial = material;
var spring = go.AddComponent<SpringRig>();
spring.Renderer = renderer;
spring.Rig = rig;
spring.Swim = Swim;
ctx.AddObjectToAsset("main", go);
ctx.SetMainObject(go);
ctx.AddObjectToAsset("mesh", mesh);
ctx.AddObjectToAsset("material", material);
ctx.AddObjectToAsset("rig", rig);
if (albedo != null) ctx.AddObjectToAsset("albedo", albedo);
}
// glTFast loads the GLB and instantiates it once; the one skinned mesh is repacked into SpringSkin's layout.
static Mesh ImportMesh(byte[] glb, out string refusal)
{
refusal = null;
var gltf = new GLTFast.GltfImport(deferAgent: new GLTFast.UninterruptedDeferAgent());
var root = new GameObject("springrig-import");
try
{
bool ok = RunSync(async () => await gltf.Load(glb) && await gltf.InstantiateMainSceneAsync(root.transform));
var skinned = root.GetComponentsInChildren<SkinnedMeshRenderer>();
if (!ok || skinned.Length != 1) { refusal = ok ? $"expected one skinned mesh, glTFast made {skinned.Length}" : "glTFast did not import the GLB"; return null; }
var src = skinned[0].sharedMesh;
var weights = src.boneWeights;
var uv = src.uv;
return Pack(src.vertices, src.normals, uv.Length == src.vertexCount ? uv : new Vector2[src.vertexCount],
weights.Select(w => new Vector4(w.weight0, w.weight1, w.weight2, w.weight3)).ToArray(),
weights.SelectMany(w => new[] { (uint)w.boneIndex0, (uint)w.boneIndex1, (uint)w.boneIndex2, (uint)w.boneIndex3 }).ToArray(),
src.triangles);
}
finally
{
UnityEngine.Object.DestroyImmediate(root);
gltf.Dispose();
}
}
// The mesh as SpringSkin reads it: position and normal in stream 0, uv in 1, blend weights (Float32x4) and indices (UInt32x4)
// in 2. bones holds four indices per vertex. Also the layout of every synthetic mesh the checks build.
public static Mesh Pack(Vector3[] position, Vector3[] normal, Vector2[] uv, Vector4[] weight, uint[] bones, int[] triangles)
{
int n = position.Length;
var mesh = new Mesh { indexFormat = IndexFormat.UInt32 };
mesh.SetVertexBufferParams(n,
new VertexAttributeDescriptor(VertexAttribute.Position, VertexAttributeFormat.Float32, 3, 0),
new VertexAttributeDescriptor(VertexAttribute.Normal, VertexAttributeFormat.Float32, 3, 0),
new VertexAttributeDescriptor(VertexAttribute.TexCoord0, VertexAttributeFormat.Float32, 2, 1),
new VertexAttributeDescriptor(VertexAttribute.BlendWeight, VertexAttributeFormat.Float32, 4, 2),
new VertexAttributeDescriptor(VertexAttribute.BlendIndices, VertexAttributeFormat.UInt32, 4, 2));
// Unity wants position and normal, texcoords and the blend pair in streams 0, 1, 2 for a skinned mesh, and warns otherwise.
var stream0 = new float[n * 6]; var stream2 = new byte[n * 32];
for (int i = 0; i < n; i++)
{
Buffer.BlockCopy(new[] { position[i].x, position[i].y, position[i].z, normal[i].x, normal[i].y, normal[i].z }, 0, stream0, i * 24, 24);
Buffer.BlockCopy(new[] { weight[i].x, weight[i].y, weight[i].z, weight[i].w }, 0, stream2, i * 32, 16);
Buffer.BlockCopy(bones, i * 16, stream2, i * 32 + 16, 16);
}
mesh.SetVertexBufferData(stream0, 0, 0, n * 6, 0);
mesh.SetVertexBufferData(uv, 0, 0, n, 1);
mesh.SetVertexBufferData(stream2, 0, 0, stream2.Length, 2);
mesh.SetIndexBufferParams(triangles.Length, IndexFormat.UInt32);
mesh.SetIndexBufferData(triangles, 0, 0, triangles.Length);
mesh.subMeshCount = 1;
mesh.SetSubMesh(0, new SubMeshDescriptor(0, triangles.Length));
mesh.RecalculateBounds();
return mesh;
}
// The bytes of the image the first primitive's material names as its base colour, or null.
static byte[] BaseColorImage(JObject json, int binAt, byte[] glb)
{
var material = json["meshes"]?[0]?["primitives"]?[0]?["material"];
var index = material == null ? null : json["materials"]?[(int)material]?["pbrMetallicRoughness"]?["baseColorTexture"]?["index"];
var source = index == null ? null : json["textures"]?[(int)index]?["source"];
var view = source == null ? null : json["images"]?[(int)source]?["bufferView"];
if (view == null) return null;
var v = json["bufferViews"][(int)view];
var bytes = new byte[(int)v["byteLength"]];
Buffer.BlockCopy(glb, binAt + ((int?)v["byteOffset"] ?? 0), bytes, 0, bytes.Length);
return bytes;
}
// sRGB, mips, BC7. Scaled down first when larger than max. Every step is CPU work on the image's pixels (decode, area average,
// mip chain, BC7), so the product is the same with or without a graphics device (-nographics batch imports, CI, cache producers).
static Texture2D Albedo(byte[] image, int max)
{
var decoded = new Texture2D(2, 2, TextureFormat.RGBA32, false, false);
if (!decoded.LoadImage(image, false)) { UnityEngine.Object.DestroyImmediate(decoded); return null; }
int w = decoded.width, h = decoded.height, side = Math.Max(w, h);
var pixels = decoded.GetPixels32();
UnityEngine.Object.DestroyImmediate(decoded);
if (side > max)
{
int tw = Math.Max(1, w * max / side), th = Math.Max(1, h * max / side);
pixels = AreaAverage(pixels, w, h, tw, th);
w = tw; h = th;
}
var texture = new Texture2D(w, h, TextureFormat.RGBA32, true, false);
texture.SetPixels32(pixels);
texture.Apply(true);
EditorUtility.CompressTexture(texture, TextureFormat.BC7, TextureCompressionQuality.Normal);
return texture;
}
// Each target pixel is the mean of the source pixels it covers (box filter by source index ranges).
static Color32[] AreaAverage(Color32[] src, int w, int h, int tw, int th)
{
var dst = new Color32[tw * th];
for (int y = 0; y < th; y++)
{
int y0 = y * h / th, y1 = Math.Max(y0 + 1, (y + 1) * h / th);
for (int x = 0; x < tw; x++)
{
int x0 = x * w / tw, x1 = Math.Max(x0 + 1, (x + 1) * w / tw);
int r = 0, g = 0, bl = 0, a = 0, n = 0;
for (int sy = y0; sy < y1; sy++)
for (int sx = x0; sx < x1; sx++) { var p = src[sy * w + sx]; r += p.r; g += p.g; bl += p.b; a += p.a; n++; }
dst[y * tw + x] = new Color32((byte)((r + n / 2) / n), (byte)((g + n / 2) / n), (byte)((bl + n / 2) / n), (byte)((a + n / 2) / n));
}
}
return dst;
}
// The JSON chunk and the offset of the BIN chunk's data (the container SpringRigData.FromGlb reads).
static (JObject json, int binAt) Chunks(byte[] glb)
{
JObject json = null; int binAt = -1;
for (int at = 12; at + 8 <= glb.Length;)
{
int length = (int)BitConverter.ToUInt32(glb, at);
uint type = BitConverter.ToUInt32(glb, at + 4);
if (type == 0x4E4F534A) json = JObject.Parse(Encoding.UTF8.GetString(glb, at + 8, length));
else if (type == 0x004E4942 && binAt < 0) binAt = at + 8;
at += 8 + length;
}
return (json, binAt);
}
// glTFast's own importer drives its loader to completion this way (its AsyncHelpers.RunSync is internal): a context that runs
// every continuation on this thread, so Unity's API is only touched from it.
static bool RunSync(Func<Task<bool>> work)
{
var previous = SynchronizationContext.Current;
var loop = new Loop();
SynchronizationContext.SetSynchronizationContext(loop);
try { return loop.Run(work); }
finally { SynchronizationContext.SetSynchronizationContext(previous); }
}
sealed class Loop : SynchronizationContext
{
readonly Queue<(SendOrPostCallback, object)> _queue = new Queue<(SendOrPostCallback, object)>();
readonly AutoResetEvent _wake = new AutoResetEvent(false);
public override void Post(SendOrPostCallback d, object state) { lock (_queue) _queue.Enqueue((d, state)); _wake.Set(); }
public bool Run(Func<Task<bool>> work)
{
var task = work();
task.ContinueWith(_ => _wake.Set(), TaskScheduler.Default);
while (!task.IsCompleted)
{
(SendOrPostCallback, object) item = default; bool any;
lock (_queue) { any = _queue.Count > 0; if (any) item = _queue.Dequeue(); }
if (any) item.Item1(item.Item2); else _wake.WaitOne(50);
}
return task.GetAwaiter().GetResult();
}
}
}
}

View file

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 467b0d4c17afeb24e8a27b9be8f80f59

File diff suppressed because it is too large Load diff

View file

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 5f27873c0b90b6049a96315bf294d8c0

View file

@ -1,221 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using Unity.Collections;
using Unity.Jobs;
using Unity.Mathematics;
using UnityEngine;
namespace Aetheria.FaunaDisplay
{
public enum SpringLod { Full, Frozen, Hidden }
// One whale's skeleton, presentation only (rulings whale-rig-spring-bone-tendrils, presenter-phase-from-zone-time,
// fauna-in-sim-ruled): it owns every bone pose and skin matrix, body and tendril, of the frame it draws. The caller
// hands in the drawn time (DrawAhead.Time) and the whale's root pose; nothing else enters, and only the skin buffer
// and the renderer's bounds leave. No GameObject per joint and no Unity skinning or animation components: a shader reads the
// skin matrices (SpringSkin.cginc) from the mesh's BLENDINDICES and BLENDWEIGHTS.
public sealed class SpringRig : MonoBehaviour
{
// The solver's fixed substep, in drawn seconds, and the most substeps one frame runs. The two cannot both hold below
// MaxSubsteps x SubstepRate = 30 frames a second: there a frame owes more than 4 and the tendrils run slow (24 fps: at
// 80% of drawn time), which is the clamp's purpose (a hitch or a slow machine must not spiral). At 30 fps and above
// the count over any span is floor(span x 120) up to rounding at a boundary, which the interpolated pose hides.
public const int SubstepRate = 120;
public const int MaxSubsteps = 4;
[Tooltip("The rig's GLB (a .springrig the importer wraps). Awake initializes from it when set; callers that Initialize by hand leave it null.")]
public TextAsset Rig;
public MeshRenderer Renderer;
public SwimSettings Swim = SwimSettings.Default;
[Tooltip("Projected height of the whale as a fraction of the viewport at or above which the tendrils are solved.")]
public float FullAbove = 0.06f;
[Tooltip("Below FullAbove and at or above this the tendrils hold their rest pose on the swimming body; below it the caller hides them.")]
public float FrozenAbove = 0.015f;
[Tooltip("A level is left only once the projected height is this fraction below the threshold that entered it.")]
[Range(0f, 0.5f)] public float Hysteresis = 0.15f;
[Tooltip("Drawn seconds over which the tendrils ease to rest when the level leaves Full: 0.5 to 1 reads as settling, a quarter second as a flare.")]
public float BlendSeconds = 0.75f;
public Camera LodCamera;
public SpringRigData Data { get; private set; }
public SpringLod Level { get; private set; }
public GraphicsBuffer SkinBuffer { get; private set; }
public NativeArray<float4x4>.ReadOnly Skin => _skin.AsReadOnly();
public long SubstepsRun { get; private set; }
public int SolveJobsScheduled { get; private set; }
public int Resets { get; private set; }
public float3 BonePosition(int bone) => _bonePos[bone];
public quaternion BoneRotation(int bone) => _boneRot[bone];
NativeArray<int> _order, _parent, _spine, _chainStart, _chainLen, _chainBone, _chainColStart, _chainColLen, _chainCol;
NativeArray<float3> _restPos, _bonePos, _simPos, _simPrev, _drawn;
NativeArray<quaternion> _restRot, _boneRot;
NativeArray<float4x4> _bind, _skin;
NativeArray<SpringJointParams> _param;
NativeArray<SpringCollider> _colliders;
bool _started, _wasFull;
long _lastIndex;
float3 _lastPosition;
float _pad;
float _lodDiameter, _restWeight = 1f, _lastFrac;
double _lastTime;
bool _everFull;
NativeArray<float3> _minMax;
readonly System.Collections.Generic.List<IDisposable> _owned = new System.Collections.Generic.List<IDisposable>();
NativeArray<T> Own<T>(T[] source) where T : unmanaged { var a = new NativeArray<T>(source, Allocator.Persistent); _owned.Add(a); return a; }
NativeArray<T> Own<T>(int length) where T : unmanaged { var a = new NativeArray<T>(length, Allocator.Persistent); _owned.Add(a); return a; }
public void Initialize(SpringRigData data, Bounds meshBounds)
{
Release();
Data = data;
_order = Own(data._order);
_parent = Own(data._parent);
_spine = Own(data._spine);
_chainStart = Own(data._chainStart);
_chainLen = Own(data._chainLen);
_chainBone = Own(data._chainBone);
_chainColStart = Own(data._chainColStart);
_chainColLen = Own(data._chainColLen);
_chainCol = Own(data._chainCol);
_restPos = Own(data._restPos);
_restRot = Own(data._restRot);
_bind = Own(data._bind);
_param = Own(data._chainParam);
_colliders = Own(data._colliders);
int n = data.BoneCount;
_bonePos = Own<float3>(n);
_simPos = Own<float3>(n);
_simPrev = Own<float3>(n);
_drawn = Own<float3>(n);
_boneRot = Own<quaternion>(n);
_skin = Own<float4x4>(n);
_minMax = Own<float3>(2);
SkinBuffer = new GraphicsBuffer(GraphicsBuffer.Target.Structured, n, 64);
var block = new MaterialPropertyBlock();
block.SetBuffer("_SpringBones", SkinBuffer);
Renderer.SetPropertyBlock(block);
// The mesh reaches past its bones by the rest mesh's margin; each frame's bounds are the bones' reach plus that margin.
var restPos = new float3[n]; var restRot = new quaternion[n];
float3 lo = new float3(float.MaxValue), hi = new float3(float.MinValue);
foreach (int i in data._order)
{
int p = data._parent[i];
restPos[i] = (p < 0 ? default : restPos[p]) + math.mul(p < 0 ? quaternion.identity : restRot[p], data._restPos[i]);
restRot[i] = math.mul(p < 0 ? quaternion.identity : restRot[p], data._restRot[i]);
lo = math.min(lo, restPos[i]); hi = math.max(hi, restPos[i]);
}
_lodDiameter = meshBounds.extents.magnitude * 2f;
Renderer.localBounds = meshBounds;
// One radius all round (the mesh turns with its bones): the rest mesh's largest margin past its bones, per axis, as a length.
_pad = math.length(math.max(math.max(lo - (float3)meshBounds.min, (float3)meshBounds.max - hi), 0f));
_started = false;
_everFull = false;
_restWeight = 1f;
}
// The one entry: swim pose, solver substeps, skin write, upload, bounds. drawnTime is DrawAhead.Time.
public SpringLod Present(double drawnTime, Vector3 position, Quaternion rotation, float scale)
{
if (Data == null) throw new InvalidOperationException("SpringRig.Present before Initialize.");
Level = Classify(position, scale);
bool full = Level == SpringLod.Full;
// Substeps owed: the fixed 1/120 s boundaries crossed since the last frame, by absolute drawn time so the
// count over any span is the same at any frame rate. Not full: keep the index current so an unfreeze owes nothing.
long index = (long)math.floor(drawnTime * SubstepRate);
int steps = _started && full ? (int)math.clamp(index - _lastIndex, 0, MaxSubsteps) : 0;
_lastIndex = index;
float frac = (float)(drawnTime * SubstepRate - index);
// Leaving Full the tendrils ease to rest over BlendSeconds of drawn time (no snap); the solver still draws, with no steps.
double dt = _started ? math.max(drawnTime - _lastTime, 0) : 0;
_lastTime = drawnTime;
bool midEase = _everFull && _restWeight < 1f; // a return to Full from here starts from the pose last drawn, not from rest
if (full) { _restWeight = 0f; _everFull = true; _lastFrac = frac; }
else if (_everFull) _restWeight = (float)math.min(1.0, _restWeight + dt / math.max(BlendSeconds, 1e-4f));
bool easing = !full && _everFull && _restWeight < 1f;
bool jumped = math.distance(_lastPosition, position) > Data.MaxChainLength * scale;
bool reset = !_started || (full && !_wasFull) || jumped;
bool seedDrawn = reset && _started && !jumped && full && !_wasFull && midEase;
_started = true;
_wasFull = full;
_lastPosition = position;
if (reset && full) Resets++;
var pos = (float3)position;
var rot = (quaternion)rotation;
var pose = new PoseJob
{
order = _order, parent = _parent, spine = _spine, restPos = _restPos, restRot = _restRot,
swim = Swim, time = drawnTime, rootPos = pos, rootRot = rot, scale = scale, bonePos = _bonePos, boneRot = _boneRot,
}.Schedule();
if (full || easing)
{
SolveJobsScheduled++;
SubstepsRun += steps;
pose = new SpringSolveJob
{
chainStart = _chainStart, chainLen = _chainLen, chainBone = _chainBone, chainColStart = _chainColStart, chainColLen = _chainColLen,
chainCol = _chainCol, restPos = _restPos, restRot = _restRot, param = _param, colliders = _colliders,
bonePos = _bonePos, boneRot = _boneRot, simPos = _simPos, simPrev = _simPrev,
drawn = _drawn, seedDrawn = seedDrawn,
substeps = steps, step = 1f / SubstepRate, scale = scale, frac = full ? frac : _lastFrac, blend = full ? 0f : _restWeight, reset = reset,
}.Schedule(Data.ChainCount, 4, pose);
}
var skinned = new SkinJob
{
bonePos = _bonePos, boneRot = _boneRot, bind = _bind, rootInverse = math.inverse(float4x4.TRS(pos, rot, new float3(scale))), scale = scale, skin = _skin,
}.Schedule(Data.BoneCount, 64, pose);
new BoundsJob { bonePos = _bonePos, rootPos = pos, rootRot = rot, scale = scale, minMax = _minMax }.Schedule(skinned).Complete();
SkinBuffer.SetData(_skin);
_drawn.CopyFrom(_bonePos);
var t = Renderer.transform;
t.SetPositionAndRotation(position, rotation);
t.localScale = new Vector3(scale, scale, scale);
// Bounds follow the pose: every bone in object space, plus the rest mesh's margin around the bones.
float3 min = _minMax[0] - _pad, max = _minMax[1] + _pad;
Renderer.localBounds = new Bounds((min + max) * 0.5f, max - min);
return Level;
}
// Projected height of the whale's bounds as a fraction of the viewport.
SpringLod Classify(Vector3 position, float scale)
{
var cam = LodCamera;
if (cam == null) return SpringLod.Full;
float diameter = _lodDiameter * scale;
float visible = cam.orthographic ? cam.orthographicSize * 2f : 2f * Vector3.Distance(cam.transform.position, position) * Mathf.Tan(cam.fieldOfView * 0.5f * Mathf.Deg2Rad);
float height = diameter / Mathf.Max(visible, 1e-6f), stay = 1f - Hysteresis;
if (height >= FullAbove * (Level == SpringLod.Full ? stay : 1f)) return SpringLod.Full;
return height >= FrozenAbove * (Level != SpringLod.Hidden ? stay : 1f) ? SpringLod.Frozen : SpringLod.Hidden;
}
void Release()
{
foreach (var a in _owned) a.Dispose();
_owned.Clear();
SkinBuffer?.Release();
SkinBuffer = null;
}
// From the serialized Rig and this object's mesh. Awake calls it in play; an editor tool that instantiates the asset outside play
// (Awake does not run there) calls it itself.
public void Initialize() => Initialize(SpringRigData.FromGlb(Rig.bytes), GetComponent<MeshFilter>().sharedMesh.bounds);
void Awake()
{
if (Rig != null && Data == null) Initialize();
}
void OnDestroy() => Release();
}
}

View file

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 02a69b7a8aa84824cbd397cbe3c02d4b

View file

@ -1,316 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Newtonsoft.Json.Linq;
using Unity.Mathematics;
namespace Aetheria.FaunaDisplay
{
// One spring joint's VRMC_springBone parameters. They drive the segment that ends at the NEXT joint of the chain.
// Stiffness is a RATE in 1/s and dimensionless in length: each substep the joint closes saturate(Stiffness x step) of its
// distance to the rest target, so the same number moves a 0.1 u tendril and a 10 u one by the same fraction. VRMC_springBone
// gives stiffness a length-per-second unit (a fixed-magnitude nudge along the rest axis), so a rig authored by a VRM tool
// reads this field with a different meaning; the Blender builder (whale-rig-builder) authors it as a rate. GravityPower is
// a displacement per second in rig units and DragForce a fraction of velocity lost per substep, as in VRM.
public readonly struct SpringJointParams
{
public readonly float HitRadius, Stiffness, GravityPower, DragForce;
public readonly float3 GravityDir;
public SpringJointParams(float hitRadius, float stiffness, float gravityPower, float3 gravityDir, float dragForce)
{ HitRadius = hitRadius; Stiffness = stiffness; GravityPower = gravityPower; GravityDir = gravityDir; DragForce = dragForce; }
}
// A VRMC_springBone collider bound to a body bone: sphere (Tail unused) or capsule from Offset to Tail, in the bone's frame.
public readonly struct SpringCollider
{
public readonly int Bone;
public readonly bool Capsule;
public readonly float3 Offset, Tail;
public readonly float Radius;
public SpringCollider(int bone, bool capsule, float3 offset, float3 tail, float radius)
{ Bone = bone; Capsule = capsule; Offset = offset; Tail = tail; Radius = radius; }
}
// The parsed rig: a glTF skin plus VRMC_springBone 1.0 (the seam with the Blender builder). Bone index = skin joint
// index, so the mesh's BLENDINDICES address the skin matrices directly. Skin joints no spring names are body bones.
// Immutable after FromGlbJson; presentation only (nothing in ServerShared reads it).
// HANDEDNESS: glTF is right-handed, Unity left-handed, and glTFast mirrors x on everything it imports (positions, normals,
// node translations (-x,y,z), rotations (x,-y,-z,w), bind poses S M S with S = diag(-1,1,1)). FromGlbJson is the one owner
// of the same mirror for the rig: every vector, rotation, matrix, collider offset and gravity direction it returns is in
// Unity space, matching a glTFast-imported mesh and node tree. Nothing downstream converts.
public sealed class SpringRigData
{
public int BoneCount => _parent.Length;
public int BodyCount { get; private set; }
public int ChainCount => _chainStart.Length;
public int SpringJointCount => _chainBone.Length;
public float MaxChainLength { get; private set; }
public IReadOnlyList<int> Parent => _parent; // bone parent in the skin, -1 for a root
public IReadOnlyList<float3> RestPosition => _restPos; // local to the parent (roots: composed over non-skin ancestors)
public IReadOnlyList<quaternion> RestRotation => _restRot;
public IReadOnlyList<float4x4> BindPose => _bind; // inverseBindMatrices
public IReadOnlyList<bool> IsBody => _isBody;
public IReadOnlyList<int> SpineIndex => _spine; // position along the swimming spine, -1 off it
public IReadOnlyList<SpringCollider> Colliders => _colliders;
public string ChainName(int c) => _chainName[c];
public IReadOnlyList<int> ChainBones(int c) => new ArraySegment<int>(_chainBone, _chainStart[c], _chainLen[c]);
public SpringJointParams ChainJoint(int c, int k) => _chainParam[_chainStart[c] + k];
public IReadOnlyList<int> ChainColliders(int c) => new ArraySegment<int>(_chainCol, _chainColStart[c], _chainColLen[c]);
// Flattened layout the jobs copy: chain c owns [ChainStart[c], +ChainLen[c]) of ChainBone/ChainParam.
internal int[] _parent, _order, _spine, _chainStart, _chainLen, _chainBone, _chainColStart, _chainColLen, _chainCol;
internal float3[] _restPos;
internal quaternion[] _restRot;
internal float4x4[] _bind;
internal bool[] _isBody;
internal SpringJointParams[] _chainParam;
internal SpringCollider[] _colliders;
string[] _chainName;
SpringRigData() { }
// A GLB container: header, JSON chunk, optional BIN chunk.
public static SpringRigData FromGlb(byte[] glb, int skin = 0)
{
if (glb.Length < 20 || BitConverter.ToUInt32(glb, 0) != 0x46546C67) throw new InvalidDataException("Not a GLB (magic).");
int at = 12;
JObject json = null;
byte[] bin = null;
while (at + 8 <= glb.Length)
{
int length = (int)BitConverter.ToUInt32(glb, at);
uint type = BitConverter.ToUInt32(glb, at + 4);
if (type == 0x4E4F534A) json = JObject.Parse(Encoding.UTF8.GetString(glb, at + 8, length));
else if (type == 0x004E4942 && bin == null) { bin = new byte[length]; Buffer.BlockCopy(glb, at + 8, bin, 0, length); }
at += 8 + length;
}
return FromGlbJson(json ?? throw new InvalidDataException("GLB has no JSON chunk."), bin, skin);
}
// json is the GLB JSON chunk, bin the BIN chunk (the inverseBindMatrices live there).
public static SpringRigData FromGlbJson(JObject json, byte[] bin, int skinIndex = 0)
{
var nodes = json["nodes"] as JArray ?? throw new InvalidDataException("glTF has no nodes.");
var skins = json["skins"] as JArray;
var skin = skins != null && skinIndex >= 0 && skinIndex < skins.Count ? skins[skinIndex] as JObject : null;
if (skin == null) throw new InvalidDataException($"glTF has no skin {skinIndex}.");
var joints = (skin["joints"] as JArray)?.Select(j => (int)j).ToArray() ?? throw new InvalidDataException("Skin has no joints.");
int n = nodes.Count, b = joints.Length;
// Node parents from children; a node with two parents or a loop is refused by name.
var nodeParent = Enumerable.Repeat(-1, n).ToArray();
for (int i = 0; i < n; i++)
foreach (var child in (nodes[i]["children"] as JArray) ?? new JArray())
{
int c = (int)child;
if (c < 0 || c >= n) throw new InvalidDataException($"Node {i} names child {c} outside the node list.");
if (nodeParent[c] >= 0) throw new InvalidDataException($"Node {c} has two parents ({nodeParent[c]} and {i}).");
nodeParent[c] = i;
}
for (int i = 0; i < n; i++)
{
int hops = 0;
for (int p = nodeParent[i]; p >= 0; p = nodeParent[p])
if (++hops > n) throw new InvalidDataException($"Cycle in the node tree through node {i}.");
}
var boneOfNode = Enumerable.Repeat(-1, n).ToArray();
for (int i = 0; i < b; i++)
{
if (joints[i] < 0 || joints[i] >= n) throw new InvalidDataException($"Skin joint {i} names node {joints[i]} outside the node list.");
if (boneOfNode[joints[i]] >= 0) throw new InvalidDataException($"Node {joints[i]} appears twice in the skin.");
boneOfNode[joints[i]] = i;
}
var d = new SpringRigData { _isBody = Enumerable.Repeat(true, b).ToArray() };
d._parent = new int[b];
d._restPos = new float3[b];
d._restRot = new quaternion[b];
for (int i = 0; i < b; i++)
{
// Rest pose of a bone is its node's TRS; a bone whose parent node is outside the skin composes that ancestry in.
var (pos, rot) = LocalRest(nodes, joints[i]);
int pn = nodeParent[joints[i]];
var outside = new List<int>();
while (pn >= 0 && boneOfNode[pn] < 0) { outside.Add(pn); pn = nodeParent[pn]; }
d._parent[i] = pn >= 0 ? boneOfNode[pn] : -1;
foreach (var o in outside)
{
var (op, or) = LocalRest(nodes, o);
pos = op + math.mul(or, pos);
rot = math.mul(or, rot);
}
d._restPos[i] = pos;
d._restRot[i] = rot;
}
// Colliders, groups, springs.
var ext = json["extensions"]?["VRMC_springBone"] as JObject;
var colliders = new List<SpringCollider>();
var colliderJson = (ext?["colliders"] as JArray) ?? new JArray();
for (int ci = 0; ci < colliderJson.Count; ci++)
{
var c = colliderJson[ci];
int node = (int)c["node"];
if (node < 0 || node >= n || boneOfNode[node] < 0) throw new InvalidDataException($"Collider {ci} sits on node {node}, which is not a skin joint.");
var shape = c["shape"] as JObject ?? throw new InvalidDataException($"Collider {ci} has no shape.");
var props = shape.Properties().ToArray();
if (props.Length != 1 || (props[0].Name != "sphere" && props[0].Name != "capsule"))
throw new InvalidDataException($"Collider {ci}: unknown shape '{string.Join(",", props.Select(p => p.Name))}' (sphere or capsule).");
var s = props[0].Value;
bool capsule = props[0].Name == "capsule";
var offset = Vec3(s["offset"], default);
colliders.Add(new SpringCollider(boneOfNode[node], capsule, offset, capsule ? Vec3(s["tail"], default) : offset, (float)(s["radius"] ?? 0f)));
}
d._colliders = colliders.ToArray();
var groups = ((ext?["colliderGroups"] as JArray) ?? new JArray()).Select(g => ((g["colliders"] as JArray) ?? new JArray()).Select(x => (int)x).ToArray()).ToArray();
var springs = ((ext?["springs"] as JArray) ?? new JArray()).Cast<JObject>().ToArray();
var springBones = new List<int[]>();
for (int si = 0; si < springs.Length; si++)
{
var name = (string)springs[si]["name"] ?? $"spring{si}";
var bones = ((springs[si]["joints"] as JArray) ?? new JArray()).Select(j =>
{
int node = (int)j["node"];
if (node < 0 || node >= n || boneOfNode[node] < 0) throw new InvalidDataException($"Spring '{name}' names node {node}, which is not a skin joint.");
return boneOfNode[node];
}).ToArray();
if (bones.Length < 2) throw new InvalidDataException($"Spring '{name}' needs at least two joints.");
foreach (var bone in bones)
{
if (!d._isBody[bone]) throw new InvalidDataException($"Spring '{name}': node {joints[bone]} is named twice by springs.");
d._isBody[bone] = false;
}
springBones.Add(bones);
}
for (int ci = 0; ci < d._colliders.Length; ci++)
if (!d._isBody[d._colliders[ci].Bone])
throw new InvalidDataException($"Collider {ci} sits on node {joints[d._colliders[ci].Bone]}, a spring joint; colliders ride body bones.");
for (int si = 0; si < springBones.Count; si++)
{
var bones = springBones[si];
var name = (string)springs[si]["name"] ?? $"spring{si}";
for (int k = 0; k < bones.Length; k++)
{
int parent = d._parent[bones[k]];
if (k == 0 && (parent < 0 || !d._isBody[parent]))
throw new InvalidDataException($"Spring '{name}': first joint (node {joints[bones[0]]}) must hang from a body bone.");
if (k > 0 && math.lengthsq(d._restPos[bones[k]]) < 1e-12f)
throw new InvalidDataException($"Spring '{name}': joint {k} (node {joints[bones[k]]}) sits on its predecessor; a segment needs a length.");
if (k > 0 && parent != bones[k - 1])
throw new InvalidDataException($"Spring '{name}': joint {k} (node {joints[bones[k]]}) has parent {(parent < 0 ? "none" : "node " + joints[parent])}, not its predecessor node {joints[bones[k - 1]]}.");
}
}
var chainBone = new List<int>(); var chainParam = new List<SpringJointParams>(); var chainCol = new List<int>();
var starts = new List<int>(); var lens = new List<int>(); var cstarts = new List<int>(); var clens = new List<int>(); var names = new List<string>();
float longest = 0;
for (int si = 0; si < springBones.Count; si++)
{
var bones = springBones[si];
var sp = springs[si];
starts.Add(chainBone.Count); lens.Add(bones.Length); names.Add((string)sp["name"] ?? $"spring{si}");
var js = (JArray)sp["joints"];
float length = 0;
for (int k = 0; k < bones.Length; k++)
{
chainBone.Add(bones[k]);
var j = js[k];
chainParam.Add(new SpringJointParams((float)(j["hitRadius"] ?? 0f), (float)(j["stiffness"] ?? 1f), (float)(j["gravityPower"] ?? 0f),
Vec3(j["gravityDir"], new float3(0, -1, 0)), (float)(j["dragForce"] ?? 0.5f)));
if (k > 0) length += math.length(d._restPos[bones[k]]);
}
longest = math.max(longest, length);
cstarts.Add(chainCol.Count);
var set = new SortedSet<int>();
foreach (var g in (sp["colliderGroups"] as JArray) ?? new JArray())
{
int gi = (int)g;
if (gi < 0 || gi >= groups.Length) throw new InvalidDataException($"Spring '{names[names.Count - 1]}' names collider group {gi}, which does not exist.");
foreach (var c in groups[gi])
{
if (c < 0 || c >= d._colliders.Length) throw new InvalidDataException($"Collider group {gi} names collider {c}, which does not exist.");
set.Add(c);
}
}
chainCol.AddRange(set); clens.Add(set.Count);
}
d._chainBone = chainBone.ToArray(); d._chainParam = chainParam.ToArray(); d._chainCol = chainCol.ToArray();
d._chainStart = starts.ToArray(); d._chainLen = lens.ToArray(); d._chainColStart = cstarts.ToArray(); d._chainColLen = clens.ToArray();
d._chainName = names.ToArray();
d.MaxChainLength = longest;
d.BodyCount = d._isBody.Count(x => x);
// Parents before children.
var children = new List<int>[b];
for (int i = 0; i < b; i++) children[i] = new List<int>();
var roots = new List<int>();
for (int i = 0; i < b; i++) (d._parent[i] < 0 ? roots : children[d._parent[i]]).Add(i);
var order = new List<int>(roots);
for (int i = 0; i < order.Count; i++) order.AddRange(children[order[i]]);
d._order = order.ToArray();
// Spine: from the first body root, the body child with the most body descendants at each step; the swim wave runs down it.
var weight = new int[b];
for (int i = d._order.Length - 1; i >= 0; i--)
{
int bone = d._order[i];
if (!d._isBody[bone]) continue;
weight[bone] += 1;
if (d._parent[bone] >= 0) weight[d._parent[bone]] += weight[bone];
}
d._spine = Enumerable.Repeat(-1, b).ToArray();
int cur = roots.Where(r => d._isBody[r]).DefaultIfEmpty(-1).First(), depth = 0;
while (cur >= 0)
{
d._spine[cur] = depth++;
cur = children[cur].Where(c => d._isBody[c]).OrderByDescending(c => weight[c]).DefaultIfEmpty(-1).First();
}
d._bind = ReadBindPoses(json, skin, bin, b);
return d;
}
// A glTF vector read into Unity space (x mirrored).
static float3 Vec3(JToken t, float3 fallback) => t is JArray a && a.Count == 3 ? new float3(-(float)a[0], (float)a[1], (float)a[2]) : fallback;
static (float3, quaternion) LocalRest(JArray nodes, int node)
{
var nd = nodes[node];
if (nd["matrix"] != null) throw new InvalidDataException($"Node {node} uses a matrix; the rig takes translation, rotation and unit scale.");
if (nd["scale"] is JArray s && (math.abs((float)s[0] - 1) > 1e-4f || math.abs((float)s[1] - 1) > 1e-4f || math.abs((float)s[2] - 1) > 1e-4f))
throw new InvalidDataException($"Node {node} has a non-unit scale; bake it before export.");
float3 t = Vec3(nd["translation"], default);
var r = nd["rotation"] as JArray;
return (t, r != null && r.Count == 4 ? math.normalize(new quaternion((float)r[0], -(float)r[1], -(float)r[2], (float)r[3])) : quaternion.identity);
}
static float4x4[] ReadBindPoses(JObject json, JObject skin, byte[] bin, int count)
{
var result = Enumerable.Repeat(float4x4.identity, count).ToArray();
if (skin["inverseBindMatrices"] == null) return result;
var acc = (json["accessors"] as JArray)?[(int)skin["inverseBindMatrices"]] ?? throw new InvalidDataException("inverseBindMatrices names a missing accessor.");
var view = (json["bufferViews"] as JArray)?[(int)acc["bufferView"]] ?? throw new InvalidDataException("inverseBindMatrices accessor has no bufferView.");
if ((int)acc["componentType"] != 5126 || (string)acc["type"] != "MAT4" || (int)acc["count"] < count)
throw new InvalidDataException("inverseBindMatrices must be float MAT4, one per joint.");
int at = (int)(view["byteOffset"] ?? 0) + (int)(acc["byteOffset"] ?? 0);
if (bin == null || at + count * 64 > bin.Length) throw new InvalidDataException("inverseBindMatrices run past the BIN chunk.");
for (int i = 0; i < count; i++)
{
var f = new float[16];
Buffer.BlockCopy(bin, at + i * 64, f, 0, 64);
// glTF is column-major; S M S negates the x row and column but for m00.
result[i] = new float4x4(f[0], -f[4], -f[8], -f[12], -f[1], f[5], f[9], f[13], -f[2], f[6], f[10], f[14], f[3], f[7], f[11], f[15]);
}
return result;
}
}
}

View file

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: f6469766221cfcc439a676418613514c

View file

@ -1,204 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using Unity.Burst;
using Unity.Collections;
using Unity.Jobs;
using Unity.Mathematics;
namespace Aetheria.FaunaDisplay
{
// The three jobs one whale runs each frame, in order: PoseJob (every bone at its swimming-body pose, springs at rest),
// SpringSolveJob (the VRM SpringBone step over chains, then the interpolated drawn pose, overwriting the spring bones; skipped when frozen) and SkinJob
// (skin = rootInverse x boneWorld x bindPose for every bone). Bone worlds are position + rotation with a uniform scale;
// the solver works in world space so a swimming root drags the tendrils.
[BurstCompile(CompileSynchronously = true, DisableSafetyChecks = true)]
public struct PoseJob : IJob
{
[ReadOnly] public NativeArray<int> order, parent, spine;
[ReadOnly] public NativeArray<float3> restPos;
[ReadOnly] public NativeArray<quaternion> restRot;
public SwimSettings swim;
public double time;
public float3 rootPos;
public quaternion rootRot;
public float scale;
public NativeArray<float3> bonePos;
public NativeArray<quaternion> boneRot;
public void Execute()
{
for (int n = 0; n < order.Length; n++)
{
int i = order[n], p = parent[i];
quaternion local = spine[i] >= 0 ? math.mul(restRot[i], SwimPose.Rotation(time, spine[i], swim)) : restRot[i];
quaternion pr = p < 0 ? rootRot : boneRot[p];
float3 pp = p < 0 ? rootPos : bonePos[p];
bonePos[i] = pp + math.mul(pr, restPos[i] * scale);
boneRot[i] = math.mul(pr, local);
}
}
}
[BurstCompile(CompileSynchronously = true, DisableSafetyChecks = true)]
public struct SpringSolveJob : IJobParallelFor
{
[ReadOnly] public NativeArray<int> chainStart, chainLen, chainBone, chainColStart, chainColLen, chainCol;
[ReadOnly] public NativeArray<float3> restPos;
[ReadOnly] public NativeArray<quaternion> restRot;
[ReadOnly] public NativeArray<SpringJointParams> param;
[ReadOnly] public NativeArray<SpringCollider> colliders;
// The bone positions drawn last frame; a reset seeds from them when seedDrawn (a return to Full part way through the ease), from rest otherwise.
[ReadOnly] public NativeArray<float3> drawn;
public bool seedDrawn;
// Bone-indexed. A chain writes only its own bones; colliders read body bones only.
[NativeDisableParallelForRestriction] public NativeArray<float3> bonePos, simPos, simPrev;
[NativeDisableParallelForRestriction] public NativeArray<quaternion> boneRot;
public int substeps;
public float step, scale, frac, blend;
public bool reset;
public void Execute(int c)
{
int start = chainStart[c], len = chainLen[c];
if (reset)
for (int k = 0; k < len; k++)
{
int bone = chainBone[start + k];
simPos[bone] = simPrev[bone] = seedDrawn ? drawn[bone] : bonePos[bone];
}
int root = chainBone[start];
float3 headPos0 = bonePos[root];
quaternion headRest0 = boneRot[root];
// The fixed steps: the VRM SpringBone step per joint, head to tip, against the body as posed this frame.
for (int s = 0; s < substeps; s++)
{
float3 headPos = headPos0;
quaternion headRest = headRest0;
for (int k = 1; k < len; k++)
{
int bone = chainBone[start + k];
var jp = param[start + k - 1];
float3 p = simPos[bone];
float seg = math.length(restPos[bone]) * scale;
float3 axis = math.normalizesafe(restPos[bone], new float3(0, -1, 0));
float3 target = headPos + math.mul(headRest, restPos[bone] * scale);
float3 np = p + (p - simPrev[bone]) * (1f - jp.DragForce) // inertia
+ (target - p) * math.saturate(jp.Stiffness * step) // pull to the rest direction from the parent's current rotation
+ jp.GravityDir * (jp.GravityPower * step * scale); // gravity
np = Reproject(headPos, np, seg, math.mul(headRest, axis));
float hit = jp.HitRadius * scale;
int cs = chainColStart[c], cn = chainColLen[c];
for (int q = 0; q < cn; q++) np = PushOut(np, colliders[chainCol[cs + q]], hit);
np = Reproject(headPos, np, seg, math.mul(headRest, axis));
simPrev[bone] = p;
simPos[bone] = np;
headRest = math.mul(Aim(headRest, axis, np - headPos), restRot[bone]);
headPos = np;
}
}
// The pose drawn: the last two fixed steps blended by the leftover fraction of a step (so a frame that owes no
// step still moves), then pushed out of the colliders and the lengths held again from this frame's head. The state itself is not touched.
float3 head = headPos0;
quaternion rest = headRest0;
for (int k = 1; k < len; k++)
{
int bone = chainBone[start + k];
float seg = math.length(restPos[bone]) * scale;
float3 axis = math.normalizesafe(restPos[bone], new float3(0, -1, 0));
var jp = param[start + k - 1];
float3 fall = math.mul(rest, axis);
float3 p = Reproject(head, math.lerp(math.lerp(simPrev[bone], simPos[bone], frac), bonePos[bone], blend), seg, fall); // blend: weight toward rest (bonePos still holds it)
int cs = chainColStart[c], cn = chainColLen[c];
// A blend of two pushed-out points can dip into a collider; two rounds of push-out and length settle it.
for (int round = 0; round < 2 && cn > 0; round++)
{
for (int q = 0; q < cn; q++) p = PushOut(p, colliders[chainCol[cs + q]], jp.HitRadius * scale);
p = Reproject(head, p, seg, fall);
}
quaternion aimed = Aim(rest, axis, p - head);
boneRot[chainBone[start + k - 1]] = aimed;
bonePos[bone] = p;
head = p;
rest = math.mul(aimed, restRot[bone]);
}
boneRot[chainBone[start + len - 1]] = rest;
}
// The head's rotation once its bone axis (in its rest frame) points along dir.
static quaternion Aim(quaternion headRest, float3 axis, float3 dir)
{
float3 from = math.mul(headRest, axis);
return math.mul(FromTo(from, math.normalizesafe(dir, from)), headRest);
}
static float3 Reproject(float3 head, float3 p, float length, float3 fallback) => head + math.normalizesafe(p - head, fallback) * length;
float3 PushOut(float3 p, SpringCollider col, float hit)
{
float3 origin = bonePos[col.Bone], center = origin + math.mul(boneRot[col.Bone], col.Offset * scale);
float3 nearest = center;
if (col.Capsule)
{
float3 tail = origin + math.mul(boneRot[col.Bone], col.Tail * scale), axis = tail - center;
nearest = center + axis * math.saturate(math.dot(p - center, axis) / math.max(math.lengthsq(axis), 1e-12f));
}
float3 d = p - nearest;
float r = col.Radius * scale + hit, l = math.length(d);
return l < r ? nearest + (l > 1e-9f ? d / l : new float3(0, 1, 0)) * r : p;
}
static quaternion FromTo(float3 a, float3 b)
{
float d = math.dot(a, b);
if (d < -0.99999f)
{
float3 axis = math.normalize(math.cross(a, math.abs(a.x) < 0.9f ? new float3(1, 0, 0) : new float3(0, 1, 0)));
return new quaternion(axis.x, axis.y, axis.z, 0);
}
float3 c = math.cross(a, b);
return math.normalize(new quaternion(c.x, c.y, c.z, 1f + d));
}
}
// The renderer's bounds: every bone's place in the whale's object space, min and max.
[BurstCompile(CompileSynchronously = true, DisableSafetyChecks = true)]
public struct BoundsJob : IJob
{
[ReadOnly] public NativeArray<float3> bonePos;
public float3 rootPos;
public quaternion rootRot;
public float scale;
public NativeArray<float3> minMax;
public void Execute()
{
quaternion inverse = math.inverse(rootRot);
float3 min = new float3(float.MaxValue), max = new float3(float.MinValue);
for (int i = 0; i < bonePos.Length; i++)
{
float3 local = math.mul(inverse, bonePos[i] - rootPos) / scale;
min = math.min(min, local); max = math.max(max, local);
}
minMax[0] = min; minMax[1] = max;
}
}
[BurstCompile(CompileSynchronously = true, DisableSafetyChecks = true)]
public struct SkinJob : IJobParallelFor
{
[ReadOnly] public NativeArray<float3> bonePos;
[ReadOnly] public NativeArray<quaternion> boneRot;
[ReadOnly] public NativeArray<float4x4> bind;
public float4x4 rootInverse;
public float scale;
[WriteOnly] public NativeArray<float4x4> skin;
public void Execute(int i) =>
skin[i] = math.mul(rootInverse, math.mul(float4x4.TRS(bonePos[i], boneRot[i], new float3(scale)), bind[i]));
}
}

View file

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 93b873d12ec4f68459ca547f239f3b15

View file

@ -1,34 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using Unity.Mathematics;
namespace Aetheria.FaunaDisplay
{
// Body swim as a closed form of drawn time (ruling presenter-phase-from-zone-time): a wave travelling down the spine
// chain, one phase step per spine bone. Pure: no state, no clock; the same drawn time gives the same pose however it
// was reached, and a paused zone holds it.
[Serializable]
public struct SwimSettings
{
public float AmplitudeDegrees; // peak bend of each spine bone
public float PeriodSeconds; // one full wave cycle
public float PhasePerBone; // cycles of lag per spine bone (0.1 = ten bones per wavelength)
public float3 Axis; // bend axis in the bone's local frame (X: pitch for a body along Z)
public static SwimSettings Default => new SwimSettings { AmplitudeDegrees = 6f, PeriodSeconds = 4f, PhasePerBone = 0.08f, Axis = new float3(1, 0, 0) };
}
public static class SwimPose
{
// Extra local rotation (applied after the rest rotation) of the spine bone at spineIndex at drawn time t.
public static quaternion Rotation(double t, int spineIndex, in SwimSettings s)
{
double cycles = t / math.max(s.PeriodSeconds, 1e-4f) - spineIndex * (double)s.PhasePerBone;
float phase = (float)(cycles - math.floor(cycles));
return quaternion.AxisAngle(math.normalizesafe(s.Axis, new float3(1, 0, 0)), math.radians(s.AmplitudeDegrees) * math.sin(phase * (2f * math.PI)));
}
}
}

View file

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 2e41e6c57dffede48a9926cd59432848

View file

@ -140,6 +140,7 @@ public class ActionGameManager : MonoBehaviour
public ZoneRenderer ZoneRenderer; public ZoneRenderer ZoneRenderer;
public CinemachineVirtualCamera DockCamera; public CinemachineVirtualCamera DockCamera;
public CinemachineVirtualCamera FollowCamera; public CinemachineVirtualCamera FollowCamera;
public CinemachineVirtualCamera WormholeCamera;
//public SectorRenderer SectorRenderer; //public SectorRenderer SectorRenderer;
public SectorMap SectorMap; public SectorMap SectorMap;
@ -190,6 +191,9 @@ public class ActionGameManager : MonoBehaviour
//public PlayerInput Input; //public PlayerInput Input;
// private CinemachineFramingTransposer _transposer;
// private CinemachineComposer _composer;
private bool _paused; private bool _paused;
private float _time; private float _time;
private int _zoomLevelIndex; private int _zoomLevelIndex;
@ -273,25 +277,13 @@ public class ActionGameManager : MonoBehaviour
private void OnApplicationQuit() private void OnApplicationQuit()
{ {
SaveRun(); SaveRun();
DiscardSimulation();
SavePlayerSettings(); SavePlayerSettings();
} }
// The live simulation (Scenario.Saved false), or null while a saved run or nothing is live. Whether the session is // Wormhole arrival and quit save the run; a dead run has no galaxy, so it is not saved.
// saved is derived from it alone: StartScenario is the only setter and DiscardSimulation the only clearer.
public static RunSave.Simulation Simulation { get; private set; }
// Removes what the simulation wrote to the run store, so the saved run and the next run never see it.
private void DiscardSimulation()
{
Simulation?.Discard(CultCache);
Simulation = null;
}
// Wormhole arrival and quit save the run; a dead run has no galaxy, so it is not saved, and a simulation never is.
public void SaveRun() public void SaveRun()
{ {
if (Simulation == null && CurrentGalaxy != null) if (CurrentGalaxy != null)
{ {
var (game, zones) = RunSave.Capture(CultCache, CurrentGalaxy, Zone, DockedEntity ?? CurrentEntity, var (game, zones) = RunSave.Capture(CultCache, CurrentGalaxy, Zone, DockedEntity ?? CurrentEntity,
_actionBarSlots.Select(s => s.Save()).ToArray(), Credits); _actionBarSlots.Select(s => s.Save()).ToArray(), Credits);
@ -332,7 +324,7 @@ public class ActionGameManager : MonoBehaviour
Input.Global.Enable(); Input.Global.Enable();
// The latch is the game's own, so it can disagree with the keyboard's Caps Lock light: show it. // The latch is the game's own, so it can disagree with the keyboard's Caps Lock light: show it.
Bind(Input.Player.ToggleFaceAim, context => _helm.Toggle()); Input.Player.ToggleFaceAim.performed += context => _helm.Toggle();
var markParent = GameplayUI != null ? GameplayUI.transform : UiRoot.transform; var markParent = GameplayUI != null ? GameplayUI.transform : UiRoot.transform;
var markObject = new GameObject("Face Aim Mark", typeof(RectTransform)); var markObject = new GameObject("Face Aim Mark", typeof(RectTransform));
markObject.transform.SetParent(markParent, false); markObject.transform.SetParent(markParent, false);
@ -346,59 +338,23 @@ public class ActionGameManager : MonoBehaviour
_faceAimMark.enabled = false; _faceAimMark.enabled = false;
_zoomLevelIndex = Settings.DefaultMinimapZoom; _zoomLevelIndex = Settings.DefaultMinimapZoom;
Bind(Input.Player.MinimapZoom, context => Input.Player.MinimapZoom.performed += context =>
{ {
_zoomLevelIndex = (_zoomLevelIndex + 1) % Settings.MinimapZoomLevels.Length; _zoomLevelIndex = (_zoomLevelIndex + 1) % Settings.MinimapZoomLevels.Length;
ZoneRenderer.MinimapDistance = Settings.MinimapZoomLevels[_zoomLevelIndex]; ZoneRenderer.MinimapDistance = Settings.MinimapZoomLevels[_zoomLevelIndex];
}); };
// The tactical view is a distinct camera over the grid (ruling tactical-view-distinct-mode): the wheel is one axis Input.Global.ZoneMap.performed += context =>
// from the chase view through a detent into it, and TacticalView the one owner of where on that axis the camera is.
_tactical = new TacticalView(Settings.TacticalZoomStep, Settings.TacticalBlendStart, Settings.TacticalBlendEnd,
Settings.TacticalTimeScale, Settings.TacticalFitPerRadius, Settings.DetentResistance, Settings.DetentRelaxTime,
Settings.ViewEaseTime);
// The view rig: the chase camera (child 0) and the tactical camera (child 1) mixed by the blend, built here so the
// scene stays as authored. The mix is a function of the eased distance, not a brain blend on a priority switch.
var rig = new GameObject("View Rig");
_viewRig = rig.AddComponent<CinemachineMixingCamera>();
_viewRig.Priority = FollowCamera.Priority;
FollowCamera.transform.SetParent(rig.transform, false);
FollowCamera.transform.SetAsFirstSibling();
var tacticalCamera = new GameObject("Tactical Camera");
tacticalCamera.transform.SetParent(rig.transform, false);
_tacticalCamera = tacticalCamera.AddComponent<CinemachineVirtualCamera>();
_tacticalFade = ScriptableObject.CreateInstance<TacticalFade>();
_tacticalFade.enabled.Override(true);
_tacticalFade.Background.Override(Settings.TacticalBackground);
_tacticalVolume = PostProcessManager.instance.QuickVolume(DeathPost.gameObject.layer, 100f, _tacticalFade);
_tacticalVolume.weight = 0;
var schematic = new GameObject("Tactical Schematic Camera");
schematic.transform.SetParent(ZoneRenderer.MainCamera.transform, false);
_schematicCamera = schematic.AddComponent<Camera>();
_schematicCamera.clearFlags = CameraClearFlags.Depth;
_schematicCamera.depth = ZoneRenderer.MainCamera.depth + 1;
_schematicCamera.cullingMask = 1 << LayerMask.NameToLayer("Minimap");
_schematicCamera.enabled = false;
Bind(Input.Player.Zoom, context =>
{
var scroll = context.ReadValue<float>();
if (scroll == 0 || !Flying) return;
var was = _tactical.Tactical;
_tactical.Scroll(-Mathf.Sign(scroll));
if (_tactical.Tactical != was) EnablePlayerInput();
});
Bind(Input.Global.ZoneMap, context =>
{ {
ToggleMenuTab(MenuTab.Map); ToggleMenuTab(MenuTab.Map);
MenuMap.Position = DrawAhead.Position(CurrentEntity, Clock.Lead).xz; MenuMap.Position = DrawAhead.Position(CurrentEntity, Clock.Lead).xz;
}); };
Bind(Input.Global.Inventory, context => ToggleMenuTab(MenuTab.Inventory)); Input.Global.Inventory.performed += context => ToggleMenuTab(MenuTab.Inventory);
Bind(Input.Global.GalaxyMap, context => ToggleMenuTab(MenuTab.Galaxy)); Input.Global.GalaxyMap.performed += context => ToggleMenuTab(MenuTab.Galaxy);
Bind(Input.Global.Interact, context => Input.Global.Interact.performed += context =>
{ {
if (EventSystem.current.currentSelectedGameObject != null && EventSystem.current.currentSelectedGameObject.GetComponent<TMP_InputField>() != null) return; if (EventSystem.current.currentSelectedGameObject != null && EventSystem.current.currentSelectedGameObject.GetComponent<TMP_InputField>() != null) return;
if (MainMenu.gameObject.activeSelf) return; if (MainMenu.gameObject.activeSelf) return;
@ -415,15 +371,6 @@ public class ActionGameManager : MonoBehaviour
foreach (var wormhole in ZoneRenderer.WormholeInstances.Keys) foreach (var wormhole in ZoneRenderer.WormholeInstances.Keys)
{ {
if (!(length(wormhole.Position - CurrentEntity.Position.xz) < Settings.GameplaySettings.WormholeExitRadius)) continue; if (!(length(wormhole.Position - CurrentEntity.Position.xz) < Settings.GameplaySettings.WormholeExitRadius)) continue;
if (Simulation != null)
{
// The simulation's wormhole is its exit (ruling ifl-wormhole-exit-standin).
Dialog.Clear();
Dialog.Title.text = "Leave the simulation and start a run?";
Dialog.Show(onConfirm: LeaveSimulation, onCancel: () => { }, confirmText: "Leave", cancelText: "Stay");
Dialog.MoveToCursor();
return;
}
if (wormhole.Exit) if (wormhole.Exit)
{ {
// The exit gate leads nowhere: TryWin consults RunGoal and ends the run when the gate is open. // The exit gate leads nowhere: TryWin consults RunGoal and ends the run when the gate is open.
@ -441,57 +388,53 @@ public class ActionGameManager : MonoBehaviour
Dock(); Dock();
} }
else Undock(); else Undock();
}); };
Bind(Input.Global.MainMenu, context => Input.Global.MainMenu.performed += context =>
{ {
if(Menu.gameObject.activeSelf) if(Menu.gameObject.activeSelf)
ToggleMenuTab(Menu.CurrentTab); ToggleMenuTab(Menu.CurrentTab);
else else
ToggleFullscreenMenu(MainMenu.gameObject); ToggleFullscreenMenu(MainMenu.gameObject);
}); };
Bind(Input.Global.InputScreen, context => ToggleFullscreenMenu(HelpScreen)); Input.Global.InputScreen.performed += context => ToggleFullscreenMenu(HelpScreen);
Bind(Input.Player.HideUI, context => Input.Player.HideUI.performed += context =>
{ {
_uiHidden = !_uiHidden; _uiHidden = !_uiHidden;
GameplayUI.alpha = _uiHidden ? 0 : 1; GameplayUI.alpha = _uiHidden ? 0 : 1;
ActionBar.gameObject.SetActive(!_uiHidden); ActionBar.gameObject.SetActive(!_uiHidden);
}); };
// The switches and the ping are presses on the entity's command, flipped at the next step. // The switches and the ping are presses on the entity's command, flipped at the next step.
Bind(Input.Player.OverrideShutdown, context => CurrentEntity.Command.ToggleOverrideShutdown()); Input.Player.OverrideShutdown.performed += context => CurrentEntity.Command.ToggleOverrideShutdown();
Bind(Input.Player.Ping, context => CurrentEntity.Command.Ping()); Input.Player.Ping.performed += context => CurrentEntity.Command.Ping();
// TODO: SFX: Success/Fail // TODO: SFX: Success/Fail
Bind(Input.Player.ToggleHeatsinks, context => CurrentEntity.Command.ToggleHeatsinks()); Input.Player.ToggleHeatsinks.performed += context => CurrentEntity.Command.ToggleHeatsinks();
// TODO: SFX: Success/Fail // TODO: SFX: Success/Fail
Bind(Input.Player.ToggleShield, context => CurrentEntity.Command.ToggleShield()); Input.Player.ToggleShield.performed += context => CurrentEntity.Command.ToggleShield();
// Flips the player's own stance on the current target between hostile and neutral. Going // Flips the player's own stance on the current target between hostile and neutral. Going
// neutral mid-fight safes weapons (Weapon.StanceAllowsFire); an unmarked/undetected target // neutral mid-fight safes weapons (Weapon.StanceAllowsFire); an unmarked/undetected target
// reads as non-hostile, so the first press declares hostile. The flip reads the target and its stance when applied, // reads as non-hostile, so the first press declares hostile. The flip reads the target and its stance when applied,
// after the step's target presses, so two presses in a step cancel. // after the step's target presses, so two presses in a step cancel.
Bind(Input.Player.ToggleStance, context => CurrentEntity.Command.ToggleStance()); Input.Player.ToggleStance.performed += context => CurrentEntity.Command.ToggleStance();
#region Targeting #region Targeting
// The reticle, nearest, next and previous presses each command a verb; the applier chooses through Entity at the // The reticle, nearest, next and previous presses each command a verb; the applier chooses through Entity at the
// next step (mining target-queries cut): the rule lives with the entity, so the player, the test agent and any // next step (mining target-queries cut): the rule lives with the entity, so the player, the test agent and any
// director pick alike. // director pick alike.
Bind(Input.Player.TargetReticle, context => CurrentEntity.Command.Verb(TargetVerb.UnderReticle)); Input.Player.TargetReticle.performed += context => CurrentEntity.Command.Verb(TargetVerb.UnderReticle);
Bind(Input.Player.TargetNearest, context => CurrentEntity.Command.Verb(TargetVerb.NearestEnemy)); Input.Player.TargetNearest.performed += context => CurrentEntity.Command.Verb(TargetVerb.NearestEnemy);
Bind(Input.Player.TargetNext, context => CurrentEntity.Command.Verb(TargetVerb.Next)); Input.Player.TargetNext.performed += context => CurrentEntity.Command.Verb(TargetVerb.Next);
Bind(Input.Player.TargetPrevious, context => CurrentEntity.Command.Verb(TargetVerb.Previous)); Input.Player.TargetPrevious.performed += context => CurrentEntity.Command.Verb(TargetVerb.Previous);
// Cut 2 (docs/fire-control-cut.md): steps the aim through the target's schematic rows -- every mount this ship // Cut 2 (docs/fire-control-cut.md): steps the aim through the target's schematic rows -- every mount this ship
// has located, empty or not, minus the ones it saw destroyed. Decides nothing: the entity owns the cycle, applied at // has located, empty or not, minus the ones it saw destroyed. Decides nothing: the entity owns the cycle, applied at
// the next step. // the next step.
Bind(Input.Player.CycleTargetItem, context => CurrentEntity.Command.CycleAim()); Input.Player.CycleTargetItem.performed += context => CurrentEntity.Command.CycleAim();
// The tractor is held while its key is: a press and a release each set it. It is not polled, so a key already down when the
// flight view returns does nothing until it is pressed again, as with fire; Update releases it while the view is tactical.
Bind(Input.Player.TractorBeam, context => CurrentEntity.Command.Tractor = context.ReadValue<float>(), context => CurrentEntity.Command.Tractor = 0);
#endregion #endregion
@ -616,7 +559,11 @@ public class ActionGameManager : MonoBehaviour
{ {
FollowCamera.Follow = x.missile.transform; FollowCamera.Follow = x.missile.transform;
FollowCamera.LookAt = x.target ? x.target : x.missile.transform; FollowCamera.LookAt = x.target ? x.target : x.missile.transform;
x.missile.OnKill += () => FrameFollow(CurrentEntity); x.missile.OnKill += () =>
{
FollowCamera.LookAt = ZoneRenderer.EntityInstances[CurrentEntity].LookAtPoint;
FollowCamera.Follow = ZoneRenderer.EntityInstances[CurrentEntity].transform;
};
}); });
} }
}); });
@ -633,33 +580,6 @@ public class ActionGameManager : MonoBehaviour
ItemManager.Random.NextFloat2Direction() * ItemManager.Random.NextFloat(50, 500); ItemManager.Random.NextFloat2Direction() * ItemManager.Random.NextFloat(50, 500);
Zone.Admit(turret, piloted: false); Zone.Admit(turret, piloted: false);
}); });
// "summon" lists the formations; "summon <id>" places one 400 m ahead of the current ship, facing back toward it. The
// faction rule decides who fights whom: a summon writes no stance.
ConsoleController.AddCommand("summon",
args =>
{
var console = ConsoleController.Instance;
if (args.Length == 0)
{
console.AppendLogLine("Formations: " + string.Join(", ", Formations.All.Select(formation => formation.Id)));
return;
}
var formation = Formations.ById(args[0]);
if (formation == null)
{
console.AppendLogLine($"No formation \"{args[0]}\"; summon alone lists them");
return;
}
if (_currentEntity == null || _currentEntity.Parent != null)
{
console.AppendLogLine("Refused: undock first");
return;
}
var failures = new List<string>();
var summoned = formation.Summon(ItemManager, Zone, _currentEntity.Position.xz + _currentEntity.Direction * 400, -_currentEntity.Direction, failures);
foreach (var failure in failures) console.AppendLogLine($"summon {formation.Id}: {failure}");
if (summoned != null) console.AppendLogLine($"Summoned {formation.Name}: {string.Join(", ", summoned.Select(entity => entity.Name))}");
});
// "fly Djinni": a freshly fitted ship of the named hull beside the current one, and you in it. The ship you leave // "fly Djinni": a freshly fitted ship of the named hull beside the current one, and you in it. The ship you leave
// stays where it is, unpiloted. // stays where it is, unpiloted.
ConsoleController.AddCommand("fly", ConsoleController.AddCommand("fly",
@ -702,12 +622,6 @@ public class ActionGameManager : MonoBehaviour
//Temporary, or not //Temporary, or not
ConsoleController.AddCommand("tow", _ => TowShip()); ConsoleController.AddCommand("tow", _ => TowShip());
ConsoleController.AddCommand("leave", _ =>
{
if (Simulation == null) Debug.Log("leave: only a simulation can be left; there is no simulation");
else LeaveSimulation();
});
// Manual IFF override for the player's current target, for hand-testing combat. // Manual IFF override for the player's current target, for hand-testing combat.
// "iff hostile"/"iff neutral" force a stance; "iff clear" restores the derived faction rule. // "iff hostile"/"iff neutral" force a stance; "iff clear" restores the derived faction rule.
ConsoleController.AddCommand("iff", args => ConsoleController.AddCommand("iff", args =>
@ -777,37 +691,11 @@ public class ActionGameManager : MonoBehaviour
return success ?? false; return success ?? false;
} }
// Ruling tactical-input-hands-off: the one route every Player and Global action is subscribed and read through. TacticalInput
// decides per action whether it is live (an unclassified action is not); a press, a release or a read that is not live is
// dropped, never queued, so the ship holds its last commands. A test scans this file and fails if an action is touched anywhere else.
private bool Live(InputAction action) => TacticalInput.Live(_tactical, action.actionMap.name, action.name);
private void Bind(InputAction action, Action<InputAction.CallbackContext> performed, Action<InputAction.CallbackContext> canceled = null)
{
action.performed += context => { if (Live(action)) performed(context); };
if (canceled != null) action.canceled += context => { if (Live(action)) canceled(context); };
}
private bool TryRead<T>(InputAction action, out T value) where T : struct
{
value = default;
if (!Live(action)) return false;
value = action.ReadValue<T>();
return true;
}
private bool Held(InputAction action) => Live(action) && action.IsPressed();
private InputControl ActiveControl(InputAction action) => Live(action) ? action.activeControl : null;
// The one writer of the cursor lock and the action bar while playing: the tactical view frees the cursor and gives the
// mouse buttons to Pan, so the bar is off there. It is re-applied whenever Tactical changes.
public void EnablePlayerInput() public void EnablePlayerInput()
{ {
Cursor.lockState = _tactical.Tactical ? CursorLockMode.None : CursorLockMode.Locked; Cursor.lockState = CursorLockMode.Locked;
Input.Player.Enable(); Input.Player.Enable();
foreach (var a in _actionBarActions) foreach (var a in _actionBarActions) a.Enable();
if (_tactical.Tactical) a.Disable(); else a.Enable();
} }
public void DisablePlayerInput() public void DisablePlayerInput()
@ -820,10 +708,13 @@ public class ActionGameManager : MonoBehaviour
private void EnterWormhole(Wormhole wormhole) private void EnterWormhole(Wormhole wormhole)
{ {
if (!(CurrentEntity is Ship ship) || ship.WormholeAnimationInProgress) return; if (!(CurrentEntity is Ship ship) || ship.WormholeAnimationInProgress) return;
// var wormholeCameraFollow = new GameObject("Wormhole Camera Follow").transform;
// wormholeCameraFollow.position = new Vector3(wormhole.Position.x, -50, wormhole.Position.y);
// wormholeCameraFollow.rotation = Quaternion.LookRotation(Vector3.down, ship.Aim);
// WormholeCamera.enabled = true;
// WormholeCamera.Follow = wormholeCameraFollow;
// FollowCamera.enabled = false;
ship.EnterWormhole(wormhole.Position); ship.EnterWormhole(wormhole.Position);
WormholeWarpPresenter.Begin(ship, DeathPost.gameObject.layer,
Mathf.Max(DeathPost.priority, HeatstrokePost.priority, HypothermiaPost.priority,
SevereHeatstrokePost.priority, SevereHypothermiaPost.priority) + 1);
ship.OnEnteredWormhole += () => ship.OnEnteredWormhole += () =>
{ {
var oldZone = Zone; var oldZone = Zone;
@ -831,33 +722,30 @@ public class ActionGameManager : MonoBehaviour
foreach (var zone in wormhole.Target.AdjacentZones) foreach (var zone in wormhole.Target.AdjacentZones)
CurrentGalaxy.DiscoveredZones.Add(zone); CurrentGalaxy.DiscoveredZones.Add(zone);
SectorMap.QueueZoneReveal(wormhole.Target.AdjacentZones); SectorMap.QueueZoneReveal(wormhole.Target.AdjacentZones);
ship.ExitWormhole(Zone.WormholeTo(oldZone.GalaxyZone), ship.ExitWormhole(ZoneRenderer.WormholeInstances.Keys.First(w => w.Target == oldZone.GalaxyZone).Position,
Settings.GameplaySettings.WormholeExitVelocity * ItemManager.Random.NextFloat2Direction()); Settings.GameplaySettings.WormholeExitVelocity * ItemManager.Random.NextFloat2Direction());
CurrentEntity.Zone = Zone; CurrentEntity.Zone = Zone;
SaveRun(); SaveRun();
}; };
} }
// The one way out of a simulation: starts the Terminus run. AL7 puts the pilot pick in front of this call.
public void LeaveSimulation()
{
MainMenu.gameObject.SetActive(true); // Launch starts a coroutine on it
MainMenu.Launch(Scenarios.Terminus);
}
public void PopulateLevel(GalaxyZone galaxyZone) public void PopulateLevel(GalaxyZone galaxyZone)
{ {
if (galaxyZone == null) throw new ArgumentNullException(nameof(galaxyZone)); if (galaxyZone == null) throw new ArgumentNullException(nameof(galaxyZone));
// RunStart.Materialize owns every zone's existence; RegionClock.Enter settles the zone entered, records the sighting if (galaxyZone.Contents == null)
// of the zone left and writes the visit. The traveller leaves first, so the sighting holds no player.
var leaving = Zone;
if (CurrentEntity != null)
{ {
CurrentEntity.Deactivate(); galaxyZone.PackedContents ??= ZoneGenerator.GenerateZone(
CurrentEntity.Zone.Remove(CurrentEntity); ItemManager,
Settings.ZoneSettings,
Settings.PlanetSettings,
CurrentGalaxy,
galaxyZone,
CurrentGalaxy.IsPrelude
);
galaxyZone.Contents = new Zone(ItemManager, Settings.PlanetSettings, galaxyZone.PackedContents, galaxyZone, CurrentGalaxy);
} }
Zone = RegionClock.Enter(CurrentGalaxy, leaving, galaxyZone); Zone = galaxyZone.Contents;
_zoneEntered = true; // the clock forgets its lead between frames, never inside a step _zoneEntered = true; // the clock forgets its lead between frames, never inside a step
PlayMusic(MusicType.Overworld); PlayMusic(MusicType.Overworld);
_music = MusicType.Overworld; _music = MusicType.Overworld;
@ -866,6 +754,8 @@ public class ActionGameManager : MonoBehaviour
if (CurrentEntity != null) if (CurrentEntity != null)
{ {
CurrentEntity.Deactivate();
CurrentEntity.Zone.Remove(CurrentEntity);
CurrentEntity.Zone = Zone; CurrentEntity.Zone = Zone;
Zone.Admit(CurrentEntity, piloted: false); Zone.Admit(CurrentEntity, piloted: false);
} }
@ -929,7 +819,6 @@ public class ActionGameManager : MonoBehaviour
private void StartGame() private void StartGame()
{ {
DiscardSimulation(); // a run's Replace never sees simulation records
if (CurrentGalaxy != null) if (CurrentGalaxy != null)
{ {
if (PendingScenario != null) StartScenario(); if (PendingScenario != null) StartScenario();
@ -940,7 +829,6 @@ public class ActionGameManager : MonoBehaviour
foreach(var group in CurrentGalaxy.DiscoveredZones foreach(var group in CurrentGalaxy.DiscoveredZones
.GroupBy(dz=>dz.Distance[CurrentGalaxy.Entrance])) .GroupBy(dz=>dz.Distance[CurrentGalaxy.Entrance]))
SectorMap.QueueZoneReveal(group); SectorMap.QueueZoneReveal(group);
RunStart.Materialize(ItemManager, Settings.ZoneSettings, Settings.PlanetSettings, CurrentGalaxy);
PopulateLevel(CurrentGalaxy.Zones[saved.CurrentZone]); PopulateLevel(CurrentGalaxy.Zones[saved.CurrentZone]);
var targetEntity = Zone.Entities[saved.CurrentZoneEntity]; var targetEntity = Zone.Entities[saved.CurrentZoneEntity];
if (targetEntity is OrbitalEntity orbitalEntity) if (targetEntity is OrbitalEntity orbitalEntity)
@ -962,26 +850,19 @@ public class ActionGameManager : MonoBehaviour
} }
// RunStart owns what a new run starts with (docs/scenarios-cut.md, R.4); this enters and binds. The saved run is // RunStart owns what a new run starts with (docs/scenarios-cut.md, R.4); this enters and binds. The saved run is
// replaced only once the scenario has staged; a simulation starts beside it and never replaces it. A start that fails leaves the saved run as it was and says why on // replaced only once the scenario has staged. A start that fails leaves the saved run as it was and says why on
// the main menu, where Continue still resumes the saved run. // the main menu, where Continue still resumes the saved run.
private void StartScenario() private void StartScenario()
{ {
var scenario = PendingScenario; var scenario = PendingScenario;
PendingScenario = null; PendingScenario = null;
var failures = new List<string>(); var failures = new List<string>();
RunSave.Simulation simulation = null; var staged = RunStart.Launch(() => RunSave.Replace(CultCache, () =>
Func<RunStart.Staged> start = () =>
{ {
return RunStart.Begin(ItemManager, Settings.ZoneSettings, Settings.PlanetSettings, CurrentGalaxy, scenario, RunStart.GenerateArena(ItemManager, Settings.ZoneSettings, Settings.PlanetSettings, CurrentGalaxy, scenario);
Settings.StartingHullName, failures, () => PopulateLevel(CurrentGalaxy.Entrance)); PopulateLevel(CurrentGalaxy.Entrance);
}; return RunStart.Stage(ItemManager, Zone, scenario, Settings.StartingHullName, Settings.TutorialGenerationSettings, failures);
var staged = RunStart.Launch(() => }), failures, Debug.LogException);
{
if (scenario.Saved) return RunSave.Replace(CultCache, start);
var (started, begun) = RunSave.Beside(CultCache, start);
simulation = begun;
return started;
}, failures, Debug.LogException);
if (staged == null) if (staged == null)
{ {
@ -990,7 +871,6 @@ public class ActionGameManager : MonoBehaviour
MainMenu.Refuse($"{scenario.Name} could not start", string.Join("\n", failures)); MainMenu.Refuse($"{scenario.Name} could not start", string.Join("\n", failures));
return; return;
} }
Simulation = simulation;
Credits = staged.Credits; Credits = staged.Credits;
SectorMap.QueueZoneReveal(CurrentGalaxy.Entrance.AdjacentZones.Prepend(CurrentGalaxy.Entrance)); SectorMap.QueueZoneReveal(CurrentGalaxy.Entrance.AdjacentZones.Prepend(CurrentGalaxy.Entrance));
BindToEntity(staged.Player); BindToEntity(staged.Player);
@ -1036,7 +916,7 @@ public class ActionGameManager : MonoBehaviour
ZoneRenderer.PerspectiveEntity = DockedEntity; ZoneRenderer.PerspectiveEntity = DockedEntity;
DockingBay = dockingBay; DockingBay = dockingBay;
DockCamera.enabled = true; DockCamera.enabled = true;
_viewRig.enabled = false; FollowCamera.enabled = false;
var orbital = (OrbitalEntity) entity; var orbital = (OrbitalEntity) entity;
DockCamera.Follow = ZoneRenderer.EntityInstances[orbital].transform; DockCamera.Follow = ZoneRenderer.EntityInstances[orbital].transform;
var parentOrbit = Zone.Orbits[orbital.OrbitData].Data.Parent.Key; var parentOrbit = Zone.Orbits[orbital.OrbitData].Data.Parent.Key;
@ -1138,6 +1018,7 @@ public class ActionGameManager : MonoBehaviour
if(_incomingLockIndicator.indicator != null) _incomingLockIndicator.indicator.GetComponent<Prototype>().ReturnToPool(); if(_incomingLockIndicator.indicator != null) _incomingLockIndicator.indicator.GetComponent<Prototype>().ReturnToPool();
_incomingLockIndicator = default; _incomingLockIndicator = default;
DisablePlayerInput(); DisablePlayerInput();
Cursor.lockState = CursorLockMode.None;
GameplayUI.gameObject.SetActive(false); GameplayUI.gameObject.SetActive(false);
foreach(var subscription in _shipSubscriptions) subscription.Dispose(); foreach(var subscription in _shipSubscriptions) subscription.Dispose();
@ -1177,8 +1058,6 @@ public class ActionGameManager : MonoBehaviour
private void BindToEntity(Entity entity) private void BindToEntity(Entity entity)
{ {
// A tractor held through a ship change would stay on for the ship we leave: its release is a press we will no longer see.
if (CurrentEntity != null) CurrentEntity.Command.Tractor = 0;
if (!ZoneRenderer.EntityInstances.ContainsKey(entity)) if (!ZoneRenderer.EntityInstances.ContainsKey(entity))
{ {
Debug.LogError($"Attempted to bind to entity {entity.Name}, but SectorRenderer has no such instance!"); Debug.LogError($"Attempted to bind to entity {entity.Name}, but SectorRenderer has no such instance!");
@ -1186,7 +1065,6 @@ public class ActionGameManager : MonoBehaviour
} }
CurrentEntity = entity; CurrentEntity = entity;
_tactical.Reset(entity.Zone.Pack.Radius, BaseFollowDistance(entity), DrawAhead.Position(entity, Clock.Lead).xz);
DeathPost.weight = 0; DeathPost.weight = 0;
ZoneRenderer.PerspectiveEntity = CurrentEntity; ZoneRenderer.PerspectiveEntity = CurrentEntity;
@ -1194,11 +1072,12 @@ public class ActionGameManager : MonoBehaviour
DockedEntity = null; DockedEntity = null;
DockingBay = null; DockingBay = null;
DockCamera.enabled = false; DockCamera.enabled = false;
_viewRig.enabled = true; FollowCamera.enabled = true;
if (length(CurrentEntity.Direction) > .1f) if (length(CurrentEntity.Direction) > .1f)
_viewDirection = float3(CurrentEntity.Direction.x,0,CurrentEntity.Direction.y); _viewDirection = float3(CurrentEntity.Direction.x,0,CurrentEntity.Direction.y);
Cursor.lockState = CursorLockMode.Locked;
EnablePlayerInput(); EnablePlayerInput();
GameplayUI.gameObject.SetActive(true); GameplayUI.gameObject.SetActive(true);
ShipPanel.Display(CurrentEntity, true); ShipPanel.Display(CurrentEntity, true);
@ -1214,7 +1093,8 @@ public class ActionGameManager : MonoBehaviour
if (EventLog != null) EventLog.LogMessage(HaulFeed.Line(gain, ItemManager), gain.Adrift > 0 ? Color.yellow : Color.white); if (EventLog != null) EventLog.LogMessage(HaulFeed.Line(gain, ItemManager), gain.Adrift > 0 ? Color.yellow : Color.white);
})); }));
FrameFollow(CurrentEntity); FollowCamera.LookAt = ZoneRenderer.EntityInstances[CurrentEntity].LookAtPoint;
FollowCamera.Follow = ZoneRenderer.EntityInstances[CurrentEntity].transform;
_articulationGroups = CurrentEntity.Equipment _articulationGroups = CurrentEntity.Equipment
.Where(item => item.Behaviors.Any(x => x.Data is WeaponData && !(x.Data is LauncherData))) .Where(item => item.Behaviors.Any(x => x.Data is WeaponData && !(x.Data is LauncherData)))
.GroupBy(item => ZoneRenderer.EntityInstances[CurrentEntity] .GroupBy(item => ZoneRenderer.EntityInstances[CurrentEntity]
@ -1322,85 +1202,6 @@ public class ActionGameManager : MonoBehaviour
_incomingLockIndicator = (incoming, incoming.GetComponent<Rotate>()); _incomingLockIndicator = (incoming, incoming.GetComponent<Rotate>());
} }
private CinemachineFramingTransposer _framingTransposer;
private CinemachineMixingCamera _viewRig;
private CinemachineVirtualCamera _tacticalCamera;
// The grid point the Pan drag holds under the cursor; one gesture's state, nothing else.
private float2? _grab;
private TacticalView _tactical;
private TacticalFade _tacticalFade;
private PostProcessVolume _tacticalVolume;
private Camera _schematicCamera;
// Flying: a ship under the player's hand, not docked. Everything tactical reads 0 otherwise.
private bool Flying => RunLive && CurrentEntity != null && DockedEntity == null;
// The one writer of the follow camera's Follow, LookAt and distance for an entity: the distance is
// the hull's reach (from its centre of mass, where Follow sits) times the authored ratio.
private void FrameFollow(Entity entity)
{
var instance = ZoneRenderer.EntityInstances[entity];
FollowCamera.LookAt = instance.LookAtPoint;
FollowCamera.Follow = instance.transform;
ApplyFraming(entity);
}
private float BaseFollowDistance(Entity entity) => Settings.FollowCameraDistancePerReach * Contacts.Radius(entity);
// The one writer of the follow camera's distance: the eased view distance. It asks ZoneRenderer, the one writer of the
// far clip, to see the whole zone from there.
private void ApplyFraming(Entity entity)
{
if (_framingTransposer == null)
_framingTransposer = FollowCamera.GetCinemachineComponent<CinemachineFramingTransposer>();
var distance = _tactical.Distance;
_framingTransposer.m_CameraDistance = distance;
ZoneRenderer.FarClipNeeded = distance + 2 * entity.Zone.Pack.Radius;
}
// The one writer of the tactical camera: three-quarters top-down over the view target on the grid surface, the chase
// view's yaw held, at the eased distance. Its lens is the chase camera's, so the far clip is the one writer's.
private void PoseTactical()
{
var target = _tactical.Target;
var target3 = new Vector3(target.x, DrawAhead.Height(CurrentEntity.Zone, target, Clock.Lead), target.y);
var rotation = Quaternion.Euler(Settings.TacticalPitch, _entityYawPitch.x * Mathf.Rad2Deg, 0);
_tacticalCamera.transform.SetPositionAndRotation(target3 - rotation * Vector3.forward * _tactical.Distance, rotation);
_tacticalCamera.m_Lens = FollowCamera.m_Lens;
}
// Drag: the grid point under the cursor when the button went down stays under it.
private void PanTarget()
{
if (!Held(Input.Player.Pan))
{
_grab = null;
return;
}
var height = DrawAhead.Height(CurrentEntity.Zone, _tactical.Target, Clock.Lead);
TryRead(Input.Player.Point, out Vector2 pointer);
var ray = ZoneRenderer.MainCamera.ScreenPointToRay(pointer);
if (!new Plane(Vector3.up, new Vector3(0, height, 0)).Raycast(ray, out var hit)) return;
var point = ray.GetPoint(hit);
var ground = float2(point.x, point.z);
if (_grab is { } grab) _tactical.Pan(grab - ground);
else _grab = ground;
}
// Everything the tactical view shows is read off the eased camera distance: the fade, the rig's mix, the schematic, the
// map icons' size and the minimap cameras. Time is the Update line that feeds the clock.
private float TacticalBlend() => Flying ? _tactical.Blend(_tactical.Distance) : 0f;
private void ShowTactical(float blend)
{
_viewRig.SetWeight(0, 1 - blend);
_viewRig.SetWeight(1, blend);
_tacticalVolume.weight = blend;
_schematicCamera.enabled = blend > 0;
ZoneRenderer.Map.SetTacticalScale(blend > 0 ? _tactical.Distance * Settings.TacticalIconSize : 0);
foreach (var camera in ZoneRenderer.MinimapCameras) camera.enabled = blend == 0;
}
private void UpdatePlayerPanel() private void UpdatePlayerPanel()
{ {
ShipPanel.Display(CurrentEntity, true); ShipPanel.Display(CurrentEntity, true);
@ -1427,8 +1228,7 @@ public class ActionGameManager : MonoBehaviour
MainMenu.gameObject.SetActive(true); MainMenu.gameObject.SetActive(true);
Menu.gameObject.SetActive(false); Menu.gameObject.SetActive(false);
CurrentGalaxy = null; CurrentGalaxy = null;
if (Simulation != null) DiscardSimulation(); RunSave.Clear(CultCache);
else RunSave.Clear(CultCache);
SavePlayerSettings(); SavePlayerSettings();
} }
@ -1450,7 +1250,7 @@ public class ActionGameManager : MonoBehaviour
var deathTime = Time.time; var deathTime = Time.time;
EndRun(); EndRun();
Observable.EveryUpdate() Observable.EveryUpdate()
.TakeWhile(_ => Time.time - deathTime < DeathPostTransitionTime) .Where(_ => Time.time - deathTime < DeathPostTransitionTime)
.Subscribe(_ => .Subscribe(_ =>
{ {
var t = (Time.time - deathTime) / DeathPostTransitionTime; var t = (Time.time - deathTime) / DeathPostTransitionTime;
@ -1473,11 +1273,7 @@ public class ActionGameManager : MonoBehaviour
HypothermiaPost.weight = 0; HypothermiaPost.weight = 0;
SevereHypothermiaPost.weight = 0; SevereHypothermiaPost.weight = 0;
DeathPost.weight = 1; DeathPost.weight = 1;
// Every run begins in the simulation (ruling terminus-boots-into-ifl), so death anywhere returns to it. });
// A New Game or Continue click during the fade has already launched; the scene reload ends the subscription.
if (!MainMenu.Launching) MainMenu.Launch(Scenarios.Simulation);
})
.AddTo(this);
} }
// public void ToggleEditMode() // public void ToggleEditMode()
@ -1546,17 +1342,6 @@ public class ActionGameManager : MonoBehaviour
void Update() void Update()
{ {
if (Flying)
{
_tactical.Tick(Time.unscaledDeltaTime);
_tactical.Track(DrawAhead.Position(CurrentEntity, Clock.Lead).xz);
if (_tactical.Tactical) PanTarget();
else _grab = null;
ApplyFraming(CurrentEntity);
PoseTactical();
}
var blend = TacticalBlend();
ShowTactical(blend);
if (!RunLive) return; if (!RunLive) return;
if(!_paused) if(!_paused)
{ {
@ -1578,13 +1363,10 @@ public class ActionGameManager : MonoBehaviour
indicator.Value.Place.Target = DrawAhead.Position(indicator.Key, Clock.Lead).ToUnity(); indicator.Value.Place.Target = DrawAhead.Position(indicator.Key, Clock.Lead).ToUnity();
PlaceFill(indicator.Value, indicator.Key); PlaceFill(indicator.Value, indicator.Key);
} }
// The tactical view does not steer: the aim and the chase yaw hold while the mouse pans the view. var look = Input.Player.Look.ReadValue<Vector2>();
if (TryRead(Input.Player.Look, out Vector2 look)) var sensitivity = PlayerSettings.InputSettings.Sensitivity;
{ _entityYawPitch = float2(_entityYawPitch.x + look.x * sensitivity.x, clamp(_entityYawPitch.y + look.y * sensitivity.y, -.45f * PI, .45f * PI));
var sensitivity = PlayerSettings.InputSettings.Sensitivity; _viewDirection = mul(float3(0, 0, 1), CultMath.float3x3.Euler(float3(_entityYawPitch.yx, 0), RotationOrder.YXZ));
_entityYawPitch = float2(_entityYawPitch.x + look.x * sensitivity.x, clamp(_entityYawPitch.y + look.y * sensitivity.y, -.45f * PI, .45f * PI));
_viewDirection = mul(float3(0, 0, 1), CultMath.float3x3.Euler(float3(_entityYawPitch.yx, 0), RotationOrder.YXZ));
}
CurrentEntity.Command.Aim = _viewDirection; CurrentEntity.Command.Aim = _viewDirection;
HeatstrokePost.weight = saturate(unlerp(0, Settings.GameplaySettings.SevereHeatstrokeRiskThreshold, CurrentEntity.Heatstroke)); HeatstrokePost.weight = saturate(unlerp(0, Settings.GameplaySettings.SevereHeatstrokeRiskThreshold, CurrentEntity.Heatstroke));
var severeHeatstrokeLerp = saturate(unlerp(Settings.GameplaySettings.SevereHeatstrokeRiskThreshold, 1, CurrentEntity.Heatstroke)); var severeHeatstrokeLerp = saturate(unlerp(Settings.GameplaySettings.SevereHeatstrokeRiskThreshold, 1, CurrentEntity.Heatstroke));
@ -1593,14 +1375,13 @@ public class ActionGameManager : MonoBehaviour
max(Settings.HeatstrokePhasingFloor, sin(Time.time * Settings.HeatstrokePhasingFrequency)); max(Settings.HeatstrokePhasingFloor, sin(Time.time * Settings.HeatstrokePhasingFrequency));
_faceAimMark.enabled = _helm.Latched; _faceAimMark.enabled = _helm.Latched;
if (CurrentEntity is Ship ship && TryRead(Input.Player.Move, out Vector2 move)) if(CurrentEntity is Ship ship)
{ {
ship.Command.Movement = move.ToCultMath(); ship.Command.Movement = Input.Player.Move.ReadValue<Vector2>().ToCultMath();
_helm.Held = Held(Input.Player.FaceAim); _helm.Held = Input.Player.FaceAim.IsPressed();
if (ActiveControl(Input.Player.Turn) is { } turnControl) if (Input.Player.Turn.activeControl is { } turnControl)
_turnDigital = turnControl.device is UnityEngine.InputSystem.Keyboard; _turnDigital = turnControl.device is UnityEngine.InputSystem.Keyboard;
TryRead(Input.Player.Turn, out float turn); var turnAxis = _helm.TurnAxis(Input.Player.Turn.ReadValue<float>(), _turnDigital, Time.deltaTime, KeyboardTurnRampTime);
var turnAxis = _helm.TurnAxis(turn, _turnDigital, Time.deltaTime, KeyboardTurnRampTime);
ship.Command.Turn = _helm.Demand(_viewDirection.xz, ship.BandedTurn(turnAxis)); ship.Command.Turn = _helm.Demand(_viewDirection.xz, ship.BandedTurn(turnAxis));
} }
@ -1616,7 +1397,7 @@ public class ActionGameManager : MonoBehaviour
TargetShieldsFill.fillAmount = target.Shield == null ? 0 : lerp(.25f, .75f, target.Shield.Progress); TargetShieldsFill.fillAmount = target.Shield == null ? 0 : lerp(.25f, .75f, target.Shield.Progress);
} }
if (!Live(Input.Player.TractorBeam)) CurrentEntity.Command.Tractor = 0; CurrentEntity.Command.Tractor = Input.Player.TractorBeam.ReadValue<float>();
} }
} }
// One clock steps the zone, paused or not: a paused frame feeds it no real time. // One clock steps the zone, paused or not: a paused frame feeds it no real time.
@ -1624,11 +1405,10 @@ public class ActionGameManager : MonoBehaviour
void EnterNewZone() { if (_zoneEntered) { Clock.Reset(); _zoneEntered = false; } } void EnterNewZone() { if (_zoneEntered) { Clock.Reset(); _zoneEntered = false; } }
EnterNewZone(); EnterNewZone();
var steppedZone = Zone; var steppedZone = Zone;
Clock.Rate = _tactical.TimeRate(blend);
Clock.Advance(_paused ? 0f : Time.deltaTime, delta => Clock.Advance(_paused ? 0f : Time.deltaTime, delta =>
{ {
if (Zone != steppedZone) return; if (Zone != steppedZone) return;
RegionClock.Step(steppedZone, delta); steppedZone.Update(delta);
// A warning lives one tick, so sweeps are collected per tick, never read per frame. // A warning lives one tick, so sweeps are collected per tick, never read per frame.
if (CurrentEntity != null && CurrentEntity.Zone == steppedZone) if (CurrentEntity != null && CurrentEntity.Zone == steppedZone)
foreach (var warning in CurrentEntity.IncomingPaints) foreach (var warning in CurrentEntity.IncomingPaints)
@ -1714,11 +1494,6 @@ public class ActionGameManager : MonoBehaviour
private void LateUpdate() private void LateUpdate()
{ {
// The schematic camera is the game camera's pose and lens, seeing only the map's layer.
var output = ZoneRenderer.MainCamera;
_schematicCamera.fieldOfView = output.fieldOfView;
_schematicCamera.nearClipPlane = output.nearClipPlane;
_schematicCamera.farClipPlane = output.farClipPlane;
UpdateTargetIndicators(); UpdateTargetIndicators();
} }

View file

@ -13,9 +13,7 @@ public class GameSettings : ScriptableObject
public string StartingHullName = "Longinus"; public string StartingHullName = "Longinus";
public float HeatstrokePhasingFloor = 0; public float HeatstrokePhasingFloor = 0;
public float HeatstrokePhasingFrequency = 5; public float HeatstrokePhasingFrequency = 5;
// The follow camera's distance from the hull's centre of mass, as a multiple of the hull's reach public float WormholeDistanceRatio;
// (Contacts.Radius); 1.5 keeps the Longinus at about 30 m.
public float FollowCameraDistancePerReach = 1.5f;
public float DefaultViewDistance; public float DefaultViewDistance;
public float[] MinimapZoomLevels; public float[] MinimapZoomLevels;
public int DefaultMinimapZoom; public int DefaultMinimapZoom;
@ -23,44 +21,9 @@ public class GameSettings : ScriptableObject
public int AsteroidMeshCount = 5; public int AsteroidMeshCount = 5;
public float MinimapAsteroidSize = 3; public float MinimapAsteroidSize = 3;
public float MinimapIconSize = 1f / 32; public float MinimapIconSize = 1f / 32;
// One isoline view's settings (IsolineView reads them every frame). The look is the operator's to tune by eye;
// CellPixels is the target pixels per field sample; the capacities are sized from the smokes' readings (IsolineRenderSmoke
// 'shipped capacities hold'): the next power of two at or above twice the worst reading at the view's largest pose.
[Serializable]
public struct IsolineViewSettings
{
public IsolineLook Look;
public int CellPixels;
public int SegmentCapacity;
public int PoolCapacity;
}
public IsolineViewSettings MapIsolines, MinimapIsolines;
// Tactical view (rulings tactical-view-distinct-mode, tactical-view-in-runs-slow-time): one wheel notch multiplies the
// camera distance by this, in either view. Every feel constant here (step, band, detent, ease, pitch) is a placeholder
// the operator tunes by eye.
public float TacticalZoomStep = 1.25f;
// The camera distance (m) where the scene starts to fade to the schematic: the chase view's farthest distance and the
// detent band's near edge; and where it is fully faded: the tactical view's nearest distance and the band's far edge.
public float TacticalBlendStart = 250;
public float TacticalBlendEnd = 1000;
// Inside the detent band a notch moves the view this fraction as far as outside it (lower holds harder).
public float DetentResistance = .6f;
// Seconds, e-folding, for the band to push the view back to the edge it came from.
public float DetentRelaxTime = .4f;
// Seconds the camera takes to settle on where the wheel put it (critically damped).
public float ViewEaseTime = .15f;
// The tactical camera's pitch down from the horizon, degrees.
public float TacticalPitch = 55;
// Sim seconds per real second at full fade (about 100x slower).
public float TacticalTimeScale = .01f;
// The farthest zoom, as a multiple of the zone radius.
public float TacticalFitPerRadius = 2;
// Schematic icon size as a fraction of the camera distance.
public float TacticalIconSize = 1f / 40;
// The colour the scene fades toward.
public Color TacticalBackground = new Color(.02f, .03f, .05f, 1);
public float PlanetRotationSpeed = 1; public float PlanetRotationSpeed = 1;
public SectorBackgroundSettings CastBackgroundSettings; public TutorialGenerationSettings TutorialGenerationSettings;
public SectorBackgroundSettings TutorialBackgroundSettings;
public SectorBackgroundSettings SectorBackgroundSettings; public SectorBackgroundSettings SectorBackgroundSettings;
public SectorGenerationSettings SectorGenerationSettings; public SectorGenerationSettings SectorGenerationSettings;
public BodySettingsCollection[] BodySettingsCollections; public BodySettingsCollection[] BodySettingsCollections;
@ -80,16 +43,7 @@ public class GameSettings : ScriptableObject
[HideInInspector] public Sprite[] WeaponFireTypeIcons; [HideInInspector] public Sprite[] WeaponFireTypeIcons;
[HideInInspector] public Sprite[] WeaponModifierIcons; [HideInInspector] public Sprite[] WeaponModifierIcons;
// Every HardpointType has an entry in the asset's ItemIcons; a missing one is named, never an IndexOutOfRange. public Sprite GetIcon(HardpointType type) => ItemIcons[(int) type];
public Sprite GetIcon(HardpointType type) => IconOf(ItemIcons, type);
public static Sprite IconOf(Sprite[] icons, HardpointType type)
{
var index = (int) type;
if (icons == null || index < 0 || index >= icons.Length || icons[index] == null)
throw new InvalidOperationException($"GameSettings.ItemIcons has no sprite for HardpointType.{type} (index {index}, {icons?.Length ?? 0} entries); set it in the Settings asset.");
return icons[index];
}
public Sprite GetIcon(WeaponType type) => WeaponTypeIcons[(int) type]; public Sprite GetIcon(WeaponType type) => WeaponTypeIcons[(int) type];
public Sprite GetIcon(WeaponRange range) => WeaponRangeIcons[(int) range]; public Sprite GetIcon(WeaponRange range) => WeaponRangeIcons[(int) range];
public Sprite GetIcon(WeaponCaliber caliber) => WeaponCaliberIcons[(int) caliber]; public Sprite GetIcon(WeaponCaliber caliber) => WeaponCaliberIcons[(int) caliber];

View file

@ -0,0 +1,23 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using CultMath;
using static CultMath.math;
public class ShieldTest : MonoBehaviour
{
public float Acceleration;
private float _velocity;
// Update is called once per frame
void Update()
{
_velocity += -sign(transform.position.x) * Acceleration * Time.deltaTime;
transform.position += Vector3.right * (_velocity * Time.deltaTime);
}
private void OnCollisionEnter(Collision other)
{
_velocity = -_velocity;
}
}

View file

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: d23c676e0ae04fa795f625de181970a5 guid: 28d5bea988fad35428986b994b4cf42e
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2

View file

@ -85,11 +85,10 @@ public static class ShipModShips
return body; return body;
} }
// Fills an instance on the visual's root from its anchors, as ShipModPlan says; the shared effects come from the // Fills a ShipInstance on the visual's root from its anchors, as ShipModPlan says; the shared effects come from the
// template. Nothing here decides a slot: the plan does. The schematic lines stay in the prototype but are hidden in // template. Nothing here decides a slot: the plan does. The schematic lines stay in the prototype but are hidden in
// world; the in-world ship is the GLB. A Ship hull gets a ShipInstance and a tractor beam; any other hull (a station) // world; the in-world ship is the GLB.
// gets a plain EntityInstance, because ShipInstance flies (SetEntity and Update read its thrusters) and a station does not. public static ShipInstance Assemble(ShipModVisual.Instance visual, HullData hull, ShipAuthoring ship, ShipModTemplate template)
public static EntityInstance Assemble(ShipModVisual.Instance visual, HullData hull, ShipAuthoring ship, ShipModTemplate template)
{ {
var plan = ShipModPlan.Build(hull, ship); var plan = ShipModPlan.Build(hull, ship);
var minimap = LayerMask.NameToLayer("Minimap"); var minimap = LayerMask.NameToLayer("Minimap");
@ -136,14 +135,8 @@ public static class ShipModShips
var shield = Object.Instantiate(template.Shield.GetComponent<ShieldManager>(), shieldMarker, false); var shield = Object.Instantiate(template.Shield.GetComponent<ShieldManager>(), shieldMarker, false);
Reset(shield.transform); Reset(shield.transform);
AddOrGet<ShieldEnvelope>(shield.gameObject); AddOrGet<ShieldEnvelope>(shield.gameObject);
var isShip = hull.HullType == HullType.Ship; var tractor = Object.Instantiate(template.TractorBeam.GetComponent<TractorBeam>(), Node(plan.Tractor), false);
// The tractor anchor stays required by the plan; a station leaves it unused. Reset(tractor.transform);
TractorBeam tractor = null;
if (isShip)
{
tractor = Object.Instantiate(template.TractorBeam.GetComponent<TractorBeam>(), Node(plan.Tractor), false);
Reset(tractor.transform);
}
var thrusters = plan.Thrusters.Select(id => var thrusters = plan.Thrusters.Select(id =>
{ {
@ -171,7 +164,7 @@ public static class ShipModShips
var lines = visual.Root.transform.Find("Schematic Lines"); var lines = visual.Root.transform.Find("Schematic Lines");
if (lines != null) lines.gameObject.SetActive(false); if (lines != null) lines.gameObject.SetActive(false);
EntityInstance instance = isShip ? AddOrGet<ShipInstance>(visual.Root) : AddOrGet<EntityInstance>(visual.Root); var instance = AddOrGet<ShipInstance>(visual.Root);
instance.MapIcon = mapIcon; instance.MapIcon = mapIcon;
instance.InfluencePrefab = null; instance.InfluencePrefab = null;
instance.PingPrefab = template.Ping.transform; instance.PingPrefab = template.Ping.transform;
@ -183,7 +176,7 @@ public static class ShipModShips
instance.RadiatorHardpoints = radiators; instance.RadiatorHardpoints = radiators;
instance.ArticulationPoints = Array.Empty<ArticulationPoint>(); instance.ArticulationPoints = Array.Empty<ArticulationPoint>();
instance.DestroyEffect = template.DestroyEffect; instance.DestroyEffect = template.DestroyEffect;
if (instance is ShipInstance flier) flier.TractorBeam = tractor; instance.TractorBeam = tractor;
return instance; return instance;
} }

View file

@ -7,8 +7,8 @@ using GameCult.Caching.MessagePack;
// Aetheria's stores: one home store per type, composed here and nowhere else. // Aetheria's stores: one home store per type, composed here and nowhere else.
public static class AetheriaStores public static class AetheriaStores
{ {
public static readonly Type[] CatalogTypes = { typeof(ItemData), typeof(ShipAuthoring), typeof(Faction), typeof(FactionProductData), typeof(PersonalityAttribute), typeof(InputLayout), typeof(Loadout), typeof(FieldKindData), typeof(ProvinceData), typeof(VerseGrammar), typeof(VerseVerb), typeof(StationKindData), typeof(RecipeData), typeof(OutsideMarketData), typeof(AtmosphereData) }; public static readonly Type[] CatalogTypes = { typeof(ItemData), typeof(ShipAuthoring), typeof(Faction), typeof(FactionProductData), typeof(PersonalityAttribute), typeof(InputLayout), typeof(Loadout), typeof(FieldKindData), typeof(ProvinceData), typeof(VerseGrammar), typeof(VerseVerb), typeof(StationKindData), typeof(RecipeData), typeof(OutsideMarketData) };
public static readonly Type[] RunTypes = { typeof(OrbitData), typeof(BodyData), typeof(SavedZone), typeof(SavedGame), typeof(ProvenanceLedger), typeof(HaulOrderData) }; public static readonly Type[] RunTypes = { typeof(OrbitData), typeof(BodyData), typeof(SavedZone), typeof(SavedGame), typeof(ProvenanceLedger) };
public static readonly Type[] PlayerTypes = { typeof(PlayerSettings) }; public static readonly Type[] PlayerTypes = { typeof(PlayerSettings) };
// Attaches (hydrates) the catalog read-only unless catalogWritable, then the run and player stores when given. // Attaches (hydrates) the catalog read-only unless catalogWritable, then the run and player stores when given.

View file

@ -34,11 +34,7 @@ public class Agent
public GameplaySettings Settings { get; } public GameplaySettings Settings { get; }
// How this pilot fights: its faction's doctrine for its role (Zone.CreateAgent resolves it). // How this pilot fights: its faction's doctrine for its role (Zone.CreateAgent resolves it).
public RoleDoctrine Doctrine { get; } public RoleDoctrine Doctrine { get; }
// How fast this hull flies: its VelocityLimit, or 100 without one. The pilot (the cached limit) and an off-screen hauler's flight public float TopSpeed => _velocityLimit?.Limit ?? 100;
// (HaulRun.Fly, TopSpeedOf) read the one rule.
public float TopSpeed => SpeedOf(_velocityLimit);
public static float TopSpeedOf(Ship ship) => SpeedOf(ship.GetBehavior<VelocityLimit>());
private static float SpeedOf(VelocityLimit limit) => limit?.Limit ?? 100;
public Agent(Ship ship, RoleDoctrine doctrine) public Agent(Ship ship, RoleDoctrine doctrine)
{ {

View file

@ -20,14 +20,6 @@ public class Minion : Agent
followState.AddTransition(patrolState, () => Task is PatrolOrbitsTask, Patrol); followState.AddTransition(patrolState, () => Task is PatrolOrbitsTask, Patrol);
followState.AddTransition(_rootState, () => !(Task is FollowTask)); followState.AddTransition(_rootState, () => !(Task is FollowTask));
// The hauler's task (HaulRun.TaskOf): the same switch as patrol's, ignoring the other task states each walk could reach.
var haulState = new HaulState(this);
_rootState.AddTransition(haulState, () => Task is HaulingTask);
haulState.AddTransition(followState, () => Task is FollowTask, null, true, _rootState);
haulState.AddTransition(_rootState, () => !(Task is HaulingTask), null, true, _rootState, followState);
followState.AddTransition(haulState, () => Task is HaulingTask);
patrolState.AddTransition(haulState, () => Task is HaulingTask, null, true, _rootState, followState);
var combatState = new CombatState(this); var combatState = new CombatState(this);
_rootState.AddTransition(combatState, _rootState.AddTransition(combatState,
() => View.TargetOf(Ship) != null, null, true, _rootState); () => View.TargetOf(Ship) != null, null, true, _rootState);

View file

@ -1,33 +0,0 @@
using GameCult.Caching;
// A hauler's pilot: it flies to HaulRun.Waypoint, derived from the hold and the order on every update. With no hop it flies to the leg's
// orbit and, within docking distance of a station where the call would move a unit, commands the call (HaulRun.Call docks, moves the
// goods and undocks it, which gives it a fresh pilot on the same task). With a hop the leg lies in another zone: it flies to this zone's
// wormhole toward it and, within the wormhole's reach, commands the jump (HaulRun.Jump). No field but its children: a hand-emptied hold
// changes the waypoint at once.
public class HaulState : BaseState
{
public HaulState(Agent agent) : base(agent)
{
var move = new MoveToOrbitState(agent);
var leave = new MoveToPointState(agent);
HaulOrderData Order() => _agent.Task is HaulingTask task ? HaulRun.OrderOf(_agent.ItemManager, task.Order) : null;
(CultRecordKey Orbit, GalaxyZone Hop)? Way() => Order() is HaulOrderData order ? HaulRun.Waypoint(_agent.Ship, order) : null;
OrbitalEntity Station() => HaulRun.Station(_agent.Ship.Zone, move.Orbit);
bool Callable()
{
var order = Order();
var station = order == null ? null : Station();
return station != null && move.Distance < _agent.Settings.DockingDistance && HaulRun.CanCall(_agent.Ship, station, order);
}
bool Leaving() => leave.Distance < _agent.Settings.WormholeExitRadius && !_agent.Ship.WormholeAnimationInProgress;
Transitions.Add(new StateTransition(move, () => Way() is { Hop: null }, () => move.Orbit = Way().Value.Orbit));
Transitions.Add(new StateTransition(leave, () => Way() is { Hop: not null }, () => leave.Point = _agent.Ship.Zone.WormholeTo(Way().Value.Hop)));
// A changed waypoint re-enters this state, which points the child at it; a callable station commands the call, a reached wormhole the jump.
move.Transitions.Add(new StateTransition(this, () => !(Way() is { Hop: null } way && way.Orbit.Equals(move.Orbit)), null));
move.Transitions.Add(new StateTransition(this, Callable, () => _agent.Ship.Command.Call(Station())));
leave.Transitions.Add(new StateTransition(this, () => !(Way() is { Hop: not null } way && _agent.Ship.Zone.WormholeTo(way.Hop).Equals(leave.Point)), null));
leave.Transitions.Add(new StateTransition(this, Leaving, () => _agent.Ship.Command.Jump(Way().Value.Hop)));
}
}

View file

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: c8eaf78200fa454292cd86bdde3f4903
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -36,11 +36,3 @@ public class MoveToOrbitState : MoveToState
protected override float2 TargetPosition => _agent.Ship.Zone.GetOrbitPosition(Orbit); protected override float2 TargetPosition => _agent.Ship.Zone.GetOrbitPosition(Orbit);
} }
public class MoveToPointState : MoveToState
{
public float2 Point { get; set; }
public MoveToPointState(Agent agent) : base(agent) { }
protected override float2 TargetPosition => Point;
}

View file

@ -1,16 +1,27 @@
/* This Source Code Form is subject to the terms of the Mozilla Public /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using GameCult.Caching; using GameCult.Caching;
using System;
using System.Collections;
using System.Collections.Generic;
using MessagePack; using MessagePack;
using Newtonsoft.Json; using Newtonsoft.Json;
// The order key alone: the leg is HaulRun.Leg's, derived from the hold and the order every update, never stored here.
public class HaulingTask : AgentTask public class HaulingTask : AgentTask
{ {
public override TaskType Type => TaskType.Haul; public override TaskType Type => TaskType.Haul;
[JsonProperty("order"), Key(4)] [JsonProperty("origin"), Key(4)]
public CultRecordKey Order; public Entity Origin;
[JsonProperty("target"), Key(5)]
public Entity Target;
[JsonProperty("itemType"), Key(6)]
public CultRecordKey ItemType;
[JsonProperty("quantity"), Key(7)]
public int Quantity;
} }

View file

@ -28,7 +28,7 @@ public abstract class Behavior
{ {
if(Item != null) if(Item != null)
{ {
var itemDirection = Item.Orient(Entity.Direction); var itemDirection = Entity.Direction.Rotate(Item.EquippableItem.Rotation);
return float3(itemDirection.x, 0, itemDirection.y); return float3(itemDirection.x, 0, itemDirection.y);
} }
@ -109,6 +109,11 @@ public interface IInitializableBehavior
void Initialize(); void Initialize();
} }
public interface IInteractiveBehavior
{
bool Exposed { get; }
}
public interface IAlwaysUpdatedBehavior public interface IAlwaysUpdatedBehavior
{ {
void Update(float delta); void Update(float delta);
@ -119,6 +124,11 @@ public interface IProgressBehavior
float Progress { get; } float Progress { get; }
} }
public interface IPopulationAssignment
{
int AssignedPopulation { get; set; }
}
// Cut 3 (docs/stats-and-power-cut.md §1.2): a behaviour that wants to draw from its entity's PowerBus declares a // Cut 3 (docs/stats-and-power-cut.md §1.2): a behaviour that wants to draw from its entity's PowerBus declares a
// request instead of spending energy itself. PowerBus.Step calls this on every consumer once per tick, before // request instead of spending energy itself. PowerBus.Step calls this on every consumer once per tick, before
// any behaviour's Execute runs, so PowerRequest must be computable from state that is already current at that // any behaviour's Execute runs, so PowerRequest must be computable from state that is already current at that
@ -190,8 +200,6 @@ public interface IPowerConsumer
Union(50, typeof(ListenerData)), Union(50, typeof(ListenerData)),
Union(51, typeof(ScannerData)), Union(51, typeof(ScannerData)),
Union(52, typeof(LockWeaponData)), Union(52, typeof(LockWeaponData)),
Union(53, typeof(FacilityData)),
Union(54, typeof(HabitationData)),
JsonObject(MemberSerialization.OptIn)] JsonObject(MemberSerialization.OptIn)]
public abstract class BehaviorData public abstract class BehaviorData
{ {

View file

@ -1,160 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using GameCult.Caching;
using MessagePack;
using Newtonsoft.Json;
// The facility gear a station carries to run recipes: a GearData of HardpointType Facility whose Behaviors hold one of these. The type
// says where it mounts (a hull's Facility rows), this says it runs recipes. It holds no field of its own: which recipes a facility
// runs is derived from RecipeData.Facility, so no list is stored here. A facility is installed gear, never a consumable's effect.
[Inspectable, MessagePackObject, JsonObject(MemberSerialization.OptIn)]
public class FacilityData : BehaviorData
{
public override Behavior CreateInstance(EquippedItem item)
{
return new Facility(this, item);
}
public override Behavior CreateInstance(ConsumableItemEffect item)
{
throw new System.InvalidOperationException($"{item.Data.Name} cannot carry a facility: a facility is installed gear, never a consumable effect.");
}
}
// The installed facility (ruling demand-consumed-inputs-processed-by-facilities). It ticks once per zone step, from EquippedItem.Update
// while the item is active, on screen; off screen RegionClock.AdvanceInstalled calls Span with the span the zone missed. Its recipes are
// the run list of its design, fixed for a run because the catalog is.
//
// Two paths, by where the zone is (ruling auto-mining-is-off-screen-only). Off screen every facility advances by Production.Advance:
// an ore rig's raw recipes start by Production.Pick. On screen the raw ore entries of the list work the zone's rocks instead (Work),
// through Zone.Wear and FireControl.Extract, the player's own mining, an ore at a time as Production.Pick names it, at the recipe's own
// cycle and count, so the units of each ore come as the pick has them off screen; the player sees the rocks break, and the unit's
// FacilityRun is left as the off-screen path last wrote it. Every other entry, a skimmer's volatiles included (ruling
// skimmers-run-their-recipe-on-screen-for-now), runs Advance in both.
public class Facility : Behavior
{
private IReadOnlyList<RecipeData> _runList;
private IReadOnlyList<RecipeData> _ores;
private IReadOnlyList<RecipeData> _others;
private EntityHold _hold;
// Why the facility advanced no further this step: derived by Advance every step, never stored on the unit.
public Stall Stall { get; private set; }
// The hold's Revision when an idle facility last failed to take a cycle's inputs. A failed take reads nothing but the hold, so
// until the hold changes a retry fails the same way and is skipped. Not persisted: a restored facility tries once on its first step.
private long _failedAt;
// How many steps tried to take a cycle's inputs: a diagnostic of the skip above, derived and not persisted.
public int Attempts { get; private set; }
// The rig's on-screen cycle, derived and not persisted: how many it has worked (the pick's count, begun from the unit's own count
// when first worked), the recipe and rock of the one under way, and the sim seconds into it.
private long _worked = -1;
private RecipeData _working;
private ChunkId _rock;
private bool _rocked;
private double _into;
public Facility(FacilityData data, EquippedItem item) : base(data, item)
{
SetRunList();
}
// The run list as the catalog holds it, split into the raw ore entries that work rocks on screen and the rest.
private void SetRunList()
{
var catalog = ItemManager.ItemData;
_runList = Production.RunList(catalog, Item.EquippableItem.Data.Key);
bool Ore(RecipeData recipe) => Recipes.IsRaw(catalog, recipe) && catalog.Get(recipe.Output) is SimpleCommodityData output && FieldKinds.IsOre(catalog, output);
_ores = _runList.Where(Ore).ToArray();
_others = _runList.Where(recipe => !Ore(recipe)).ToArray();
}
// The on-screen step: one zone step.
public override bool Execute(float dt)
{
if (_ores.Count > 0) Work(dt);
if (_others.Count > 0 || _ores.Count == 0) Advance(dt, _others);
return true;
}
// The off-screen step: the span the zone missed, always the recipe rule.
public void Span(double seconds) => Advance(seconds, _runList);
// Whether the station's output bays have a cell for one unit of the good and its share of the silo has room: the landing Advance's
// put takes, asked before any rock is worn.
private bool Lands(CultRecordKey good) =>
StationWants.Room(Entity, good) >= 1 && StationWants.OutputBays(Entity, good).Any(bay =>
bay.TryFindSpace(new SimpleCommodity { Data = new CultRecordRef<ItemData>(good), Quantity = 1 }));
// The rock an ore rig works, in sim time dt. A cycle begins at Production.Pick on the cycles worked (then the next recipe the ground
// holds and the station has room for, as Advance goes on), picks a whole rock whose belt holds that ore, by a stable hash of the cycle
// (so rocks take turns), and for the recipe's Cycle seconds wears it by what OutputCount units of it owe (what FireControl.Extract
// pays for the damage it absorbs); a rock that breaks gives way to the next. Extract pays that ore only, into the output bays, by dice
// of its own stream. Barren with no ore the ground holds or no whole rock of it; Room, with nothing worn, when the ore has no landing.
private void Work(double dt)
{
_hold ??= new EntityHold(Entity);
var catalog = ItemManager.ItemData;
var zone = Entity.Zone;
if (zone == null) { Stall = Stall.Barren; return; }
if (_worked < 0) _worked = Item.EquippableItem.Run?.Cycles ?? 0;
if (_working == null)
{
var pick = Production.Pick(_ores, _worked, _hold);
if (pick < 0) { Stall = Stall.Barren; return; }
for (var step = 0; step < _ores.Count && _working == null; step++)
{
var candidate = _ores[(pick + step) % _ores.Count];
if (_hold.Deposit(candidate.Output.Key) > 0f && Lands(candidate.Output.Key)) _working = candidate;
}
if (_working == null) { Stall = Stall.Room; return; }
_into = 0;
_rocked = false;
}
var ore = _working.Output.Key;
if (!Lands(ore)) { Stall = Stall.Room; return; }
if (!_rocked || !zone.ChunkExists(_rock))
{
var province = zone.GalaxyZone?.Province?.Type ?? default;
var whole = new List<ChunkId>();
foreach (var belt in zone.AsteroidBelts.OrderBy(entry => entry.Value.Data.SiteOr(entry.Key), StringComparer.Ordinal))
{
if (!FieldKinds.Yield(belt.Value.Data.Kind, province, catalog).Any(yield => yield.Commodity.Key.Equals(ore))) continue;
for (var index = 0; index < belt.Value.Data.Asteroids.Length; index++)
if (zone.ChunkExists(new ChunkId(belt.Key, index))) whole.Add(new ChunkId(belt.Key, index));
}
if (whole.Count == 0) { _rocked = false; Stall = Stall.Barren; return; }
_rock = whole[(int) ($"rock:{_worked}:{ore.Value}".StableHash() % (uint) whole.Count)];
_rocked = true;
}
var settings = zone.Settings;
var size = ((AsteroidBeltData) zone.Planets[_rock.Field]).Asteroids[_rock.Index].Size;
var damage = (float) (_working.OutputCount / (double) _working.Cycle * dt / settings.AsteroidYield.Evaluate(size) * settings.AsteroidHitpoints.Evaluate(size));
var place = Entity.Equipment.IndexOf(Item);
var ordinal = SimulationDice.Mix(unchecked((uint) (long) Math.Floor(zone.ExactTime * 1000))) ^ (uint) place;
FireControl.Extract(zone, _rock, zone.Wear(_rock, damage), Entity, SimulationDice.For(zone.DropSeed, SimulationDice.RigStream, ordinal),
ore, StationWants.OutputBays(Entity, ore));
Stall = Stall.None;
_into += dt;
if (_into >= _working.Cycle) { _worked++; _working = null; _rocked = false; }
}
private void Advance(double seconds, IReadOnlyList<RecipeData> list)
{
_hold ??= new EntityHold(Entity);
var idle = Item.EquippableItem.Run == null || Item.EquippableItem.Run.Progress <= 0;
if (idle && Stall == Stall.Inputs && _hold.Revision == _failedAt) return;
Attempts++;
// A running cycle whose recipe left the catalog or stopped running here is dropped by Advance: the list it was built from is
// stale, so it is rebuilt from the catalog before that step.
if (!idle && Production.Live(ItemManager.ItemData, Item.EquippableItem.Run.Recipe) == null)
SetRunList();
var (run, stall) = Production.Advance(ItemManager.ItemData, list, Item.EquippableItem.Run, seconds, _hold);
Item.EquippableItem.Run = run;
Stall = stall;
if (idle && stall == Stall.Inputs) _failedAt = _hold.Revision;
}
}

View file

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: a65a21b40f2a4daba2b058018ba5e8d7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -1,119 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using GameCult.Caching;
using MessagePack;
using Newtonsoft.Json;
// The habitation gear a station carries to house a population: a GearData whose Behaviors hold one of these. The design says how many
// it houses and what each occupant consumes, so a population is installed gear like a facility is (rulings
// installed-gear-decides-what-a-station-buys, mass-populations-live-in-blooms): there is no population record and no needs table
// outside the module design. A station's Crew Quarters and a habitat's Housing Districts are designs of it. Installed gear, never a
// consumable's effect.
[Inspectable, MessagePackObject, JsonObject(MemberSerialization.OptIn)]
public class HabitationData : BehaviorData
{
// The occupants the unit houses when full: what a unit with no recorded population holds, and, until population dynamics moves
// it, what it holds always.
[Inspectable, JsonProperty("capacity"), Key(1)]
public int Capacity;
// What each occupant consumes: one row per commodity.
[Inspectable, JsonProperty("table"), Key(2)]
public List<HabitationRow> Table = new List<HabitationRow>();
public override Behavior CreateInstance(EquippedItem item)
{
return new Habitation(this, item);
}
public override Behavior CreateInstance(ConsumableItemEffect item)
{
throw new InvalidOperationException($"{item.Data.Name} cannot carry a habitation module: a habitation module is installed gear, never a consumable effect.");
}
}
// One commodity a population eats: units per occupant per sim hour, and whether the occupants cannot do without it (Basic) or it is
// a lifestyle good. Basic is recorded for the follow-up that makes a shortfall matter; this cut reads it nowhere.
[MessagePackObject, JsonObject(MemberSerialization.OptIn)]
public class HabitationRow
{
[JsonProperty("commodity"), Key(0)] public CultRecordRef<ItemData> Commodity;
[JsonProperty("perOccupantHour"), Key(1)] public float PerOccupantHour;
[JsonProperty("basic"), Key(2)] public bool Basic;
// Element identity: minted by the cache on write; "" means unset.
[Key(3)] [CultElementId] public string Id = "";
}
// The population an installed habitation unit houses, on the unit (EquippableItem.Habitants): its size and, per table row, the
// fraction of a unit its occupants have consumed and not yet taken. Written only by Habitation.Execute from Upkeep.Advance's result.
[MessagePackObject, JsonObject(MemberSerialization.OptIn)]
public class Habitants
{
[JsonProperty("size"), Key(0)] public double Size;
// By table row. Always a fraction below one between steps: whole units are taken, or dropped when the hold lacks them.
[JsonProperty("owed"), Key(1)] public double[] Owed = Array.Empty<double>();
}
// The one rule for what a population consumes: the occupants of a unit accrue Size x rate x seconds / 3600 of each row, the hold is
// asked for the whole units, and a unit the hold cannot give is dropped, never carried as a debt (idea planets-blooms-map.rejected-carry-unmet-debt).
// On screen its one caller is Habitation.Execute with one zone step; off screen RegionClock.AdvanceInstalled calls that with the span
// the zone missed. It reads no random, no clock and no crew.
public static class Upkeep
{
// The population after `seconds`, and the rows of the table that went short (a row whose hold gave fewer whole units than the
// occupants owed). A null state is a unit that has not stepped yet: full capacity, nothing owed. Pure over its arguments but for the
// hold it takes from.
public static (Habitants state, IReadOnlyList<CultRecordKey> shortfall) Advance(HabitationData data, Habitants state, double seconds, IProductionHold hold)
{
var size = state?.Size ?? data.Capacity;
if (!(seconds > 0)) seconds = 0;
var owed = new double[data.Table.Count];
var shortfall = new List<CultRecordKey>();
for (var at = 0; at < owed.Length; at++)
{
var row = data.Table[at];
// A row that names no commodity consumes nothing and owes nothing: its Owed stays zero, so Owed is a fraction below one always.
if (!row.Commodity.IsSet()) continue;
var was = state?.Owed != null && at < state.Owed.Length ? state.Owed[at] : 0;
owed[at] = was + size * row.PerOccupantHour * seconds / 3600;
var whole = (int) Math.Floor(owed[at]);
if (whole <= 0) continue;
var key = row.Commodity.Key;
var taken = whole;
if (!hold.TryTake(new[] { (key, whole) }))
{
taken = Math.Min(whole, hold.Held(key));
if (taken > 0 && !hold.TryTake(new[] { (key, taken) })) taken = 0;
shortfall.Add(key);
}
owed[at] -= whole;
}
return (new Habitants { Size = size, Owed = owed }, shortfall);
}
}
// The installed habitation unit. It ticks once per zone step, from EquippedItem.Update while the item is active, on screen; off screen
// RegionClock.AdvanceInstalled calls Execute with the span the zone missed. It takes from the same hold a facility does.
public class Habitation : Behavior
{
private readonly HabitationData _data;
private EntityHold _hold;
// The commodities the last step could not fully take: derived by Execute every step, never stored on the unit.
public IReadOnlyList<CultRecordKey> Shortfall { get; private set; } = Array.Empty<CultRecordKey>();
public Habitation(HabitationData data, EquippedItem item) : base(data, item)
{
_data = data;
}
public override bool Execute(float dt)
{
_hold ??= new EntityHold(Entity);
var (state, shortfall) = Upkeep.Advance(_data, Item.EquippableItem.Habitants, dt, _hold);
Item.EquippableItem.Habitants = state;
Shortfall = shortfall;
return true;
}
}

View file

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 4066805b976ae8b493827f0cefb1a1d0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -45,8 +45,10 @@ public class ItemUsage : Behavior
if (cargo == null) return false; if (cargo == null) return false;
var item = cargo.ItemsOfType[_data.Item.Key][0]; var item = cargo.ItemsOfType[_data.Item.Key][0];
// One unit of a stack, or the unit itself. if (item is SimpleCommodity simpleCommodity)
cargo.Remove(item, 1); cargo.Remove(simpleCommodity, 1);
if (item is CraftedItemInstance craftedItemInstance)
cargo.Remove(craftedItemInstance);
return true; return true;
} }

View file

@ -49,13 +49,7 @@ public class Thruster : Behavior, IPowerConsumer
// Thrust at a full grant, the same stat read without the power-supply term: what a column promises. Live, like Thrust. // Thrust at a full grant, the same stat read without the power-supply term: what a column promises. Live, like Thrust.
public float NominalThrust => EvaluateNominalPower(_data.Thrust); public float NominalThrust => EvaluateNominalPower(_data.Thrust);
// GameplaySettings.ThrustScale scales the push alone: it tunes how hard ships fight gravity, and turning does not. // GameplaySettings.ThrustScale scales the push alone: it tunes how hard ships fight gravity, and turning does not.
public float Torque => Item == null ? 0f : -dot(normalize(_hullCenter - _itemCenter), Item.Orient(float2(1, 0))); public float Torque { get; }
// Placement, fixed at construction: the hull's centre of mass and the item's own centre, both in cell space. The
// lever (the direction from one to the other) and the facing it is dotted with are derived on every Torque read,
// so a later change to where the item sits or which way it faces moves the torque without a second owner.
private readonly float2 _hullCenter;
private readonly float2 _itemCenter;
// This thruster's effect per unit throttle at the given thrust, in the body frame: xy is the push (x starboard, y // This thruster's effect per unit throttle at the given thrust, in the body frame: xy is the push (x starboard, y
// forward), z the clockwise yaw rate in rad/s. Zero when the item is absent or offline. The one geometry owner for // forward), z the clockwise yaw rate in rad/s. Zero when the item is absent or offline. The one geometry owner for
@ -63,7 +57,7 @@ public class Thruster : Behavior, IPowerConsumer
public float3 Column(float thrust) public float3 Column(float thrust)
{ {
if (Item == null || !Item.Active.Value) return default; if (Item == null || !Item.Active.Value) return default;
var push = -Item.Orient(float2(0, 1)) * thrust * ItemManager.GameplaySettings.ThrustScale / Entity.Mass; var push = -float2(0, 1).Rotate(Item.EquippableItem.Rotation) * thrust * ItemManager.GameplaySettings.ThrustScale / Entity.Mass;
return float3(push.x, push.y, Torque * thrust * ItemManager.GameplaySettings.TorqueMultiplier / Entity.Mass); return float3(push.x, push.y, Torque * thrust * ItemManager.GameplaySettings.TorqueMultiplier / Entity.Mass);
} }
@ -87,14 +81,17 @@ public class Thruster : Behavior, IPowerConsumer
{ {
_data = data; _data = data;
var hullData = ItemManager.GetData(Entity.Hull) as HullData; var hullData = ItemManager.GetData(Entity.Hull) as HullData;
_hullCenter = hullData.Shape.CenterOfMass; var hullCenter = hullData.Shape.CenterOfMass;
var itemData = ItemManager.GetData(item.EquippableItem); var itemData = ItemManager.GetData(item.EquippableItem);
_itemCenter = hullData.Shape.Inset(itemData.Shape, item.Position, item.EquippableItem.Rotation).CenterOfMass; var itemCenter = hullData.Shape.Inset(itemData.Shape, item.Position, item.EquippableItem.Rotation).CenterOfMass;
var toCenter = hullCenter - itemCenter;
Torque = -dot(normalize(toCenter), float2(1, 0).Rotate(item.EquippableItem.Rotation));
} }
public Thruster(ThrusterData data, ConsumableItemEffect item) : base(data, item) public Thruster(ThrusterData data, ConsumableItemEffect item) : base(data, item)
{ {
_data = data; _data = data;
Torque = 0;
} }
// Cut 3 (docs/stats-and-power-cut.md): the resolved stat times the behaviour-supplied throttle scalar (§1.2), // Cut 3 (docs/stats-and-power-cut.md): the resolved stat times the behaviour-supplied throttle scalar (§1.2),

View file

@ -23,8 +23,7 @@ public enum GiveEnd
public sealed class GiveOrder public sealed class GiveOrder
{ {
public readonly Entity Receiver; public readonly Entity Receiver;
// A stack order is for any stack the item StacksWith in the giver's bays (the same design, and for a compound // A commodity order is for any stack of this item's design in the giver's bays; a crafted order is for this instance.
// commodity the same lot); a unit order is for this instance.
public readonly ItemInstance Item; public readonly ItemInstance Item;
// Units still to move. // Units still to move.
public int Remaining { get; internal set; } public int Remaining { get; internal set; }
@ -100,25 +99,27 @@ public static class CargoTransfer
} }
} }
// Where the next unit comes from: the first stack in the giver's bays the order's item StacksWith, or the unit itself. // Where the next unit comes from: the first stack of the order's design in the giver's bays, or the crafted instance.
private static (EquippedCargoBay Bay, ItemInstance Item) Source(Entity giver, GiveOrder order) private static (EquippedCargoBay Bay, ItemInstance Item) Source(Entity giver, GiveOrder order)
{ {
foreach (var bay in giver.CargoBays) foreach (var bay in giver.CargoBays)
{ {
if (order.Item is ICommodityStack wanted) if (order.Item is CraftedItemInstance crafted)
{ {
if (bay.ItemsOfType.TryGetValue(order.Item.Data.Key, out var stacks)) if (bay.Cargo.ContainsKey(crafted)) return (bay, crafted);
{ }
var stack = stacks.FirstOrDefault(wanted.StacksWith); else if (bay.ItemsOfType.TryGetValue(order.Item.Data.Key, out var stacks))
if (stack != null) return (bay, stack); {
} var stack = stacks.OfType<SimpleCommodity>().FirstOrDefault();
if (stack != null) return (bay, stack);
} }
else if (bay.Cargo.ContainsKey(order.Item)) return (bay, order.Item);
} }
return (null, null); return (null, null);
} }
// One unit of a stack, or the unit itself, into the first receiver bay that takes it. // One unit of a commodity, or the crafted item, into the first receiver bay that takes it.
private static bool Move(EquippedCargoBay from, ItemInstance item, Entity receiver) => private static bool Move(EquippedCargoBay from, ItemInstance item, Entity receiver) =>
receiver.CargoBays.Any(bay => from.TryTransferItem(bay, item, 1)); item is SimpleCommodity commodity
? receiver.CargoBays.Any(bay => from.TryTransferItem(bay, commodity, 1))
: receiver.CargoBays.Any(bay => from.TryTransferItem(bay, (CraftedItemInstance) item));
} }

View file

@ -49,10 +49,7 @@ public class Faction
// Keys 13 to 15 (overworldMusic, combatMusic, bossMusic) held Wwise ids; retired, never reuse them. // Keys 13 to 15 (overworldMusic, combatMusic, bossMusic) held Wwise ids; retired, never reuse them.
// How this faction regards each other faction; absent is Neutral. Directed: this map says how this faction regards them, theirs // Key 16 is reserved for Relations (operator ruling faction-relations-field).
// says how they regard it. Read only through Entity.Regard (ruling faction-relations-field).
[Inspectable, CultReference(typeof(Faction), many: true), JsonProperty("relations"), Key(16)]
public Dictionary<CultRecordRef<Faction>, FactionRelationship> Relations = new Dictionary<CultRecordRef<Faction>, FactionRelationship>();
// The faction's rules of engagement; null fights as FactionDoctrine.Default. // The faction's rules of engagement; null fights as FactionDoctrine.Default.
[Inspectable, JsonProperty("doctrine"), Key(17)] [Inspectable, JsonProperty("doctrine"), Key(17)]
@ -61,7 +58,7 @@ public class Faction
// The maker's final assembly: the distribution every lot of theirs draws its own quality from, and the hard ceiling on each // The maker's final assembly: the distribution every lot of theirs draws its own quality from, and the hard ceiling on each
// of its roles (quality-lean-assembly-hard-ceiling). Null is not authored: a lot of theirs assembles at AssemblyDistribution's // of its roles (quality-lean-assembly-hard-ceiling). Null is not authored: a lot of theirs assembles at AssemblyDistribution's
// defaults. assembly-from-maker derives it once at the part mean plus a tolerance margin (quality-min-tolerance-binned-assembly); // defaults. assembly-from-maker derives it once at the part mean plus a tolerance margin (quality-min-tolerance-binned-assembly);
// tune it in Studio after that. Key 18 is reserved for Livery. Key 20 was assemblyDeviation (retired); never reuse it. // tune it in Studio after that. Key 16 is reserved for Relations and 18 for Livery. Key 20 was assemblyDeviation (retired); never reuse it.
[Inspectable, JsonProperty("assembly"), Key(19)] [Inspectable, JsonProperty("assembly"), Key(19)]
public AssemblyDistribution Assembly; public AssemblyDistribution Assembly;

View file

@ -1,33 +1,17 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Numerics;
using CultMath; using CultMath;
// The Delaunay triangulation of a galaxy's zone positions, as the edges Galaxy links zones along. Bowyer-Watson // The Delaunay triangulation of a galaxy's zone positions, as the edges Galaxy links zones along. Bowyer-Watson
// (Bowyer 1981, Watson 1981): each point is inserted by removing every triangle whose circumcircle strictly holds it and // (Bowyer 1981, Watson 1981) in double precision: each point is inserted by removing every triangle whose
// fanning the cavity's boundary to it. The orientation and in-circle predicates are exact: a double-precision // circumcircle holds it and fanning the cavity's boundary to it. Every point lands in the triangulation, so for two or
// determinant answers when it clears its rounding-error bound (Shewchuk 1997), otherwise the determinant is evaluated // more distinct points the edge graph is connected.
// in BigInteger, since every double is a dyadic rational. For two or more distinct points the edge graph is connected:
// collinear points link each to its neighbour along the line; duplicate or non-finite points throw.
public static class Delaunay public static class Delaunay
{ {
// Each edge once, as (lower index, higher index), in ascending order. // Each edge once, as (lower index, higher index), in ascending order.
public static List<(int a, int b)> Edges(IReadOnlyList<float2> points) public static List<(int a, int b)> Edges(IReadOnlyList<float2> points)
{ {
var n = points.Count; var n = points.Count;
var order = new int[n];
for (var i = 0; i < n; i++)
{
if (!float.IsFinite(points[i].x) || !float.IsFinite(points[i].y))
throw new ArgumentException($"Delaunay point {i} is not finite: ({points[i].x}, {points[i].y})");
order[i] = i;
}
// Lexicographic order runs along any line, and puts equal points side by side.
Array.Sort(order, (i, j) => points[i].x != points[j].x ? points[i].x.CompareTo(points[j].x) : points[i].y.CompareTo(points[j].y));
for (var i = 1; i < n; i++)
if (points[order[i - 1]].x == points[order[i]].x && points[order[i - 1]].y == points[order[i]].y)
throw new ArgumentException($"Delaunay points {Math.Min(order[i - 1], order[i])} and {Math.Max(order[i - 1], order[i])} are the same point ({points[order[i]].x}, {points[order[i]].y})");
var x = new double[n + 3]; var x = new double[n + 3];
var y = new double[n + 3]; var y = new double[n + 3];
double minX = double.MaxValue, minY = double.MaxValue, maxX = double.MinValue, maxY = double.MinValue; double minX = double.MaxValue, minY = double.MaxValue, maxX = double.MinValue, maxY = double.MinValue;
@ -41,22 +25,9 @@ public static class Delaunay
maxY = Math.Max(maxY, y[i]); maxY = Math.Max(maxY, y[i]);
} }
var collinear = true; // A super-triangle far outside the points, so its vertices bend no edge between them; its triangles are
for (var i = 2; i < n && collinear; i++) // dropped at the end.
collinear = Orientation(x, y, order[0], order[1], order[i]) == 0; var size = Math.Max(Math.Max(maxX - minX, maxY - minY), 1e-6) * 1000;
if (collinear)
{
var line = new List<(int a, int b)>();
for (var i = 1; i < n; i++) line.Add(Ordered(order[i - 1], order[i]));
line.Sort();
return line;
}
// A super-triangle so far outside the points that its vertices bend no edge between them: a float's coordinates
// are multiples of 2^-149, so a triple of distinct non-collinear points has circumradius under extent^3 * 2^300,
// which 2^700 * extent exceeds for any extent a float holds. Its triangles are dropped at the end. Its
// coordinates overflow the double determinants, which then fail every comparison and fall to the exact path.
var size = Math.Max(maxX - minX, maxY - minY) * Math.Pow(2, 700);
double midX = (minX + maxX) / 2, midY = (minY + maxY) / 2; double midX = (minX + maxX) / 2, midY = (minY + maxY) / 2;
x[n] = midX - size; y[n] = midY - size; x[n] = midX - size; y[n] = midY - size;
x[n + 1] = midX + size; y[n + 1] = midY - size; x[n + 1] = midX + size; y[n + 1] = midY - size;
@ -70,7 +41,9 @@ public static class Delaunay
for (var t = triangles.Count - 1; t >= 0; t--) for (var t = triangles.Count - 1; t >= 0; t--)
{ {
var triangle = triangles[t]; var triangle = triangles[t];
if (InCircle(x, y, triangle.A, triangle.B, triangle.C, p) * triangle.Orientation <= 0) continue; var dx = x[p] - triangle.CenterX;
var dy = y[p] - triangle.CenterY;
if (dx * dx + dy * dy >= triangle.RadiusSquared) continue;
Count(cavity, triangle.A, triangle.B); Count(cavity, triangle.A, triangle.B);
Count(cavity, triangle.B, triangle.C); Count(cavity, triangle.B, triangle.C);
Count(cavity, triangle.C, triangle.A); Count(cavity, triangle.C, triangle.A);
@ -106,90 +79,19 @@ public static class Delaunay
private readonly struct Triangle private readonly struct Triangle
{ {
public readonly int A, B, C; public readonly int A, B, C;
// +1 if A, B, C run counter-clockwise, -1 if clockwise; a triangle never has zero area. public readonly double CenterX, CenterY, RadiusSquared;
public readonly int Orientation;
public Triangle(int a, int b, int c, double[] x, double[] y) public Triangle(int a, int b, int c, double[] x, double[] y)
{ {
A = a; A = a;
B = b; B = b;
C = c; C = c;
Orientation = Delaunay.Orientation(x, y, a, b, c); double ax = x[a], ay = y[a], bx = x[b], by = y[b], cx = x[c], cy = y[c];
if (Orientation == 0) throw new InvalidOperationException($"Delaunay built a zero-area triangle on points {a}, {b}, {c}"); var d = 2 * (ax * (by - cy) + bx * (cy - ay) + cx * (ay - by));
} double a2 = ax * ax + ay * ay, b2 = bx * bx + by * by, c2 = cx * cx + cy * cy;
} CenterX = (a2 * (by - cy) + b2 * (cy - ay) + c2 * (ay - by)) / d;
CenterY = (a2 * (cx - bx) + b2 * (ax - cx) + c2 * (bx - ax)) / d;
// Shewchuk's error bounds for the double-precision determinants: (3 + 16e)e and (10 + 96e)e, e = 2^-53. RadiusSquared = (ax - CenterX) * (ax - CenterX) + (ay - CenterY) * (ay - CenterY);
private const double OrientationBound = 3.3306690738754716e-16;
private const double InCircleBound = 1.1102230246251577e-15;
// The sign of the area a, b, c span: +1 counter-clockwise, -1 clockwise, 0 collinear.
private static int Orientation(double[] x, double[] y, int a, int b, int c)
{
var left = (x[a] - x[c]) * (y[b] - y[c]);
var right = (y[a] - y[c]) * (x[b] - x[c]);
var det = left - right;
var bound = OrientationBound * (Math.Abs(left) + Math.Abs(right));
if (det > bound) return 1;
if (-det > bound) return -1;
var exact = Exact.Of(x, y, a, b, c);
return (exact[0] * exact[3] - exact[1] * exact[2]).Sign;
}
// The sign of the in-circle determinant: +1 when p is strictly inside the circle through a, b, c taken
// counter-clockwise, -1 strictly outside, 0 on it.
private static int InCircle(double[] x, double[] y, int a, int b, int c, int p)
{
double adx = x[a] - x[p], ady = y[a] - y[p], bdx = x[b] - x[p], bdy = y[b] - y[p], cdx = x[c] - x[p], cdy = y[c] - y[p];
double abL = adx * bdy, abR = bdx * ady, bcL = bdx * cdy, bcR = cdx * bdy, caL = cdx * ady, caR = adx * cdy;
double alift = adx * adx + ady * ady, blift = bdx * bdx + bdy * bdy, clift = cdx * cdx + cdy * cdy;
var det = alift * (bcL - bcR) + blift * (caL - caR) + clift * (abL - abR);
var permanent = (Math.Abs(bcL) + Math.Abs(bcR)) * alift + (Math.Abs(caL) + Math.Abs(caR)) * blift + (Math.Abs(abL) + Math.Abs(abR)) * clift;
var bound = InCircleBound * permanent;
if (det > bound) return 1;
if (-det > bound) return -1;
var e = Exact.Of(x, y, a, b, c, p);
BigInteger ax = e[0], ay = e[1], bx = e[2], by = e[3], cx = e[4], cy = e[5];
return (e[6] * (bx * cy - cx * by) + e[7] * (cx * ay - ax * cy) + e[8] * (ax * by - bx * ay)).Sign;
}
// Coordinates exactly, as integers in units of the smallest binary exponent among them.
private static class Exact
{
// Orientation: [a.x - c.x, a.y - c.y, b.x - c.x, b.y - c.y] with the cross product the caller takes.
public static BigInteger[] Of(double[] x, double[] y, int a, int b, int c)
{
var v = Scaled(new[] { x[a], y[a], x[b], y[b], x[c], y[c] });
return new[] { v[0] - v[4], v[1] - v[5], v[2] - v[4], v[3] - v[5] };
}
// In-circle: [a - p (x, y), b - p, c - p, then each one's squared length].
public static BigInteger[] Of(double[] x, double[] y, int a, int b, int c, int p)
{
var v = Scaled(new[] { x[a], y[a], x[b], y[b], x[c], y[c], x[p], y[p] });
BigInteger adx = v[0] - v[6], ady = v[1] - v[7], bdx = v[2] - v[6], bdy = v[3] - v[7], cdx = v[4] - v[6], cdy = v[5] - v[7];
return new[] { adx, ady, bdx, bdy, cdx, cdy, adx * adx + ady * ady, bdx * bdx + bdy * bdy, cdx * cdx + cdy * cdy };
}
private static BigInteger[] Scaled(double[] values)
{
var mantissa = new long[values.Length];
var exponent = new int[values.Length];
var lowest = int.MaxValue;
for (var i = 0; i < values.Length; i++)
{
var bits = BitConverter.DoubleToInt64Bits(values[i]);
var biased = (int) ((bits >> 52) & 0x7FF);
var fraction = bits & 0xFFFFFFFFFFFFFL;
mantissa[i] = biased == 0 ? fraction : fraction | (1L << 52);
exponent[i] = biased == 0 ? -1074 : biased - 1075;
if (bits < 0) mantissa[i] = -mantissa[i];
if (mantissa[i] != 0) lowest = Math.Min(lowest, exponent[i]);
}
var scaled = new BigInteger[values.Length];
for (var i = 0; i < values.Length; i++)
scaled[i] = mantissa[i] == 0 ? BigInteger.Zero : new BigInteger(mantissa[i]) << (exponent[i] - lowest);
return scaled;
} }
} }
} }

View file

@ -1,67 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using System.Linq;
// The demo's pressure curve (aetheria-release, cut demo-pressure-curve): how many hostiles, of what hull tier, a zone of a
// galaxy with a gate antagonist (Galaxy.Antagonist) holds, as a function of its depth toward the gate. The single owner of these numbers;
// ZoneGenerator asks and draws. Pure: no Unity, no cache, no randomness, so the same persisted galaxy yields the same zone.
public static class DemoPressure
{
// Depth at or below which a zone carries no hostiles. Depth is e / (e + x), the share of the way from the entrance to the
// gate a zone sits at, so a quarter covers the entrance, its neighbours, and on a short galaxy the first jump out.
public const float GraceDepth = 0.25f;
// Hostiles at the gate (its ring, besides the boss), the most the curve ever asks for.
public const int MaxHostiles = 6;
// Tier is depth raised to this power: above 1 keeps heavy hulls rare until the last stretch.
public const float TierExponent = 2f;
public readonly struct Pressure
{
public readonly int Hostiles;
// 0..1: the antagonist's ship hulls up to this quantile of cost may be drawn.
public readonly float Tier;
public Pressure(int hostiles, float tier) { Hostiles = hostiles; Tier = tier; }
}
// e / (e + x) for e = jumps from the entrance and x = jumps to the exit: 0 only at the entrance, 1 only at the gate, from
// the persisted Entrance and Exit alone. On a shortest entrance-exit path it is the share of the way travelled; a zone
// behind the entrance rises slowly with its distance from it rather than sitting at 0.
public static float Depth(Galaxy galaxy, GalaxyZone zone)
{
float e = galaxy.Entrance.Distance[zone], x = galaxy.Exit.Distance[zone];
return e + x == 0 ? 0f : e / (e + x);
}
// The entrance and this many jumps around it are quiet whatever the galaxy's depth scale, so a short galaxy's first
// neighbours are no deeper than the grace.
public const int GraceJumps = 1;
// No antagonist ship, station or turret holds a zone in grace.
public static bool InGrace(Galaxy galaxy, GalaxyZone zone) =>
galaxy.Entrance.Distance[zone] <= GraceJumps || Depth(galaxy, zone) <= GraceDepth;
// What the zone holds: the curve at its depth, none in grace.
public static Pressure Of(Galaxy galaxy, GalaxyZone zone) =>
InGrace(galaxy, zone) ? new Pressure(0, At(Depth(galaxy, zone)).Tier) : At(Depth(galaxy, zone));
public static Pressure At(float depth)
{
depth = Math.Clamp(depth, 0f, 1f);
var ramp = Math.Clamp((depth - GraceDepth) / (1f - GraceDepth), 0f, 1f);
var smooth = ramp * ramp * (3f - 2f * ramp);
return new Pressure((int)MathF.Round(MaxHostiles * smooth), MathF.Pow(depth, TierExponent));
}
// The dearest hull price the tier admits: the price at that quantile of the hulls offered, cheapest first. Never below the
// cheapest hull offered, so the draw is never empty while any hull is offered.
public static int PriceCeiling(int[] offeredPrices, float tier)
{
var sorted = offeredPrices.OrderBy(price => price).ToArray();
return sorted[(int)MathF.Round(Math.Clamp(tier, 0f, 1f) * (sorted.Length - 1))];
}
}

View file

@ -1,65 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using GameCult.Caching;
using MessagePack;
using Newtonsoft.Json;
// What a gas giant's atmosphere holds before its province weights it: a catalog record, keyed atmosphere:<id>. Its yields are
// read by Deposits through FieldKinds.Yield, as a field kind's are. Volatiles are not ore: FieldKinds.IsOre never reads this.
[CultDocument("aetheria.atmospheredata", "1"), MessagePackObject, JsonObject(MemberSerialization.OptIn)]
public class AtmosphereData
{
[CultName, JsonProperty("name"), Key(0)]
public string Name = "";
[JsonProperty("yields"), Key(1)]
public List<FieldYield> Yields = new List<FieldYield>();
public static CultRecordKey KeyOf(string id) => new CultRecordKey("atmosphere:" + id);
}
// The one owner of what a zone's ground holds (ruling auto-mining-is-off-screen-only): the goods an ore rig mines or a skimmer
// skims, in units, derived from the zone's bodies and never stored. Production.Advance picks its raw recipes by it off screen,
// and an ore rig on screen works the rocks of the ore Production.Pick names from it.
public static class Deposits
{
// The atmosphere every gas giant draws on, until a giant authors its own.
public const string GasGiantAtmosphere = "gas-giant";
// Each good's amount, in design-key order, zero dropped; empty for a null zone. A belt adds its kind's yields in this
// province (FieldKinds.Yield) as shares of one, times what its rocks pay a miner once fully worn (the sum of
// Settings.AsteroidYield over their sizes, the units FireControl.Extract splits by the same yields). A gas giant that is not
// a sun adds the atmosphere's yields the same way, as shares of one times one.
public static (CultRecordKey design, float amount)[] Of(Zone zone, CultCache catalog)
{
if (zone == null) return Array.Empty<(CultRecordKey, float)>();
var province = zone.GalaxyZone?.Province?.Type ?? default;
var held = new Dictionary<string, (CultRecordKey design, double amount)>(StringComparer.Ordinal);
void Add((CultRecordRef<SimpleCommodityData> Commodity, float Amount)[] yields, double scale)
{
var total = yields.Sum(yield => (double) yield.Amount);
if (!(total > 0) || !(scale > 0)) return;
foreach (var yield in yields)
{
var key = yield.Commodity.Key;
held.TryGetValue(key.Value, out var before);
held[key.Value] = (key, before.amount + yield.Amount / total * scale);
}
}
foreach (var belt in zone.AsteroidBelts.OrderBy(entry => entry.Value.Data.SiteOr(entry.Key), StringComparer.Ordinal))
{
var rocks = belt.Value.Data.Asteroids.Sum(rock => (double) zone.Settings.AsteroidYield.Evaluate(rock.Size));
Add(FieldKinds.Yield(belt.Value.Data.Kind, province, catalog), rocks);
}
var giants = zone.Planets.Values.Count(body => body is GasGiantData && !(body is SunData));
var atmosphere = catalog.Get<AtmosphereData>(AtmosphereData.KeyOf(GasGiantAtmosphere));
if (giants > 0 && atmosphere != null) Add(FieldKinds.Yield(atmosphere.Yields, province, catalog), giants);
return held.Values.Where(entry => entry.amount > 0).OrderBy(entry => entry.design.Value, StringComparer.Ordinal)
.Select(entry => (entry.design, (float) entry.amount)).ToArray();
}
}

View file

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 1fddcfe8170c46949a77a09bcbc69082
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -106,7 +106,7 @@ public static class DrawAhead
} }
public static BeltDraw<T> DrawListOf<T>(AsteroidBelt belt, PlanetSettings settings, IReadOnlyList<T> meshes, System.Func<T, float> radius, int keep, CultRecordKey beltKey) => public static BeltDraw<T> DrawListOf<T>(AsteroidBelt belt, PlanetSettings settings, IReadOnlyList<T> meshes, System.Func<T, float> radius, int keep, CultRecordKey beltKey) =>
new(Enumerable.Range(0, belt.Data.Asteroids.Length).Select(i => belt.UndamagedSize(i, settings)).ToArray(), meshes, radius, keep, belt.Data.SiteOr(beltKey)); new(Enumerable.Range(0, belt.Data.Asteroids.Length).Select(i => belt.UndamagedSize(i, settings)).ToArray(), meshes, radius, keep, beltKey.Value);
// A ship in a wormhole animation has its pose scripted by the step, not integrated from Velocity and TurnRate, // A ship in a wormhole animation has its pose scripted by the step, not integrated from Velocity and TurnRate,
// so it is drawn where the step put it: extrapolating a scripted pose draws a streak that resets every step. // so it is drawn where the step put it: extrapolating a scripted pose draws a streak that resets every step.

View file

@ -1,193 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using GameCult.Caching;
// One recipe read as a chain link. Wage is the implied credits per worker-second at the authored prices; null when the link
// is unpriced (an input, any filler of a role, or the output at Price 0) or has no labour. Cost is the derived cost of one output unit.
public sealed class BalanceLink
{
public string Output, Name, StationKind;
public double Labour, Price, Cost;
public double? Wage;
public double? WageRatio;
// Why Wage is null: "output" (the output is at Price 0), "input" (an input, upkeep or role filler is at Price 0), "labour" (no labour);
// null when priced. The first that applies, in that order.
public string Unpriced;
}
// One ore a kind of belt holds: its share of the kind's abundance, its extraction link's wage over the median, its price and cost.
public sealed class BeltYield
{
public string Ore;
public double Share, Price, Cost;
public double? WageRatio;
}
public sealed class BeltRow
{
public string Kind;
public List<BeltYield> Yields = new List<BeltYield>();
public double Price, Cost;
}
public sealed class BalanceReport
{
public double WageReference;
public List<BalanceLink> Links;
public List<EconomyFault> Faults;
public List<BeltRow> Belts;
}
// The static economy balance: a steady-state input-output reading of the chain (Leontief 1936; Sraffa 1960 zero-profit prices under
// one wage; Samuelson 1951: with labour the only primary factor the cheapest filler of a role is demand-independent; Lewis 1954: the
// extraction sector sets the going wage). Pure: reads the catalog, writes nothing. ItemData.Price stays the one price the game charges;
// for a made good it is the price Prices derives, which economy author writes. Balance's faults are report-only.
public static class EconomyBalance
{
public const string HMargin = "H-margin", HWage = "H-wage", HConverge = "H-converge";
private const int SweepCap = 10000, SettleWindow = 100;
// The stored price a derived price becomes: whole credits, at least 1.
public static int Rounded(double derived) => (int) Math.Max(1, Math.Round(derived, MidpointRounding.AwayFromZero));
// The words for goods whose price does not settle.
public static string Unsettled(CultCache catalog, IEnumerable<string> keys) =>
$"No price settles within {SweepCap} sweeps: these goods sit on a cycle of recipes whose requirements do not shrink: " +
string.Join(", ", keys.Select(k => catalog.Get<ItemData>(new CultRecordKey(k))?.Name ?? k));
private static double Price(CultCache catalog, string key) => catalog.Get<ItemData>(new CultRecordKey(key))?.Price ?? 0;
// Authored-price wage per link; the cheapest filler fills a role, and a role with any filler at Price 0 leaves the link unpriced.
private static List<BalanceLink> Links(CultCache catalog, List<EconomyChecks.Column> columns)
{
double? CheapestPriced(string[] fillers) => fillers.Length == 0 || fillers.Any(f => Price(catalog, f) <= 0) ? (double?) null : fillers.Min(f => Price(catalog, f));
var links = new List<BalanceLink>();
foreach (var c in columns)
{
var link = new BalanceLink { Output = c.Output, Name = catalog.Get(c.Recipe.Output)?.Name ?? c.Output, Labour = c.Labour, Price = Price(catalog, c.Output), StationKind = catalog.Get(c.Recipe.StationKind)?.Name ?? "no kind" };
var cost = 0.0;
var inputsPriced = true;
foreach (var (commodity, count) in c.Inputs.Concat(c.Upkeep))
{
if (count <= 0) continue;
var p = Price(catalog, commodity);
if (p <= 0) inputsPriced = false;
cost += count * p;
}
foreach (var slot in c.Slots)
{
if (slot.Count <= 0) continue;
var p = CheapestPriced(slot.Fillers);
if (p == null) inputsPriced = false;
else cost += slot.Count * p.Value;
}
link.Unpriced = link.Price <= 0 ? "output" : !inputsPriced ? "input" : c.Labour <= 0 ? "labour" : null;
if (link.Unpriced == null) link.Wage = (c.OutputCount * link.Price - cost) / c.Labour;
links.Add(link);
}
return links;
}
// The going wage: the median implied wage of the priced raw links, 0 when none is priced.
private static double RawWage(CultCache catalog, List<EconomyChecks.Column> columns, List<BalanceLink> links)
{
var wages = links.Where((l, i) => l.Wage.HasValue && columns[i].IsCommodity && Recipes.IsRaw(catalog, columns[i].Recipe)).Select(l => l.Wage.Value).OrderBy(w => w).ToList();
return wages.Count == 0 ? 0 : wages.Count % 2 == 1 ? wages[wages.Count / 2] : (wages[wages.Count / 2 - 1] + wages[wages.Count / 2]) / 2;
}
public static double Wage(CultCache catalog)
{
var columns = EconomyChecks.Columns(catalog);
return RawWage(catalog, columns, Links(catalog, columns));
}
// Value iteration from zero over every recipe at one wage. A good in fixedOutputs, or with no recipe, holds its authored price.
// Two recipes for one output: the cheaper sets its price, as a role takes its cheapest filler.
private static Dictionary<string, double> Sweep(CultCache catalog, List<EconomyChecks.Column> columns, double wage, ISet<string> fixedOutputs, out List<string> unsettled)
{
var derived = new Dictionary<string, double>(StringComparer.Ordinal);
foreach (var c in columns) if (!fixedOutputs.Contains(c.Output)) derived[c.Output] = 0;
double Cost(string key) => derived.TryGetValue(key, out var v) ? v : Price(catalog, key);
var converged = false;
// The last sweep each good moved in: a cycle can move one good per sweep, so the last sweep alone would name half of it.
var lastMoved = new Dictionary<string, int>(StringComparer.Ordinal);
for (var sweep = 0; sweep < SweepCap && !converged; sweep++)
{
converged = true;
var best = new Dictionary<string, double>(StringComparer.Ordinal);
foreach (var c in columns.Where(c => !fixedOutputs.Contains(c.Output)))
{
var sum = wage * c.Labour;
foreach (var (commodity, count) in c.Inputs.Concat(c.Upkeep)) if (count > 0) sum += count * Cost(commodity);
foreach (var slot in c.Slots)
if (slot.Count > 0 && slot.Fillers.Length > 0) sum += slot.Count * slot.Fillers.Min(Cost);
var next = sum / c.OutputCount;
if (!best.TryGetValue(c.Output, out var held) || next < held) best[c.Output] = next;
}
foreach (var (output, next) in best)
{
// A price that is not a finite number is not settled, however little it moved.
if (!double.IsFinite(next) || Math.Abs(next - derived[output]) > 1e-12 * Math.Max(1, Math.Abs(next))) { converged = false; lastMoved[output] = sweep; }
derived[output] = next;
}
}
unsettled = converged ? new List<string>() : lastMoved.Where(p => p.Value >= SweepCap - SettleWindow).Select(p => p.Key).OrderBy(k => k, StringComparer.Ordinal).ToList();
return derived;
}
// The price of every made good (an output whose recipe is not raw) at the going wage: its inputs, upkeep and cheapest
// role fillers at their prices, plus the wage times its labour, over its output count. A design with a recipe is a made good
// priced like a commodity; raw goods and designs with no recipe keep their authored price. Unsettled names the goods still moving
// when the sweep gave up: a cycle of recipes whose requirements do not shrink has no price, so none of the values are a price.
public static Dictionary<string, double> Prices(CultCache catalog, out List<string> unsettled)
{
var columns = EconomyChecks.Columns(catalog);
var raw = new HashSet<string>(columns.Where(c => Recipes.IsRaw(catalog, c.Recipe)).Select(c => c.Output), StringComparer.Ordinal);
var derived = Sweep(catalog, columns, RawWage(catalog, columns, Links(catalog, columns)), raw, out unsettled);
return columns.Where(c => !raw.Contains(c.Output)).Select(c => c.Output).Distinct(StringComparer.Ordinal)
.ToDictionary(key => key, key => derived[key], StringComparer.Ordinal);
}
public static BalanceReport Balance(CultCache catalog, double wageSpread = 2)
{
var columns = EconomyChecks.Columns(catalog);
var links = Links(catalog, columns);
var reference = RawWage(catalog, columns, links);
foreach (var l in links) l.WageRatio = reference > 0 ? l.Wage / reference : null;
// Derived cost: nothing fixed, so an ore costs its labour; belt rows show price minus cost, the rent.
var derived = Sweep(catalog, columns, reference, new HashSet<string>(), out var unsettled);
var converged = unsettled.Count == 0;
double Cost(string key) => derived.TryGetValue(key, out var v) ? v : Price(catalog, key);
foreach (var l in links) l.Cost = derived[l.Output];
var faults = new List<EconomyFault>();
if (!converged) faults.Add(new EconomyFault(HConverge, "(chain)", $"Derived cost did not settle within {SweepCap} sweeps."));
foreach (var l in links.Where(l => l.Wage.HasValue))
{
if (l.Wage.Value <= 0)
faults.Add(new EconomyFault(HMargin, l.Output, $"{l.Name} sells at or below its inputs: implied wage {l.Wage.Value:0.#####} per worker-second."));
else if (reference > 0 && (l.Wage.Value < reference / wageSpread || l.Wage.Value > reference * wageSpread))
faults.Add(new EconomyFault(HWage, l.Output, $"{l.Name}: implied wage {l.Wage.Value:0.#####} is {l.WageRatio:0.##}x the median {reference:0.#####}, outside the spread of {wageSpread:0.##}."));
}
var belts = new List<BeltRow>();
foreach (var kind in catalog.GetAll<FieldKindData>().OrderBy(k => k.Name, StringComparer.Ordinal))
{
var row = new BeltRow { Kind = kind.Name };
var total = kind.Yields.Where(y => y.Abundance > 0).Sum(y => (double) y.Abundance);
foreach (var y in kind.Yields.Where(y => y.Abundance > 0 && total > 0))
{
var ore = y.Commodity.Key.Value;
var share = y.Abundance / total;
var yield = new BeltYield { Ore = ore, Share = share, Price = Price(catalog, ore), Cost = Cost(ore), WageRatio = links.FirstOrDefault(l => l.Output == ore)?.WageRatio };
row.Price += share * yield.Price;
row.Cost += share * yield.Cost;
row.Yields.Add(yield);
}
belts.Add(row);
}
return new BalanceReport { WageReference = reference, Links = links, Faults = faults, Belts = belts };
}
}

View file

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 8f6fa275e57694a48b223fb633e42c1e

Some files were not shown because too many files have changed in this diff Show more