Browse Source

adjusted physics layers & body manager

main
cailean 9 months ago
parent
commit
7f2392f43e
  1. 121
      Assets/5_Scenes/DreconDemo.unity
  2. 4
      Assets/5_Scenes/DreconDemo/HDRP Base.asset
  3. 15
      Assets/8_Scripts/2_General/BodyManager.cs
  4. 0
      Assets/8_Scripts/2_General/BodyManager.cs.meta
  5. 54
      Assets/9_Models/Humanoid/SMPLX/basicModel_m_lbs_10_207_0_v1.0.2 (1).prefab
  6. 2
      Assets/ML-Agents/Timers/DreconDemo_timers.json
  7. 2
      ProjectSettings/DynamicsManager.asset
  8. 4
      ProjectSettings/TagManager.asset

121
Assets/5_Scenes/DreconDemo.unity

@ -5176,6 +5176,37 @@ Transform:
- {fileID: 345254372}
m_Father: {fileID: 764745129}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &327870759
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 327870760}
m_Layer: 0
m_Name: '+++++++++++++++++++++++++++++ '
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &327870760
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 327870759}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -1.1371689, y: 1.4247435, z: -1.9901705}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &330585543
GameObject:
m_ObjectHideFlags: 0
@ -5243,7 +5274,7 @@ Camera:
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 127
m_Bits: 383
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
@ -9285,7 +9316,7 @@ GameObject:
- component: {fileID: 756894921}
- component: {fileID: 756894920}
m_Layer: 0
m_Name: Spawner
m_Name: Body Manager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -9308,6 +9339,7 @@ MonoBehaviour:
m_SpawnTime: 2
m_DefaultPoolCapacity: 30
m_MaxPoolCapacity: 40
m_Parent: {fileID: 1517085324}
--- !u!4 &756894921
Transform:
m_ObjectHideFlags: 0
@ -9316,12 +9348,12 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 756894919}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 6.7, z: 0}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -3.9680753, y: -2.2090826, z: -8.888225}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_Father: {fileID: 760971828}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &758406327
GameObject:
@ -9355,6 +9387,38 @@ Transform:
- {fileID: 1915047727}
m_Father: {fileID: 475102863}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &760971827
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 760971828}
m_Layer: 0
m_Name: Managers
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &760971828
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 760971827}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 3.9680753, y: 8.909082, z: 8.888225}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 756894921}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &762459446
GameObject:
m_ObjectHideFlags: 0
@ -16365,6 +16429,37 @@ Transform:
- {fileID: 1076050970}
m_Father: {fileID: 437277871}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1517085323
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1517085324}
m_Layer: 8
m_Name: Body Group
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1517085324
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1517085323}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 3.9680753, y: 8.909082, z: 8.888225}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1517384663
GameObject:
m_ObjectHideFlags: 0
@ -16475,7 +16570,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!4 &1552239303
Transform:
m_ObjectHideFlags: 0
@ -19982,8 +20077,8 @@ GameObject:
- component: {fileID: 1853480534}
- component: {fileID: 1853480533}
- component: {fileID: 1853480532}
m_Layer: 0
m_Name: Floor
m_Layer: 9
m_Name: Body Collider
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -20018,7 +20113,7 @@ MeshRenderer:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1853480531}
m_Enabled: 1
m_Enabled: 0
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
@ -20071,7 +20166,7 @@ Transform:
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.6, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalScale: {x: 1.5235814, y: 1.5235814, z: 1.5235814}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
@ -24544,7 +24639,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!4 &919403383614959585
Transform:
m_ObjectHideFlags: 0
@ -34407,7 +34502,9 @@ SceneRoots:
- {fileID: 547443783}
- {fileID: 1327997889}
- {fileID: 2079806149}
- {fileID: 760971828}
- {fileID: 21194790}
- {fileID: 543450651852864845}
- {fileID: 327870760}
- {fileID: 1517085324}
- {fileID: 1853480535}
- {fileID: 756894921}

4
Assets/5_Scenes/DreconDemo/HDRP Base.asset

@ -537,7 +537,9 @@ MonoBehaviour:
active: 1
diffusionProfiles:
m_OverrideState: 1
m_Value: []
m_Value:
- {fileID: 11400000, guid: 404820c4cf36ad944862fa59c56064f0, type: 2}
- {fileID: 11400000, guid: 2384dbf2c1c420f45a792fbc315fbfb1, type: 2}
--- !u!114 &2790219418207653712
MonoBehaviour:
m_ObjectHideFlags: 3

15
Assets/8_Scripts/2_General/SpawnRB.cs → Assets/8_Scripts/2_General/BodyManager.cs

