Wormholes

This commit is contained in:
Reinier Vens 2021-03-05 14:31:18 +00:00
commit adfb200a91
38 changed files with 1102 additions and 59 deletions

1
.gitignore vendored
View file

@ -76,4 +76,3 @@ Economy.Shared/obj/
# JetBrains Rider .idea folder
.idea/
AetherDB.msgpack

View file

@ -1531,7 +1531,7 @@
<e p="FactoryBehavior.cs" t="Include" />
<e p="HaulingController.cs" t="Include" />
<e p="Heat.cs" t="Include" />
<e p="Heatsink.cs" t="Include" />
<e p="HeatStorage.cs" t="Include" />
<e p="InstantWeapon.cs" t="Include" />
<e p="ItemUsage.cs" t="Include" />
<e p="Launcher.cs" t="Include" />
@ -2028,6 +2028,7 @@
<e p="Settings.cs" t="Include" />
<e p="Ship.cs" t="Include" />
<e p="TypeFormatterResolver.cs" t="Include" />
<e p="Wormhole.cs" t="Include" />
<e p="Zone.cs" t="Include" />
<e p="ZoneData.cs" t="Include" />
<e p="ZoneGenerator.cs" t="Include" />
@ -2107,6 +2108,7 @@
<e p="PowerBrush.shader" t="Include" />
<e p="RadialWaveBrush.shader" t="Include" />
<e p="SimplexBrush.shader" t="Include" />
<e p="WormholeBrush.shader" t="Include" />
</e>
<e p="Clouds.shader" t="Include" />
<e p="Compute" t="Include">

View file

@ -425,6 +425,7 @@
<None Include="Assets\Shaders\Brushes\PowerBrush.shader" />
<None Include="Assets\Shaders\DitheredParticles.shader" />
<None Include="Assets\Shaders\Raymarching\VolumeJupiter.shader" />
<None Include="Assets\Shaders\Brushes\WormholeBrush.shader" />
<None Include="Assets\Shaders\ViewNormalEmissive.shader" />
<None Include="Assets\Shaders\Particle Standard Unlit.shader" />
<None Include="Assets\com.unity.uiextensions\Runtime\Resources\Shaders\UI Particle MultiplyDouble.shader" />

View file

@ -78,6 +78,6 @@ Material:
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.1764706, g: 0.31764707, b: 0.1254902, a: 1}
- _Color: {r: 0.65882355, g: 0.39265883, b: 0.5376236, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []

View file

@ -0,0 +1,80 @@
%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: Wormhole Gravity 1
m_Shader: {fileID: 4800000, guid: 268da230635cfb34ab4ed6ad39503fa0, 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: 0}
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:
- _BumpScale: 1
- _Cutoff: 0.5
- _Depth: 54
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Power: 4
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []

View file

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

View file

@ -0,0 +1,80 @@
%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: Wormhole Gravity
m_Shader: {fileID: 4800000, guid: 268da230635cfb34ab4ed6ad39503fa0, 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: 0}
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:
- _BumpScale: 1
- _Cutoff: 0.5
- _Depth: 2000
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Power: 64
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []

View file

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

View file

@ -0,0 +1,83 @@
%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: Wormhole Lighting
m_Shader: {fileID: 4800000, guid: 268da230635cfb34ab4ed6ad39503fa0, 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: 0}
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:
- _BumpScale: 1
- _Cutoff: 0.5
- _Depth: 4
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _Frequency: 6.2832
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Phase: 0
- _Power: 12
- _SinePower: 1.25
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 0.5058824, b: 0.86, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []

View file

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

View file

@ -0,0 +1,84 @@
%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: Wormhole Waves
m_Shader: {fileID: 4800000, guid: 8681ac064d59d15458d16cc9b884262c, 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: 0}
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:
- _BumpScale: 1
- _Cutoff: 0.5
- _Depth: 24
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _Frequency: 2
- _FrequencyDist: 60
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Power: 2
- _SinePower: 1.25
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _Speed: 10
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []

View file

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

View file

@ -86,7 +86,7 @@ Material:
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Scale: 5.4972186
- _Scale: 5.9919047
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1

View file

@ -0,0 +1,360 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1826894967093516808
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1030590306481442051}
- component: {fileID: 3216580199816124320}
- component: {fileID: 3211969211988968959}
m_Layer: 9
m_Name: Gravity Well
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1030590306481442051
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1826894967093516808}
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1024, y: 1024, z: 1024}
m_Children: []
m_Father: {fileID: 463084220523011477}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!33 &3216580199816124320
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1826894967093516808}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &3211969211988968959
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1826894967093516808}
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: 244f3e4c0c030a24b8d7aa944895bdcf, 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 &3908760799087214860
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 581261949390603689}
- component: {fileID: 987447324816385543}
- component: {fileID: 3959510878930752720}
m_Layer: 9
m_Name: Gravity Waves
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &581261949390603689
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3908760799087214860}
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 512, y: 512, z: 512}
m_Children: []
m_Father: {fileID: 463084220523011477}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!33 &987447324816385543
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3908760799087214860}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &3959510878930752720
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3908760799087214860}
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: ef2f6090d5cc14a4e9ce38def3bed9ac, 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 &4837153162502999620
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 463084220523011477}
m_Layer: 0
m_Name: Wormhole 1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &463084220523011477
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4837153162502999620}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 8222188360457572195}
- {fileID: 1030590306481442051}
- {fileID: 581261949390603689}
- {fileID: 8249320701965103923}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &5989754434710127254
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8249320701965103923}
- component: {fileID: 1358808915677722173}
- component: {fileID: 6450194732864552839}
m_Layer: 13
m_Name: Fog Tint
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8249320701965103923
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5989754434710127254}
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1024, y: 1024, z: 1}
m_Children: []
m_Father: {fileID: 463084220523011477}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!33 &1358808915677722173
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5989754434710127254}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &6450194732864552839
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5989754434710127254}
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: 8d101bf8c1287cb49a4bd68fe8824246, 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 &7647029665738834910
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8222188360457572195}
- component: {fileID: 2468954688819198096}
- component: {fileID: 8290522694236574882}
m_Layer: 9
m_Name: Gravity Pit
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8222188360457572195
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7647029665738834910}
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 512, y: 512, z: 512}
m_Children: []
m_Father: {fileID: 463084220523011477}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!33 &2468954688819198096
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7647029665738834910}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &8290522694236574882
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7647029665738834910}
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: a9ef17c902709ce41a837c54b809184b, 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}

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 4a77c480b4bb2a148954bd57dfe91d0b
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -156,6 +156,14 @@
"expectedControlType": "Button",
"processors": "",
"interactions": ""
},
{
"name": "EnterWormhole",
"type": "Button",
"id": "c918ac22-b029-4805-9c85-e615a52641f2",
"expectedControlType": "Button",
"processors": "",
"interactions": ""
}
],
"bindings": [
@ -554,6 +562,17 @@
"action": "Toggle Heatsinks",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "95817d40-4c8d-4660-bd68-a93afe74b6e1",
"path": "<Keyboard>/#(V)",
"interactions": "",
"processors": "",
"groups": "Keyboard&Mouse",
"action": "EnterWormhole",
"isComposite": false,
"isPartOfComposite": false
}
]
},

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

