Navigation and AI merge for level 3 #445

Merged
maverickdgg merged 6 commits from Navigation into main 2023-03-25 18:49:20 +08:00
4 changed files with 114 additions and 60 deletions
Showing only changes of commit 4a149508c9 - Show all commits

Binary file not shown.

View File

@ -0,0 +1,3 @@
Name: Level3_NavData
ID: 263362242
Type: 15

View File

@ -1,4 +1,4 @@
- NavData: 0 - NavData: 263362242
- EID: 0 - EID: 0
Name: Light_Direction Name: Light_Direction
IsActive: true IsActive: true
@ -4573,6 +4573,15 @@
Density: 1 Density: 1
Position Offset: {x: 0.284000009, y: 0.305999994, z: 0.555999994} Position Offset: {x: 0.284000009, y: 0.305999994, z: 0.555999994}
Rotation Offset: {x: 0, y: 0, z: 0} Rotation Offset: {x: 0, y: 0, z: 0}
- Is Trigger: false
Collision Tag: 9
Type: Box
Half Extents: {x: 1.70000005, y: 1, z: 1.79999995}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: -0.200000003, y: 0.200000003, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
- EID: 206 - EID: 206
@ -5696,7 +5705,7 @@
Collider Component: Collider Component:
Colliders: Colliders:
- Is Trigger: false - Is Trigger: false
Collision Tag: 7 Collision Tag: 8
Type: Box Type: Box
Half Extents: {x: 15, y: 1, z: 15} Half Extents: {x: 15, y: 1, z: 15}
Friction: 0.400000006 Friction: 0.400000006
@ -8930,60 +8939,6 @@
Clicked: false Clicked: false
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
- EID: 542
Name: ====AI=====
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 1.19757175, y: 0, z: 0.855755448}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 148542784
Material: 121518381
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
Angular Drag: 0.100000001
Gravity Scale: 1
Use Gravity: true
Interpolate: false
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: true
Freeze Rotation Y: false
Freeze Rotation Z: true
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Collision Tag: 5
Type: Box
Half Extents: {x: 0.600000024, y: 1.79999995, z: 0.400000006}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0.899999976, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Scripts:
- Type: Homeowner1
Enabled: true
waypointsPool: 541
startWaypoint: 540
patrolSpeed: 0.75
chaseSpeed: 2
turningSpeed: 5
sightDistance: 8
eyeOffset: [0, 1.64999998, 0]
distanceToCapture: 0.800000012
captureTime: 0.5
footstepSFXIntervalMultiplier: 0.5
- EID: 541 - EID: 541
Name: ====WaypointPool==== Name: ====WaypointPool====
IsActive: true IsActive: true
@ -12335,7 +12290,7 @@
NumberOfChildren: 8 NumberOfChildren: 8
Components: Components:
Transform Component: Transform Component:
Translate: {x: 5.5, y: 0.171148509, z: 10} Translate: {x: 5.5, y: 0.300000012, z: 10}
Rotate: {x: -0, y: -3.1415925, z: 0} Rotate: {x: -0, y: -3.1415925, z: 0}
Scale: {x: 0.999999404, y: 1, z: 0.999999404} Scale: {x: 0.999999404, y: 1, z: 0.999999404}
IsActive: true IsActive: true
@ -15498,3 +15453,99 @@
Acceleration: {x: 0, y: 0.100000001, z: 0} Acceleration: {x: 0, y: 0.100000001, z: 0}
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
- EID: 66078
Name: ====AI=====
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: -2.93461704}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
Mesh: 148542784
Material: 121518381
IsActive: true
RigidBody Component:
Type: Dynamic
Drag: 0.00999999978
Angular Drag: 0.100000001
Gravity Scale: 1
Use Gravity: true
Interpolate: false
Sleeping Enabled: true
Freeze Position X: false
Freeze Position Y: false
Freeze Position Z: false
Freeze Rotation X: true
Freeze Rotation Y: false
Freeze Rotation Z: true
IsActive: true
Collider Component:
Colliders:
- Is Trigger: false
Collision Tag: 5
Type: Box
Half Extents: {x: 0.600000024, y: 1.79999995, z: 0.400000006}
Friction: 0.400000006
Bounciness: 0
Density: 1
Position Offset: {x: 0, y: 0.899999976, z: 0}
Rotation Offset: {x: 0, y: 0, z: 0}
IsActive: true
Navigation Component:
Target: {x: 0, y: 0, z: 0}
Forward: {x: 0, y: 0, z: 0}
Recalculate Path: true
Unreachable Target: false
Tolerance: 1
Acceptance threshold: 0.100000001
IsActive: true
Animator Component:
Rig: 76586906
AnimationController: 0
IsActive: true
Scripts:
- Type: SHADE_Scripting.Gameplay.AIBehaviour.AIRework.AILineOfSight
Enabled: true
player: 65775
range: 5
angle: 30
angleBetween: 0
distance: 0
heightLimit: 1
rayOffset: [0, 0, 0]
withinRange: false
withinSight: false
lastFoundPos: [0, 0, 0]
lastFoundTimer: 0
- Type: SHADE_Scripting.Gameplay.AIBehaviour.AIRework.RotateToVelocity
Enabled: true
rotationPerSecond: 5
active: true
rotateToPlayerLastKnown: false
lookAround: false
- Type: SHADE_Scripting.Gameplay.AIBehaviour.AIRework.HomeOwnerAI
Enabled: true
idleDuration: 1
timeoutDuration: 2
patrolPointParent: 541
patrolSpeed: 1
chaseSpeed: 3
alertCooldown: 0
player: 65775
attackHitbox: 627
walkingAnim: 229189609
idleAnim: 224442713
alertAnim: 227890696
alertRunAnim: 230172366
alertIdleAnim: 234046577
timeoutAnim: 228323560
atkWindupAnim: 223078653
atkHoldAnim: 228250554
atkSeqAnim: 226129627
- Type: StateMachine
Enabled: true
currentStateName: ""
currentAnimName: ""

View File

@ -240,8 +240,8 @@ namespace SHADE
if (system->drawNavigationArea) if (system->drawNavigationArea)
{ {
SHTransform trans; SHTransform trans;
trans.position = SHVec3{ 0.0f }; trans.position = system->origin_editor;
trans.scale = navigationAreaSize; trans.scale = system->size_editor;
trans.ComputeTRS(); trans.ComputeTRS();
debugDrawSystem->DrawWireCube(trans.trs, SHColour::YELLOW, false); debugDrawSystem->DrawWireCube(trans.trs, SHColour::YELLOW, false);
} }