update AI and doc
This commit is contained in:
@@ -73,20 +73,20 @@ custom_minimum_size = Vector2(1, 1)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 1
|
||||
text = "System Logic:
|
||||
- The NPC is based on CharacterBody3D and is managed via a Finite State Machine (FSM).
|
||||
- Movement and navigation are calculated during the _physics_process.
|
||||
- The NPC uses a finite state machine to switch between behaviors.
|
||||
- State logic runs during physics updates, while movement is handled by the agent through NavigationAgent3D.
|
||||
|
||||
AI States:
|
||||
- IdleState: The agent remains stationary for the duration defined by the wait_time variable.
|
||||
- PatrolState: The agent calculates a valid random point and moves toward it.
|
||||
- IdleState: The agent waits in place for the duration defined by wait_time.
|
||||
- PatrolState: The agent selects a valid random destination and moves toward it.
|
||||
|
||||
Core Components:
|
||||
- NavigationAgent3D: Manages pathfinding and detects when the agent reaches its destination.
|
||||
- PatrolRadiusShape: Defines the radius of the area where the agent can move randomly.
|
||||
- StateMachine: Coordinates transitions between states, such as the automatic switch from Idle to Patrol.
|
||||
- NavigationAgent3D: Calculates the path and reports when the destination has been reached.
|
||||
- PatrolRadiusShape: Defines the random movement area used when choosing the next patrol point.
|
||||
- StateMachine: Initializes the available states and handles transitions between them.
|
||||
|
||||
Parameters:
|
||||
Parameters:
|
||||
- Speed: Movement speed of the agent.
|
||||
- Wait Time: Delay in seconds within the IdleState node.
|
||||
- Area Radius: Size of the SphereShape3D inside the PatrolRadiusShape node."
|
||||
- Wait Time: Delay in seconds on the IdleState node.
|
||||
- Area Radius: Radius of the SphereShape3D used by PatrolRadiusShape."
|
||||
autowrap_mode = 2
|
||||
|
||||
Reference in New Issue
Block a user