Binary file not shown.

View file

@ -4553,7 +4553,7 @@ MonoBehaviour:
EnergyLabel: {fileID: 0}
CockpitTemperatureLabel: {fileID: 0}
RadiatorTemperatureLabel: {fileID: 0}
HeatsinkTemperatureLabel: {fileID: 0}
HeatStorageTemperatureLabel: {fileID: 0}
CargoTemperatureLabel: {fileID: 517688448}
VisibilityLabel: {fileID: 858665366}
HullDurabilityLabel: {fileID: 2101419019}
@ -13046,6 +13046,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: bed3b49fe74863340b2a75f3d0517e86, type: 3}
m_Name:
m_EditorClassIdentifier:
WormholePrefab: {fileID: 463084220523011477, guid: 4a77c480b4bb2a148954bd57dfe91d0b,
type: 3}
EntityFadeTime: 3
EffectManagerParent: {fileID: 134113271}
FogCameraParent: {fileID: 1547889399}
@ -29475,7 +29477,7 @@ MonoBehaviour:
EnergyLabel: {fileID: 804489113}
CockpitTemperatureLabel: {fileID: 212527384}
RadiatorTemperatureLabel: {fileID: 1752418078}
HeatsinkTemperatureLabel: {fileID: 1060591360}
HeatStorageTemperatureLabel: {fileID: 1060591360}
CargoTemperatureLabel: {fileID: 388927456}
VisibilityLabel: {fileID: 2122035461}
HullDurabilityLabel: {fileID: 697075017}

View file

@ -169,6 +169,14 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """"
},
{
""name"": ""EnterWormhole"",
""type"": ""Button"",
""id"": ""c918ac22-b029-4805-9c85-e615a52641f2"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """"
}
],
""bindings"": [
@ -567,6 +575,17 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
""action"": ""Toggle Heatsinks"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""95817d40-4c8d-4660-bd68-a93afe74b6e1"",
""path"": ""<Keyboard>/#(V)"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard&Mouse"",
""action"": ""EnterWormhole"",
""isComposite"": false,
""isPartOfComposite"": false
}
]
},
@ -1152,6 +1171,7 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
m_Player_TargetNext = m_Player.FindAction("Target Next", throwIfNotFound: true);
m_Player_TargetNearest = m_Player.FindAction("Target Nearest", throwIfNotFound: true);
m_Player_ToggleHeatsinks = m_Player.FindAction("Toggle Heatsinks", throwIfNotFound: true);
m_Player_EnterWormhole = m_Player.FindAction("EnterWormhole", throwIfNotFound: true);
// UI
m_UI = asset.FindActionMap("UI", throwIfNotFound: true);
m_UI_Navigate = m_UI.FindAction("Navigate", throwIfNotFound: true);
@ -1236,6 +1256,7 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
private readonly InputAction m_Player_TargetNext;
private readonly InputAction m_Player_TargetNearest;
private readonly InputAction m_Player_ToggleHeatsinks;
private readonly InputAction m_Player_EnterWormhole;
public struct PlayerActions
{
private @AetheriaInput m_Wrapper;
@ -1259,6 +1280,7 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
public InputAction @TargetNext => m_Wrapper.m_Player_TargetNext;
public InputAction @TargetNearest => m_Wrapper.m_Player_TargetNearest;
public InputAction @ToggleHeatsinks => m_Wrapper.m_Player_ToggleHeatsinks;
public InputAction @EnterWormhole => m_Wrapper.m_Player_EnterWormhole;
public InputActionMap Get() { return m_Wrapper.m_Player; }
public void Enable() { Get().Enable(); }
public void Disable() { Get().Disable(); }
@ -1325,6 +1347,9 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
@ToggleHeatsinks.started -= m_Wrapper.m_PlayerActionsCallbackInterface.OnToggleHeatsinks;
@ToggleHeatsinks.performed -= m_Wrapper.m_PlayerActionsCallbackInterface.OnToggleHeatsinks;
@ToggleHeatsinks.canceled -= m_Wrapper.m_PlayerActionsCallbackInterface.OnToggleHeatsinks;
@EnterWormhole.started -= m_Wrapper.m_PlayerActionsCallbackInterface.OnEnterWormhole;
@EnterWormhole.performed -= m_Wrapper.m_PlayerActionsCallbackInterface.OnEnterWormhole;
@EnterWormhole.canceled -= m_Wrapper.m_PlayerActionsCallbackInterface.OnEnterWormhole;
}
m_Wrapper.m_PlayerActionsCallbackInterface = instance;
if (instance != null)
@ -1386,6 +1411,9 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
@ToggleHeatsinks.started += instance.OnToggleHeatsinks;
@ToggleHeatsinks.performed += instance.OnToggleHeatsinks;
@ToggleHeatsinks.canceled += instance.OnToggleHeatsinks;
@EnterWormhole.started += instance.OnEnterWormhole;
@EnterWormhole.performed += instance.OnEnterWormhole;
@EnterWormhole.canceled += instance.OnEnterWormhole;
}
}
}
@ -1584,6 +1612,7 @@ public class @AetheriaInput : IInputActionCollection, IDisposable
void OnTargetNext(InputAction.CallbackContext context);
void OnTargetNearest(InputAction.CallbackContext context);
void OnToggleHeatsinks(InputAction.CallbackContext context);
void OnEnterWormhole(InputAction.CallbackContext context);
}
public interface IUIActions
{

View file

@ -17,6 +17,7 @@ using UnityEngine.InputSystem;
using UnityEngine.UI;
using static Unity.Mathematics.math;
using float2 = Unity.Mathematics.float2;
using quaternion = Unity.Mathematics.quaternion;
using Random = UnityEngine.Random;
public class ActionGameManager : MonoBehaviour
@ -85,6 +86,21 @@ public class ActionGameManager : MonoBehaviour
File.WriteAllBytes(Path.Combine(_loadoutPath.FullName, $"{pack.Name}.preset"), MessagePackSerializer.Serialize(pack));
}
public void GenerateLevel()
{
var zonePack = ZoneGenerator.GenerateZone(
settings: Settings.ZoneSettings,
// mapLayers: Context.MapLayers,
// resources: Context.Resources,
mass: Settings.DefaultZoneMass,
radius: Settings.DefaultZoneRadius
);
Zone = new Zone(Settings.PlanetSettings, zonePack);
Zone.Log = s => Debug.Log($"Zone: {s}");
SectorRenderer.LoadZone(Zone);
}
void Start()
{
AkSoundEngine.RegisterGameObj(gameObject);
@ -95,27 +111,14 @@ public class ActionGameManager : MonoBehaviour
ItemData = new DatabaseCache();
ItemData.Load(_filePath.FullName);
ItemManager = new ItemManager(ItemData, Settings.GameplaySettings, Debug.Log);
SectorRenderer.ItemManager = ItemManager;
Loadouts.AddRange(_loadoutPath.EnumerateFiles("*.preset")
.Select(fi => MessagePackSerializer.Deserialize<EntityPack>(File.ReadAllBytes(fi.FullName))));
var zoneFile = Path.Combine(_filePath.FullName, "Home.zone");
//var zoneFile = Path.Combine(_filePath.FullName, "Home.zone");
// If the game has already been run, there will be a Home file containing a ZonePack; if not, generate one
var zonePack = File.Exists(zoneFile) ?
MessagePackSerializer.Deserialize<ZonePack>(File.ReadAllBytes(zoneFile)):
ZoneGenerator.GenerateZone(
settings: Settings.ZoneSettings,
// mapLayers: Context.MapLayers,
// resources: Context.Resources,
mass: Settings.DefaultZoneMass,
radius: Settings.DefaultZoneRadius
);
Zone = new Zone(Settings.PlanetSettings, zonePack);
Zone.Log = s => Debug.Log($"Zone: {s}");
SectorRenderer.ItemManager = ItemManager;
SectorRenderer.LoadZone(Zone);
GenerateLevel();
_input = new AetheriaInput();
_input.Global.Enable();
@ -189,6 +192,23 @@ public class ActionGameManager : MonoBehaviour
else Undock();
};
_input.Player.EnterWormhole.performed += context =>
{
foreach (var wormhole in SectorRenderer.WormholeInstances.Keys)
{
if (length(wormhole.Position - CurrentShip.Position.xz) < Settings.GameplaySettings.WormholeExitRadius)
{
CurrentShip.EnterWormhole(wormhole.Position);
CurrentShip.OnEnteredWormhole += () =>
{
GenerateLevel();
CurrentShip.ExitWormhole(SectorRenderer.WormholeInstances.Keys.First().Position,
Settings.GameplaySettings.WormholeExitVelocity * ItemManager.Random.NextFloat2Direction());
};
}
}
};
_input.Player.ToggleHeatsinks.performed += context =>
{
CurrentShip.HeatsinksEnabled = !CurrentShip.HeatsinksEnabled;
@ -197,13 +217,15 @@ public class ActionGameManager : MonoBehaviour
_input.Player.TargetReticle.performed += context =>
{
var underReticle = Zone.Entities.Where(x => x != CurrentShip).MaxBy(x => dot(normalize(x.Position - CurrentShip.Position), CurrentShip.LookDirection));
var underReticle = Zone.Entities.Where(x => x != CurrentShip)
.MaxBy(x => dot(normalize(x.Position - CurrentShip.Position), CurrentShip.LookDirection));
CurrentShip.Target.Value = CurrentShip.Target.Value == underReticle ? null : underReticle;
};
_input.Player.TargetNearest.performed += context =>
{
CurrentShip.Target.Value = Zone.Entities.Where(x=>x!=CurrentShip).MaxBy(x => length(x.Position - CurrentShip.Position));
CurrentShip.Target.Value = Zone.Entities.Where(x=>x!=CurrentShip)
.MaxBy(x => length(x.Position - CurrentShip.Position));
};
_input.Player.TargetNext.performed += context =>
@ -599,7 +621,7 @@ public class ActionGameManager : MonoBehaviour
foreach(var agent in _shipAgents)
agent.Update(Time.deltaTime);
Zone.Update(_time, Time.deltaTime);
SectorRenderer.Time = _time;
SectorRenderer.GameTime = _time;
}
private void LateUpdate()

