From 9a7c51c90725744c8fd4418590a4de6330c8397e Mon Sep 17 00:00:00 2001 From: turtlebasket <32886427+turtlebasket@users.noreply.github.com> Date: Sun, 29 Sep 2024 15:52:09 -0700 Subject: [PATCH] start on new threat types & strategy abstraction --- ...t.prefab => FixedWingMissileThreat.prefab} | 40 +- .../FixedWingMissileThreat.prefab.meta | 7 + .../RollStabilizedMissileThreat.prefab | 361 ++++++++++++++++++ ...> RollStabilizedMissileThreat.prefab.meta} | 0 Assets/Scripts/Agent.cs | 4 + Assets/Scripts/Config/SimulationConfig.cs | 118 +++--- Assets/Scripts/DefendPoint.cs | 28 ++ Assets/Scripts/DefendPoint.cs.meta | 2 + Assets/Scripts/SimManager.cs | 11 +- .../{DroneTarget.cs => DroneThreat.cs} | 2 +- ...roneTarget.cs.meta => DroneThreat.cs.meta} | 0 .../Scripts/Threats/FixedWingMissileThreat.cs | 41 ++ .../Threats/FixedWingMissileThreat.cs.meta | 2 + Assets/Scripts/Threats/MissileThreat.cs | 107 ------ .../Threats/RollStabilizedMissileThreat.cs | 204 ++++++++++ ...ta => RollStabilizedMissileThreat.cs.meta} | 0 Assets/Scripts/Threats/Strategies.meta | 8 + Assets/Scripts/Threats/Threat.cs | 36 ++ .../Configs/1_salvo_1_hydra_7_tomahawks.json | 10 +- .../1_salvo_1_hydra_7_tomahawks.json.meta | 7 + .../Models/base_roll_stabilized_missile.json | 25 ++ .../base_roll_stabilized_missile.json.meta | 7 + 22 files changed, 824 insertions(+), 196 deletions(-) rename Assets/Resources/Prefabs/{MissileThreat.prefab => FixedWingMissileThreat.prefab} (97%) create mode 100644 Assets/Resources/Prefabs/FixedWingMissileThreat.prefab.meta create mode 100644 Assets/Resources/Prefabs/RollStabilizedMissileThreat.prefab rename Assets/Resources/Prefabs/{MissileThreat.prefab.meta => RollStabilizedMissileThreat.prefab.meta} (100%) create mode 100644 Assets/Scripts/DefendPoint.cs create mode 100644 Assets/Scripts/DefendPoint.cs.meta rename Assets/Scripts/Threats/{DroneTarget.cs => DroneThreat.cs} (93%) rename Assets/Scripts/Threats/{DroneTarget.cs.meta => DroneThreat.cs.meta} (100%) create mode 100644 Assets/Scripts/Threats/FixedWingMissileThreat.cs create mode 100644 Assets/Scripts/Threats/FixedWingMissileThreat.cs.meta delete mode 100644 Assets/Scripts/Threats/MissileThreat.cs create mode 100644 Assets/Scripts/Threats/RollStabilizedMissileThreat.cs rename Assets/Scripts/Threats/{MissileThreat.cs.meta => RollStabilizedMissileThreat.cs.meta} (100%) create mode 100644 Assets/Scripts/Threats/Strategies.meta create mode 100644 Assets/StreamingAssets/Configs/1_salvo_1_hydra_7_tomahawks.json.meta create mode 100644 Assets/StreamingAssets/Configs/Models/base_roll_stabilized_missile.json create mode 100644 Assets/StreamingAssets/Configs/Models/base_roll_stabilized_missile.json.meta diff --git a/Assets/Resources/Prefabs/MissileThreat.prefab b/Assets/Resources/Prefabs/FixedWingMissileThreat.prefab similarity index 97% rename from Assets/Resources/Prefabs/MissileThreat.prefab rename to Assets/Resources/Prefabs/FixedWingMissileThreat.prefab index b7469bf..c8f9c23 100644 --- a/Assets/Resources/Prefabs/MissileThreat.prefab +++ b/Assets/Resources/Prefabs/FixedWingMissileThreat.prefab @@ -287,10 +287,10 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 8462434346230391091} - - component: {fileID: 4571646124809534626} - component: {fileID: 4451965530778273955} + - component: {fileID: 4194966225731047199} m_Layer: 0 - m_Name: MissileThreat + m_Name: FixedWingMissileThreat m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -314,24 +314,6 @@ Transform: - {fileID: 9192475791974545516} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &4571646124809534626 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6438458936967544359} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f532f6ee629e87643b7b75a50e83083f, type: 3} - m_Name: - m_EditorClassIdentifier: - _flightPhase: 0 - _velocity: {x: 0, y: 0, z: 0} - _acceleration: {x: 0, y: 0, z: 0} - _dragAcceleration: {x: 0, y: 0, z: 0} - _target: {fileID: 0} - staticConfigFile: drone.json --- !u!54 &4451965530778273955 Rigidbody: m_ObjectHideFlags: 0 @@ -359,3 +341,21 @@ Rigidbody: m_Interpolate: 0 m_Constraints: 0 m_CollisionDetection: 0 +--- !u!114 &4194966225731047199 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6438458936967544359} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e6c2fbd1e492be448760f5045b13b2e, type: 3} + m_Name: + m_EditorClassIdentifier: + _flightPhase: 3 + _velocity: {x: 0, y: 0, z: 0} + _acceleration: {x: 0, y: 0, z: 0} + _dragAcceleration: {x: 0, y: 0, z: 0} + _target: {fileID: 0} + staticConfigFile: generic_static_config.json diff --git a/Assets/Resources/Prefabs/FixedWingMissileThreat.prefab.meta b/Assets/Resources/Prefabs/FixedWingMissileThreat.prefab.meta new file mode 100644 index 0000000..3216fdb --- /dev/null +++ b/Assets/Resources/Prefabs/FixedWingMissileThreat.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9c1ccc1cc7ad8cb4aa0b59a0afd50568 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Prefabs/RollStabilizedMissileThreat.prefab b/Assets/Resources/Prefabs/RollStabilizedMissileThreat.prefab new file mode 100644 index 0000000..a1a5ec6 --- /dev/null +++ b/Assets/Resources/Prefabs/RollStabilizedMissileThreat.prefab @@ -0,0 +1,361 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &295999596028346972 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9192475791974545516} + - component: {fileID: 3681380462727606042} + - component: {fileID: 5038767565634652910} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &9192475791974545516 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 295999596028346972} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -3.89} + m_LocalScale: {x: 20, y: 20, z: 20} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 8462434346230391091} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!33 &3681380462727606042 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 295999596028346972} + m_Mesh: {fileID: 4300000, guid: 36b72d5a34c22d94c88a068dfcbdf27a, type: 2} +--- !u!23 &5038767565634652910 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 295999596028346972} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 061083197c659dc44983633a84d39cea, 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 &4390675743535140416 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 585396986125101381} + - component: {fileID: 4620404264009677289} + m_Layer: 0 + m_Name: TrailRenderer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &585396986125101381 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4390675743535140416} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 10} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 8462434346230391091} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!96 &4620404264009677289 +TrailRenderer: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4390675743535140416} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 0e42500808910f24cb6626a81760c995, 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_Time: 5 + m_PreviewTimeScale: 1 + m_Parameters: + serializedVersion: 3 + widthMultiplier: 5 + widthCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + colorGradient: + serializedVersion: 2 + key0: {r: 1, g: 0, b: 0, a: 1} + key1: {r: 1, g: 1, b: 1, 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} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_ColorSpace: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + numCornerVertices: 0 + numCapVertices: 0 + alignment: 0 + textureMode: 0 + textureScale: {x: 1, y: 1} + shadowBias: 0.5 + generateLightingData: 0 + m_MinVertexDistance: 0.1 + m_MaskInteraction: 0 + m_Autodestruct: 0 + m_Emitting: 1 + m_ApplyActiveColorSpace: 0 +--- !u!1 &4590233640347492898 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8315564871113561163} + - component: {fileID: 6203868598056538240} + m_Layer: 0 + m_Name: Collider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8315564871113561163 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4590233640347492898} + serializedVersion: 2 + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 8462434346230391091} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!135 &6203868598056538240 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4590233640347492898} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 1 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Radius: 10 + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &6438458936967544359 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8462434346230391091} + - component: {fileID: -2759790757235477429} + - component: {fileID: 4451965530778273955} + m_Layer: 0 + m_Name: RollStabilizedMissileThreat + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8462434346230391091 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6438458936967544359} + serializedVersion: 2 + 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_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 585396986125101381} + - {fileID: 8315564871113561163} + - {fileID: 9192475791974545516} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &-2759790757235477429 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6438458936967544359} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 16e40584b2154ef4a95c84e85a321999, type: 3} + m_Name: + m_EditorClassIdentifier: + _flightPhase: 3 + _velocity: {x: 0, y: 0, z: 0} + _acceleration: {x: 0, y: 0, z: 0} + _dragAcceleration: {x: 0, y: 0, z: 0} + _target: {fileID: 0} + staticConfigFile: base_roll_stabilized_missile.json +--- !u!54 &4451965530778273955 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6438458936967544359} + serializedVersion: 4 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0 + m_CenterOfMass: {x: 0, y: 0, z: 0} + m_InertiaTensor: {x: 1, y: 1, z: 1} + m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ImplicitCom: 1 + m_ImplicitTensor: 1 + m_UseGravity: 0 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 diff --git a/Assets/Resources/Prefabs/MissileThreat.prefab.meta b/Assets/Resources/Prefabs/RollStabilizedMissileThreat.prefab.meta similarity index 100% rename from Assets/Resources/Prefabs/MissileThreat.prefab.meta rename to Assets/Resources/Prefabs/RollStabilizedMissileThreat.prefab.meta diff --git a/Assets/Scripts/Agent.cs b/Assets/Scripts/Agent.cs index 3795137..4b7a4c8 100644 --- a/Assets/Scripts/Agent.cs +++ b/Assets/Scripts/Agent.cs @@ -128,6 +128,10 @@ public abstract class Agent : MonoBehaviour { return GetComponent().linearVelocity; } + public Vector3 GetAcceleration() { + return _acceleration; + } + public double GetDynamicPressure() { var airDensity = Constants.CalculateAirDensityAtAltitude(transform.position.y); var flowSpeed = GetSpeed(); diff --git a/Assets/Scripts/Config/SimulationConfig.cs b/Assets/Scripts/Config/SimulationConfig.cs index 6ec3d6a..e734a1f 100644 --- a/Assets/Scripts/Config/SimulationConfig.cs +++ b/Assets/Scripts/Config/SimulationConfig.cs @@ -4,115 +4,121 @@ using UnityEngine; using Newtonsoft.Json; using Newtonsoft.Json.Converters; - [Serializable] public class SimulationConfig { - [Header("Simulation Settings")] - public float timeScale = 0.05f; + [Header("Simulation Settings")] + public float timeScale = 0.05f; - [Header("Interceptor Swarm Configurations")] - public List interceptor_swarm_configs = new List(); + // [Header("Defense Points")] + // public SwarmConfig defense_points_config; - [Header("Threat Swarm Configurations")] - public List threat_swarm_configs = new List(); + [Header("Interceptor Swarm Configurations")] + public List interceptor_swarm_configs = new List(); + + [Header("Threat Swarm Configurations")] + public List threat_swarm_configs = new List(); } [Serializable] public class DynamicConfig { - public LaunchConfig launch_config; - public SensorConfig sensor_config; + public LaunchConfig launch_config; + public SensorConfig sensor_config; } - [Serializable] +[Serializable] public class SwarmConfig { - public int num_agents; - public AgentConfig agent_config; + public int num_agents; + public AgentConfig agent_config; } [Serializable] public class AgentConfig { - public InterceptorType interceptor_type; - public ThreatType threat_type; - public InitialState initial_state; - public StandardDeviation standard_deviation; - public DynamicConfig dynamic_config; - public PlottingConfig plotting_config; - public SubmunitionsConfig submunitions_config; + public InterceptorType interceptor_type; + public ThreatType threat_type; + public InitialState initial_state; + public StandardDeviation standard_deviation; + public DynamicConfig dynamic_config; + public PlottingConfig plotting_config; + public SubmunitionsConfig submunitions_config; - public static AgentConfig FromSubmunitionAgentConfig(SubmunitionAgentConfig submunitionConfig) { - return new AgentConfig { - interceptor_type = submunitionConfig.interceptor_type, - initial_state = submunitionConfig.initial_state, - standard_deviation = submunitionConfig.standard_deviation, - dynamic_config = submunitionConfig.dynamic_config, - plotting_config = submunitionConfig.plotting_config, - // Set other fields as needed, using default values if not present in SubmunitionAgentConfig - threat_type = ThreatType.DRONE, // Or another default value - submunitions_config = null // Or a default value if needed - }; - } + public static AgentConfig FromSubmunitionAgentConfig(SubmunitionAgentConfig submunitionConfig) { + return new AgentConfig { + interceptor_type = submunitionConfig.interceptor_type, + initial_state = submunitionConfig.initial_state, + standard_deviation = submunitionConfig.standard_deviation, + dynamic_config = submunitionConfig.dynamic_config, + plotting_config = submunitionConfig.plotting_config, + // Set other fields as needed, using default values if not present in SubmunitionAgentConfig + threat_type = ThreatType.DRONE, // Or another default value + submunitions_config = null // Or a default value if needed + }; + } } [Serializable] public class InitialState { - public Vector3 position; - public Vector3 rotation; - public Vector3 velocity; + public Vector3 position; + public Vector3 rotation; + public Vector3 velocity; } [Serializable] public class StandardDeviation { - public Vector3 position; - public Vector3 velocity; + public Vector3 position; + public Vector3 velocity; } -[Serializable] +[Serializable] public class LaunchConfig { - public float launch_time; + public float launch_time; } [Serializable] public class PlottingConfig { - public ConfigColor color; - public LineStyle linestyle; - public Marker marker; + public ConfigColor color; + public LineStyle linestyle; + public Marker marker; } [Serializable] public class SubmunitionsConfig { - public int num_submunitions; - public LaunchConfig launch_config; - public SubmunitionAgentConfig agent_config; + public int num_submunitions; + public LaunchConfig launch_config; + public SubmunitionAgentConfig agent_config; } [Serializable] public class SubmunitionAgentConfig { - public InterceptorType interceptor_type; - public InitialState initial_state; - public StandardDeviation standard_deviation; - public DynamicConfig dynamic_config; - public PlottingConfig plotting_config; + public InterceptorType interceptor_type; + public InitialState initial_state; + public StandardDeviation standard_deviation; + public DynamicConfig dynamic_config; + public PlottingConfig plotting_config; } [Serializable] public class SensorConfig { - public SensorType type; - public float frequency; + public SensorType type; + public float frequency; } [Serializable] public class TargetConfig { - public ThreatType threat_type; - public InitialState initial_state; - public PlottingConfig plotting_config; - public string prefabName; + public ThreatType threat_type; + public InitialState initial_state; + public PlottingConfig plotting_config; + public string prefabName; } // Enums [JsonConverter(typeof(StringEnumConverter))] public enum InterceptorType { HYDRA_70, MICROMISSILE } [JsonConverter(typeof(StringEnumConverter))] -public enum ThreatType { DRONE, MISSILE } +public enum ThreatType { + DRONE, + FIXED_WING_MISSILE, + ROLL_STABILIZED_MISSILE +} // Add ballistic later -michael [JsonConverter(typeof(StringEnumConverter))] public enum ConfigColor { BLUE, GREEN, RED } [JsonConverter(typeof(StringEnumConverter))] diff --git a/Assets/Scripts/DefendPoint.cs b/Assets/Scripts/DefendPoint.cs new file mode 100644 index 0000000..5505b12 --- /dev/null +++ b/Assets/Scripts/DefendPoint.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +/// +/// Static targetable point to defend +/// +public class DefendPoint : Agent { + // Currently just initializes to the origin + public DefendPoint() { + // Set the initial state + this.transform.position = Vector3.zero; + } + + protected override void FixedUpdate() { + return; + } + + protected override void UpdateBoost(double deltaTime) { + return; + } + + protected override void UpdateMidCourse(double deltaTime) { + return; + } + + protected override void UpdateReady(double deltaTime) { + return; + } +} \ No newline at end of file diff --git a/Assets/Scripts/DefendPoint.cs.meta b/Assets/Scripts/DefendPoint.cs.meta new file mode 100644 index 0000000..fbd8e02 --- /dev/null +++ b/Assets/Scripts/DefendPoint.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7eed014a152a65043be19cd044faa5d2 \ No newline at end of file diff --git a/Assets/Scripts/SimManager.cs b/Assets/Scripts/SimManager.cs index f781ea6..2ab56a7 100644 --- a/Assets/Scripts/SimManager.cs +++ b/Assets/Scripts/SimManager.cs @@ -75,7 +75,6 @@ public class SimManager : MonoBehaviour { StartSimulation(); ResumeSimulation(); } - } public void SetTimeScale(float timeScale) { @@ -197,9 +196,10 @@ public class SimManager : MonoBehaviour { /// Configuration settings for the interceptor. /// The created Interceptor instance, or null if creation failed. public Interceptor CreateInterceptor(AgentConfig config) { - string prefabName = config.interceptor_type switch { InterceptorType.HYDRA_70 => "Hydra70", - InterceptorType.MICROMISSILE => "Micromissile", - _ => "Hydra70" }; + string prefabName = + config.interceptor_type switch { InterceptorType.HYDRA_70 => "Hydra70", + InterceptorType.MICROMISSILE => "Micromissile", + _ => "Hydra70" }; GameObject missileObject = CreateAgent(config, prefabName); if (missileObject == null) @@ -231,7 +231,8 @@ public class SimManager : MonoBehaviour { /// The created Threat instance, or null if creation failed. private Threat CreateThreat(AgentConfig config) { string prefabName = config.threat_type switch { - ThreatType.DRONE => "Drone", ThreatType.MISSILE => "MissileThreat", + ThreatType.DRONE => "Drone", ThreatType.FIXED_WING_MISSILE => "FixedWingMissileThreat", + ThreatType.ROLL_STABILIZED_MISSILE => "RollStabilizedMissileThreat", _ => throw new System.ArgumentException($"Unsupported threat type: {config.threat_type}") }; GameObject threatObject = CreateAgent(config, prefabName); diff --git a/Assets/Scripts/Threats/DroneTarget.cs b/Assets/Scripts/Threats/DroneThreat.cs similarity index 93% rename from Assets/Scripts/Threats/DroneTarget.cs rename to Assets/Scripts/Threats/DroneThreat.cs index a754fd7..50aee13 100644 --- a/Assets/Scripts/Threats/DroneTarget.cs +++ b/Assets/Scripts/Threats/DroneThreat.cs @@ -2,7 +2,7 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; -public class DroneTarget : Threat { +public class DroneThreat : Threat { // Start is called before the first frame update protected override void Start() { base.Start(); diff --git a/Assets/Scripts/Threats/DroneTarget.cs.meta b/Assets/Scripts/Threats/DroneThreat.cs.meta similarity index 100% rename from Assets/Scripts/Threats/DroneTarget.cs.meta rename to Assets/Scripts/Threats/DroneThreat.cs.meta diff --git a/Assets/Scripts/Threats/FixedWingMissileThreat.cs b/Assets/Scripts/Threats/FixedWingMissileThreat.cs new file mode 100644 index 0000000..48bebac --- /dev/null +++ b/Assets/Scripts/Threats/FixedWingMissileThreat.cs @@ -0,0 +1,41 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class FixedWingMissileThreat : Threat { + protected override void UpdateBoost(double deltaTime) { + throw new System.NotImplementedException(); + } + + protected override void UpdateMidCourse(double deltaTime) { + throw new System.NotImplementedException(); + } + + /// + /// Strategy for moving the Threat in a straight path towards its target. + /// + public class DirectPathStrategy : NavigationStrategy { + public override void Execute(Threat threat, List swarmMates, FlightPhase flightPhase, + List interceptors, double deltaTime) { + throw new System.NotImplementedException(); + } + } + + /// + /// Strategy for moving the Threat in an S-curve towards a predefined target. + /// + public class SlalomStrategy : NavigationStrategy { + private float maxAmplitude; + private float periodDistance; + + public SlalomStrategy(float maxAmplitude, float periodDistance) { + this.maxAmplitude = maxAmplitude; + this.periodDistance = periodDistance; + } + + public override void Execute(Threat threat, List swarmMates, FlightPhase flightPhase, + List interceptors, double deltaTime) { + throw new System.NotImplementedException(); + } + } +} diff --git a/Assets/Scripts/Threats/FixedWingMissileThreat.cs.meta b/Assets/Scripts/Threats/FixedWingMissileThreat.cs.meta new file mode 100644 index 0000000..be8dca9 --- /dev/null +++ b/Assets/Scripts/Threats/FixedWingMissileThreat.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 4e6c2fbd1e492be448760f5045b13b2e \ No newline at end of file diff --git a/Assets/Scripts/Threats/MissileThreat.cs b/Assets/Scripts/Threats/MissileThreat.cs deleted file mode 100644 index 6d3e04d..0000000 --- a/Assets/Scripts/Threats/MissileThreat.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -/// -/// Base class for missile targets. Uses same set of flight phases as base Hydra-70. -/// -public class MissileThreat : Threat -{ - protected float boostAcceleration = 20; - protected float midcourseAcceleration = 5; - - protected override void UpdateReady(double deltaTime) - { - // if in ready phase, just set to boost phase immediately - SetFlightPhase(FlightPhase.BOOST); - } - - protected override void UpdateBoost(double deltaTime) - { - // The interceptor only accelerates along its roll axis (forward in Unity) - Vector3 rollAxis = transform.forward; - - // Calculate boost acceleration - float boostAcceleration = - (float)(_staticConfig.boostConfig.boostAcceleration * Constants.kGravity); - Vector3 accelerationInput = boostAcceleration * rollAxis; - - // Calculate the total acceleration - Vector3 acceleration = CalculateAcceleration(accelerationInput); - - // Apply the acceleration force - GetComponent().AddForce(acceleration, ForceMode.Acceleration); - } - - protected override void UpdateMidCourse(double deltaTime) - { - Vector3 accelerationInput = Vector3.zero; - // Calculate and set the total acceleration - Vector3 acceleration = CalculateAcceleration(accelerationInput); - GetComponent().AddForce(acceleration, ForceMode.Acceleration); - } - - protected Vector3 CalculateAcceleration(Vector3 accelerationInput, - bool compensateForGravity = false) - { - Vector3 gravity = Physics.gravity; - if (compensateForGravity) - { - Vector3 gravityProjection = CalculateGravityProjectionOnPitchAndYaw(); - accelerationInput -= gravityProjection; - } - - float airDrag = CalculateDrag(); - float liftInducedDrag = CalculateLiftInducedDrag(accelerationInput); - float dragAcceleration = -(airDrag + liftInducedDrag); - - // Project the drag acceleration onto the forward direction - Vector3 dragAccelerationAlongRoll = dragAcceleration * transform.forward; - _dragAcceleration = dragAccelerationAlongRoll; - - return accelerationInput + gravity + dragAccelerationAlongRoll; - } - - protected float CalculateMaxAcceleration() - { - float maxReferenceAcceleration = - (float)(_staticConfig.accelerationConfig.maxReferenceAcceleration * Constants.kGravity); - float referenceSpeed = _staticConfig.accelerationConfig.referenceSpeed; - return Mathf.Pow(GetComponent().linearVelocity.magnitude / referenceSpeed, 2) * - maxReferenceAcceleration; - } - - protected Vector3 CalculateGravityProjectionOnPitchAndYaw() - { - Vector3 gravity = Physics.gravity; - Vector3 pitchAxis = transform.right; - Vector3 yawAxis = transform.up; - - // Project the gravity onto the pitch and yaw axes - float gravityProjectionPitchCoefficient = Vector3.Dot(gravity, pitchAxis); - float gravityProjectionYawCoefficient = Vector3.Dot(gravity, yawAxis); - - // Return the sum of the projections - return gravityProjectionPitchCoefficient * pitchAxis + - gravityProjectionYawCoefficient * yawAxis; - } - - private float CalculateDrag() - { - float dragCoefficient = _staticConfig.liftDragConfig.dragCoefficient; - float crossSectionalArea = _staticConfig.bodyConfig.crossSectionalArea; - float mass = _staticConfig.bodyConfig.mass; - float dynamicPressure = (float)GetDynamicPressure(); - float dragForce = dragCoefficient * dynamicPressure * crossSectionalArea; - return dragForce / mass; - } - - private float CalculateLiftInducedDrag(Vector3 accelerationInput) - { - float liftAcceleration = - (accelerationInput - Vector3.Dot(accelerationInput, transform.up) * transform.up).magnitude; - float liftDragRatio = _staticConfig.liftDragConfig.liftDragRatio; - return Mathf.Abs(liftAcceleration / liftDragRatio); - } - -} diff --git a/Assets/Scripts/Threats/RollStabilizedMissileThreat.cs b/Assets/Scripts/Threats/RollStabilizedMissileThreat.cs new file mode 100644 index 0000000..c75a177 --- /dev/null +++ b/Assets/Scripts/Threats/RollStabilizedMissileThreat.cs @@ -0,0 +1,204 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +/// +/// Base class for missile targets. Uses same set of flight phases as base Hydra-70. +/// +public class RollStabilizedMissileThreat : Threat { + protected float boostAcceleration = 20; + protected float midcourseAcceleration = 0; + protected float terminalAcceleration = 22; + protected float maxAmplitude = 22; + + public RollStabilizedMissileThreat() { + strategy = new DirectPathStrategy(); + } + + protected override void UpdateBoost(double deltaTime) { + // The interceptor only accelerates along its roll axis (forward in Unity) + Vector3 rollAxis = transform.forward; + + // Calculate boost acceleration + float boostAcceleration = + (float)(_staticConfig.boostConfig.boostAcceleration * Constants.kGravity); + Vector3 accelerationInput = boostAcceleration * rollAxis; + + // Calculate the total acceleration + Vector3 acceleration = CalculateAcceleration(accelerationInput); + + // Apply the acceleration force + GetComponent().AddForce(acceleration, ForceMode.Acceleration); + } + + protected override void UpdateMidCourse(double deltaTime) { + Vector3 accelerationInput = Vector3.zero; + // Calculate and set the total acceleration + Vector3 acceleration = CalculateAcceleration(accelerationInput); + GetComponent().AddForce(acceleration, ForceMode.Acceleration); + } + + protected Vector3 CalculateAcceleration(Vector3 accelerationInput, + bool compensateForGravity = false) { + Vector3 gravity = Physics.gravity; + if (compensateForGravity) { + Vector3 gravityProjection = CalculateGravityProjectionOnPitchAndYaw(); + accelerationInput -= gravityProjection; + } + + float airDrag = CalculateDrag(); + float liftInducedDrag = CalculateLiftInducedDrag(accelerationInput); + float dragAcceleration = -(airDrag + liftInducedDrag); + + // Project the drag acceleration onto the forward direction + Vector3 dragAccelerationAlongRoll = dragAcceleration * transform.forward; + _dragAcceleration = dragAccelerationAlongRoll; + + return accelerationInput + gravity + dragAccelerationAlongRoll; + } + + protected float CalculateMaxAcceleration() { + float maxReferenceAcceleration = + (float)(_staticConfig.accelerationConfig.maxReferenceAcceleration * Constants.kGravity); + float referenceSpeed = _staticConfig.accelerationConfig.referenceSpeed; + return Mathf.Pow(GetComponent().linearVelocity.magnitude / referenceSpeed, 2) * + maxReferenceAcceleration; + } + + protected Vector3 CalculateGravityProjectionOnPitchAndYaw() { + Vector3 gravity = Physics.gravity; + Vector3 pitchAxis = transform.right; + Vector3 yawAxis = transform.up; + + // Project the gravity onto the pitch and yaw axes + float gravityProjectionPitchCoefficient = Vector3.Dot(gravity, pitchAxis); + float gravityProjectionYawCoefficient = Vector3.Dot(gravity, yawAxis); + + // Return the sum of the projections + return gravityProjectionPitchCoefficient * pitchAxis + + gravityProjectionYawCoefficient * yawAxis; + } + + private float CalculateDrag() { + float dragCoefficient = _staticConfig.liftDragConfig.dragCoefficient; + float crossSectionalArea = _staticConfig.bodyConfig.crossSectionalArea; + float mass = _staticConfig.bodyConfig.mass; + float dynamicPressure = (float)GetDynamicPressure(); + float dragForce = dragCoefficient * dynamicPressure * crossSectionalArea; + return dragForce / mass; + } + + private float CalculateLiftInducedDrag(Vector3 accelerationInput) { + float liftAcceleration = + (accelerationInput - Vector3.Dot(accelerationInput, transform.up) * transform.up).magnitude; + float liftDragRatio = _staticConfig.liftDragConfig.liftDragRatio; + return Mathf.Abs(liftAcceleration / liftDragRatio); + } + + // =========================================================== + // STRATEGIES + // =========================================================== + + /// + /// Strategy for moving the Threat in a straight path towards its target. + /// + public class DirectPathStrategy : NavigationStrategy { + DefendPoint target = new DefendPoint(); + + private float _navigationGain = 3f; // Typically 3-5 + private SensorOutput _sensorOutput; + private Vector3 _accelerationCommand; + private double _elapsedTime = 0; + + public override void Execute(Threat threat, List swarmMates, FlightPhase flightPhase, + List interceptors, double deltaTime) { + RollStabilizedMissileThreat missileThreat = threat as RollStabilizedMissileThreat; + if (missileThreat == null) { + Debug.LogError("DirectPathStrategy can only be used with RollStabilizedMissileThreat"); + return; + } + + _elapsedTime += deltaTime; + Vector3 accelerationInput = Vector3.zero; + + if (target != null) { + // Correct the state of the threat model at the sensor frequency + float sensorUpdatePeriod = + 1f / missileThreat._agentConfig.dynamic_config.sensor_config.frequency; + if (_elapsedTime >= sensorUpdatePeriod) { + _sensorOutput = new SensorOutput(); + missileThreat.GetComponent().Sense(target); + Debug.Log(_sensorOutput.velocity.range); + _elapsedTime = 0; + } + + // Check whether the threat should be considered a miss + SensorOutput sensorOutput = missileThreat.GetComponent().Sense(target); + if (sensorOutput.velocity.range > 1000f) { + missileThreat.MarkAsMiss(); + } + + // Calculate the acceleration input + accelerationInput = CalculateAccelerationCommand(missileThreat, _sensorOutput); + } else { + Debug.LogError("DirectPathStrategy requires a target to be set"); + } + + // Calculate and set the total acceleration + Vector3 acceleration = + missileThreat.CalculateAcceleration(accelerationInput, compensateForGravity: true); + missileThreat.GetComponent().AddForce(acceleration, ForceMode.Acceleration); + } + + private Vector3 CalculateAccelerationCommand(Threat threat, SensorOutput sensorOutput) { + RollStabilizedMissileThreat missileThreat = threat as RollStabilizedMissileThreat; + + // Implement Proportional Navigation guidance law + Vector3 accelerationCommand; + + // Extract relevant information from sensor output + float los_rate_az = sensorOutput.velocity.azimuth; + float los_rate_el = sensorOutput.velocity.elevation; + float closing_velocity = + -sensorOutput.velocity + .range; // Negative because closing velocity is opposite to range rate + + // Navigation gain (adjust as needed) + float N = _navigationGain; + + // Calculate acceleration commands in azimuth and elevation planes + float acc_az = N * closing_velocity * los_rate_az; + float acc_el = N * closing_velocity * los_rate_el; + + // Convert acceleration commands to craft body frame + accelerationCommand = + missileThreat.transform.right * acc_az + missileThreat.transform.up * acc_el; + + // Clamp the acceleration command to the maximum acceleration + float maxAcceleration = missileThreat.CalculateMaxAcceleration(); + accelerationCommand = Vector3.ClampMagnitude(accelerationCommand, maxAcceleration); + + // Update the stored acceleration command for debugging + _accelerationCommand = accelerationCommand; + return accelerationCommand; + } + } + + /// + /// Strategy for moving the Threat in a spiral towards a predefined target. + /// + public class SpiralStrategy : NavigationStrategy { + private float spiralRadius; + private float periodDistance; + + public SpiralStrategy(float spiralRadius, float periodDistance) { + this.spiralRadius = spiralRadius; + this.periodDistance = periodDistance; + } + + public override void Execute(Threat threat, List swarmMates, FlightPhase flightPhase, + List interceptors, double deltaTime) { + throw new System.NotImplementedException(); + } + } +} diff --git a/Assets/Scripts/Threats/MissileThreat.cs.meta b/Assets/Scripts/Threats/RollStabilizedMissileThreat.cs.meta similarity index 100% rename from Assets/Scripts/Threats/MissileThreat.cs.meta rename to Assets/Scripts/Threats/RollStabilizedMissileThreat.cs.meta diff --git a/Assets/Scripts/Threats/Strategies.meta b/Assets/Scripts/Threats/Strategies.meta new file mode 100644 index 0000000..8316847 --- /dev/null +++ b/Assets/Scripts/Threats/Strategies.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0d798867791c1444b985d8807b144572 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Threats/Threat.cs b/Assets/Scripts/Threats/Threat.cs index 2bb3b0b..5e8a3c8 100644 --- a/Assets/Scripts/Threats/Threat.cs +++ b/Assets/Scripts/Threats/Threat.cs @@ -3,6 +3,29 @@ using System.Collections.Generic; using UnityEngine; public abstract class Threat : Agent { + /// + /// Strategy for moving the Threat towards a predefined target. + /// + public abstract class NavigationStrategy { + /// + /// Execute one timestep of the strategy for the given threat and flight phase. Should only + /// apply normal forces to the threat. Can also change the threat's flight phase. Should NOT + /// manage thrust. + /// + /// Parent Threat object + /// List of other threats in the swarm + /// Current flight phase + /// List of active interceptors + /// Timestep + public abstract void Execute(Threat threat, List swarmMates, FlightPhase flightPhase, + List interceptors, double deltaTime); + } + + /// + /// Navigation strategy that this threat will use to move towards its target. + /// + public NavigationStrategy strategy; + public override bool IsAssignable() { return false; } @@ -13,5 +36,18 @@ public abstract class Threat : Agent { protected override void FixedUpdate() { base.FixedUpdate(); + // NOTE: no swarm-mates for now + strategy.Execute(this, new List(), GetFlightPhase(), + SimManager.Instance.GetActiveInterceptors(), Time.fixedDeltaTime); + } + + /// + /// OVERRIDE: THIS SHOULD NEVER BE CALLED; threats always start in midcourse or (at the very + /// earliest) boost phase. + /// + /// + /// + protected override void UpdateReady(double deltaTime) { + throw new System.NotImplementedException(); } } \ No newline at end of file diff --git a/Assets/StreamingAssets/Configs/1_salvo_1_hydra_7_tomahawks.json b/Assets/StreamingAssets/Configs/1_salvo_1_hydra_7_tomahawks.json index e65320f..7b8073e 100644 --- a/Assets/StreamingAssets/Configs/1_salvo_1_hydra_7_tomahawks.json +++ b/Assets/StreamingAssets/Configs/1_salvo_1_hydra_7_tomahawks.json @@ -5,7 +5,7 @@ "num_agents": 1, "agent_config": { "interceptor_type": "HYDRA_70", - "threat_type": "DRONE", + "threat_type": "ROLL_STABILIZED_MISSILE", "initial_state": { "position": { "x": 0, @@ -98,8 +98,7 @@ { "num_agents": 7, "agent_config": { - "interceptor_type": "HYDRA_70", - "threat_type": "MISSILE", + "threat_type": "ROLL_STABILIZED_MISSILE", "initial_state": { "position": { "x": 0, @@ -108,7 +107,7 @@ }, "rotation": { "x": 90, - "y": 0, + "y": 50, "z": 0 }, "velocity": { @@ -137,9 +136,6 @@ "type": "IDEAL", "frequency": 0 } - }, - "static_config": { - }, "submunitions_config": { "num_submunitions": 0 diff --git a/Assets/StreamingAssets/Configs/1_salvo_1_hydra_7_tomahawks.json.meta b/Assets/StreamingAssets/Configs/1_salvo_1_hydra_7_tomahawks.json.meta new file mode 100644 index 0000000..286876c --- /dev/null +++ b/Assets/StreamingAssets/Configs/1_salvo_1_hydra_7_tomahawks.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 22c1e00f13b5ec6468892b8c6df37933 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets/Configs/Models/base_roll_stabilized_missile.json b/Assets/StreamingAssets/Configs/Models/base_roll_stabilized_missile.json new file mode 100644 index 0000000..d4c81cd --- /dev/null +++ b/Assets/StreamingAssets/Configs/Models/base_roll_stabilized_missile.json @@ -0,0 +1,25 @@ +{ + "accelerationConfig": { + "maxReferenceAcceleration": 300, + "referenceSpeed": 1000 + }, + "boostConfig": { + "boostTime": 0.3, + "boostAcceleration": 350 + }, + "liftDragConfig": { + "liftCoefficient": 0.2, + "dragCoefficient": 0.7, + "liftDragRatio": 5 + }, + "bodyConfig": { + "mass": 0.37, + "crossSectionalArea": 0.0003, + "finArea": 0.0006, + "bodyArea": 0.01 + }, + "hitConfig": { + "hitRadius": 1, + "killProbability": 0.9 + } +} \ No newline at end of file diff --git a/Assets/StreamingAssets/Configs/Models/base_roll_stabilized_missile.json.meta b/Assets/StreamingAssets/Configs/Models/base_roll_stabilized_missile.json.meta new file mode 100644 index 0000000..c247667 --- /dev/null +++ b/Assets/StreamingAssets/Configs/Models/base_roll_stabilized_missile.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 72573475cbd372d4dbb25291cc6545b0 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: