Merge branch 'master' of git@ooftooft.net:Racesm.git
This commit is contained in:
BIN
Assets/Brains/BensonImitationV3.onnx
Normal file
BIN
Assets/Brains/BensonImitationV3.onnx
Normal file
Binary file not shown.
16
Assets/Brains/BensonImitationV3.onnx.meta
Normal file
16
Assets/Brains/BensonImitationV3.onnx.meta
Normal file
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d616899359e594c45a68f837475f54bb
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 683b6cb6d0a474744822c888b46772c9, type: 3}
|
||||
optimizeModel: 1
|
||||
forceArbitraryBatchSize: 1
|
||||
treatErrorsAsWarnings: 0
|
||||
importMode: 1
|
||||
weightsTypeMode: 0
|
||||
activationTypeMode: 0
|
||||
@@ -1,104 +0,0 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
public class WelcomeWindow : EditorWindow
|
||||
{
|
||||
private GUIStyle textureButton;
|
||||
private GUIStyle headingText;
|
||||
private GUIStyle commonText;
|
||||
|
||||
private Texture2D top;
|
||||
|
||||
private Texture2D image1;
|
||||
|
||||
private Texture2D linkButton;
|
||||
|
||||
private Texture2D logo;
|
||||
|
||||
private Vector2 scrollIndex;
|
||||
|
||||
[UnityEditor.Callbacks.DidReloadScripts]
|
||||
private static void OpenWindowOnUnityStart()
|
||||
{
|
||||
if (EditorApplication.isPlayingOrWillChangePlaymode)
|
||||
return;
|
||||
|
||||
OpenWindow();
|
||||
}
|
||||
|
||||
[MenuItem("Tools/EmaceArt/Welcome Window")]
|
||||
private static void OpenWindow()
|
||||
{
|
||||
EditorWindow panel = GetWindow<WelcomeWindow>();
|
||||
panel.titleContent = new GUIContent("Hello Developer!", Resources.Load<Texture2D>("Favi_top"));
|
||||
// panel.minSize = new Vector2(600, Mathf.Min(Screen.currentResolution.height, 862));
|
||||
// panel.maxSize = new Vector2(600, Mathf.Min(Screen.currentResolution.height, 862));
|
||||
//panel.ShowUtility();
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
var style = Resources.Load<GUISkin>("GUISkin");
|
||||
textureButton = style.GetStyle("textureButton");
|
||||
headingText = style.GetStyle("headingText");
|
||||
commonText = style.GetStyle("commonText");
|
||||
|
||||
top = Resources.Load<Texture2D>("EA_Top");
|
||||
|
||||
image1 = Resources.Load<Texture2D>("Btn_01");
|
||||
|
||||
linkButton = Resources.Load<Texture2D>("button_free_zone");
|
||||
|
||||
logo = Resources.Load<Texture2D>("Logo");
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
scrollIndex = GUILayout.BeginScrollView(scrollIndex);
|
||||
GUILayout.BeginVertical();
|
||||
|
||||
DrawHeader();
|
||||
GUILayout.Space(20f);
|
||||
DrawBody();
|
||||
GUILayout.Space(20f);
|
||||
DrawFooter();
|
||||
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.EndScrollView();
|
||||
}
|
||||
|
||||
private void DrawHeader()
|
||||
{
|
||||
if (GUILayout.Button(top, textureButton))
|
||||
Application.OpenURL("https://assetstore.unity.com/packages/3d/environments/fantasy/slavic-medieval-village-town-interior-and-exterior-pack-environm-137794");
|
||||
}
|
||||
|
||||
private void DrawBody()
|
||||
{
|
||||
GUILayout.Label("Thanks for checkin Slavica Lite", headingText);
|
||||
GUILayout.Space(1f);
|
||||
GUILayout.Label("This pack perfect match with the Medieval Slavica Town Full!", commonText);
|
||||
GUILayout.Space(20f);
|
||||
|
||||
if (GUILayout.Button(image1, textureButton))
|
||||
Application.OpenURL("https://assetstore.unity.com/packages/3d/environments/fantasy/slavic-medieval-village-town-interior-and-exterior-pack-environm-137794");
|
||||
}
|
||||
|
||||
private void DrawFooter()
|
||||
{
|
||||
GUILayout.BeginHorizontal();
|
||||
if (GUILayout.Button(logo, textureButton))
|
||||
Application.OpenURL("https://www.emaceart.com");
|
||||
|
||||
GUILayout.BeginVertical();
|
||||
GUILayout.Space(10f);
|
||||
GUILayout.Label("Visit my free zone. If you like this content, don't forget leave review :)", commonText);
|
||||
GUILayout.Space(10f);
|
||||
if (GUILayout.Button(linkButton, textureButton))
|
||||
Application.OpenURL("https://assetstore.unity.com/lists/free-zone-178789");
|
||||
|
||||
GUILayout.EndVertical();
|
||||
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 15e5888e5fc5cbe4cbe94ecca9240790
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,6 +0,0 @@
|
||||
Thanks for download!
|
||||
This pack of assets belongs to my other huge pack, which I encourage to buy!
|
||||
|
||||
https://assetstore.unity.com/packages/3d/environments/fantasy/slavic-medieval-village-town-interior-and-exterior-pack-environm-137794
|
||||
|
||||
If you have any questions, or request of additional models, fell free to email me at CONTACT@EMACEART.COM
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3c85e6a8b5d07b545988a6efab51a32e
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d884527f3e242c144af52b11faf49d2f
|
||||
guid: 58f7e79a87c79824597746e8c1bfe400
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4fa517224fb5c15469ddaafdf4a94068
|
||||
guid: f58d25b9e504a4f41ab4a71cf87c1845
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
@@ -1 +1 @@
|
||||
{"count":1,"self":309.6612096,"total":311.8317685,"children":{"InitializeActuators":{"count":1,"self":0.0015026999999999998,"total":0.0015026999999999998,"children":null},"InitializeSensors":{"count":1,"self":0.0020054,"total":0.0020054,"children":null},"AgentSendState":{"count":15319,"self":1.2925794,"total":1.8818713,"children":{"CollectObservations":{"count":15319,"self":0.3923006,"total":0.3923006,"children":null},"WriteActionMask":{"count":15319,"self":0.0248735,"total":0.0248735,"children":null},"RequestDecision":{"count":15319,"self":0.085557,"total":0.1400864,"children":{"RayPerceptionSensor.Perceive":{"count":30638,"self":0.0545294,"total":0.0545294,"children":null}}},"RayPerceptionSensor.Perceive":{"count":30636,"self":0.0320314,"total":0.0320314,"children":null}}},"DecideAction":{"count":15319,"self":0.0765185,"total":0.0765185,"children":null},"AgentAct":{"count":15319,"self":0.2076653,"total":0.2076653,"children":{"RayPerceptionSensor.Perceive":{"count":36,"self":0,"total":0,"children":null}}}},"gauges":{"BensonImitationV3.CumulativeReward":{"count":9,"max":24.016304,"min":7.681255,"runningAverage":20.2167473,"value":23.9503059,"weightedAverage":21.3022}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1712925366","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 9ca26982-a0f6-4127-8a14-962f9b9ca2ae -accessToken Uz6Elw7wQ8JPvtO_g14OUcqdUTEXpflxltMduak3nKQ005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"AI training","end_time_seconds":"1712925678"}}
|
||||
{"count":1,"self":37.447126399999995,"total":38.1944854,"children":{"InitializeActuators":{"count":1,"self":0.0025220999999999998,"total":0.0025220999999999998,"children":null},"InitializeSensors":{"count":1,"self":0.0015034,"total":0.0015034,"children":null},"AgentSendState":{"count":1670,"self":0.10014859999999999,"total":0.668503,"children":{"CollectObservations":{"count":1670,"self":0.54390779999999994,"total":0.54390779999999994,"children":null},"WriteActionMask":{"count":1670,"self":0.0030217,"total":0.0030217,"children":null},"RequestDecision":{"count":1670,"self":0.012055399999999999,"total":0.0214249,"children":{"RayPerceptionSensor.Perceive":{"count":3340,"self":0.0093695,"total":0.0093695,"children":null}}}}},"DecideAction":{"count":1670,"self":0.0163969,"total":0.0163969,"children":null},"AgentAct":{"count":1670,"self":0.056928099999999995,"total":0.056928099999999995,"children":{"RayPerceptionSensor.Perceive":{"count":4,"self":0,"total":0,"children":null}}}},"gauges":{"BensonV4.CumulativeReward":{"count":2,"max":24.2291832,"min":23.1571674,"runningAverage":23.6931763,"value":24.2291832,"weightedAverage":23.42517}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1713519122","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 4068a663-bd5e-4526-907d-88111baad304 -accessToken lEnHrjqkaCSQA7MdFiPPC8yoqdYZh4_FAtRTqZKLQPI005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"AI training","end_time_seconds":"1713519160"}}
|
||||
@@ -1,6 +1,6 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &3959557473817272857
|
||||
--- !u!1 &7234834637752836426
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
@@ -8,47 +8,48 @@ GameObject:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 257965083965449723}
|
||||
- component: {fileID: 2670097205243573776}
|
||||
- component: {fileID: 5347261225699996736}
|
||||
- component: {fileID: 8320126915491364009}
|
||||
- component: {fileID: 1288577159706020061}
|
||||
- component: {fileID: 471271415023977368}
|
||||
- component: {fileID: 1915818325675539370}
|
||||
- component: {fileID: 3466260334280045808}
|
||||
- component: {fileID: 5655726606384773670}
|
||||
m_Layer: 0
|
||||
m_Name: model
|
||||
m_Name: CheckPoint
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &257965083965449723
|
||||
--- !u!4 &1288577159706020061
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3959557473817272857}
|
||||
m_GameObject: {fileID: 7234834637752836426}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
|
||||
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 30, y: 1, z: 30}
|
||||
m_LocalScale: {x: 7.5, y: 0.25, z: 7.5}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1288577159706020061}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
|
||||
--- !u!33 &2670097205243573776
|
||||
--- !u!33 &471271415023977368
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3959557473817272857}
|
||||
m_GameObject: {fileID: 7234834637752836426}
|
||||
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &5347261225699996736
|
||||
--- !u!23 &1915818325675539370
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3959557473817272857}
|
||||
m_GameObject: {fileID: 7234834637752836426}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
@@ -84,13 +85,13 @@ MeshRenderer:
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!65 &8320126915491364009
|
||||
--- !u!65 &3466260334280045808
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3959557473817272857}
|
||||
m_GameObject: {fileID: 7234834637752836426}
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
@@ -105,35 +106,16 @@ BoxCollider:
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 1.0000001, y: 2.0000005, z: 1.0000005}
|
||||
m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940699}
|
||||
--- !u!1 &7234834637752836426
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1288577159706020061}
|
||||
m_Layer: 0
|
||||
m_Name: CheckPoint
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1288577159706020061
|
||||
Transform:
|
||||
--- !u!114 &5655726606384773670
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7234834637752836426}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 48.319576, y: 2.6632206, z: -37.745872}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 257965083965449723}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5cb7e797faf91a145ace5b3e5953a682, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
isCollected: 0
|
||||
|
||||
@@ -82,7 +82,6 @@ Transform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 2089599405993210120}
|
||||
- {fileID: 6910657865482355608}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1001 &517737349064952996
|
||||
@@ -1249,80 +1248,6 @@ Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 1279437348525638701, guid: e2e682b966e3f644392ffbfab511e0e2, type: 3}
|
||||
m_PrefabInstance: {fileID: 6134520914307201963}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &6914808702520983802
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 4410338557763827223}
|
||||
m_Modifications:
|
||||
- target: {fileID: 1685004736896436, guid: 8d0bec0dc9ff9204bb3391cc6cb2c885, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: EA03_Prop_Pier_03d_PRE
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4999849139159906, guid: 8d0bec0dc9ff9204bb3391cc6cb2c885, type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4999849139159906, guid: 8d0bec0dc9ff9204bb3391cc6cb2c885, type: 3}
|
||||
propertyPath: m_LocalScale.y
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4999849139159906, guid: 8d0bec0dc9ff9204bb3391cc6cb2c885, type: 3}
|
||||
propertyPath: m_LocalScale.z
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4999849139159906, guid: 8d0bec0dc9ff9204bb3391cc6cb2c885, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: -66.6138
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4999849139159906, guid: 8d0bec0dc9ff9204bb3391cc6cb2c885, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: -17.81
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4999849139159906, guid: 8d0bec0dc9ff9204bb3391cc6cb2c885, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 18.163359
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4999849139159906, guid: 8d0bec0dc9ff9204bb3391cc6cb2c885, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 0.3226137
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4999849139159906, guid: 8d0bec0dc9ff9204bb3391cc6cb2c885, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4999849139159906, guid: 8d0bec0dc9ff9204bb3391cc6cb2c885, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0.9465307
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4999849139159906, guid: 8d0bec0dc9ff9204bb3391cc6cb2c885, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: -0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4999849139159906, guid: 8d0bec0dc9ff9204bb3391cc6cb2c885, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4999849139159906, guid: 8d0bec0dc9ff9204bb3391cc6cb2c885, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 142.358
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4999849139159906, guid: 8d0bec0dc9ff9204bb3391cc6cb2c885, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 8d0bec0dc9ff9204bb3391cc6cb2c885, type: 3}
|
||||
--- !u!4 &6910657865482355608 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 4999849139159906, guid: 8d0bec0dc9ff9204bb3391cc6cb2c885, type: 3}
|
||||
m_PrefabInstance: {fileID: 6914808702520983802}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &7665355901869235984
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9b8c300fd72328743893f6c3a05071cc
|
||||
guid: dd1c964ebcc644242b0798f3cdc71e51
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -496,6 +496,7 @@ RectTransform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1429604867}
|
||||
- {fileID: 1303067121}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
@@ -728,12 +729,12 @@ Transform:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1303067118}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: -960, y: -540, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_Father: {fileID: 1032240017}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1303067122
|
||||
MonoBehaviour:
|
||||
@@ -749,6 +750,7 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
car: {fileID: 86731284}
|
||||
carRB: {fileID: 86731289}
|
||||
speedometer: {fileID: 0}
|
||||
--- !u!1 &1429604866
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -774,7 +776,7 @@ RectTransform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1429604866}
|
||||
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
|
||||
@@ -806,7 +808,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text:
|
||||
m_text: L
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
@@ -1170,7 +1172,6 @@ SceneRoots:
|
||||
- {fileID: 8222889276702183714}
|
||||
- {fileID: 2034582631126909176}
|
||||
- {fileID: 1032240017}
|
||||
- {fileID: 1303067121}
|
||||
- {fileID: 437868554}
|
||||
- {fileID: 467812079}
|
||||
- {fileID: 1239887511}
|
||||
|
||||
@@ -115,6 +115,9 @@ public class AgentController : Agent
|
||||
|
||||
public override void OnActionReceived(ActionBuffers actions)
|
||||
{
|
||||
|
||||
print("L");
|
||||
|
||||
// Actions size = 2 [vertical speed, horizontal speed] = [-1..1, -1..1] // discrete = [{0, 1, 2}, {0, 1, 2}] = [{-1, 0, 1}...]
|
||||
float vInput = 0;
|
||||
float hInput = 0;
|
||||
@@ -133,7 +136,7 @@ public class AgentController : Agent
|
||||
|
||||
if (vInput == 1f)
|
||||
{
|
||||
AddReward(0.001f);
|
||||
AddReward(0.02f);
|
||||
}
|
||||
|
||||
// give benson mental pain for existing (punishment for maximizing first checkpoint by standing still)
|
||||
226
Assets/Scripts/AgentControllerV4.cs
Normal file
226
Assets/Scripts/AgentControllerV4.cs
Normal file
@@ -0,0 +1,226 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Unity.MLAgents;
|
||||
using Unity.MLAgents.Sensors;
|
||||
using Unity.MLAgents.Actuators;
|
||||
using UnityEngine.UIElements;
|
||||
using System.Linq;
|
||||
using Unity.Mathematics;
|
||||
using Unity.VisualScripting;
|
||||
using System.Reflection;
|
||||
using System;
|
||||
|
||||
public class AgentControllerV4 : Agent
|
||||
{
|
||||
public float motorForce = 300;
|
||||
public float brakeForce = 500;
|
||||
public float maxSpeed = 400;
|
||||
public float steeringRange = 9;
|
||||
Rigidbody rigidBody;
|
||||
public List<GameObject> checkpoints;
|
||||
Vector3 startPosition;
|
||||
Quaternion startRotation;
|
||||
int currentStep = 0;
|
||||
int stepsSinceCheckpoint = 0;
|
||||
public int maxStepsPerCheckpoint = 300;
|
||||
public int distanceBetweenCheckpoints;
|
||||
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
rigidBody = GetComponent<Rigidbody>();
|
||||
// Find all child GameObjects that have the WheelControl script attached
|
||||
startPosition = transform.localPosition;
|
||||
startRotation = transform.localRotation;
|
||||
}
|
||||
|
||||
public override void OnEpisodeBegin()
|
||||
{
|
||||
stepsSinceCheckpoint = 0;
|
||||
|
||||
// reset car
|
||||
transform.localPosition = startPosition;
|
||||
transform.localRotation = startRotation;
|
||||
rigidBody.velocity = Vector3.zero;
|
||||
rigidBody.angularVelocity = Vector3.zero;
|
||||
|
||||
// reset checkpoints
|
||||
foreach (GameObject checkpoint in checkpoints)
|
||||
{
|
||||
checkpoint.GetComponent<Checkpoint>().isCollected = false;
|
||||
}
|
||||
}
|
||||
|
||||
public override void CollectObservations(VectorSensor sensor)
|
||||
{
|
||||
Transform currentCheckpoint = checkpoints[0].transform;
|
||||
foreach (GameObject checkpoint in checkpoints)
|
||||
{
|
||||
bool isCollected = checkpoint.GetComponent<Checkpoint>().isCollected;
|
||||
|
||||
if (!isCollected)
|
||||
{
|
||||
currentCheckpoint = checkpoint.transform;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
print(transform.rotation.y);
|
||||
sensor.AddObservation(transform.rotation.y);
|
||||
|
||||
Vector3 position = transform.localPosition;
|
||||
Vector3 checkpointPosition = currentCheckpoint.localPosition;
|
||||
|
||||
Vector2 toCheckpoint = new Vector2(
|
||||
checkpointPosition.x - position.x,
|
||||
checkpointPosition.z - position.z
|
||||
);
|
||||
|
||||
sensor.AddObservation(toCheckpoint.normalized);
|
||||
sensor.AddObservation(toCheckpoint.magnitude);
|
||||
|
||||
var FullVelocityMagnitude = rigidBody.velocity.magnitude; // Velocity including angular velocity
|
||||
var angularMagnitude = rigidBody.angularVelocity.magnitude;
|
||||
|
||||
var forwardMagnitude = Mathf.Sqrt( Mathf.Pow(FullVelocityMagnitude, 2) - Mathf.Pow(angularMagnitude, 2)); // Agent velocity in forward direction
|
||||
|
||||
if (forwardMagnitude >= 0.001)
|
||||
sensor.AddObservation(forwardMagnitude);
|
||||
else
|
||||
sensor.AddObservation(FullVelocityMagnitude);
|
||||
|
||||
sensor.AddObservation(angularMagnitude);
|
||||
|
||||
}
|
||||
|
||||
public override void OnActionReceived(ActionBuffers actions)
|
||||
{
|
||||
// Actions size = 2 [vertical speed, horizontal speed] = [-1..1, -1..1] // discrete = [{0, 1, 2}, {0, 1, 2}] = [{-1, 0, 1}...]
|
||||
float vInput = 0;
|
||||
float hInput = 0;
|
||||
|
||||
if (actions.DiscreteActions[0] == 0)
|
||||
vInput = -1f;
|
||||
if (actions.DiscreteActions[0] == 1)
|
||||
vInput = 1f;
|
||||
|
||||
if (actions.DiscreteActions[1] == 0)
|
||||
hInput = -1f;
|
||||
if (actions.DiscreteActions[1] == 1)
|
||||
hInput = 1f;
|
||||
|
||||
// reward for going forward
|
||||
|
||||
// if (vInput == 1f)
|
||||
// {
|
||||
// AddReward(0.02f);
|
||||
// }
|
||||
|
||||
// give benson mental pain for existing (punishment for maximizing first checkpoint by standing still)
|
||||
AddReward(-0.002f);
|
||||
|
||||
Vector3 movementForce = vInput * motorForce * transform.forward;
|
||||
float carAngle = transform.rotation.eulerAngles.y + steeringRange * hInput;
|
||||
|
||||
float x = transform.rotation.eulerAngles.x;
|
||||
float z = transform.rotation.eulerAngles.z;
|
||||
|
||||
transform.rotation = Quaternion.Euler(x, carAngle, z);
|
||||
|
||||
rigidBody.AddForce(movementForce, ForceMode.Impulse);
|
||||
|
||||
// rewards
|
||||
Transform currentCheckpoint = checkpoints[0].transform;
|
||||
foreach (GameObject checkpoint in checkpoints)
|
||||
{
|
||||
bool isCollected = checkpoint.GetComponent<Checkpoint>().isCollected;
|
||||
|
||||
if (!isCollected)
|
||||
{
|
||||
currentCheckpoint = checkpoint.transform;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
float checkpintDistance = distanceToCheckpoint(currentCheckpoint);
|
||||
|
||||
float reward = (1 - Mathf.InverseLerp(0, distanceBetweenCheckpoints, checkpintDistance)) / 1000;
|
||||
|
||||
AddReward(reward);
|
||||
|
||||
if (checkpintDistance < 0.1f)
|
||||
{
|
||||
currentCheckpoint.GetComponent<Checkpoint>().isCollected = true;
|
||||
stepsSinceCheckpoint = 0;
|
||||
|
||||
if (currentCheckpoint == checkpoints[checkpoints.Count - 1].transform)
|
||||
{
|
||||
AddReward(10f);
|
||||
EndEpisode();
|
||||
}
|
||||
AddReward(1.0f);
|
||||
}
|
||||
|
||||
currentStep += 1;
|
||||
stepsSinceCheckpoint += 1;
|
||||
|
||||
if (stepsSinceCheckpoint >= maxStepsPerCheckpoint)
|
||||
{
|
||||
stepsSinceCheckpoint = 0;
|
||||
EndEpisode();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Heuristic(in ActionBuffers actionsOut)
|
||||
{
|
||||
var discreteActionsOut = actionsOut.DiscreteActions;
|
||||
|
||||
discreteActionsOut[0] = 2;
|
||||
discreteActionsOut[1] = 2;
|
||||
|
||||
if (Input.GetAxis("Vertical") < -0.5)
|
||||
discreteActionsOut[0] = 0;
|
||||
if (Input.GetAxis("Vertical") > 0.5)
|
||||
discreteActionsOut[0] = 1;
|
||||
|
||||
if (Input.GetAxis("Horizontal") < -0.5)
|
||||
discreteActionsOut[1] = 0;
|
||||
if (Input.GetAxis("Horizontal") > 0.5)
|
||||
discreteActionsOut[1] = 1;
|
||||
}
|
||||
|
||||
// finds distance from agent to closest point on the checkpoint line
|
||||
float distanceToCheckpoint(Transform checkpoint)
|
||||
{
|
||||
var closestPoint = checkpoint.GetComponent<Collider>().ClosestPointOnBounds(transform.position);
|
||||
var distanceToCheckpoint = Vector3.Distance(transform.position, closestPoint);
|
||||
return distanceToCheckpoint;
|
||||
}
|
||||
|
||||
// find angle from agent to middle of checkpoint line.
|
||||
float angleToCheckpoint(Transform checkpoint)
|
||||
{
|
||||
Vector3 checkpointDirection = checkpoint.localPosition - transform.localPosition;
|
||||
|
||||
float angle = Vector3.SignedAngle(transform.forward, checkpointDirection, Vector3.up);
|
||||
return angle;
|
||||
}
|
||||
|
||||
// punishment for hitting a wall
|
||||
private void OnCollisionEnter(Collision other) {
|
||||
if (other.gameObject.tag == "Wall")
|
||||
{
|
||||
AddReward(-0.05f);
|
||||
}
|
||||
}
|
||||
|
||||
// punishment for staying at a wall
|
||||
private void OnCollisionStay(Collision other) {
|
||||
if (other.gameObject.tag == "Wall")
|
||||
{
|
||||
AddReward(-0.05f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a23c7d66d3ff94847a946cf7b30ca1b7
|
||||
guid: f5cda3de98f45464999f00bdd795f2a0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -1,44 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CarControl : MonoBehaviour
|
||||
{
|
||||
|
||||
public float motorTorque = 2000;
|
||||
public float maxSpeed = 20;
|
||||
public float steeringRange = 30;
|
||||
//public float steeringRangeAtMaxSpeed = 10;
|
||||
WheelControl[] wheels;
|
||||
Rigidbody rigidBody;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
rigidBody = GetComponent<Rigidbody>();
|
||||
|
||||
// Find all child GameObjects that have the WheelControl script attached
|
||||
wheels = GetComponentsInChildren<WheelControl>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void FixedUpdate()
|
||||
{
|
||||
float vInput = Input.GetAxis("Vertical");
|
||||
float hInput = Input.GetAxis("Horizontal");
|
||||
|
||||
foreach (var wheel in wheels)
|
||||
{
|
||||
// Apply steering to Wheel colliders that have "Steerable" enabled
|
||||
if (wheel.steerable)
|
||||
{
|
||||
wheel.WheelCollider.steerAngle = hInput * steeringRange;
|
||||
}
|
||||
|
||||
// Apply torque to Wheel colliders that have "Motorized" enabled
|
||||
if (wheel.motorized)
|
||||
{
|
||||
wheel.WheelCollider.motorTorque = vInput * motorTorque;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,4 +5,20 @@ using UnityEngine;
|
||||
public class Checkpoint : MonoBehaviour
|
||||
{
|
||||
public bool isCollected = false;
|
||||
MeshRenderer meshRenderer;
|
||||
|
||||
private void Start() {
|
||||
meshRenderer = GetComponent<MeshRenderer>();
|
||||
}
|
||||
|
||||
private void Update() {
|
||||
if (isCollected)
|
||||
{
|
||||
meshRenderer.enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
meshRenderer.enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,15 @@ public class GameUI : MonoBehaviour
|
||||
public GameObject car;
|
||||
private float carVel;
|
||||
public Rigidbody carRB;
|
||||
|
||||
public TextMeshPro speedometer;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
if (speedometer == null)
|
||||
{
|
||||
speedometer = new TextMeshPro();
|
||||
}
|
||||
if (carRB == null)
|
||||
{
|
||||
carRB = GetComponent<Rigidbody>();
|
||||
@@ -25,7 +31,7 @@ public class GameUI : MonoBehaviour
|
||||
void Update()
|
||||
{
|
||||
carVel = (math.abs(carRB.velocity.x) + math.abs(carRB.velocity.y) + math.abs(carRB.velocity.z))*5;
|
||||
print(carVel);
|
||||
|
||||
//print(carVel);
|
||||
speedometer.SetText(carVel.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class VehichleControl : MonoBehaviour
|
||||
{
|
||||
public InputController InputCtrl;
|
||||
[Tooltip("Set ref in order of FL, FR, RL, RR")]
|
||||
public WheelCollider[] WheelColliders;
|
||||
|
||||
[Tooltip("Set ref of wheel meshes in order of FL, FR, RL, RR")]
|
||||
public Transform[] Wheels;
|
||||
|
||||
public Transform CenterOfMass;
|
||||
|
||||
public int Force;
|
||||
public int Angle;
|
||||
public int BrakeForce;
|
||||
|
||||
private void Drive()
|
||||
{
|
||||
WheelColliders[0].motorTorque = WheelColliders[1].motorTorque = InputCtrl.Vertical * Force;
|
||||
}
|
||||
|
||||
private void Steer()
|
||||
{
|
||||
WheelColliders[0].steerAngle = WheelColliders[1].steerAngle = InputCtrl.Horizontal * Angle;
|
||||
}
|
||||
|
||||
private void Brake()
|
||||
{
|
||||
WheelColliders[0].brakeTorque = WheelColliders[1].brakeTorque = InputCtrl.Brake * BrakeForce;
|
||||
}
|
||||
|
||||
private void UpdateWheelMovements()
|
||||
{
|
||||
for (var i = 0; i < Wheels.Length; i++)
|
||||
{
|
||||
Vector3 pos;
|
||||
Quaternion rot;
|
||||
WheelColliders[i].GetWorldPose(out pos, out rot);
|
||||
Wheels[i].transform.position = pos;
|
||||
Wheels[i].transform.rotation = rot;
|
||||
}
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
Steer();
|
||||
Drive();
|
||||
Brake();
|
||||
UpdateWheelMovements();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
GetComponent<Rigidbody>().centerOfMass = CenterOfMass.localPosition;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8c9672ffa7e21bf41b27f35da94be659
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user