Represents a Non-Player Character (NPC) in the game world. Handles decision making, vision, memory, and interaction logic for the NPC.
More...
|
void | Awake () |
| Initializes the NPC, sets up the entity ID, animator, and subscribes to the NPC event bus.
|
|
void | Setup (IDecisionSystem decisionSystem, string modelId, CharacterDTO characterDTO) |
| Sets up the NPC's decision system, model, name, and system prompt. Initializes default memories.
|
|
IDecision | GetCurrentDecision () |
| Gets the current decision being executed by the NPC.
|
|
IDecisionSystem | GetDecisionSystem () |
| Gets the decision system used by the NPC.
|
|
void | LookAt (Transform targetTransform) |
| Makes the NPC look at a specified target transform. Updates the NPC's rotation to face the target. If the target is null, resets the rotation to the previous value. Logs the action for debugging purposes.
|
|
List< CurrentEnvironment > | GetCurrentEnvironment () |
| Returns a list of possible environment descriptions for the NPC.
|
|
void | OnDestroy () |
| Unsubscribes from the NPC event bus when the NPC is destroyed.
|
|
void | OnInteraction () |
| Called when Player starts interacting with NPC, see PlayerController::StartInteraction NPC will look at Player and StoppedDecision will be set to currentDecision
|
|
IEnumerator | DrawConclusions (List< Message > conversation) |
| Coroutine that draws conclusions from conversation using Narrator LLM Model,.
|
|
Represents a Non-Player Character (NPC) in the game world. Handles decision making, vision, memory, and interaction logic for the NPC.
◆ Awake()
Initializes the NPC, sets up the entity ID, animator, and subscribes to the NPC event bus.
◆ DrawConclusions()
IEnumerator NPC.DrawConclusions |
( |
List< Message > |
conversation | ) |
|
Coroutine that draws conclusions from conversation using Narrator LLM Model,.
- Returns
- IEnumerator for coroutine execution.
◆ GetCurrentDecision()
Gets the current decision being executed by the NPC.
- Returns
- The current decision.
◆ GetCurrentEnvironment()
Returns a list of possible environment descriptions for the NPC.
- Returns
- List of CurrentEnvironment objects describing the environment.
◆ GetDecisionSystem()
Gets the decision system used by the NPC.
- Returns
- The decision system.
◆ LookAt()
void NPC.LookAt |
( |
Transform |
targetTransform | ) |
|
Makes the NPC look at a specified target transform. Updates the NPC's rotation to face the target. If the target is null, resets the rotation to the previous value. Logs the action for debugging purposes.
- Parameters
-
targetTransform | The transform of the target to look at. If null, the NPC resets its rotation. |
◆ OnDestroy()
Unsubscribes from the NPC event bus when the NPC is destroyed.
◆ OnInteraction()
void NPC.OnInteraction |
( |
| ) |
|
◆ Setup()
Sets up the NPC's decision system, model, name, and system prompt. Initializes default memories.
- Parameters
-
decisionSystem | The decision system to use. |
modelId | The model ID for LLM-based decision making. |
characterDTO | Character data |
◆ agent
The NavMeshAgent component for navigation.
◆ HisBuilding
GameObject NPC.HisBuilding = null |
The building associated with this NPC.
◆ Hunger
The hunger level of the NPC.
◆ speed
The movement speed of the NPC.
◆ StoppedDecision
◆ Thirst
The thirst level of the NPC.
◆ CharacterData
The Character data generated by Narrator.
◆ EntityID
The unique entity ID of the NPC.
◆ ModelID
string NPC.ModelID = null |
|
get |
The model ID used for LLM-based decision making.
◆ NpcName
string NPC.NpcName = null |
|
get |
◆ ObtainedMemories
The list of memories obtained by the NPC.
◆ SystemPrompt
string NPC.SystemPrompt = null |
|
getset |
The system prompt used for LLM-based decision making.
The documentation for this class was generated from the following file:
- RaymondMaarloeve/Assets/Scripts/NPC/NPC.cs