V3.1.4 应用Parameter数值到Script

应用Parameter数值到Script
This commit is contained in:
Koha9 2023-07-11 18:32:28 +08:00
parent 0b0c0771ce
commit 13e5c82862
7 changed files with 43198 additions and 113 deletions

View File

@ -6610,7 +6610,7 @@ MonoBehaviour:
vX: 0
vZ: 0
thisMovement: {x: 0, y: 0, z: 0}
acceleration: 0.1
acceleration: 0.9
mouseXSensitivity: 100
mouseYSensitivity: 200
yRotation: 0.1
@ -7563,7 +7563,7 @@ MonoBehaviour:
targetTimeBonusPerSec: 0.5
areaTimeBonusPerSec: 0.2
distanceReward: 50
facingTargetReward: 20
facingTargetReward: 10
goWinRewardDefault: 999
attackWinRewardDefault: 999
defenceWinRewardDefault: 999
@ -7571,12 +7571,12 @@ MonoBehaviour:
nonReward: -1
loseReward: -999
shootReward: -0.5
hitReward: -5
killReward: -5
hitNonTargetReward: -5
killNonTargetReward: -5
shootWithoutReadyReward: -1.15
killBonusReward: 0
facingReward: 2
shootTargetAreaReward: 5
facingReward: 5
shootTargetAreaReward: 10
movePenalty: 0.1
spinPenalty: 0.08
mousePenalty: 0.06

File diff suppressed because it is too large Load Diff

View File

@ -20,7 +20,7 @@ public class AgentController : MonoBehaviour
public float vX = 0f;
public float vZ = 0f;
public Vector3 thisMovement;
public float acceleration = 0.1f; // 加速度
public float acceleration = 0.9f; // 加速度
public float mouseXSensitivity = 100;
public float mouseYSensitivity = 200;
public float yRotation = 0.1f;//定义一个浮点类型的量记录围绕X轴旋转的角度

View File

@ -19,90 +19,90 @@ public class ParameterContainer : MonoBehaviour
public int timeLimit = 30;
public bool lockCameraX = false;
public bool lockCameraY = true;
public bool spawnAgentInAllMap = false;
public int spinRecordMax = 20;
public float spinPenaltyThreshold = 50;
public bool spawnAgentInAllMap = true;
public int spinRecordMax = 40;
public float spinPenaltyThreshold = 10;
public float facingInviewEnemyDisCOEF = 0.5f;
[Header("Dynamic Defaut Rewards")]
//[Tooltip("Hit Enemy reward")]
//public float hitRewardDefault = 60.0f;
[Tooltip("Free mode Hit Enemy reward")]
public float hitTargetRewardDefault = 60.0f;
public float hitTargetRewardDefault = 25f;
//[Tooltip("Enemy down reward")]
//public float killRewardDefault = 60.0f;
[Tooltip("Enemy down in area Reward")]
public float killTargetEnemyRewardDefault = 100.0f;
public float killTargetEnemyRewardDefault = 25f;
[Tooltip("stay in firebasesArea reward")]
public float inAreaRewardDefault = 10.0f;
public float inAreaRewardDefault = 12f;
[Tooltip("free left time bonus reward. ALLR + leftTime * r")]
public float freeTimeBonusPerSec = 1.0f;
[Tooltip("target left time bonus reward. ALLR + leftTime * r")]
public float targetTimeBonusPerSec = 3.0f;
public float targetTimeBonusPerSec = 0.5f;
[Tooltip("in area left time bonus reward. ALLR + leftTime * r")]
public float areaTimeBonusPerSec = 1.0f;
public float areaTimeBonusPerSec = 0.2f;
[Tooltip("distance reward reward = r*(1-(nowDis/startDis))")]
public float distanceReward = 20.0f;
public float distanceReward = 50.0f;
[Tooltip("facing to Target distance reward reward = r*(1-(nowDis/startDis))")]
public float facingTargetReward = 20.0f;
public float facingTargetReward = 10.0f;
[Space(10)]
[Tooltip("Goto Win reward")]
public float goWinRewardDefault = 100.0f;
public float goWinRewardDefault = 999f;
[Tooltip("Attack Win reward")]
public float attackWinRewardDefault = 100.0f;
public float attackWinRewardDefault = 999f;
[Tooltip("Defence Win reward")]
public float defenceWinRewardDefault = 100.0f;
public float defenceWinRewardDefault = 999f;
[Tooltip("free Win reward")]
public float freeWinRewardDefault = 100.0f;
public float freeWinRewardDefault = 999f;
[Header("Static Rewards")]
[Tooltip("Nothing happened reward")]
public float nonReward = -0.05f;
public float nonReward = -1f;
[Tooltip("Episode Lose reward")]
public float loseReward = -0.05f;
public float loseReward = -999f;
[Tooltip("Agent Do shoot action reward")]
public float shootReward = -0.1f;
public float shootReward = -0.5f;
[Tooltip("Hit Not target Enemy reward")]
public float hitReward = 30.0f;
public float hitNonTargetReward = -5f;
[Tooltip("Not Target Enemy down reward")]
public float killReward = 40.0f;
public float killNonTargetReward = -5f;
[Tooltip("Agent Do shoot action but gun is not read")]
public float shootWithoutReadyReward = -0.15f;
public float shootWithoutReadyReward = -1.15f;
[Tooltip("Kill bonus reward stack to nothing happend reward")]
public float killBonusReward = 0.0f;
[Tooltip("Facing to enemy's reward")]
public float facingReward = 2.0f;
public float facingReward = 5f;
[Tooltip("Shoot at target area but didn't hit enemy")]
public float shootTargetAreaReward = 5.0f;
public float shootTargetAreaReward = 10f;
[Header("Penalty Rewards")]
[Tooltip("move Penalty Reward")]
public float movePenalty = 0f;
public float movePenalty = 0.1f;
[Tooltip("spiiiiiiin Panalty Reward")]
public float spinPenalty = 0f;
public float spinPenalty = 0.08f;
[Tooltip("while move mouse a little bit's penalty")]
public float mousePenalty = 0f;
public float mousePenalty = 0.06f;
[Header("Dynamic Rewards")]
[Tooltip("Free mode Hit Enemy reward")]
@ -112,7 +112,7 @@ public class ParameterContainer : MonoBehaviour
public float killTargetEnemyReward = 80.0f;
[Tooltip("stay in firebasesArea reward")]
public float inAreaReward = 1.0f;
public float inAreaReward = 5.0f;
[Space(10)]
[Tooltip("go Win reward")]