@ -3,15 +3,26 @@ using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Pool;
public class SpawnRB : MonoBehaviour
public class BodyManager : MonoBehaviour
{
public static BodyManager Instance { get; private set; }
public Body m_Rigidbody;
public ObjectPool<Body> m_Pool;
public float m_SpawnTime;
public int m_DefaultPoolCapacity;
public int m_MaxPoolCapacity;
public Transform m_Parent;
private Vector3 m_PelvisPosition;
private void Awake()
{
if (Instance != null)
Destroy(this);
else
Instance = this;
}
private void Start()
{
if (m_Rigidbody == null)
@ -25,7 +36,7 @@ public class SpawnRB : MonoBehaviour
private Body CreateBody()
{
Vector3 spawnPos = this.transform.position;
Body body = Instantiate(m_Rigidbody, spawnPos, new Quaternion(Random.Range(0, 180), Random.Range(0, 180), Random.Range(0, 180), Random.Range(0, 180)));
Body body = Instantiate(m_Rigidbody, spawnPos, new Quaternion(Random.Range(0, 180), Random.Range(0, 180), Random.Range(0, 180), Random.Range(0, 180)), m_Parent);
body.m_Pelvis.gameObject.GetComponent<Rigidbody>().AddForce(new Vector3(1, 1, 1));
m_PelvisPosition = body.m_Pelvis.position;
body.SetPool(m_Pool);

0
Assets/8_Scripts/2_General/SpawnRB.cs.meta → Assets/8_Scripts/2_General/BodyManager.cs.meta

54
Assets/9_Models/Humanoid/SMPLX/basicModel_m_lbs_10_207_0_v1.0.2 (1).prefab

@ -9,7 +9,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 2621388052444323}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_L_Wrist
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -41,7 +41,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 3416493215792410601}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_R_Collar
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -76,7 +76,7 @@ GameObject:
- component: {fileID: 8608643442074244007}
- component: {fileID: 5779414777730544932}
- component: {fileID: 4531014026059542562}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_R_Knee
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -204,7 +204,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 7053945083716261137}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_R_Wrist
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -236,7 +236,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 1234258318008518033}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_root
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -269,7 +269,7 @@ GameObject:
m_Component:
- component: {fileID: 725708368551456178}
- component: {fileID: 6293844864974396996}
m_Layer: 0
m_Layer: 8
m_Name: basicModel_m_lbs_10_207_0_v1.0.2 (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -319,7 +319,7 @@ GameObject:
- component: {fileID: 2296520526387657909}
- component: {fileID: 4780858546646163507}
- component: {fileID: 6594493312919754251}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_R_Elbow
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -447,7 +447,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 8822598865079012791}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_L_Foot
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -478,7 +478,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 4649143479671865686}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_L_Collar
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -513,7 +513,7 @@ GameObject:
- component: {fileID: 6047481721412739124}
- component: {fileID: 958894058804254088}
- component: {fileID: 6881410035351102794}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_L_Hip
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -643,7 +643,7 @@ GameObject:
- component: {fileID: 4895783841800412640}
- component: {fileID: 1272971490257197318}
- component: {fileID: 2589419581028157696}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_Pelvis
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -728,7 +728,7 @@ GameObject:
- component: {fileID: 684823703737173087}
- component: {fileID: 4975426484968991098}
- component: {fileID: 6148005760040749047}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_Spine2
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -854,7 +854,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 818150302048161760}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_L_Hand
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -885,7 +885,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 8930074591871296429}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_R_Foot
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -916,7 +916,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 7901250069882341582}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_Spine1
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -951,7 +951,7 @@ GameObject:
- component: {fileID: 4487047334041361207}
- component: {fileID: 1494545432384605745}
- component: {fileID: 7432854695056488702}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_L_Elbow
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -1080,7 +1080,7 @@ GameObject:
m_Component:
- component: {fileID: 681830848489824576}
- component: {fileID: 1540003803412720133}
m_Layer: 0
m_Layer: 8
m_Name: m_avg
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -1406,7 +1406,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 3417959254290028953}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_R_Hand
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -1440,7 +1440,7 @@ GameObject:
- component: {fileID: 5083463928606826055}
- component: {fileID: 3552846380860879215}
- component: {fileID: 3800214251609523913}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_L_Shoulder
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -1568,7 +1568,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 5219304553590207711}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_L_Ankle
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -1603,7 +1603,7 @@ GameObject:
- component: {fileID: 1965305456792351878}
- component: {fileID: 1971607919947363082}
- component: {fileID: 47398644869302000}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_R_Shoulder
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -1734,7 +1734,7 @@ GameObject:
- component: {fileID: 1037066624660013298}
- component: {fileID: 5404087638917693857}
- component: {fileID: 1287866221113018661}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_R_Hip
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -1862,7 +1862,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 1231917449372663643}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_Neck
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -1894,7 +1894,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 6472073811024252503}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_R_Ankle
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -1929,7 +1929,7 @@ GameObject:
- component: {fileID: 6621003610756086248}
- component: {fileID: 8525818638187974980}
- component: {fileID: 8929802388664056413}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_Head
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -2054,7 +2054,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 1841805770803627981}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_Spine3
m_TagString: Untagged
m_Icon: {fileID: 0}
@ -2091,7 +2091,7 @@ GameObject:
- component: {fileID: 8319005067042079993}
- component: {fileID: 7479043455189566497}
- component: {fileID: 6935732032146660818}
m_Layer: 0
m_Layer: 8
m_Name: m_avg_L_Knee
m_TagString: Untagged
m_Icon: {fileID: 0}

