Merge branch 'master' of git@ooftooft.net:Racesm.git

# Conflicts:
#	Assets/ML-Agents/Timers/WinScreen_timers.json
This commit is contained in:
magn9775
2024-04-26 14:35:30 +02:00
4 changed files with 47 additions and 8 deletions

View File

@@ -1 +1 @@
{"count":1,"self":7.7646456,"total":7.8548963,"children":{"InitializeActuators":{"count":8,"self":0.0035095,"total":0.0035095,"children":null},"InitializeSensors":{"count":8,"self":0.0035093999999999998,"total":0.0035093999999999998,"children":null},"AgentSendState":{"count":1,"self":0.0090396,"total":0.0199904,"children":{"CollectObservations":{"count":8,"self":0,"total":0,"children":null},"WriteActionMask":{"count":8,"self":0,"total":0,"children":null},"RequestDecision":{"count":8,"self":0.0109508,"total":0.0109508,"children":null}}},"DecideAction":{"count":1,"self":0.0632417,"total":0.0632417,"children":{"RayPerceptionSensor.Perceive":{"count":16,"self":0,"total":0,"children":null}}},"AgentAct":{"count":1,"self":0,"total":0,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714132819","unity_version":"2022.3.11f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.11f1\\Editor\\Unity.exe -projectpath C:\\Users\\noahk\\Documents\\Unity projects\\Racesm -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-noahk -hubSessionId a6f45e0e-41b6-4c96-a70e-ec8e10ca5aa9 -accessToken LhF-MiZYoHmiI2p1_6JvQZvJ6QUPd4VyLbrTbhNHTT8005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"ForestRacetrack","end_time_seconds":"1714132827"}}
{"count":1,"self":111.73324799999999,"total":115.3655125,"children":{"InitializeActuators":{"count":8,"self":0.0010012999999999999,"total":0.0010012999999999999,"children":null},"InitializeSensors":{"count":8,"self":0.0015026,"total":0.0015026,"children":null},"AgentSendState":{"count":5535,"self":0.3819255,"total":0.4813301,"children":{"CollectObservations":{"count":8856,"self":0.055236799999999996,"total":0.055236799999999996,"children":null},"WriteActionMask":{"count":8856,"self":0.0010157999999999999,"total":0.0010157999999999999,"children":null},"RequestDecision":{"count":8856,"self":0.043151999999999996,"total":0.043151999999999996,"children":null}}},"DecideAction":{"count":5535,"self":2.6350796,"total":2.6868285,"children":{"RayPerceptionSensor.Perceive":{"count":17712,"self":0.0517488,"total":0.0517488,"children":null}}},"AgentAct":{"count":5535,"self":0.4606065,"total":0.4606065,"children":null}},"gauges":{"Benson Track2.CumulativeReward":{"count":13,"max":25.5656662,"min":21.4600677,"runningAverage":23.7516136,"value":25.0143127,"weightedAverage":23.9939575}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714134391","unity_version":"2022.3.11f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.11f1\\Editor\\Unity.exe -projectpath C:\\Users\\noahk\\Documents\\Unity projects\\Racesm -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-noahk -hubSessionId a6f45e0e-41b6-4c96-a70e-ec8e10ca5aa9 -accessToken LhF-MiZYoHmiI2p1_6JvQZvJ6QUPd4VyLbrTbhNHTT8005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"ForestRacetrack","end_time_seconds":"1714134506"}}

View File

@@ -1 +1,5 @@
{"count":1,"self":143.99398399999998,"total":158.9544038,"children":{"InitializeActuators":{"count":8,"self":0.0019890999999999997,"total":0.0019890999999999997,"children":null},"InitializeSensors":{"count":8,"self":0.0019927,"total":0.0019927,"children":null},"AgentSendState":{"count":7618,"self":1.1591486,"total":1.4356867,"children":{"CollectObservations":{"count":9544,"self":0.1744258,"total":0.1744258,"children":null},"WriteActionMask":{"count":9544,"self":0.0269984,"total":0.0269984,"children":null},"RequestDecision":{"count":9544,"self":0.0751139,"total":0.0751139,"children":null}}},"DecideAction":{"count":7618,"self":12.356396799999999,"total":12.5554197,"children":{"RayPerceptionSensor.Perceive":{"count":19088,"self":0.19902319999999998,"total":0.19902319999999998,"children":null}}},"AgentAct":{"count":7618,"self":0.96334409999999993,"total":0.96334409999999993,"children":null}},"gauges":{"Benson Track2.CumulativeReward":{"count":17,"max":25.4505177,"min":22.522934,"runningAverage":24.4887524,"value":25.4505177,"weightedAverage":25.1389389}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714134194","unity_version":"2022.3.11f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.11f1\\Editor\\Unity.exe -projectpath C:\\Users\\Magnus\\Desktop\\Ny unityting\\Racesm -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-Magnus -hubSessionId 8c17471b-7795-4082-905c-75744d6a077b -accessToken hv3zp4IA8nxcowfZc35r5tDHrlmzUZoExTBgESksngo005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"WinScreen","end_time_seconds":"1714134353"}}
<<<<<<< HEAD
{"count":1,"self":143.99398399999998,"total":158.9544038,"children":{"InitializeActuators":{"count":8,"self":0.0019890999999999997,"total":0.0019890999999999997,"children":null},"InitializeSensors":{"count":8,"self":0.0019927,"total":0.0019927,"children":null},"AgentSendState":{"count":7618,"self":1.1591486,"total":1.4356867,"children":{"CollectObservations":{"count":9544,"self":0.1744258,"total":0.1744258,"children":null},"WriteActionMask":{"count":9544,"self":0.0269984,"total":0.0269984,"children":null},"RequestDecision":{"count":9544,"self":0.0751139,"total":0.0751139,"children":null}}},"DecideAction":{"count":7618,"self":12.356396799999999,"total":12.5554197,"children":{"RayPerceptionSensor.Perceive":{"count":19088,"self":0.19902319999999998,"total":0.19902319999999998,"children":null}}},"AgentAct":{"count":7618,"self":0.96334409999999993,"total":0.96334409999999993,"children":null}},"gauges":{"Benson Track2.CumulativeReward":{"count":17,"max":25.4505177,"min":22.522934,"runningAverage":24.4887524,"value":25.4505177,"weightedAverage":25.1389389}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714134194","unity_version":"2022.3.11f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.11f1\\Editor\\Unity.exe -projectpath C:\\Users\\Magnus\\Desktop\\Ny unityting\\Racesm -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-Magnus -hubSessionId 8c17471b-7795-4082-905c-75744d6a077b -accessToken hv3zp4IA8nxcowfZc35r5tDHrlmzUZoExTBgESksngo005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"WinScreen","end_time_seconds":"1714134353"}}
=======
{"count":1,"self":92.310976,"total":94.7386543,"children":{"InitializeActuators":{"count":8,"self":0.0010216,"total":0.0010216,"children":null},"InitializeSensors":{"count":8,"self":0.0020005,"total":0.0020005,"children":null},"AgentSendState":{"count":3706,"self":0.2585523,"total":0.33199409999999996,"children":{"CollectObservations":{"count":5928,"self":0.0394114,"total":0.0394114,"children":null},"WriteActionMask":{"count":5928,"self":0.0065324,"total":0.0065324,"children":null},"RequestDecision":{"count":5928,"self":0.027497999999999998,"total":0.027497999999999998,"children":null}}},"DecideAction":{"count":3706,"self":1.7604408,"total":1.7950252999999998,"children":{"RayPerceptionSensor.Perceive":{"count":11856,"self":0.0345845,"total":0.0345845,"children":null}}},"AgentAct":{"count":3706,"self":0.2966395,"total":0.2966395,"children":null}},"gauges":{"Benson Track2.CumulativeReward":{"count":6,"max":25.4789715,"min":19.6162643,"runningAverage":22.84457,"value":23.53373,"weightedAverage":22.6495037}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714133850","unity_version":"2022.3.11f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.11f1\\Editor\\Unity.exe -projectpath C:\\Users\\noahk\\Documents\\Unity projects\\Racesm -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-noahk -hubSessionId a6f45e0e-41b6-4c96-a70e-ec8e10ca5aa9 -accessToken LhF-MiZYoHmiI2p1_6JvQZvJ6QUPd4VyLbrTbhNHTT8005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"WinScreen","end_time_seconds":"1714133945"}}
>>>>>>> eff1287fab0ecb324ff936e15a760c9019747146

View File

@@ -583,7 +583,7 @@ RectTransform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 287191329}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
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
@@ -592,7 +592,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 150, y: 120}
m_AnchoredPosition: {x: 150, y: 2.5}
m_SizeDelta: {x: 250, y: 150}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &287191331
@@ -1092,7 +1092,7 @@ RectTransform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 521052946}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
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
@@ -1101,7 +1101,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -150, y: 120}
m_AnchoredPosition: {x: -150, y: 2.5}
m_SizeDelta: {x: 250, y: 150}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &521052948
@@ -2838,8 +2838,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -610, y: 0}
m_SizeDelta: {x: -1320, y: -600}
m_AnchoredPosition: {x: -610, y: 117.499985}
m_SizeDelta: {x: -1320, y: -835}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1526088043
MonoBehaviour:

