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
|
||||
|
||||
@@ -112,20 +112,21 @@ size_flags_horizontal = 3
|
||||
text = "System Logic:
|
||||
- The system allows players to toggle a free camera mode to photograph and collect museum items.
|
||||
- Game Pause: Activating the mode pauses the SceneTree, freezing the world while allowing the camera to remain functional.
|
||||
- It uses a raycasting check to verify if a collectible is visible and unobstructed before unlocking it.
|
||||
- The CollectionManager acts as a global singleton to track unlocked IDs and manage the library data.
|
||||
- Save Collectibles and Photo
|
||||
- Taking a photo saves the captured image to disk and checks which collectibles are visible and unobstructed before unlocking them.
|
||||
- CollectionManager acts as a global singleton that tracks unlocked collectibles, saved photos, and the data used by the UI.
|
||||
|
||||
Photo Mode Actions:
|
||||
- Toggle Mode(P): Switches between normal gameplay and the photo camera, capturing or releasing the mouse, and toggles the global pause state.
|
||||
- Orbit & Pan(Mouse): The camera rotates around a target and can be panned horizontally or vertically.
|
||||
- Capture(F): Performs a frustum check and a raycast to identify the target in view.
|
||||
- Rotate(Mouse): The camera orbits around the configured target while photo mode is active.
|
||||
- Pan(Input Actions): The camera can be moved horizontally and vertically within the configured bounds.
|
||||
- Capture(F): Saves the current frame and performs frustum and raycast checks against collectibles in view.
|
||||
|
||||
Core Components:
|
||||
- PhotoModeController: Manages camera inputs, movement logic, and the photo-taking process.
|
||||
- Collectible: An Area3D node placed on objects to make them identifiable by the camera.
|
||||
- CollectionManager: Handles the logic for unlocking items and provides data to the UI.
|
||||
- CollectionCompendium: A UI grid that displays all items and visually highlights unlocked ones.
|
||||
- CollectibleGallery: Displays all collectibles and visually highlights the unlocked ones.
|
||||
- PhotoGallery: Displays the photos saved by the player during the session.
|
||||
|
||||
Parameters:
|
||||
- Pan & Rotation Speed: Defines how fast the camera moves and rotates.
|
||||
|
||||
@@ -85,6 +85,7 @@ Core Functionality:
|
||||
- Playlist Management: Stores a list of AudioStream resources and tracks the current song index.
|
||||
- Track Navigation: Allows cycling forward and backward through the playlist with index wrapping (loops back to start/end).
|
||||
- Playback Control: Supports jumping to specific tracks, toggling the pause state, and stopping the stream.
|
||||
- Audio Settings: If the Music bus exists, the Settings menu can be used to test and adjust playback volume.
|
||||
|
||||
Key Methods:
|
||||
- play_track: Loads a specific stream from the playlist and begins playback.
|
||||
@@ -92,8 +93,7 @@ Key Methods:
|
||||
- toggle_pause: Resumes or pauses the current stream without resetting its position.
|
||||
|
||||
Adjustable Parameters:
|
||||
- Playlist: An Array in the inspector where you can assign multiple AudioStream resources (e.g., .mp3, .ogg).
|
||||
- Current Track Index: Determines which song starts playing by default."
|
||||
- Playlist: An Array in the inspector where you can assign one or more AudioStream resources."
|
||||
autowrap_mode = 2
|
||||
|
||||
[connection signal="pressed" from="Control/VBoxContainer2/VBoxContainer/Button_Play" to="." method="_on_button_play_pressed"]
|
||||
|
||||
Reference in New Issue
Block a user