2
Assets/ML-Agents/Timers/DreconDemo_timers.json

@ -1 +1 @@
{"count":1,"self":493.75216639999996,"total":495.99881999999997,"children":{"InitializeActuators":{"count":1,"self":0.00050329999999999993,"total":0.00050329999999999993,"children":null},"InitializeSensors":{"count":1,"self":0.0010000999999999999,"total":0.0010000999999999999,"children":null},"AgentSendState":{"count":4852,"self":0.016616799999999998,"total":0.5728352,"children":{"CollectObservations":{"count":2426,"self":0.5386847,"total":0.5386847,"children":null},"WriteActionMask":{"count":2426,"self":0.0025031999999999997,"total":0.0025031999999999997,"children":null},"RequestDecision":{"count":2426,"self":0.015030499999999999,"total":0.015030499999999999,"children":null}}},"DecideAction":{"count":4852,"self":0.9795438,"total":0.9795438,"children":null},"AgentAct":{"count":4852,"self":0.6927498,"total":0.6927498,"children":null}},"gauges":{"DReCon-v0.CumulativeReward":{"count":2,"max":1189.69434,"min":71.83429,"runningAverage":630.7643,"value":1189.69434,"weightedAverage":351.299316}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1712065567","unity_version":"2022.3.5f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.5f1\\Editor\\Unity.exe -projectpath C:\\Users\\caile\\Desktop\\Projects\\24_3-Moloch\\2_Unity\\Expeirments\\Drecon2022 -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-caile -hubSessionId e647b224-3c0a-452e-b7c9-fe9b39a44e8b -accessToken itZgxicDyZQYyfQkqQBvCkvlE5Omp1TpJfmpuy2SzPw005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"DreconDemo","end_time_seconds":"1712066063"}}
{"count":1,"self":84.4865408,"total":87.5432563,"children":{"InitializeActuators":{"count":1,"self":0.001,"total":0.001,"children":null},"InitializeSensors":{"count":1,"self":0.0010042,"total":0.0010042,"children":null},"AgentSendState":{"count":6566,"self":0.0432644,"total":0.791742,"children":{"CollectObservations":{"count":3283,"self":0.7304242,"total":0.7304242,"children":null},"WriteActionMask":{"count":3283,"self":0.0045147999999999994,"total":0.0045147999999999994,"children":null},"RequestDecision":{"count":3283,"self":0.0135386,"total":0.0135386,"children":null}}},"DecideAction":{"count":6566,"self":1.3201786,"total":1.3201786,"children":null},"AgentAct":{"count":6566,"self":0.9417876,"total":0.9417876,"children":null}},"gauges":{"DReCon-v0.CumulativeReward":{"count":3,"max":2238.319,"min":76.08395,"runningAverage":855.8576,"value":2238.319,"weightedAverage":649.8463}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1712232426","unity_version":"2022.3.5f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.5f1\\Editor\\Unity.exe -projectpath C:\\Users\\caile\\Desktop\\Projects\\24_3-Moloch\\2_Unity\\Expeirments\\Drecon2022 -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-caile -hubSessionId f88630f1-920b-4dbe-b665-558da63c889d -accessToken j9cV6YRoUof5axDzFeIFUEeVZBbcpurLrJC0wa7ct1A005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"DreconDemo","end_time_seconds":"1712232513"}}

2
ProjectSettings/DynamicsManager.asset

@ -18,7 +18,7 @@ PhysicsManager:
m_ClothInterCollisionDistance: 0.1
m_ClothInterCollisionStiffness: 0.2
m_ContactsGeneration: 1
m_LayerCollisionMatrix: ffffffffffffffffffffffffb7fffffffffffffffffffffff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_LayerCollisionMatrix: ffffffffffffffffffffffffb7fefffffffffffffffffffff7fcfffffffdffffb7ffffff3fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_SimulationMode: 0
m_AutoSyncTransforms: 1
m_ReuseCollisionCallbacks: 0

4
ProjectSettings/TagManager.asset

@ -13,8 +13,8 @@ TagManager:
- UI
- marathon
- Ground
-
-
- Body
- Body Ground
-
-
-

Loading…
Cancel
Save