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 13:52:28 +02:00
5 changed files with 37 additions and 19 deletions

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 58f7e79a87c79824597746e8c1bfe400
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: f58d25b9e504a4f41ab4a71cf87c1845
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,5 +1,9 @@
<<<<<<< HEAD <<<<<<< HEAD
{"count":1,"self":54.697376,"total":56.2490324,"children":{"InitializeActuators":{"count":8,"self":0.0015032,"total":0.0015032,"children":null},"InitializeSensors":{"count":8,"self":0.0028936,"total":0.0028936,"children":null},"AgentSendState":{"count":2580,"self":0.1613813,"total":0.21219159999999998,"children":{"CollectObservations":{"count":4128,"self":0.029130899999999998,"total":0.029130899999999998,"children":null},"WriteActionMask":{"count":4128,"self":0.0045593,"total":0.0045593,"children":null},"RequestDecision":{"count":4128,"self":0.0171201,"total":0.0171201,"children":null}}},"DecideAction":{"count":2580,"self":1.1775138,"total":1.1990912,"children":{"RayPerceptionSensor.Perceive":{"count":8256,"self":0.0215774,"total":0.0215774,"children":null}}},"AgentAct":{"count":2580,"self":0.1349573,"total":0.1349573,"children":null}},"gauges":{"Benson Track2.CumulativeReward":{"count":5,"max":25.06042,"min":23.94484,"runningAverage":24.5239849,"value":24.1170235,"weightedAverage":24.5986176}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714131023","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":"1714131080"}}
=======
<<<<<<< HEAD
{"count":1,"self":32.8065536,"total":36.7679407,"children":{"InitializeActuators":{"count":8,"self":0.0040387999999999995,"total":0.0040387999999999995,"children":null},"InitializeSensors":{"count":8,"self":0.0029939999999999997,"total":0.0029939999999999997,"children":null},"AgentSendState":{"count":1587,"self":0.3011096,"total":0.3888908,"children":{"CollectObservations":{"count":2544,"self":0.044843,"total":0.044843,"children":null},"WriteActionMask":{"count":2544,"self":0.0105366,"total":0.0105366,"children":null},"RequestDecision":{"count":2544,"self":0.032401599999999996,"total":0.032401599999999996,"children":null}}},"DecideAction":{"count":1587,"self":3.2400292,"total":3.2936266,"children":{"RayPerceptionSensor.Perceive":{"count":5088,"self":0.053597399999999996,"total":0.053597399999999996,"children":null}}},"AgentAct":{"count":1587,"self":0.2688357,"total":0.2688357,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714130182","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":"ForestRacetrack","end_time_seconds":"1714130219"}} {"count":1,"self":32.8065536,"total":36.7679407,"children":{"InitializeActuators":{"count":8,"self":0.0040387999999999995,"total":0.0040387999999999995,"children":null},"InitializeSensors":{"count":8,"self":0.0029939999999999997,"total":0.0029939999999999997,"children":null},"AgentSendState":{"count":1587,"self":0.3011096,"total":0.3888908,"children":{"CollectObservations":{"count":2544,"self":0.044843,"total":0.044843,"children":null},"WriteActionMask":{"count":2544,"self":0.0105366,"total":0.0105366,"children":null},"RequestDecision":{"count":2544,"self":0.032401599999999996,"total":0.032401599999999996,"children":null}}},"DecideAction":{"count":1587,"self":3.2400292,"total":3.2936266,"children":{"RayPerceptionSensor.Perceive":{"count":5088,"self":0.053597399999999996,"total":0.053597399999999996,"children":null}}},"AgentAct":{"count":1587,"self":0.2688357,"total":0.2688357,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714130182","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":"ForestRacetrack","end_time_seconds":"1714130219"}}
======= =======
{"count":1,"self":8.7055952,"total":8.8210854,"children":{"InitializeActuators":{"count":8,"self":0.0010003,"total":0.0010003,"children":null},"InitializeSensors":{"count":8,"self":0.0035110999999999996,"total":0.0035110999999999996,"children":null},"AgentSendState":{"count":44,"self":0.0055582,"total":0.018727499999999998,"children":{"CollectObservations":{"count":72,"self":0.0019789,"total":0.0019789,"children":null},"WriteActionMask":{"count":72,"self":0,"total":0,"children":null},"RequestDecision":{"count":72,"self":0.0111904,"total":0.0111904,"children":null}}},"DecideAction":{"count":44,"self":0.0842009,"total":0.0842009,"children":{"RayPerceptionSensor.Perceive":{"count":144,"self":0,"total":0,"children":null}}},"AgentAct":{"count":44,"self":0.0080505,"total":0.0080505,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714129909","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":"1714129918"}} {"count":1,"self":8.7055952,"total":8.8210854,"children":{"InitializeActuators":{"count":8,"self":0.0010003,"total":0.0010003,"children":null},"InitializeSensors":{"count":8,"self":0.0035110999999999996,"total":0.0035110999999999996,"children":null},"AgentSendState":{"count":44,"self":0.0055582,"total":0.018727499999999998,"children":{"CollectObservations":{"count":72,"self":0.0019789,"total":0.0019789,"children":null},"WriteActionMask":{"count":72,"self":0,"total":0,"children":null},"RequestDecision":{"count":72,"self":0.0111904,"total":0.0111904,"children":null}}},"DecideAction":{"count":44,"self":0.0842009,"total":0.0842009,"children":{"RayPerceptionSensor.Perceive":{"count":144,"self":0,"total":0,"children":null}}},"AgentAct":{"count":44,"self":0.0080505,"total":0.0080505,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714129909","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":"1714129918"}}
>>>>>>> 8744c617fc8715a42e6dd73e481f756db2205086 >>>>>>> 8744c617fc8715a42e6dd73e481f756db2205086
>>>>>>> 2a3284ac7c7577c027d1ab933ed82def95da0f94

View File

@@ -1 +1,5 @@
<<<<<<< HEAD
{"count":1,"self":62.8884544,"total":70.1115109,"children":{"InitializeActuators":{"count":8,"self":0.0019954,"total":0.0019954,"children":null},"InitializeSensors":{"count":8,"self":0.0019946,"total":0.0019946,"children":null},"AgentSendState":{"count":3220,"self":0.552334,"total":0.68547439999999993,"children":{"CollectObservations":{"count":4528,"self":0.093365599999999993,"total":0.093365599999999993,"children":null},"WriteActionMask":{"count":4528,"self":0.0090262,"total":0.0090262,"children":null},"RequestDecision":{"count":4528,"self":0.030748599999999997,"total":0.030748599999999997,"children":null}}},"DecideAction":{"count":3220,"self":5.991496,"total":6.0915412,"children":{"RayPerceptionSensor.Perceive":{"count":9056,"self":0.1000452,"total":0.1000452,"children":null}}},"AgentAct":{"count":3220,"self":0.439061,"total":0.439061,"children":null}},"gauges":{"Benson Track2.CumulativeReward":{"count":7,"max":25.0725021,"min":22.12662,"runningAverage":24.1589851,"value":22.12662,"weightedAverage":23.7989845}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714132235","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":"1714132305"}} {"count":1,"self":62.8884544,"total":70.1115109,"children":{"InitializeActuators":{"count":8,"self":0.0019954,"total":0.0019954,"children":null},"InitializeSensors":{"count":8,"self":0.0019946,"total":0.0019946,"children":null},"AgentSendState":{"count":3220,"self":0.552334,"total":0.68547439999999993,"children":{"CollectObservations":{"count":4528,"self":0.093365599999999993,"total":0.093365599999999993,"children":null},"WriteActionMask":{"count":4528,"self":0.0090262,"total":0.0090262,"children":null},"RequestDecision":{"count":4528,"self":0.030748599999999997,"total":0.030748599999999997,"children":null}}},"DecideAction":{"count":3220,"self":5.991496,"total":6.0915412,"children":{"RayPerceptionSensor.Perceive":{"count":9056,"self":0.1000452,"total":0.1000452,"children":null}}},"AgentAct":{"count":3220,"self":0.439061,"total":0.439061,"children":null}},"gauges":{"Benson Track2.CumulativeReward":{"count":7,"max":25.0725021,"min":22.12662,"runningAverage":24.1589851,"value":22.12662,"weightedAverage":23.7989845}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714132235","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":"1714132305"}}
=======
{"count":1,"self":118.3093504,"total":120.47375129999999,"children":{"InitializeActuators":{"count":8,"self":0.0010007,"total":0.0010007,"children":null},"InitializeSensors":{"count":8,"self":0.0020283,"total":0.0020283,"children":null},"AgentSendState":{"count":3805,"self":0.20863199999999998,"total":0.2612761,"children":{"CollectObservations":{"count":6088,"self":0.0274956,"total":0.0274956,"children":null},"WriteActionMask":{"count":6088,"self":0.0030364,"total":0.0030364,"children":null},"RequestDecision":{"count":6088,"self":0.0221121,"total":0.0221121,"children":null}}},"DecideAction":{"count":3805,"self":1.6640274,"total":1.6968463999999999,"children":{"RayPerceptionSensor.Perceive":{"count":12176,"self":0.032819,"total":0.032819,"children":null}}},"AgentAct":{"count":3805,"self":0.2032522,"total":0.2032522,"children":null}},"gauges":{"Benson Track2.CumulativeReward":{"count":7,"max":25.4471169,"min":20.8521976,"runningAverage":23.9435921,"value":20.8521976,"weightedAverage":23.3001652}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714131242","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":"1714131362"}}
>>>>>>> 23741185380f7778b00d611454fce53c4797cce1

View File

@@ -33,7 +33,7 @@ public class GameManager : MonoBehaviour
for (int i = 0; i < players.Count(); i++) for (int i = 0; i < players.Count(); i++)
{ {
playerTimes[i] = 0.00000001f; playerTimes[i] = 0.00000001f;
playerTimesStr[i] = "DNF"; playerTimesStr[i] = "0";
} }
DontDestroyOnLoad(gameObject); DontDestroyOnLoad(gameObject);
@@ -42,8 +42,6 @@ public class GameManager : MonoBehaviour
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
print("playersfinished: " + playersFinished.Count());
for (int i = 0; i < players.Count(); i++) for (int i = 0; i < players.Count(); i++)
{ {
GameObject player = players[i]; GameObject player = players[i];
@@ -81,7 +79,10 @@ public class GameManager : MonoBehaviour
if (checkpointsCollected == checkpoints.Count()) if (checkpointsCollected == checkpoints.Count())
{ {
player.GetComponent<PlayerController>().checkpointsCollected = 0; player.GetComponent<PlayerController>().checkpointsCollected = 0;
playerLaps[i] += 1; playerLaps[i] += 1;
if (playerLaps[i] < lapAmount)
lapCounter.text = "Lap count: " + playerLaps[i]; lapCounter.text = "Lap count: " + playerLaps[i];
} }
@@ -118,6 +119,29 @@ public class GameManager : MonoBehaviour
// race finished // race finished
if (playersFinished.Count() == players.Count()) if (playersFinished.Count() == players.Count())
{ {
// sort array
float[] fTimes = new float[players.Count()];
for (int i = 0; i < players.Count(); i++)
{
fTimes[i] = float.Parse(playerTimesStr[i]);
}
Array.Sort(fTimes);
for (int i = 0; i < players.Count(); i++)
{
playerTimesStr[i] = fTimes[i].ToString();
try
{
playerTimesStr[i] = playerTimesStr[i].Substring(0, 7);
}
catch
{
}
}
SceneManager.LoadScene("WinScreen"); SceneManager.LoadScene("WinScreen");
} }