View file

@ -10,6 +10,7 @@ using UnityEngine;
[CreateAssetMenu(fileName = "Sector Display Properties", menuName = "Aetheria/Sector Display Properties")]
public class GameSettings : ScriptableObject
{
public float WormholeDistanceRatio;
public float DefaultZoneRadius;
public float DefaultZoneMass;
public float DefaultViewDistance;

View file

@ -18,6 +18,7 @@ using float2 = Unity.Mathematics.float2;
public class SectorRenderer : MonoBehaviour
{
public Transform WormholePrefab;
public float EntityFadeTime;
public Transform EffectManagerParent;
public Transform FogCameraParent;
@ -76,6 +77,8 @@ public class SectorRenderer : MonoBehaviour
private Entity _perspectiveEntity;
private IDisposable[] _perspectiveSubscriptions = new IDisposable[2];
public Dictionary<Wormhole, GameObject> WormholeInstances = new Dictionary<Wormhole, GameObject>();
public Zone Zone { get; private set; }
public ItemManager ItemManager { get; set; }
@ -108,7 +111,7 @@ public class SectorRenderer : MonoBehaviour
}
}
public float Time { get; set; }
public float GameTime { get; set; }
public float ViewDistance
{
@ -176,7 +179,7 @@ public class SectorRenderer : MonoBehaviour
Debug.Log("WTF!");
}
}
_tourPlanets.Add((x.Value.Body.transform, parent.Body.transform));
//_tourPlanets.Add((x.Value.Body.transform, parent.Body.transform));
}
}
@ -184,10 +187,26 @@ public class SectorRenderer : MonoBehaviour
LoadEntity(entity);
zone.Entities.ObserveAdd().Subscribe(e => LoadEntity(e.Value));
zone.Entities.ObserveRemove().Subscribe(e => UnloadEntity(e.Value));
var southernWormhole = new Wormhole {Position = float2(0, -Settings.DefaultZoneRadius * Settings.WormholeDistanceRatio)};
AddWormhole(southernWormhole);
var northernWormhole = new Wormhole {Position = float2(0, Settings.DefaultZoneRadius * Settings.WormholeDistanceRatio)};
AddWormhole(northernWormhole);
}
public void AddWormhole(Wormhole wormhole)
{
var instance = Instantiate(WormholePrefab);
instance.position = new Vector3(wormhole.Position.x, 0, wormhole.Position.y);
WormholeInstances.Add(wormhole, instance.gameObject);
}
public void ClearZone()
{
foreach (var wormhole in WormholeInstances.Values) Destroy(wormhole);
WormholeInstances.Clear();
if (Planets.Count > 0)
{
foreach (var planet in Planets.Values)
@ -195,6 +214,11 @@ public class SectorRenderer : MonoBehaviour
DestroyImmediate(planet.gameObject);
}
Planets.Clear();
// foreach (var beltObject in _beltObjects.Values)
// {
// beltObject.
// }
_beltObjects.Clear();
_beltMeshes.Clear();
_beltMatrices.Clear();
_tourPlanets.Clear();
@ -386,7 +410,7 @@ public class SectorRenderer : MonoBehaviour
planet.Value.Body.transform.localPosition = new Vector3(0, Zone.GetHeight(p) + planetInstance.BodyRadius.Value * 2, 0);
if(planet.Value is GasGiantObject gasGiantObject)
{
gasGiantObject.GravityWaves.material.SetFloat("_Phase", Time * ((GasGiant) Zone.PlanetInstances[planet.Key]).GravityWavesSpeed.Value);
gasGiantObject.GravityWaves.material.SetFloat("_Phase", GameTime * ((GasGiant) Zone.PlanetInstances[planet.Key]).GravityWavesSpeed.Value);
if(!(planet.Value is SunObject))
{
var toParent = normalize(Zone.GetOrbitPosition(Zone.Orbits[planetInstance.BodyData.Orbit].Data.Parent) - p);

View file

@ -89,7 +89,7 @@ public abstract class PersistentBehaviorData
Union(6, typeof(ReflectorData)),
Union(7, typeof(ShieldData)),
Union(8, typeof(ThrusterData)),
// Union(9, typeof(TurningData)),
Union(9, typeof(WearData)),
Union(10, typeof(VelocityConversionData)),
Union(11, typeof(VelocityLimitData)),
Union(12, typeof(FactoryData)),
@ -113,7 +113,7 @@ public abstract class PersistentBehaviorData
// Union(30, typeof(HaulingControllerData)),
Union(31, typeof(CapacitorData)),
Union(32, typeof(CockpitData)),
Union(33, typeof(HeatsinkData)),
Union(33, typeof(HeatStorageData)),
Union(34, typeof(TurretControllerData)),
Union(35, typeof(InstantWeaponData)),
Union(36, typeof(ConstantWeaponData)),

View file

@ -9,17 +9,17 @@ using Unity.Mathematics;
using static Unity.Mathematics.math;
[MessagePackObject, JsonObject(MemberSerialization.OptIn), RuntimeInspectable]
public class HeatsinkData : BehaviorData
public class HeatStorageData : BehaviorData
{
public override IBehavior CreateInstance(ItemManager context, Entity entity, EquippedItem item)
{
return new Heatsink(context, this, entity, item);
return new HeatStorage(context, this, entity, item);
}
}
public class Heatsink : IBehavior
public class HeatStorage : IBehavior
{
private HeatsinkData _data;
private HeatStorageData _data;
public Entity Entity { get; }
public EquippedItem Item { get; }
@ -27,7 +27,7 @@ public class Heatsink : IBehavior
public BehaviorData Data => _data;
public Heatsink(ItemManager context, HeatsinkData data, Entity entity, EquippedItem item)
public HeatStorage(ItemManager context, HeatStorageData data, Entity entity, EquippedItem item)
{
Context = context;
_data = data;

View file

@ -73,6 +73,6 @@ public class Thruster : IAnalogBehavior
var vis = _input * Context.Evaluate(_data.Visibility, Item);
if(!Entity.VisibilitySources.ContainsKey(this) || vis > Entity.VisibilitySources[this])
Entity.VisibilitySources[this] = vis;
return true;
return _input > .01f;
}
}

View file

@ -8,6 +8,7 @@ using System.Linq;
using MessagePack;
using Newtonsoft.Json;
using Unity.Mathematics;
using static Unity.Mathematics.math;
[Union(0, typeof(InstantWeaponData)),
Union(1, typeof(LauncherData)),
@ -123,7 +124,10 @@ public abstract class Weapon : IActivatedBehavior
Visibility = Context.Evaluate(_data.Visibility, Item);
Spread = Context.Evaluate(_data.Spread, Item);
Velocity = Context.Evaluate(_data.Velocity, Item);
Wear = Context.Evaluate(_itemData.WearDamage, Item);
Wear = (1 - pow(_itemData.Performance(Item.Temperature),
(1 - pow(Item.EquippableItem.Quality, Context.GameplaySettings.QualityWearExponent)) *
Context.GameplaySettings.ThermalWearExponent)
) * _itemData.Durability;
}
public virtual bool Execute(float delta)

View file

@ -12,7 +12,7 @@ using static Unity.Mathematics.math;
public class WearData : BehaviorData
{
[TemperatureInspectable, JsonProperty("perSecond"), Key(1)]
public bool PerSecond;
public bool PerSecond = true;
public override IBehavior CreateInstance(ItemManager context, Entity entity, EquippedItem item)
{
@ -42,7 +42,10 @@ public class Wear : IBehavior
public bool Execute(float delta)
{
var wear = Context.Evaluate(_itemData.WearDamage, Item);
var wear = (1 - pow(_itemData.Performance(Item.Temperature),
(1 - pow(Item.EquippableItem.Quality, Context.GameplaySettings.QualityWearExponent)) *
Context.GameplaySettings.ThermalWearExponent)
) * _itemData.Durability / _itemData.ThermalResilience;
if (_data.PerSecond) wear *= delta;
Item.EquippableItem.Durability -= wear;
return true;

View file

@ -297,8 +297,8 @@ public abstract class EquippableItemData : CraftedItemData
[InspectableAnimationCurve, JsonProperty("performanceCurve"), Key(17)]
public float4[] HeatPerformanceCurve;
[InspectableField, JsonProperty("wearDamage"), Key(18)]
public PerformanceStat WearDamage = new PerformanceStat();
[InspectableField, JsonProperty("resilience"), Key(18)]
public float ThermalResilience = 1;
[IgnoreMember]
public abstract HardpointType HardpointType { get; }

View file

@ -88,6 +88,13 @@ public class ZoneGenerationSettings
[Serializable, MessagePackObject(keyAsPropertyName: true), JsonObject]
public class GameplaySettings
{
public float WormholeDepth = 1000;
public float WormholeExitVelocity = 20;
public float WormholeExitRadius = 50;
public float WormholeAnimationDuration = 4;
public float WormholeExitCurveStart = .8f;
public float ThermalWearExponent = .01f;
public float QualityWearExponent = 2;
public int TriggerGroupCount = 6;
public float WarpDistance = 25;
public float DockingDistance = 25;

View file

@ -34,7 +34,15 @@ public class Ship : Entity
private HashSet<Thruster> _leftThrusters;
private HashSet<Thruster> _clockwiseThrusters;
private HashSet<Thruster> _counterClockwiseThrusters;
private bool _exitingWormhole = false;
private bool _enteringWormhole = false;
private float _wormholeAnimationProgress;
private float2 _wormholeEntryPosition;
private float2 _wormholeEntryDirection;
private float2 _wormholePosition;
private float2 _wormholeExitVelocity;
public float ForwardThrust { get; private set; }
public float ReverseThrust { get; private set; }
public float LeftStrafeThrust { get; private set; }
@ -52,9 +60,30 @@ public class Ship : Entity
var clockwise = dot(direction, Direction.Rotate(ItemRotation.Clockwise)) > 0;
return angleDiff / ((clockwise ? ClockwiseTorque : CounterClockwiseTorque) / Mass);
}
public event Action OnExitedWormhole;
public event Action OnEnteredWormhole;
public quaternion Rotation { get; private set; }
public void ExitWormhole(float2 wormholePosition, float2 exitVelocity)
{
_exitingWormhole = true;
_wormholeAnimationProgress = 0;
_wormholePosition = wormholePosition;
_wormholeExitVelocity = exitVelocity;
Direction = normalize(exitVelocity);
}
public void EnterWormhole(float2 wormholePosition)
{
_wormholeAnimationProgress = 0;
_enteringWormhole = true;
_wormholeEntryPosition = Position.xz;
_wormholeEntryDirection = normalize(_wormholeEntryPosition-wormholePosition);
_wormholePosition = wormholePosition;
}
public override void Activate()
{
base.Activate();
@ -113,6 +142,8 @@ public class Ship : Entity
ItemOnline.Subscribe(CheckForThruster);
}
#region ThrustCalculation
private void RecalculateForwardThrust()
{
ForwardThrust = 0;
@ -187,10 +218,11 @@ public class Ship : Entity
}
}
#endregion
public override void Update(float delta)
{
Position.xz += Velocity * delta;
if (_active)
if (_active && !_exitingWormhole)
{
foreach (var thruster in _allThrusters) thruster.Axis = 0;
var rightThrusterTorqueCompensation = abs(RightStrafeTotalTorque) / RightStrafeTorqueThrusters.Length;
@ -226,6 +258,9 @@ public class Ship : Entity
foreach (var thruster in _clockwiseThrusters) thruster.Axis += deltaRot;
foreach (var thruster in _counterClockwiseThrusters) thruster.Axis += -deltaRot;
}
Position.xz += Velocity * delta;
var normal = Zone.GetNormal(Position.xz);
var force = new float2(normal.x, normal.z);
var forceMagnitude = lengthsq(force);
@ -239,6 +274,69 @@ public class Ship : Entity
Rotation = quaternion.LookRotation(forward, normal);
base.Update(delta);
if (_exitingWormhole)
{
_wormholeAnimationProgress += delta / ItemManager.GameplaySettings.WormholeAnimationDuration;
if(_wormholeAnimationProgress < 1)
{
if (_wormholeAnimationProgress < ItemManager.GameplaySettings.WormholeExitCurveStart)
{
Position.xz = _wormholePosition;
Rotation = quaternion.LookRotation(float3(0, 1, 0), float3(-Direction.x, 0, -Direction.y));
}
else
{
var exitLerp = _wormholeAnimationProgress - ItemManager.GameplaySettings.WormholeExitCurveStart /
(1 - ItemManager.GameplaySettings.WormholeExitCurveStart);
exitLerp *= exitLerp; // Square the interpolation variable to produce curve with zero slope at start
Position.xz = _wormholePosition + normalize(_wormholeExitVelocity) * exitLerp * ItemManager.GameplaySettings.WormholeExitRadius;
Rotation = quaternion.LookRotation(
lerp(float3(0, 1, 0), forward, exitLerp),
lerp(float3(-Direction.x, 0, -Direction.y), normal, exitLerp));
}
Position.y = Position.y - lerp(ItemManager.GameplaySettings.WormholeDepth, 0, _wormholeAnimationProgress);
}
else
{
_exitingWormhole = false;
OnExitedWormhole?.Invoke();
OnExitedWormhole = null;
Velocity = _wormholeExitVelocity;
}
}
if (_enteringWormhole)
{
_wormholeAnimationProgress += delta / ItemManager.GameplaySettings.WormholeAnimationDuration;
if(_wormholeAnimationProgress < 1)
{
if (_wormholeAnimationProgress < 1 - ItemManager.GameplaySettings.WormholeExitCurveStart)
{
var enterLerp = _wormholeAnimationProgress / (1 - ItemManager.GameplaySettings.WormholeExitCurveStart);
enterLerp *= enterLerp; // Square the interpolation variable to produce curve with zero slope at vertical
Position.xz = lerp(_wormholeEntryPosition, _wormholePosition, enterLerp);
Rotation = quaternion.LookRotation(
lerp(forward, float3(0, -1, 0), enterLerp),
lerp(normal, float3(-_wormholeEntryDirection.x, 0, -_wormholeEntryDirection.y), enterLerp));
}
else
{
Position.xz = _wormholePosition;
Rotation = quaternion.LookRotation(float3(0, -1, 0),
float3(-_wormholeEntryDirection.x, 0, -_wormholeEntryDirection.y));
}
Position.y = Position.y - lerp(0, ItemManager.GameplaySettings.WormholeDepth, _wormholeAnimationProgress);
}
else
{
_enteringWormhole = false;
OnEnteredWormhole?.Invoke();
OnEnteredWormhole = null;
}
}
}
}

View file

@ -0,0 +1,6 @@
using Unity.Mathematics;
public class Wormhole
{
public float2 Position;
}

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: b5a943b5358a47a199ad5e7271c14032
timeCreated: 1614907192

View file

@ -6,6 +6,7 @@ using TMPro;
using UnityEngine;
using UnityEngine.UI;
using Unity.Mathematics;
using UnityEngine.Serialization;
using static Unity.Mathematics.math;
public class SchematicDisplay : MonoBehaviour
@ -22,7 +23,7 @@ public class SchematicDisplay : MonoBehaviour
public TextMeshProUGUI EnergyLabel;
public TextMeshProUGUI CockpitTemperatureLabel;
public TextMeshProUGUI RadiatorTemperatureLabel;
public TextMeshProUGUI HeatsinkTemperatureLabel;
[FormerlySerializedAs("HeatsinkTemperatureLabel")] public TextMeshProUGUI HeatStorageTemperatureLabel;
public TextMeshProUGUI CargoTemperatureLabel;
public TextMeshProUGUI VisibilityLabel;
public TextMeshProUGUI HullDurabilityLabel;
@ -45,7 +46,7 @@ public class SchematicDisplay : MonoBehaviour
private Cockpit _cockpit;
private Reactor _reactor;
private Capacitor[] _capacitors;
private Heatsink[] _heatsinks;
private HeatStorage[] _heatStorages;
private EquippedCargoBay[] _cargoBays;
private SchematicDisplayItem[] _schematicItems;
private Graphic[] _groupGraphics;
@ -115,9 +116,9 @@ public class SchematicDisplay : MonoBehaviour
if (_radiators.Length == 0)
RadiatorTemperatureLabel.text = "N/A";
_heatsinks = entity.GetBehaviors<Heatsink>().ToArray();
if (_heatsinks.Length == 0)
HeatsinkTemperatureLabel.text = "N/A";
_heatStorages = entity.GetBehaviors<HeatStorage>().ToArray();
if (_heatStorages.Length == 0)
HeatStorageTemperatureLabel.text = "N/A";
_cargoBays = entity.CargoBays.ToArray();
if (_cargoBays.Length == 0)
@ -222,12 +223,12 @@ public class SchematicDisplay : MonoBehaviour
$"{((int)(_radiators.Max(r => r.Temperature) - 273.15f)).ToString()}°C";
HeatsinkBackground.color = _entity.HeatsinksEnabled ? HeaderElementEnabledColor : HeaderElementDisabledColor;
if (_heatsinks.Length == 1)
HeatsinkTemperatureLabel.text = $"{((int)(_heatsinks[0].Item.Temperature - 273.15f)).ToString()}°C";
else if (_heatsinks.Length > 1)
HeatsinkTemperatureLabel.text =
$"{((int)(_heatsinks.Min(r => r.Item.Temperature) - 273.15f)).ToString()}-" +
$"{((int)(_heatsinks.Max(r => r.Item.Temperature) - 273.15f)).ToString()}°C";
if (_heatStorages.Length == 1)
HeatStorageTemperatureLabel.text = $"{((int)(_heatStorages[0].Item.Temperature - 273.15f)).ToString()}°C";
else if (_heatStorages.Length > 1)
HeatStorageTemperatureLabel.text =
$"{((int)(_heatStorages.Min(r => r.Item.Temperature) - 273.15f)).ToString()}-" +
$"{((int)(_heatStorages.Max(r => r.Item.Temperature) - 273.15f)).ToString()}°C";
if (_cargoBays.Length == 1)
CargoTemperatureLabel.text = $"{((int)(_cargoBays[0].Temperature - 273.15f)).ToString()}°C";

View file

@ -0,0 +1,85 @@
Shader "Brushes/Wormhole Brush" {
Properties {
_Depth ("Depth", Float) = 0.5
_Power("Envelope Power", Float) = 1.25
_Frequency("Frequency", Float) = 6.2832
_FrequencyDist("Distance Frequency", Float) = 6.2832
_Speed("Speed", Float) = 0
_SinePower("Sine Power", Float) = 1.25
}
Category {
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" }
Blend One One
ColorMask RGB
Cull Off Lighting Off ZWrite Off
SubShader {
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 2.0
#include "UnityCG.cginc"
float _Depth;
float _Power;
float _Frequency;
float _FrequencyDist;
float _Speed;
float _SinePower;
struct appdata_t {
float4 vertex : POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
struct v2f {
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
float4 _MainTex_ST;
v2f vert (appdata_t v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.color = v.color;
o.texcoord = v.texcoord;
return o;
}
float almostIdentity(float x, float m, float n)
{
if (x>m) return x;
const float a = 2.0f*n - m;
const float b = 2.0f*m - 3.0f*n;
const float t = x / m;
return (a*t + b)*t*t + n;
}
float powerPulse( float x, float power )
{
x = saturate(abs(x));
return pow((x + 1.0f) * (1.0f - x), power);
}
fixed4 frag (v2f i) : SV_Target
{
float2 uv2 = i.texcoord - float2(.5,.5);
float dist = length(uv2);
float ang = atan2(uv2.y,uv2.x);
return _Depth * powerPulse(dist * 2,_Power) * (cos(ang*_Frequency+dist*_FrequencyDist+_Time.x*_Speed)+1);
}
ENDCG
}
}
}
}

View file

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 8681ac064d59d15458d16cc9b884262c
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

View file

@ -483,7 +483,7 @@
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb.Driver\Generated\Ast\Add.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\LinqFaster\Select.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb.Driver\Generated\Ast\SetUnion.cs" />
<Compile Include="Assets\Scripts\ServerShared\Behaviors\Heatsink.cs" />
<Compile Include="Assets\Scripts\ServerShared\Behaviors\HeatStorage.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb.Driver\ReqlAssertFailure.cs" />
<Compile Include="Assets\Scripts\ServerShared\Behaviors\Weapon.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb.Driver.Linq\RethinkQueryable.cs" />
@ -517,13 +517,14 @@
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb.Driver\Generated\Ast\Javascript.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\LiteNetLib\SequencedChannel.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb.Driver\Generated\Ast\Without.cs" />
<Compile Include="Assets\Scripts\ServerShared\Behaviors\Wear.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb.Driver\Generated\Ast\Distinct.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\RethinkDb.Driver\Generated\Ast\Time.cs" />
<Compile Include="Assets\Scripts\ServerShared\LoadoutData.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\LinqFaster\SequenceEqual.cs" />
<Compile Include="Assets\Scripts\ServerShared\NIH\LinqFaster\Skip.cs" />
<Compile Include="Assets\Scripts\ServerShared\ItemManager.cs" />
<Compile Include="Assets\Scripts\ServerShared\Behaviors\Wear.cs" />
<Compile Include="Assets\Scripts\ServerShared\Wormhole.cs" />
<None Include="Assets\Scripts\ServerShared\NIH\LinqFaster\readme.txt" />
<None Include="Assets\Scripts\ServerShared\Economy.Shared.Unity.asmdef" />
<Reference Include="System.Threading.Tasks.Extensions">

BIN
GameData/AetherDB.msgpack Normal file

Binary file not shown.