View File

@ -17,7 +17,7 @@ public class RaySensors : MonoBehaviour
//[SerializeField, Range(0, 1)] public float totalRange = 1f; // Total view range Max = 1
[SerializeField, Range(0, 1)] public float focusRange = 0.15f; // center focus range
public int halfOuterRayNum = 3; // >=2
public int halfOuterRayNum = 7; // >=2
public int focusRayNum = 5; // >= 1 and must be odd num!
[Header("InGameLineSetting")]

View File

@ -449,7 +449,7 @@ public float KillReward(Vector3 enemyPosition)
}
else
{
thisKillReward = paramCon.killReward;
thisKillReward = paramCon.killNonTargetReward;
}
}
else if (targetTypeInt == (int)SceneBlockContainer.Targets.Free)
@ -460,7 +460,7 @@ public float KillReward(Vector3 enemyPosition)
else
{
// goto & defence
thisKillReward = paramCon.killReward;
thisKillReward = paramCon.killNonTargetReward;
}
return thisKillReward;
}
@ -481,7 +481,7 @@ public float HitEnemyReward(Vector3 enemyPosition)
else
{
// hit not in area enemy
thisHitReward = paramCon.hitReward;
thisHitReward = paramCon.hitNonTargetReward;
}
}
else if (targetTypeInt == (int)SceneBlockContainer.Targets.Free)
@ -492,7 +492,7 @@ public float HitEnemyReward(Vector3 enemyPosition)
else
{
// goto & defence
thisHitReward = paramCon.hitReward;
thisHitReward = paramCon.hitNonTargetReward;
}
return thisHitReward;
}

View File

@ -14,16 +14,16 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_PixelRect:
serializedVersion: 2
x: 637
y: 162
width: 1016
height: 1021
x: 64
y: 43
width: 1856
height: 1037
m_ShowMode: 4
m_Title: Game
m_Title: Scene
m_RootView: {fileID: 9}
m_MinSize: {x: 875, y: 300}
m_MaxSize: {x: 10000, y: 10000}
m_Maximized: 0
m_Maximized: 1
--- !u!114 &2
MonoBehaviour:
m_ObjectHideFlags: 52
@ -40,9 +40,9 @@ MonoBehaviour:
m_Position:
serializedVersion: 2
x: 0
y: 705
width: 593
height: 266
y: 717
width: 1083
height: 270
m_MinSize: {x: 231, y: 271}
m_MaxSize: {x: 10001, y: 10021}
m_ActualView: {fileID: 15}
@ -70,12 +70,12 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 593
height: 971
width: 1083
height: 987
m_MinSize: {x: 100, y: 200}
m_MaxSize: {x: 8096, y: 16192}
vertical: 1
controlID: 108
controlID: 23
--- !u!114 &4
MonoBehaviour:
m_ObjectHideFlags: 52
@ -92,9 +92,9 @@ MonoBehaviour:
m_Position:
serializedVersion: 2
x: 0
y: 705
width: 173
height: 266
y: 717
width: 316
height: 270
m_MinSize: {x: 102, y: 121}
m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 19}
@ -119,14 +119,14 @@ MonoBehaviour:
- {fileID: 4}
m_Position:
serializedVersion: 2
x: 593
x: 1083
y: 0
width: 173
height: 971
width: 316
height: 987
m_MinSize: {x: 100, y: 200}
m_MaxSize: {x: 8096, y: 16192}
vertical: 1
controlID: 119
controlID: 63
--- !u!114 &6
MonoBehaviour:
m_ObjectHideFlags: 52
@ -144,10 +144,10 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 173
height: 705
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 4000, y: 4000}
width: 316
height: 717
m_MinSize: {x: 202, y: 221}
m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 17}
m_Panes:
- {fileID: 17}
@ -173,12 +173,12 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 30
width: 1016
height: 971
width: 1856
height: 987
m_MinSize: {x: 300, y: 200}
m_MaxSize: {x: 24288, y: 16192}
vertical: 0
controlID: 107
controlID: 17
--- !u!114 &8
MonoBehaviour:
m_ObjectHideFlags: 52
@ -194,12 +194,12 @@ MonoBehaviour:
m_Children: []
m_Position:
serializedVersion: 2
x: 766
x: 1399
y: 0
width: 250
height: 971
m_MinSize: {x: 275, y: 50}
m_MaxSize: {x: 4000, y: 4000}
width: 457
height: 987
m_MinSize: {x: 276, y: 71}
m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 16}
m_Panes:
- {fileID: 16}
@ -225,8 +225,8 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 1016
height: 1021
width: 1856
height: 1037
m_MinSize: {x: 875, y: 300}
m_MaxSize: {x: 10000, y: 10000}
m_UseTopView: 1
@ -250,7 +250,7 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 1016
width: 1856
height: 30
m_MinSize: {x: 0, y: 0}
m_MaxSize: {x: 0, y: 0}
@ -271,8 +271,8 @@ MonoBehaviour:
m_Position:
serializedVersion: 2
x: 0
y: 1001
width: 1016
y: 1017
width: 1856
height: 20
m_MinSize: {x: 0, y: 0}
m_MaxSize: {x: 0, y: 0}
@ -293,8 +293,8 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 593
height: 705
width: 1083
height: 717
m_MinSize: {x: 201, y: 221}
m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 18}
@ -443,10 +443,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 637
y: 897
width: 592
height: 245
x: 64
y: 790
width: 1082
height: 249
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@ -470,7 +470,7 @@ MonoBehaviour:
m_ViewMode: 1
m_StartGridSize: 16
m_LastFolders:
- Assets
- Assets/Script/InGame
m_LastFoldersGridSize: 16
m_LastProjectPath: C:\Users\UCUNI\OneDrive\Unity\ML-Agents\Aimbot-ParallelEnv
m_LockTracker:
@ -479,7 +479,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 05ca9a3b
m_LastClickedID: 1000000005
m_ExpandedIDs: 00000000ee660000f0660000f2660000f4660000f66600001467000000ca9a3b
m_ExpandedIDs: 000000006a7600006c7600006e760000707600007276000000ca9a3b
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -507,7 +507,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 00000000ee660000f0660000f2660000f4660000f6660000
m_ExpandedIDs: 000000006a7600006c7600006e7600007076000072760000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -534,7 +534,7 @@ MonoBehaviour:
m_ListAreaState:
m_SelectedInstanceIDs:
m_LastClickedInstanceID: 0
m_HadKeyboardFocusLastEvent: 1
m_HadKeyboardFocusLastEvent: 0
m_ExpandedInstanceIDs: c62300008a5c000000000000
m_RenameOverlay:
m_UserAcceptedRename: 0
@ -583,10 +583,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 1403
y: 192
width: 249
height: 950
x: 1463
y: 73
width: 456
height: 966
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@ -624,10 +624,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 1230
y: 192
width: 171
height: 684
x: 1147
y: 73
width: 314
height: 696
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@ -637,7 +637,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 787bffffda7bffff22b3ffff3ab8ffff7cbdffffe6bdffff3cbeffff64c6ffff70cbffffcecbffff3cccffff9eccffff02d0ffff58d0ffff6ae5ffff40e6ffff90e6ffffe0e6ffff7aecffff18f3ffff6ef3ffffd8f3ffff32fbfffff87e00007c910000c6a3000054ca000034f100000e370100
m_ExpandedIDs: 32fbffff
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -681,10 +681,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 637
y: 192
width: 592
height: 684
x: 64
y: 73
width: 1082
height: 696
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@ -919,9 +919,9 @@ MonoBehaviour:
m_PlayAudio: 0
m_AudioPlay: 0
m_Position:
m_Target: {x: 208.58499, y: -370.4251, z: 418.47623}
m_Target: {x: 35.909485, y: -489.08286, z: 447.1831}
speed: 2
m_Value: {x: 208.58499, y: -370.4251, z: 418.47623}
m_Value: {x: 35.909485, y: -489.08286, z: 447.1831}
m_RenderMode: 0
m_CameraMode:
drawMode: 0
@ -970,11 +970,11 @@ MonoBehaviour:
m_Rotation:
m_Target: {x: 0.32789153, y: 0.21797852, z: -0.078089386, w: 0.9158536}
speed: 2
m_Value: {x: 0.32790574, y: 0.21798797, z: -0.07809277, w: 0.9158933}
m_Value: {x: -0.32789153, y: -0.21797852, z: 0.078089386, w: -0.9158537}
m_Size:
m_Target: 472.939
m_Target: 574.0399
speed: 2
m_Value: 472.939
m_Value: 574.0399
m_Ortho:
m_Target: 0
speed: 2
@ -1019,10 +1019,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 1230
y: 897
width: 171
height: 245
x: 1147
y: 790
width: 314
height: 249
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default