V2.8 移动算法更新

过去X与Y可同时达到maxspeed致使速度会超过maxspeed,本次修正了该错误。
追加移动Penalty。
This commit is contained in:
Koha9 2023-02-15 21:06:57 +09:00
parent 5ccb06c545
commit faa4e7b065
6 changed files with 386 additions and 367 deletions

View File

@ -1 +1 @@
{"count":1,"self":13.315304,"total":13.988529499999999,"children":{"InitializeActuators":{"count":16,"self":0.0014992,"total":0.0014992,"children":null},"InitializeSensors":{"count":16,"self":0.0010057,"total":0.0010057,"children":null},"AgentSendState":{"count":463,"self":0.0070088,"total":0.025683599999999997,"children":{"CollectObservations":{"count":3704,"self":0.0136738,"total":0.0136738,"children":null},"WriteActionMask":{"count":3704,"self":0.0010000999999999999,"total":0.0010000999999999999,"children":null},"RequestDecision":{"count":3704,"self":0.0040009,"total":0.0040009,"children":null}}},"DecideAction":{"count":463,"self":0.0090286,"total":0.0090286,"children":null},"AgentAct":{"count":463,"self":0.63550869999999993,"total":0.63550869999999993,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1670806723","unity_version":"2021.3.14f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2021.3.14f1\\Editor\\Unity.exe -projectpath C:\\Users\\UCUNI\\OneDrive\\Unity\\ML-Agents\\Aimbot-ParallelEnv -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-YRG3pCS8ZgFNZRYWWEQNT -hubSessionId bd156e60-79a0-11ed-822f-5975ccdc385f -accessToken Oh87gx5N8gBlKDUL5eNZyAhhMBi2H5U90gq84xokOa800ef","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"InGame","end_time_seconds":"1670806737"}}
{"count":1,"self":47.2882752,"total":50.6455875,"children":{"InitializeActuators":{"count":16,"self":0.0015004999999999999,"total":0.0015004999999999999,"children":null},"InitializeSensors":{"count":16,"self":0.0009998,"total":0.0009998,"children":null},"AgentSendState":{"count":2291,"self":0.0310393,"total":0.1206959,"children":{"CollectObservations":{"count":18328,"self":0.060121299999999996,"total":0.060121299999999996,"children":null},"WriteActionMask":{"count":18328,"self":0.0080016,"total":0.0080016,"children":null},"RequestDecision":{"count":18328,"self":0.0215337,"total":0.0215337,"children":null}}},"DecideAction":{"count":2291,"self":0.0295373,"total":0.0295373,"children":null},"AgentAct":{"count":2291,"self":3.2040772,"total":3.2040770999999997,"children":null}},"gauges":{"AKMAgent.CumulativeReward":{"count":9,"max":2563.29736,"min":-11622.02,"runningAverage":-9344.109,"value":2563.29736,"weightedAverage":-7458.709}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1676265049","unity_version":"2021.3.14f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2021.3.14f1\\Editor\\Unity.exe -projectpath C:\\Users\\UCUNI\\OneDrive\\Unity\\ML-Agents\\Aimbot-ParallelEnv -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-UCUNI -hubSessionId 09b1c250-aa7a-11ed-aae2-f5dbff6fb9ed -accessToken JZS3G7ukCMBqSLPYz0eBmgNgTUsctzdWLHiwknJRB1I00ef","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"InGame","end_time_seconds":"1676265100"}}

View File

@ -2575,6 +2575,170 @@ MeshFilter:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 95675457}
m_Mesh: {fileID: -6813842297940566337, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8, type: 3}
--- !u!43 &98340202
Mesh:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: pb_Mesh27346
serializedVersion: 10
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 36
topology: 0
baseVertex: 0
firstVertex: 0
vertexCount: 24
localAABB:
m_Center: {x: 5, y: 1, z: -0.5}
m_Extent: {x: 5, y: 1, z: 0.5}
m_Shapes:
vertices: []
shapes: []
channels: []
fullWeights: []
m_BindPose: []
m_BoneNameHashes:
m_RootBoneNameHash: 0
m_BonesAABB: []
m_VariableBoneCountWeights:
m_Data:
m_MeshCompression: 0
m_IsReadable: 1
m_KeepVertices: 1
m_KeepIndices: 1
m_IndexFormat: 0
m_IndexBuffer: 000001000200010003000200040005000600050007000600080009000a0009000b000a000c000d000e000d000f000e00100011001200110013001200140015001600150017001600
m_VertexData:
serializedVersion: 3
m_VertexCount: 24
m_Channels:
- stream: 0
offset: 0
format: 0
dimension: 3
- stream: 0
offset: 12
format: 0
dimension: 3
- stream: 0
offset: 24
format: 0
dimension: 4
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 40
format: 0
dimension: 2
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
m_DataSize: 1152
_typelessdata: 00000000000000000000000000000000000000000000803f000080bf0000000000000000000080bf000000000000000000002041000000000000000000000000000000000000803f000080bf0000000000000000000080bf000020c10000000000000000000000400000000000000000000000000000803f000080bf0000000000000000000080bf000000000000004000002041000000400000000000000000000000000000803f000080bf0000000000000000000080bf000020c1000000400000204100000000000000000000803f000000000000000000000000000000000000803f000080bf00000000000000000000204100000000000080bf0000803f000000000000000000000000000000000000803f000080bf000080bf000000000000204100000040000000000000803f000000000000000000000000000000000000803f000080bf00000000000000400000204100000040000080bf0000803f000000000000000000000000000000000000803f000080bf000080bf000000400000204100000000000080bf0000000000000000000080bf0000803f0000000000000000000080bf00002041000000000000000000000000000080bf0000000000000000000080bf0000803f0000000000000000000080bf00000000000000000000204100000040000080bf0000000000000000000080bf0000803f0000000000000000000080bf00002041000000400000000000000040000080bf0000000000000000000080bf0000803f0000000000000000000080bf00000000000000400000000000000000000080bf000080bf00000000000000000000000000000000000080bf000080bf0000803f00000000000000000000000000000000000080bf00000000000000000000000000000000000080bf000080bf00000000000000000000000000000040000080bf000080bf00000000000000000000000000000000000080bf000080bf0000803f00000040000000000000004000000000000080bf00000000000000000000000000000000000080bf000080bf0000000000000040000000000000004000000000000000000000803f000000000000803f0000000000000000000080bf0000000000000000000020410000004000000000000000000000803f000000000000803f0000000000000000000080bf00002041000000000000000000000040000080bf000000000000803f000000000000803f0000000000000000000080bf00000000000080bf0000204100000040000080bf000000000000803f000000000000803f0000000000000000000080bf00002041000080bf0000000000000000000080bf00000000000080bf00000000000080bf0000000000000000000080bf00000000000080bf0000204100000000000080bf00000000000080bf00000000000080bf0000000000000000000080bf000020c1000080bf00000000000000000000000000000000000080bf00000000000080bf0000000000000000000080bf000000000000000000002041000000000000000000000000000080bf00000000000080bf0000000000000000000080bf000020c100000000
m_CompressedMesh:
m_Vertices:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_UV:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Normals:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Tangents:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Weights:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_NormalSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_TangentSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_FloatColors:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_BoneIndices:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_Triangles:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_UVInfo: 0
m_LocalAABB:
m_Center: {x: 5, y: 1, z: -0.5}
m_Extent: {x: 5, y: 1, z: 0.5}
m_MeshUsageFlags: 0
m_BakedConvexCollisionMesh:
m_BakedTriangleCollisionMesh:
m_MeshMetrics[0]: 1
m_MeshMetrics[1]: 1
m_MeshOptimizationFlags: 1
m_StreamData:
serializedVersion: 2
offset: 0
size: 0
path:
--- !u!1 &98762474
GameObject:
m_ObjectHideFlags: 0
@ -5581,15 +5745,15 @@ MonoBehaviour:
nonReward: -1
loseReward: -999
shootReward: -0.5
hitReward: 5
killReward: 5
hitReward: -5
killReward: -5
shootWithoutReadyReward: -1.15
killBonusReward: 0
facingReward: 2
shootTargetAreaReward: 5
speedPenalty: 0
spinPenalty: 0.04
mousePenalty: 0.01
movePenalty: 0.1
spinPenalty: 0.08
mousePenalty: 0.06
hitTargetReward: 60
killTargetEnemyReward: 80
inAreaReward: 5
@ -6556,8 +6720,8 @@ MonoBehaviour:
group1Tag: Player
group2Tag: Enemy
minEnemyAreaX: 0
attackProb: 0.333
gotoProb: 0.333
attackProb: 1
gotoProb: 0
defenceProb: 0
targetState:
- 0
@ -8476,8 +8640,8 @@ MonoBehaviour:
group1Tag: Player
group2Tag: Enemy
minEnemyAreaX: 0
attackProb: 0.333
gotoProb: 0.333
attackProb: 1
gotoProb: 0
defenceProb: 0
targetState:
- 0
@ -8543,15 +8707,15 @@ MonoBehaviour:
nonReward: -1
loseReward: -999
shootReward: -0.5
hitReward: 5
killReward: 5
hitReward: -5
killReward: -5
shootWithoutReadyReward: -1.15
killBonusReward: 0
facingReward: 2
shootTargetAreaReward: 5
speedPenalty: 0
spinPenalty: 0.04
mousePenalty: 0.01
movePenalty: 0.1
spinPenalty: 0.08
mousePenalty: 0.06
hitTargetReward: 60
killTargetEnemyReward: 80
inAreaReward: 5
@ -12914,15 +13078,15 @@ MonoBehaviour:
nonReward: -1
loseReward: -999
shootReward: -0.5
hitReward: 5
killReward: 5
hitReward: -5
killReward: -5
shootWithoutReadyReward: -1.15
killBonusReward: 0
facingReward: 2
shootTargetAreaReward: 5
speedPenalty: 0
spinPenalty: 0.04
mousePenalty: 0.01
movePenalty: 0.1
spinPenalty: 0.08
mousePenalty: 0.06
hitTargetReward: 60
killTargetEnemyReward: 80
inAreaReward: 5
@ -14144,10 +14308,11 @@ MonoBehaviour:
TargetControllerObj: {fileID: 314156288}
HUDObj: {fileID: 2082200184}
thisCam: {fileID: 211184777}
MoveSpeed: 3
MoveSpeed: 9
vX: 0
vZ: 0
acceleration: 0.3
thisMovement: {x: 0, y: 0, z: 0}
acceleration: 0.9
mouseXSensitivity: 100
mouseYSensitivity: 200
yRotation: 0.1
@ -15173,7 +15338,7 @@ Mesh:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: pb_Mesh23548
m_Name: pb_Mesh23634
serializedVersion: 10
m_SubMeshes:
- serializedVersion: 2
@ -15537,8 +15702,8 @@ MonoBehaviour:
group1Tag: Player
group2Tag: Enemy
minEnemyAreaX: 0
attackProb: 0.333
gotoProb: 0.333
attackProb: 1
gotoProb: 0
defenceProb: 0
targetState:
- 0
@ -16241,10 +16406,11 @@ MonoBehaviour:
TargetControllerObj: {fileID: 2043573072}
HUDObj: {fileID: 2082200184}
thisCam: {fileID: 787869692}
MoveSpeed: 3
MoveSpeed: 9
vX: 0
vZ: 0
acceleration: 0.3
thisMovement: {x: 0, y: 0, z: 0}
acceleration: 0.9
mouseXSensitivity: 100
mouseYSensitivity: 200
yRotation: 0.1
@ -18405,10 +18571,11 @@ MonoBehaviour:
TargetControllerObj: {fileID: 1692325237}
HUDObj: {fileID: 2082200184}
thisCam: {fileID: 1633276149}
MoveSpeed: 3
MoveSpeed: 9
vX: 0
vZ: 0
acceleration: 0.3
thisMovement: {x: 0, y: 0, z: 0}
acceleration: 0.9
mouseXSensitivity: 100
mouseYSensitivity: 200
yRotation: 0.1
@ -18766,10 +18933,11 @@ MonoBehaviour:
TargetControllerObj: {fileID: 809652226}
HUDObj: {fileID: 2082200184}
thisCam: {fileID: 1331055318}
MoveSpeed: 3
MoveSpeed: 9
vX: 0
vZ: 0
acceleration: 0.3
thisMovement: {x: 0, y: 0, z: 0}
acceleration: 0.9
mouseXSensitivity: 100
mouseYSensitivity: 200
yRotation: 0.1
@ -21135,15 +21303,15 @@ MonoBehaviour:
nonReward: -1
loseReward: -999
shootReward: -0.5
hitReward: 5
killReward: 5
hitReward: -5
killReward: -5
shootWithoutReadyReward: -1.15
killBonusReward: 0
facingReward: 2
shootTargetAreaReward: 5
speedPenalty: 0
spinPenalty: 0.04
mousePenalty: 0.01
movePenalty: 0.1
spinPenalty: 0.08
mousePenalty: 0.06
hitTargetReward: 60
killTargetEnemyReward: 80
inAreaReward: 5
@ -23516,8 +23684,8 @@ MonoBehaviour:
group1Tag: Player
group2Tag: Enemy
minEnemyAreaX: 0
attackProb: 0.333
gotoProb: 0.333
attackProb: 1
gotoProb: 0
defenceProb: 0
targetState:
- 0
@ -24837,7 +25005,7 @@ Mesh:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: pb_Mesh23444
m_Name: pb_Mesh23470
serializedVersion: 10
m_SubMeshes:
- serializedVersion: 2
@ -25711,170 +25879,6 @@ MeshFilter:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 869278175}
m_Mesh: {fileID: -8211673063228289779, guid: 99fcce1f10b2ebd4a8cd31a345f6bed8, type: 3}
--- !u!43 &878509639
Mesh:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: pb_Mesh27094
serializedVersion: 10
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 36
topology: 0
baseVertex: 0
firstVertex: 0
vertexCount: 24
localAABB:
m_Center: {x: 5, y: 1, z: -0.5}
m_Extent: {x: 5, y: 1, z: 0.5}
m_Shapes:
vertices: []
shapes: []
channels: []
fullWeights: []
m_BindPose: []
m_BoneNameHashes:
m_RootBoneNameHash: 0
m_BonesAABB: []
m_VariableBoneCountWeights:
m_Data:
m_MeshCompression: 0
m_IsReadable: 1
m_KeepVertices: 1
m_KeepIndices: 1
m_IndexFormat: 0
m_IndexBuffer: 000001000200010003000200040005000600050007000600080009000a0009000b000a000c000d000e000d000f000e00100011001200110013001200140015001600150017001600
m_VertexData:
serializedVersion: 3
m_VertexCount: 24
m_Channels:
- stream: 0
offset: 0
format: 0
dimension: 3
- stream: 0
offset: 12
format: 0
dimension: 3
- stream: 0
offset: 24
format: 0
dimension: 4
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 40
format: 0
dimension: 2
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
m_DataSize: 1152
_typelessdata: 00000000000000000000000000000000000000000000803f000080bf0000000000000000000080bf000000000000000000002041000000000000000000000000000000000000803f000080bf0000000000000000000080bf000020c10000000000000000000000400000000000000000000000000000803f000080bf0000000000000000000080bf000000000000004000002041000000400000000000000000000000000000803f000080bf0000000000000000000080bf000020c1000000400000204100000000000000000000803f000000000000000000000000000000000000803f000080bf00000000000000000000204100000000000080bf0000803f000000000000000000000000000000000000803f000080bf000080bf000000000000204100000040000000000000803f000000000000000000000000000000000000803f000080bf00000000000000400000204100000040000080bf0000803f000000000000000000000000000000000000803f000080bf000080bf000000400000204100000000000080bf0000000000000000000080bf0000803f0000000000000000000080bf00002041000000000000000000000000000080bf0000000000000000000080bf0000803f0000000000000000000080bf00000000000000000000204100000040000080bf0000000000000000000080bf0000803f0000000000000000000080bf00002041000000400000000000000040000080bf0000000000000000000080bf0000803f0000000000000000000080bf00000000000000400000000000000000000080bf000080bf00000000000000000000000000000000000080bf000080bf0000803f00000000000000000000000000000000000080bf00000000000000000000000000000000000080bf000080bf00000000000000000000000000000040000080bf000080bf00000000000000000000000000000000000080bf000080bf0000803f00000040000000000000004000000000000080bf00000000000000000000000000000000000080bf000080bf0000000000000040000000000000004000000000000000000000803f000000000000803f0000000000000000000080bf0000000000000000000020410000004000000000000000000000803f000000000000803f0000000000000000000080bf00002041000000000000000000000040000080bf000000000000803f000000000000803f0000000000000000000080bf00000000000080bf0000204100000040000080bf000000000000803f000000000000803f0000000000000000000080bf00002041000080bf0000000000000000000080bf00000000000080bf00000000000080bf0000000000000000000080bf00000000000080bf0000204100000000000080bf00000000000080bf00000000000080bf0000000000000000000080bf000020c1000080bf00000000000000000000000000000000000080bf00000000000080bf0000000000000000000080bf000000000000000000002041000000000000000000000000000080bf00000000000080bf0000000000000000000080bf000020c100000000
m_CompressedMesh:
m_Vertices:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_UV:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Normals:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Tangents:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Weights:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_NormalSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_TangentSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_FloatColors:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_BoneIndices:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_Triangles:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_UVInfo: 0
m_LocalAABB:
m_Center: {x: 5, y: 1, z: -0.5}
m_Extent: {x: 5, y: 1, z: 0.5}
m_MeshUsageFlags: 0
m_BakedConvexCollisionMesh:
m_BakedTriangleCollisionMesh:
m_MeshMetrics[0]: 1
m_MeshMetrics[1]: 1
m_MeshOptimizationFlags: 1
m_StreamData:
serializedVersion: 2
offset: 0
size: 0
path:
--- !u!1 &881594482
GameObject:
m_ObjectHideFlags: 0
@ -26501,15 +26505,15 @@ MonoBehaviour:
nonReward: -1
loseReward: -999
shootReward: -0.5
hitReward: 5
killReward: 5
hitReward: -5
killReward: -5
shootWithoutReadyReward: -1.15
killBonusReward: 0
facingReward: 2
shootTargetAreaReward: 5
speedPenalty: 0
spinPenalty: 0.04
mousePenalty: 0.01
movePenalty: 0.1
spinPenalty: 0.08
mousePenalty: 0.06
hitTargetReward: 60
killTargetEnemyReward: 80
inAreaReward: 5
@ -26588,15 +26592,15 @@ MonoBehaviour:
nonReward: -1
loseReward: -999
shootReward: -0.5
hitReward: 5
killReward: 5
hitReward: -5
killReward: -5
shootWithoutReadyReward: -1.15
killBonusReward: 0
facingReward: 2
shootTargetAreaReward: 5
speedPenalty: 0
spinPenalty: 0.04
mousePenalty: 0.01
movePenalty: 0.1
spinPenalty: 0.08
mousePenalty: 0.06
hitTargetReward: 60
killTargetEnemyReward: 80
inAreaReward: 5
@ -28345,10 +28349,11 @@ MonoBehaviour:
TargetControllerObj: {fileID: 1669889452}
HUDObj: {fileID: 2082200184}
thisCam: {fileID: 1841302676}
MoveSpeed: 3
MoveSpeed: 9
vX: 0
vZ: 0
acceleration: 0.3
thisMovement: {x: 0, y: 0, z: 0}
acceleration: 0.9
mouseXSensitivity: 100
mouseYSensitivity: 200
yRotation: 0.1
@ -32300,10 +32305,11 @@ MonoBehaviour:
TargetControllerObj: {fileID: 237058156}
HUDObj: {fileID: 2082200184}
thisCam: {fileID: 210966817}
MoveSpeed: 3
MoveSpeed: 9
vX: 0
vZ: 0
acceleration: 0.3
thisMovement: {x: 0, y: 0, z: 0}
acceleration: 0.9
mouseXSensitivity: 100
mouseYSensitivity: 200
yRotation: 0.1
@ -40029,15 +40035,15 @@ MonoBehaviour:
nonReward: -1
loseReward: -999
shootReward: -0.5
hitReward: 5
killReward: 5
hitReward: -5
killReward: -5
shootWithoutReadyReward: -1.15
killBonusReward: 0
facingReward: 2
shootTargetAreaReward: 5
speedPenalty: 0
spinPenalty: 0.04
mousePenalty: 0.01
movePenalty: 0.1
spinPenalty: 0.08
mousePenalty: 0.06
hitTargetReward: 60
killTargetEnemyReward: 80
inAreaReward: 5
@ -40843,15 +40849,15 @@ MonoBehaviour:
nonReward: -1
loseReward: -999
shootReward: -0.5
hitReward: 5
killReward: 5
hitReward: -5
killReward: -5
shootWithoutReadyReward: -1.15
killBonusReward: 0
facingReward: 2
shootTargetAreaReward: 5
speedPenalty: 0
spinPenalty: 0.04
mousePenalty: 0.01
movePenalty: 0.1
spinPenalty: 0.08
mousePenalty: 0.06
hitTargetReward: 60
killTargetEnemyReward: 80
inAreaReward: 5
@ -43669,10 +43675,11 @@ MonoBehaviour:
TargetControllerObj: {fileID: 1639946336}
HUDObj: {fileID: 2082200184}
thisCam: {fileID: 489192433}
MoveSpeed: 3
MoveSpeed: 9
vX: 0
vZ: 0
acceleration: 0.3
thisMovement: {x: 0, y: 0, z: 0}
acceleration: 0.9
mouseXSensitivity: 100
mouseYSensitivity: 200
yRotation: 0.1
@ -45097,8 +45104,8 @@ MonoBehaviour:
group1Tag: Player
group2Tag: Enemy
minEnemyAreaX: 0
attackProb: 0.333
gotoProb: 0.333
attackProb: 1
gotoProb: 0
defenceProb: 0
targetState:
- 0
@ -45824,8 +45831,8 @@ MonoBehaviour:
group1Tag: Player
group2Tag: Enemy
minEnemyAreaX: 0
attackProb: 0.333
gotoProb: 0.333
attackProb: 1
gotoProb: 0
defenceProb: 0
targetState:
- 0
@ -46941,8 +46948,8 @@ MonoBehaviour:
group1Tag: Player
group2Tag: Enemy
minEnemyAreaX: 0
attackProb: 0.333
gotoProb: 0.333
attackProb: 1
gotoProb: 0
defenceProb: 0
targetState:
- 0
@ -47975,7 +47982,7 @@ Mesh:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: pb_Mesh23596
m_Name: pb_Mesh23770
serializedVersion: 10
m_SubMeshes:
- serializedVersion: 2
@ -50155,10 +50162,11 @@ MonoBehaviour:
TargetControllerObj: {fileID: 502694778}
HUDObj: {fileID: 2082200184}
thisCam: {fileID: 337932549}
MoveSpeed: 3
MoveSpeed: 9
vX: 0
vZ: 0
acceleration: 0.3
thisMovement: {x: 0, y: 0, z: 0}
acceleration: 0.9
mouseXSensitivity: 100
mouseYSensitivity: 200
yRotation: 0.1
@ -50278,7 +50286,7 @@ MeshCollider:
serializedVersion: 4
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 878509639}
m_Mesh: {fileID: 98340202}
--- !u!33 &1790388461
MeshFilter:
m_ObjectHideFlags: 10
@ -50286,7 +50294,7 @@ MeshFilter:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1790388458}
m_Mesh: {fileID: 878509639}
m_Mesh: {fileID: 98340202}
--- !u!23 &1790388462
MeshRenderer:
m_ObjectHideFlags: 0
@ -50540,8 +50548,8 @@ MonoBehaviour:
m_AreaError: 15
m_PreserveMeshAssetOnDestroy: 0
assetGuid:
m_Mesh: {fileID: 878509639}
m_VersionIndex: 0
m_Mesh: {fileID: 98340202}
m_VersionIndex: 3
m_IsSelectable: 1
m_SelectedFaces:
m_SelectedEdges: []
@ -57429,8 +57437,8 @@ MonoBehaviour:
group1Tag: Player
group2Tag: Enemy
minEnemyAreaX: 0
attackProb: 0.333
gotoProb: 0.333
attackProb: 1
gotoProb: 0
defenceProb: 0
targetState:
- 0