View File

@@ -16,6 +16,9 @@ public class PlayerController : MonoBehaviour
public Rigidbody rigidBody;
[HideInInspector] public int checkpointsCollected = 0;
public GameObject[] checkpoints;
Vector3 startPosition;
Quaternion startRotation;
KeyCode resetCarKey = KeyCode.Backspace;
// Start is called before the first frame update
void Start()
@@ -24,6 +27,9 @@ public class PlayerController : MonoBehaviour
{
rigidBody = GetComponent<Rigidbody> ();
}
startPosition = transform.position;
startRotation = transform.rotation;
// Find all child GameObjects that have the WheelControl script attached
@@ -128,6 +134,35 @@ public class PlayerController : MonoBehaviour
float checkpintDistance = distanceToCheckpoint(currentCheckpoint);
// send back to previous checkpoint if stuck
if (Input.GetKeyDown(resetCarKey))
{
if (checkpointsCollected == 0)
{
transform.position = startPosition;
transform.rotation = startRotation;
}
else
{
transform.position = new Vector3(
checkpoints[checkpointsCollected - 1].transform.position.x,
transform.position.y + 3,
checkpoints[checkpointsCollected - 1].transform.position.z
);
transform.eulerAngles = new Vector3(
transform.eulerAngles.x,
checkpoints[checkpointsCollected - 1].transform.eulerAngles.y,
transform.eulerAngles.z
);
}
}
if (checkpintDistance < 0.2f)
{
checkpointsCollected += 1;