From 1df7f1bc67b62082668446f72cf5bf7f4f34d7fa Mon Sep 17 00:00:00 2001 From: Reinier Vens Date: Tue, 22 Dec 2020 21:32:37 +0000 Subject: [PATCH] First Flight Polish FIX: Gravity waves weren't lining up properly between the GPU and CPU implementations Inventory menu wasn't highlighting rotated items correctly --- .../.idea/indexLayout.xml | 1 + Assets/InventoryMenu.cs | 11 +- Assets/Materials/Dithered Particle Trail.mat | 4 +- Assets/Materials/Dithered Particle.mat | 2 +- Assets/Materials/UI/Map Gravity Lines.mat | 2 +- Assets/Materials/UI/Orbital.mat | 42 ++++- .../Resources/Prefabs/Djinni Variant.prefab | 121 +++++++++++- Assets/Resources/Prefabs/Thruster 1.prefab | 74 ++++---- Assets/Resources/Prefabs/Zenith.prefab | 110 +++++++++++ Assets/Resources/Settings.asset | 4 +- Assets/Scenes/ARPG.unity | 175 ++++++++++++++++++ .../Scripts/Sector Display/SectorRenderer.cs | 8 +- Assets/Scripts/ServerShared/Zone.cs | 16 +- ProjectSettings/EditorBuildSettings.asset | 4 +- ProjectSettings/ProjectSettings.asset | 4 +- 15 files changed, 500 insertions(+), 78 deletions(-) diff --git a/.idea/.idea.Aetheria-Economy/.idea/indexLayout.xml b/.idea/.idea.Aetheria-Economy/.idea/indexLayout.xml index 763455528..c5d005208 100644 --- a/.idea/.idea.Aetheria-Economy/.idea/indexLayout.xml +++ b/.idea/.idea.Aetheria-Economy/.idea/indexLayout.xml @@ -29,6 +29,7 @@ .idea Asset Sources Build + Builds Economy.Server Economy.Shared GameData diff --git a/Assets/InventoryMenu.cs b/Assets/InventoryMenu.cs index eee71fa42..73423a236 100644 --- a/Assets/InventoryMenu.cs +++ b/Assets/InventoryMenu.cs @@ -23,6 +23,7 @@ public class InventoryMenu : MonoBehaviour private int2 _selectedPosition; private InventoryPanel _selectedPanel; + private ItemInstance _selectedItem; private ItemData _selectedItemData; private ItemInstance _dragItem; @@ -222,7 +223,7 @@ public class InventoryMenu : MonoBehaviour { foreach (var v in _selectedItemData.Shape.Coordinates) { - var v2 = v + _selectedPosition; + var v2 = _selectedItemData.Shape.Rotate(v, _selectedItem.Rotation) + _selectedPosition; _selectedPanel.CellInstances[v2].Icon.color = _selectedPanel.GetColor(v2); } } @@ -232,10 +233,11 @@ public class InventoryMenu : MonoBehaviour PropertiesPanel.AddItemProperties(item); _selectedPanel = panel; _selectedPosition = cargoEvent.CargoBay.Cargo[item]; + _selectedItem = item; _selectedItemData = GameManager.ItemManager.GetData(item); foreach (var v in _selectedItemData.Shape.Coordinates) { - var v2 = _selectedItemData.Shape.Rotate(v, item.Rotation) + _selectedPosition; + var v2 = _selectedItemData.Shape.Rotate(v, _selectedItem.Rotation) + _selectedPosition; _selectedPanel.CellInstances[v2].Icon.color = _selectedPanel.GetColor(v2, true); } } @@ -249,17 +251,18 @@ public class InventoryMenu : MonoBehaviour { foreach (var v in _selectedItemData.Shape.Coordinates) { - var v2 = v + _selectedItemData.Shape.Rotate(_selectedPosition, item.EquippableItem.Rotation); + var v2 = _selectedItemData.Shape.Rotate(v, _selectedItem.Rotation) + _selectedPosition; _selectedPanel.CellInstances[v2].Icon.color = _selectedPanel.GetColor(v2); } } PropertiesPanel.Inspect(entityEvent.Entity, item); _selectedPanel = panel; _selectedPosition = item.Position; + _selectedItem = item.EquippableItem; _selectedItemData = GameManager.ItemManager.GetData(item.EquippableItem); foreach (var v in _selectedItemData.Shape.Coordinates) { - var v2 = v + _selectedPosition; + var v2 = _selectedItemData.Shape.Rotate(v, _selectedItem.Rotation) + _selectedPosition; _selectedPanel.CellInstances[v2].Icon.color = _selectedPanel.GetColor(v2, true); } } diff --git a/Assets/Materials/Dithered Particle Trail.mat b/Assets/Materials/Dithered Particle Trail.mat index 13c53b813..071f41be8 100644 --- a/Assets/Materials/Dithered Particle Trail.mat +++ b/Assets/Materials/Dithered Particle Trail.mat @@ -61,7 +61,7 @@ Material: - _DetailNormalMapScale: 1 - _DstBlend: 0 - _GlossMapScale: 1 - - _Glossiness: 0.5 + - _Glossiness: 0.52 - _GlossyReflections: 1 - _Metallic: 0 - _Mode: 0 @@ -73,6 +73,6 @@ Material: - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 31.999996, g: 31.999996, b: 31.999996, a: 1} + - _Color: {r: 15.999998, g: 15.999998, b: 15.999998, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} m_BuildTextureStacks: [] diff --git a/Assets/Materials/Dithered Particle.mat b/Assets/Materials/Dithered Particle.mat index 60ba2ea0d..658f764c2 100644 --- a/Assets/Materials/Dithered Particle.mat +++ b/Assets/Materials/Dithered Particle.mat @@ -73,6 +73,6 @@ Material: - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 191.74902, g: 191.74902, b: 191.74902, a: 1} + - _Color: {r: 1024, g: 1024, b: 1024, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} m_BuildTextureStacks: [] diff --git a/Assets/Materials/UI/Map Gravity Lines.mat b/Assets/Materials/UI/Map Gravity Lines.mat index c5ed6b463..3ccefa1a8 100644 --- a/Assets/Materials/UI/Map Gravity Lines.mat +++ b/Assets/Materials/UI/Map Gravity Lines.mat @@ -82,7 +82,7 @@ Material: - _Mode: 0 - _OcclusionStrength: 1 - _Parallax: 0.02 - - _Scale: 4.652392 + - _Scale: 12.885553 - _SmoothnessTextureChannel: 0 - _SpecularHighlights: 1 - _SrcBlend: 1 diff --git a/Assets/Materials/UI/Orbital.mat b/Assets/Materials/UI/Orbital.mat index b97582f18..89720d8c1 100644 --- a/Assets/Materials/UI/Orbital.mat +++ b/Assets/Materials/UI/Orbital.mat @@ -8,14 +8,16 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: Orbital - m_Shader: {fileID: 203, guid: 0000000000000000f000000000000000, type: 0} - m_ShaderKeywords: - m_LightmapFlags: 4 + m_Shader: {fileID: 4800000, guid: f69be63d97f3ffe499bc8ad9f5a104c6, type: 3} + m_ShaderKeywords: _ALPHAPREMULTIPLY_ON + m_LightmapFlags: 0 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: + - ALWAYS m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -56,24 +58,44 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: + - _BlendOp: 0 - _BumpScale: 1 + - _CameraFadingEnabled: 0 + - _CameraFarFadeDistance: 2 + - _CameraNearFadeDistance: 1 + - _ColorMode: 0 + - _Cull: 2 - _Cutoff: 0.5 - _DetailNormalMapScale: 1 - - _DstBlend: 0 + - _DistortionBlend: 0.5 + - _DistortionEnabled: 0 + - _DistortionStrength: 1 + - _DistortionStrengthScaled: 0 + - _DstBlend: 10 + - _EmissionEnabled: 0 + - _FlipbookMode: 0 - _GlossMapScale: 1 - _Glossiness: 0.5 - _GlossyReflections: 1 - _InvFade: 1 + - _LightingEnabled: 0 - _Metallic: 0 - - _Mode: 0 + - _Mode: 3 - _OcclusionStrength: 1 - _Parallax: 0.02 - _SmoothnessTextureChannel: 0 + - _SoftParticlesEnabled: 0 + - _SoftParticlesFarFadeDistance: 1 + - _SoftParticlesNearFadeDistance: 0 - _SpecularHighlights: 1 - _SrcBlend: 1 - _UVSec: 0 - - _ZWrite: 1 + - _ZWrite: 0 m_Colors: + - _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0} - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - - _TintColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} + - _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0} + - _TintColor: {r: 0.75, g: 0.75, b: 0.75, a: 0.49019608} + m_BuildTextureStacks: [] diff --git a/Assets/Resources/Prefabs/Djinni Variant.prefab b/Assets/Resources/Prefabs/Djinni Variant.prefab index 9d40d8b89..dbbed54ed 100644 --- a/Assets/Resources/Prefabs/Djinni Variant.prefab +++ b/Assets/Resources/Prefabs/Djinni Variant.prefab @@ -360,6 +360,115 @@ Transform: m_Father: {fileID: 9106854767781449910} m_RootOrder: 9 m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} +--- !u!1 &7930906210874266039 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4651778235258359919} + - component: {fileID: 5323651519293148283} + - component: {fileID: 6966798770617141827} + - component: {fileID: 4190126880558894361} + - component: {fileID: 1145083064420361239} + m_Layer: 14 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4651778235258359919 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7930906210874266039} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 723, z: 0} + m_LocalScale: {x: 5000, y: 5000, z: 5000} + m_Children: [] + m_Father: {fileID: 9106854767781449910} + m_RootOrder: 30 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!33 &5323651519293148283 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7930906210874266039} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &6966798770617141827 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7930906210874266039} + 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: 658219dea0cf83049b6ab46c2f3436ed, 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: 0 + 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!64 &4190126880558894361 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7930906210874266039} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &1145083064420361239 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7930906210874266039} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 52538a3309c36fc4583c964a1c0b705f, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1001 &8784470446643017565 PrefabInstance: m_ObjectHideFlags: 0 @@ -455,7 +564,7 @@ PrefabInstance: - target: {fileID: -6625146999956858958, guid: caefaa8e0cbce524f97eb0db4be80a98, type: 3} propertyPath: m_RootOrder - value: 18 + value: 20 objectReference: {fileID: 0} - target: {fileID: -5992302138083467718, guid: caefaa8e0cbce524f97eb0db4be80a98, type: 3} @@ -500,7 +609,7 @@ PrefabInstance: - target: {fileID: -3660698809900281034, guid: caefaa8e0cbce524f97eb0db4be80a98, type: 3} propertyPath: m_RootOrder - value: 20 + value: 18 objectReference: {fileID: 0} - target: {fileID: -3189018373145680014, guid: caefaa8e0cbce524f97eb0db4be80a98, type: 3} @@ -520,12 +629,12 @@ PrefabInstance: - target: {fileID: -1282338954517755048, guid: caefaa8e0cbce524f97eb0db4be80a98, type: 3} propertyPath: m_RootOrder - value: 19 + value: 17 objectReference: {fileID: 0} - target: {fileID: -932530484554465105, guid: caefaa8e0cbce524f97eb0db4be80a98, type: 3} propertyPath: m_RootOrder - value: 17 + value: 16 objectReference: {fileID: 0} - target: {fileID: 29156028926690448, guid: caefaa8e0cbce524f97eb0db4be80a98, type: 3} @@ -545,7 +654,7 @@ PrefabInstance: - target: {fileID: 919132149155446097, guid: caefaa8e0cbce524f97eb0db4be80a98, type: 3} propertyPath: m_Name - value: Djinni + value: Djinni Variant objectReference: {fileID: 0} - target: {fileID: 1165945915133145555, guid: caefaa8e0cbce524f97eb0db4be80a98, type: 3} @@ -645,7 +754,7 @@ PrefabInstance: - target: {fileID: 5520988019811293425, guid: caefaa8e0cbce524f97eb0db4be80a98, type: 3} propertyPath: m_RootOrder - value: 16 + value: 19 objectReference: {fileID: 0} - target: {fileID: 5810462305269633799, guid: caefaa8e0cbce524f97eb0db4be80a98, type: 3} diff --git a/Assets/Resources/Prefabs/Thruster 1.prefab b/Assets/Resources/Prefabs/Thruster 1.prefab index ba91bf7ed..be938c5d4 100644 --- a/Assets/Resources/Prefabs/Thruster 1.prefab +++ b/Assets/Resources/Prefabs/Thruster 1.prefab @@ -12,7 +12,7 @@ GameObject: - component: {fileID: 4210795439511044087} - component: {fileID: 4396918519991313108} m_Layer: 0 - m_Name: Particle System + m_Name: Thruster 1 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -51,7 +51,7 @@ ParticleSystem: playOnAwake: 1 useUnscaledTime: 0 autoRandomSeed: 1 - useRigidbodyForVelocity: 1 + useRigidbodyForVelocity: 0 startDelay: serializedVersion: 2 minMaxState: 0 @@ -1304,8 +1304,8 @@ ParticleSystem: maxGradient: serializedVersion: 2 key0: {r: 0, g: 0.54509807, b: 1, a: 1} - key1: {r: 0.29799998, g: 0, b: 0.29249284, a: 0} - key2: {r: 0, g: 0, b: 0, a: 0} + key1: {r: 0.122641504, g: 0, b: 0.121027805, a: 0.45490196} + key2: {r: 0.122641504, g: 0, b: 0.121027805, a: 0} key3: {r: 0, g: 0, b: 0, a: 0} key4: {r: 0, g: 0, b: 0, a: 0} key5: {r: 0, g: 0, b: 0, a: 0} @@ -1313,7 +1313,7 @@ ParticleSystem: key7: {r: 0, g: 0, b: 0, a: 0} ctime0: 0 ctime1: 65535 - ctime2: 0 + ctime2: 65535 ctime3: 0 ctime4: 0 ctime5: 0 @@ -2075,7 +2075,7 @@ ParticleSystem: m_Curve: serializedVersion: 2 minMaxState: 0 - scalar: 0 + scalar: 2 minScalar: 0 maxCurve: serializedVersion: 2 @@ -2682,7 +2682,7 @@ ParticleSystem: strength: serializedVersion: 2 minMaxState: 1 - scalar: 4 + scalar: 8 minScalar: 1 maxCurve: serializedVersion: 2 @@ -3939,7 +3939,7 @@ ParticleSystem: lifetime: serializedVersion: 2 minMaxState: 0 - scalar: 1 + scalar: 0.5 minScalar: 1 maxCurve: serializedVersion: 2 @@ -3989,15 +3989,15 @@ ParticleSystem: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 - minVertexDistance: 0.2 + minVertexDistance: 0.1 textureMode: 0 ribbonCount: 1 shadowBias: 0.5 worldSpace: 0 - dieWithParticles: 1 - sizeAffectsWidth: 1 + dieWithParticles: 0 + sizeAffectsWidth: 0 sizeAffectsLifetime: 0 - inheritParticleColor: 1 + inheritParticleColor: 0 generateLightingData: 0 splitSubEmitterRibbons: 0 attachRibbonsToTransform: 0 @@ -4067,25 +4067,25 @@ ParticleSystem: widthOverTrail: serializedVersion: 2 minMaxState: 1 - scalar: 4 + scalar: 3 minScalar: 1 maxCurve: serializedVersion: 2 m_Curve: - serializedVersion: 3 time: 0 - value: 0 - inSlope: 0 - outSlope: 0 + value: 1 + inSlope: -2 + outSlope: -2 tangentMode: 0 weightedMode: 0 inWeight: 0 outWeight: 0 - serializedVersion: 3 time: 1 - value: 1 - inSlope: 2 - outSlope: 2 + value: 0.333 + inSlope: 0 + outSlope: 0 tangentMode: 0 weightedMode: 0 inWeight: 0 @@ -4119,13 +4119,13 @@ ParticleSystem: m_RotationOrder: 4 colorOverTrail: serializedVersion: 2 - minMaxState: 0 + minMaxState: 1 minColor: {r: 1, g: 1, b: 1, a: 1} maxColor: {r: 1, g: 1, b: 1, a: 1} maxGradient: serializedVersion: 2 - key0: {r: 1, g: 1, b: 1, a: 1} - key1: {r: 1, g: 1, b: 1, a: 1} + key0: {r: 0.2830189, g: 0, b: 0, a: 0} + key1: {r: 0, g: 0.028769147, b: 0.13207549, a: 1} key2: {r: 0, g: 0, b: 0, a: 0} key3: {r: 0, g: 0, b: 0, a: 0} key4: {r: 0, g: 0, b: 0, a: 0} @@ -4140,17 +4140,17 @@ ParticleSystem: ctime5: 0 ctime6: 0 ctime7: 0 - atime0: 0 - atime1: 65535 - atime2: 0 - atime3: 0 + atime0: 129 + atime1: 31802 + atime2: 65535 + atime3: 65535 atime4: 0 atime5: 0 atime6: 0 atime7: 0 m_Mode: 0 m_NumColorKeys: 2 - m_NumAlphaKeys: 2 + m_NumAlphaKeys: 3 minGradient: serializedVersion: 2 key0: {r: 1, g: 1, b: 1, a: 1} @@ -4181,9 +4181,9 @@ ParticleSystem: m_NumColorKeys: 2 m_NumAlphaKeys: 2 CustomDataModule: - enabled: 0 - mode0: 0 - vectorComponentCount0: 4 + enabled: 1 + mode0: 1 + vectorComponentCount0: 2 color0: serializedVersion: 2 minMaxState: 0 @@ -4250,8 +4250,8 @@ ParticleSystem: colorLabel0: Color vector0_0: serializedVersion: 2 - minMaxState: 0 - scalar: 0 + minMaxState: 3 + scalar: 1 minScalar: 0 maxCurve: serializedVersion: 2 @@ -4304,8 +4304,8 @@ ParticleSystem: vectorLabel0_0: X vector0_1: serializedVersion: 2 - minMaxState: 0 - scalar: 0 + minMaxState: 3 + scalar: 1 minScalar: 0 maxCurve: serializedVersion: 2 @@ -4788,7 +4788,7 @@ ParticleSystemRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 - m_RenderMode: 5 + m_RenderMode: 0 m_SortMode: 0 m_MinParticleSize: 0 m_MaxParticleSize: 0.5 @@ -4801,13 +4801,13 @@ ParticleSystemRenderer: m_RenderAlignment: 0 m_Pivot: {x: 0, y: 0, z: 0} m_Flip: {x: 0, y: 0, z: 0} - m_UseCustomVertexStreams: 0 + m_UseCustomVertexStreams: 1 m_EnableGPUInstancing: 1 m_ApplyActiveColorSpace: 1 m_AllowRoll: 1 m_FreeformStretching: 0 m_RotateWithStretchDirection: 1 - m_VertexStreams: 00010304 + m_VertexStreams: 0001030420 m_Mesh: {fileID: 0} m_Mesh1: {fileID: 0} m_Mesh2: {fileID: 0} diff --git a/Assets/Resources/Prefabs/Zenith.prefab b/Assets/Resources/Prefabs/Zenith.prefab index 236d714d4..d6469d61f 100644 --- a/Assets/Resources/Prefabs/Zenith.prefab +++ b/Assets/Resources/Prefabs/Zenith.prefab @@ -1,5 +1,114 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: +--- !u!1 &2756752709544852656 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 42920639392907677} + - component: {fileID: 3565715508034120831} + - component: {fileID: 1279711225872783832} + - component: {fileID: 510528213677546621} + - component: {fileID: 1892650083431298416} + m_Layer: 14 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &42920639392907677 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2756752709544852656} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 100, y: 100, z: 25} + m_Children: [] + m_Father: {fileID: 7719100217559641643} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!33 &3565715508034120831 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2756752709544852656} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1279711225872783832 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2756752709544852656} + 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: 20cdf802f7c277841b78ce86e5d1323b, 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: 0 + 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!64 &510528213677546621 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2756752709544852656} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &1892650083431298416 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2756752709544852656} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 52538a3309c36fc4583c964a1c0b705f, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &5347824108838409208 GameObject: m_ObjectHideFlags: 0 @@ -28,6 +137,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 2353559640203777757} + - {fileID: 42920639392907677} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Resources/Settings.asset b/Assets/Resources/Settings.asset index 885fa96ff..9df987b9d 100644 --- a/Assets/Resources/Settings.asset +++ b/Assets/Resources/Settings.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f6ba1f78966afdf289deba32366876e6eabcc13568b4aaf7c9c582bd6fd1142e -size 4337 +oid sha256:e44c5e5e566e2dec3099bb85b8dabf93c7b4a97abb897bbd5b8009d3c16edf3a +size 4338 diff --git a/Assets/Scenes/ARPG.unity b/Assets/Scenes/ARPG.unity index d3789b392..70ccf6dc9 100644 --- a/Assets/Scenes/ARPG.unity +++ b/Assets/Scenes/ARPG.unity @@ -7115,6 +7115,102 @@ RectTransform: type: 3} m_PrefabInstance: {fileID: 1593845000} m_PrefabAsset: {fileID: 0} +--- !u!1 &1646066147 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1646066151} + - component: {fileID: 1646066150} + - component: {fileID: 1646066148} + - component: {fileID: 1646066149} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!23 &1646066148 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1646066147} + 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: 10303, guid: 0000000000000000f000000000000000, type: 0} + 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!64 &1646066149 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1646066147} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!33 &1646066150 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1646066147} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1646066151 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1646066147} + m_LocalRotation: {x: -0, y: -0.9839266, z: -0, w: -0.17857356} + m_LocalPosition: {x: 49.3, y: 0, z: 16} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: -200.573, z: 0} --- !u!1 &1647230681 GameObject: m_ObjectHideFlags: 0 @@ -9795,6 +9891,85 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 560317486090564712} m_CullTransparentMesh: 0 +--- !u!1001 &1426725682743115580 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 434691370613433342, guid: 016516404b2bc1649bdf789bfc96d1cb, + type: 3} + propertyPath: m_LocalPosition.x + value: 45.8 + objectReference: {fileID: 0} + - target: {fileID: 434691370613433342, guid: 016516404b2bc1649bdf789bfc96d1cb, + type: 3} + propertyPath: m_LocalPosition.y + value: -1.4 + objectReference: {fileID: 0} + - target: {fileID: 434691370613433342, guid: 016516404b2bc1649bdf789bfc96d1cb, + type: 3} + propertyPath: m_LocalPosition.z + value: 15.7 + objectReference: {fileID: 0} + - target: {fileID: 434691370613433342, guid: 016516404b2bc1649bdf789bfc96d1cb, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 434691370613433342, guid: 016516404b2bc1649bdf789bfc96d1cb, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 434691370613433342, guid: 016516404b2bc1649bdf789bfc96d1cb, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 434691370613433342, guid: 016516404b2bc1649bdf789bfc96d1cb, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 434691370613433342, guid: 016516404b2bc1649bdf789bfc96d1cb, + type: 3} + propertyPath: m_RootOrder + value: 6 + objectReference: {fileID: 0} + - target: {fileID: 434691370613433342, guid: 016516404b2bc1649bdf789bfc96d1cb, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -90 + objectReference: {fileID: 0} + - target: {fileID: 434691370613433342, guid: 016516404b2bc1649bdf789bfc96d1cb, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 434691370613433342, guid: 016516404b2bc1649bdf789bfc96d1cb, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4210795439511044087, guid: 016516404b2bc1649bdf789bfc96d1cb, + type: 3} + propertyPath: ShapeModule.m_MeshRenderer + value: + objectReference: {fileID: 1646066148} + - target: {fileID: 7847908271862099961, guid: 016516404b2bc1649bdf789bfc96d1cb, + type: 3} + propertyPath: m_Name + value: Thruster 1 + objectReference: {fileID: 0} + - target: {fileID: 7847908271862099961, guid: 016516404b2bc1649bdf789bfc96d1cb, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 016516404b2bc1649bdf789bfc96d1cb, type: 3} --- !u!1001 &1719766129265659974 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Sector Display/SectorRenderer.cs b/Assets/Scripts/Sector Display/SectorRenderer.cs index 01d58c8b9..3ffc46817 100644 --- a/Assets/Scripts/Sector Display/SectorRenderer.cs +++ b/Assets/Scripts/Sector Display/SectorRenderer.cs @@ -176,12 +176,12 @@ public class SectorRenderer : MonoBehaviour { var shipInstance = new ShipInstance(); shipInstance.Ship = ship; - shipInstance.Transform = Instantiate(UnityHelpers.LoadAsset(hullData.Prefab)).transform; + shipInstance.Transform = Instantiate(UnityHelpers.LoadAsset(hullData.Prefab), ZoneRoot).transform; shipInstance.Thrusters = ship.GetBehaviors().ToArray(); shipInstance.ThrusterParticles = shipInstance.Thrusters .Select(x => { - var particles = Instantiate(UnityHelpers.LoadAsset(((ThrusterData) x.Data).ParticlesPrefab)); + var particles = Instantiate(UnityHelpers.LoadAsset(((ThrusterData) x.Data).ParticlesPrefab), shipInstance.Transform, false); var particlesShape = particles.shape; particlesShape.meshRenderer = shipInstance.Transform.Find(x.Entity.Hardpoints[x.Item.Position.x, x.Item.Position.y].Transform) .GetComponent(); @@ -359,7 +359,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 * Settings.PlanetSettings.WaveSpeed.Evaluate(planetInstance.BodyData.Mass.Value)); + gasGiantObject.GravityWaves.material.SetFloat("_Phase", Time * ((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); @@ -375,6 +375,8 @@ public class SectorRenderer : MonoBehaviour var h = _zone.GetHeight(ship.Key.Position); ship.Value.Transform.position = new Vector3(ship.Key.Position.x,h + hullData.GridOffset,ship.Key.Position.y); var normal = _zone.GetNormal(ship.Key.Position); + var f = new float2(normal.x, normal.z); + ship.Key.Velocity += f * Settings.PlanetSettings.GravityStrength;// * lengthsq(f); //Debug.Log($"Normal: {normal}"); var shipRight = ship.Key.Direction.Rotate(ItemRotation.Clockwise); var forward = Vector3.Cross(new Vector3(shipRight.x,0,shipRight.y), normal); diff --git a/Assets/Scripts/ServerShared/Zone.cs b/Assets/Scripts/ServerShared/Zone.cs index be0e7199e..1a18cacc4 100644 --- a/Assets/Scripts/ServerShared/Zone.cs +++ b/Assets/Scripts/ServerShared/Zone.cs @@ -272,23 +272,23 @@ public class Zone foreach (var body in PlanetInstances.Values) { var p = (position - body.Orbit.Position); //GetOrbitPosition(body.BodyData.Orbit) - var dist = lengthsq(p); + var distSqr = lengthsq(p); var gravityRadius = body.GravityWellRadius.Value; - if (dist < gravityRadius*gravityRadius) + if (distSqr < gravityRadius*gravityRadius) { var depth = body.GravityWellDepth.Value; - result -= PowerPulse(sqrt(dist) / gravityRadius, body.BodyData.GravityDepthExponent.Value) * depth; + result -= PowerPulse(sqrt(distSqr) / gravityRadius, body.BodyData.GravityDepthExponent.Value) * depth; } if (body is GasGiant gas) { var waveRadius = gas.GravityWavesRadius.Value; - if(dist < waveRadius*waveRadius) + if(distSqr < waveRadius*waveRadius) { var depth = gas.GravityWavesDepth.Value; var frequency = _settings.WaveFrequency.Evaluate(body.BodyData.Mass.Value); - var speed = _settings.WaveSpeed.Evaluate(body.BodyData.Mass.Value); - result -= RadialWaves(sqrt(dist) / waveRadius, 8, 1.5f, frequency, _time * speed) * depth; + var speed = gas.GravityWavesSpeed.Value; + result -= RadialWaves(sqrt(distSqr) / waveRadius, 8, 1.25f, frequency, _time * speed) * depth; } } } @@ -312,8 +312,8 @@ public class Zone public static float RadialWaves(float x, float maskExponent, float sineExponent, float frequency, float phase) { - x *= 2; - return PowerPulse(x, maskExponent) * cos(pow(x, sineExponent) * frequency + phase); + //x *= 2; + return PowerPulse(x, maskExponent) * cos(pow(x*2, sineExponent) * frequency + phase); } public float3 GetNormal(float2 pos, float step = .1f, float mul = 1) diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index 723e4e5c6..bb634f658 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4b0e4bb7ba75ad34932714873d9ed8b12e727c07822a320d67390f149a82d2c9 -size 445 +oid sha256:42c6287be6846541f8c757fdb8d769bcf1c83a272f0eb4b0a259c5dcd0e633b7 +size 351 diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 1871c5083..c42e0c978 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fd2a6b04790b18be3a482dc80d3f0b5919fe21fe94a3a87fb11454410b71fed9 -size 18951 +oid sha256:9d176554c30d08bcfd512a42f7ce42b595f4fcdfcd548ec8582dde48106d6977 +size 19020