View File

@ -33,9 +33,10 @@ public class AgentWithGun : Agent
public Camera thisCam;
[Header("GetAxis() Simulate")]
public float MoveSpeed = 2.0f;
public float MoveSpeed = 9.0f;
public float vX = 0f;
public float vZ = 0f;
public Vector3 thisMovement;
public float acceleration = 0.1f; // 加速度
public float mouseXSensitivity = 100;
public float mouseYSensitivity = 200;
@ -107,7 +108,7 @@ private void Start()
// moveAgent 用于模拟Input.GetAxis移动
public void moveAgent(int vertical, int horizontal)
{
Vector3 thisMovement;
// Vector3 thisMovement;
if (horizontal != 0)//当按下按键(水平方向)
{
@ -170,9 +171,13 @@ public void moveAgent(int vertical, int horizontal)
vZ = 0;
}
}
thisMovement = (transform.forward * vZ + transform.right * vX) * MoveSpeed;
thisMovement = (transform.forward * vZ + transform.right * vX);
//PlayerController下的.Move为实现物体运动的函数
//Move()括号内放入一个Vector3类型的量本例中为Player_Move
if (thisMovement.magnitude > MoveSpeed)
{
thisMovement = thisMovement.normalized * MoveSpeed;
}
PlayerController.Move(thisMovement * Time.deltaTime);
// update Key Viewer
}
@ -362,7 +367,7 @@ float facingReward()
// ------------Reward--------------
// rewardCalculate 计算本动作的Reward
public float rewardCalculate(float sceneReward,float mouseX)
public float rewardCalculate(float sceneReward,float mouseX,float movement)
{
float epreward = 0f;
// 击杀reward判断
@ -383,6 +388,7 @@ public float rewardCalculate(float sceneReward,float mouseX)
epreward += ballistic() + sceneReward;
// facing reward
epreward += facingReward();
// Penalty
// spin penalty
spinRecord.Add(mouseX);
if (spinRecord.Count >= paramContainer.spinRecordMax)
@ -398,6 +404,11 @@ public float rewardCalculate(float sceneReward,float mouseX)
{
epreward -= Math.Abs(mouseX) * paramContainer.mousePenalty;
}
// move penalty
if (movement != 0)
{
epreward -= paramContainer.movePenalty;
}
return epreward;
}
@ -484,7 +495,7 @@ public override void OnActionReceived(ActionBuffers actionBuffers)
float sceneReward = 0f;
float endReward = 0f;
(finishedState, sceneReward, endReward) = targetCon.checkOverAndRewards();
float thisRoundReward = rewardCalculate(sceneReward+ endReward,Mouse_X);
float thisRoundReward = rewardCalculate(sceneReward+ endReward,Mouse_X,Math.Abs(vertical)+Math.Abs(horizontal));
if (hudController.chartOn)
{
EnvUICon.updateChart(thisRoundReward);

View File

@ -76,8 +76,8 @@ public class ParameterContainer : MonoBehaviour
public float shootTargetAreaReward = 5.0f;
[Header("Penalty Rewards")]
[Tooltip("Speed Penalty Reward")]
public float speedPenalty = 0f;
[Tooltip("move Penalty Reward")]
public float movePenalty = 0f;
[Tooltip("spiiiiiiin Panalty Reward")]
public float spinPenalty = 0f;
[Tooltip("while move mouse a little bit's penalty")]

View File

@ -264,8 +264,8 @@ public void moveAgentTo(Vector3 thisPosition)
(nowDistance, inArea) = blockCont.getAgentTargetDistanceAndInside(AgentObj.transform.position);
envUICon.updateTargetGauge(blockCont.thisBlock.firebasesBelong, blockCont.thisBlock.belongMaxPoint);
float areaTargetReward = getDistanceReward(nowDistance, inArea);
// if (blockCont.thisBlock.firebasesBelong >= blockCont.thisBlock.belongMaxPoint)
if(inArea != 0)
//if(inArea != 0)
if (blockCont.thisBlock.firebasesBelong >= blockCont.thisBlock.belongMaxPoint)
{
// win
// let the area belongs to me
@ -284,7 +284,6 @@ public void moveAgentTo(Vector3 thisPosition)
else
{
// keep on keeping on!
thisReward = areaTargetReward;
endReward = 0;
endTypeInt = (int)EndType.Running;
@ -392,6 +391,7 @@ public float getDistanceReward(float nowDistance,int inarea)
float thisSceneReward = 0f;
if (inarea != 0)
{
// in area
thisSceneReward = paramCon.inAreaReward;
}
else

View File

@ -1,30 +1,6 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &1
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 12004, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_PixelRect:
serializedVersion: 2
x: -1073
y: -653
width: 1080
height: 595
m_ShowMode: 0
m_Title: Game
m_RootView: {fileID: 4}
m_MinSize: {x: 100, y: 121}
m_MaxSize: {x: 4000, y: 4021}
m_Maximized: 0
--- !u!114 &2
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
@ -38,16 +14,40 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_PixelRect:
serializedVersion: 2
x: 70
y: 53
width: 1840
height: 1019
x: -152
y: 101
width: 1858
height: 1037
m_ShowMode: 4
m_Title: Inspector
m_Title: Hierarchy
m_RootView: {fileID: 12}
m_MinSize: {x: 875, y: 542}
m_MinSize: {x: 875, y: 392}
m_MaxSize: {x: 10000, y: 10000}
m_Maximized: 0
--- !u!114 &2
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 12004, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_PixelRect:
serializedVersion: 2
x: -1080
y: -695
width: 1080
height: 636
m_ShowMode: 0
m_Title: Game
m_RootView: {fileID: 4}
m_MinSize: {x: 100, y: 121}
m_MaxSize: {x: 4000, y: 4021}
m_Maximized: 0
--- !u!114 &3
MonoBehaviour:
m_ObjectHideFlags: 52
@ -66,7 +66,7 @@ MonoBehaviour:
x: 0
y: 0
width: 1080
height: 595
height: 636
m_MinSize: {x: 100, y: 121}
m_MaxSize: {x: 4000, y: 4021}
m_ActualView: {fileID: 16}
@ -93,11 +93,11 @@ MonoBehaviour:
x: 0
y: 0
width: 1080
height: 595
height: 636
m_MinSize: {x: 100, y: 121}
m_MaxSize: {x: 4000, y: 4021}
vertical: 0
controlID: 152
controlID: 48
--- !u!114 &5
MonoBehaviour:
m_ObjectHideFlags: 52
@ -114,9 +114,9 @@ MonoBehaviour:
m_Position:
serializedVersion: 2
x: 0
y: 589
width: 878
height: 380
y: 714
width: 1083
height: 273
m_MinSize: {x: 231, y: 271}
m_MaxSize: {x: 10001, y: 10021}
m_ActualView: {fileID: 18}
@ -144,12 +144,12 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 878
height: 969
width: 1083
height: 987
m_MinSize: {x: 100, y: 200}
m_MaxSize: {x: 8096, y: 16192}
vertical: 1
controlID: 114
controlID: 80
--- !u!114 &7
MonoBehaviour:
m_ObjectHideFlags: 52
@ -166,9 +166,9 @@ MonoBehaviour:
m_Position:
serializedVersion: 2
x: 0
y: 358
width: 500
height: 611
y: 714
width: 335
height: 273
m_MinSize: {x: 102, y: 121}
m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 22}
@ -193,14 +193,14 @@ MonoBehaviour:
- {fileID: 7}
m_Position:
serializedVersion: 2
x: 878
x: 1083
y: 0
width: 500
height: 969
width: 335
height: 987
m_MinSize: {x: 100, y: 200}
m_MaxSize: {x: 8096, y: 16192}
vertical: 1
controlID: 123
controlID: 141
--- !u!114 &9
MonoBehaviour:
m_ObjectHideFlags: 52
@ -218,8 +218,8 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 500
height: 358
width: 335
height: 714
m_MinSize: {x: 202, y: 221}
m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 20}
@ -247,12 +247,12 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 30
width: 1840
height: 969
width: 1858
height: 987
m_MinSize: {x: 300, y: 200}
m_MaxSize: {x: 24288, y: 16192}
vertical: 0
controlID: 17
controlID: 79
--- !u!114 &11
MonoBehaviour:
m_ObjectHideFlags: 52
@ -268,10 +268,10 @@ MonoBehaviour:
m_Children: []
m_Position:
serializedVersion: 2
x: 1378
x: 1418
y: 0
width: 462
height: 969
width: 440
height: 987
m_MinSize: {x: 276, y: 71}
m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 19}
@ -299,8 +299,8 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 1840
height: 1019
width: 1858
height: 1037
m_MinSize: {x: 875, y: 300}
m_MaxSize: {x: 10000, y: 10000}
m_UseTopView: 1
@ -324,7 +324,7 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 1840
width: 1858
height: 30
m_MinSize: {x: 0, y: 0}
m_MaxSize: {x: 0, y: 0}
@ -345,8 +345,8 @@ MonoBehaviour:
m_Position:
serializedVersion: 2
x: 0
y: 999
width: 1840
y: 1017
width: 1858
height: 20
m_MinSize: {x: 0, y: 0}
m_MaxSize: {x: 0, y: 0}
@ -367,8 +367,8 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 878
height: 589
width: 1083
height: 714
m_MinSize: {x: 201, y: 221}
m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 21}
@ -396,10 +396,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: -1073
y: -653
x: -1080
y: -695
width: 1080
height: 574
height: 615
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@ -410,7 +410,7 @@ MonoBehaviour:
m_ShowGizmos: 0
m_TargetDisplay: 0
m_ClearColor: {r: 0, g: 0, b: 0, a: 0}
m_TargetSize: {x: 1080, y: 553}
m_TargetSize: {x: 1080, y: 594}
m_TextureFilterMode: 0
m_TextureHideFlags: 61
m_RenderIMGUI: 1
@ -418,7 +418,7 @@ MonoBehaviour:
m_UseMipMap: 0
m_VSyncEnabled: 0
m_Gizmos: 0
m_Stats: 1
m_Stats: 0
m_SelectedSizes: 00000000000000000000000000000000000000000000000000000000000000000000000000000000
m_ZoomArea:
m_HRangeLocked: 0
@ -427,8 +427,8 @@ MonoBehaviour:
vZoomLockedByDefault: 0
m_HBaseRangeMin: -540
m_HBaseRangeMax: 540
m_VBaseRangeMin: -276.5
m_VBaseRangeMax: 276.5
m_VBaseRangeMin: -297
m_VBaseRangeMax: 297
m_HAllowExceedBaseRangeMin: 1
m_HAllowExceedBaseRangeMax: 1
m_VAllowExceedBaseRangeMin: 1
@ -447,9 +447,9 @@ MonoBehaviour:
x: 0
y: 21
width: 1080
height: 553
height: 594
m_Scale: {x: 1, y: 1}
m_Translation: {x: 540, y: 276.5}
m_Translation: {x: 540, y: 297}
m_MarginLeft: 0
m_MarginRight: 0
m_MarginTop: 0
@ -457,12 +457,12 @@ MonoBehaviour:
m_LastShownAreaInsideMargins:
serializedVersion: 2
x: -540
y: -276.5
y: -297
width: 1080
height: 553
height: 594
m_MinimalGUI: 1
m_defaultScale: 1
m_LastWindowPixelSize: {x: 1080, y: 574}
m_LastWindowPixelSize: {x: 1080, y: 615}
m_ClearInEditMode: 1
m_NoCameraWarning: 1
m_LowResolutionForAspectRatios: 01000000000000000000
@ -488,10 +488,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 1920
y: 784
width: 1125
height: 255
x: 62
y: 787
width: 1086
height: 252
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@ -516,10 +516,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 70
y: 672
width: 877
height: 359
x: -152
y: 845
width: 1082
height: 252
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@ -549,10 +549,10 @@ MonoBehaviour:
m_LockTracker:
m_IsLocked: 0
m_FolderTreeState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: ca780000
m_LastClickedID: 30922
m_ExpandedIDs: 00000000a0780000a2780000a4780000a6780000a8780000c478000000ca9a3b
scrollPos: {x: 0, y: 104}
m_SelectedIDs: ea780000
m_LastClickedID: 30954
m_ExpandedIDs: 00000000a0780000a2780000a4780000a6780000a8780000e478000000ca9a3b
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -632,10 +632,10 @@ MonoBehaviour:
m_Icon: {fileID: 0}
m_ResourceFile:
m_NewAssetIndexInList: -1
m_ScrollPosition: {x: 0, y: 0}
m_ScrollPosition: {x: 0, y: 83}
m_GridSize: 16
m_SkipHiddenPackages: 0
m_DirectoriesAreaWidth: 334
m_DirectoriesAreaWidth: 355
--- !u!114 &19
MonoBehaviour:
m_ObjectHideFlags: 52
@ -656,10 +656,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 1448
y: 83
width: 461
height: 948
x: 1419
y: 19
width: 439
height: 966
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@ -697,10 +697,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 948
y: 83
width: 498
height: 337
x: 1
y: 19
width: 333
height: 693
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@ -708,9 +708,9 @@ MonoBehaviour:
m_SceneHierarchy:
m_TreeViewState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 46b50000
m_LastClickedID: 46406
m_ExpandedIDs: c0efffff1af0ffff9af1ffff32fbffffe0ab0000
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 32fbffffc06a0000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -754,10 +754,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 70
y: 83
width: 877
height: 568
x: 0
y: 19
width: 1082
height: 693
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@ -811,7 +811,7 @@ MonoBehaviour:
floating: 0
collapsed: 0
displayed: 1
snapOffset: {x: 0, y: 25}
snapOffset: {x: 0, y: 0}
snapOffsetDelta: {x: 0, y: 0}
snapCorner: 0
id: unity-transform-toolbar
@ -992,9 +992,9 @@ MonoBehaviour:
m_PlayAudio: 0
m_AudioPlay: 0
m_Position:
m_Target: {x: -235.76265, y: -96.757225, z: -37.648766}
m_Target: {x: -187.27528, y: -575.05884, z: 130.28072}
speed: 2
m_Value: {x: -235.76265, y: -96.757225, z: -37.648766}
m_Value: {x: -187.27528, y: -575.05884, z: 130.28072}
m_RenderMode: 0
m_CameraMode:
drawMode: 0
@ -1041,13 +1041,13 @@ MonoBehaviour:
m_GridAxis: 1
m_gridOpacity: 0.5
m_Rotation:
m_Target: {x: -0.3018964, y: -0.27848974, z: 0.09269831, w: -0.9070203}
m_Target: {x: 0.5423778, y: 0.009795776, z: -0.0063570384, w: 0.8400479}
speed: 2
m_Value: {x: -0.30189642, y: -0.27848974, z: 0.09269832, w: -0.90702033}
m_Value: {x: 0.5423804, y: 0.009795822, z: -0.006357068, w: 0.84005183}
m_Size:
m_Target: 103.20677
m_Target: 355.98242
speed: 2
m_Value: 103.20677
m_Value: 355.98242
m_Ortho:
m_Target: 0
speed: 2
@ -1092,10 +1092,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 948
y: 441
width: 498
height: 590
x: 1
y: 733
width: 333
height: 252
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default