-
Notifications
You must be signed in to change notification settings - Fork 1
ActionManager
A singleton “logger” MonoBehaviour that tracks player interactions, task progress, chat history, and idle time between tasks, then packages it all into an UploadDataDTO for AIRequest to send to Chat-Service
-
Prefab:
ActionManager, located inVR4VET/Components/ActionManager -
Required Components on the GameObject:
ActionManager.csIdleTimer
-
Also requires to function properly:
- Optional
Grabberinstances (for grab/release events) - A running Task system via
WatchManager(definesTask.Task,Task.Subtask,Task.Step) - A chat/NPC AI implementation (to consume global chat logs)
- A way to send the global chat logs (Handled by
AIRequest.csthroughAIConversationController.cs - Ideally Chat-Service running on a server somewhere
- Optional
-
Scene Changes
- Registers
SceneManager.sceneLoaded→OnSceneLoaded - Writes
scene.nameinto_uploadData.scene_name
- Registers
-
Grab & Release
- Finds all
Grabbercomponents in the scene atOnEnable() - Hooks
onAfterGrabEvent→OnGrabEvent(Grabbable grabbable) - Hooks
onReleaseEvent→OnReleaseEvent(Grabbable grabbable)
- Finds all
To add e.g. UI-button events:
- Register listeners in
OnEnable()- Unregister in
OnDisable()- Implement your handler methods on the same pattern.
- Hierarchy:
Task (ScriptableObject)
└─ Subtask (ScriptableObject)
└─ Step (ScriptableObject)
-
Initialization:
- Call
ActionManager.Instance.LogTaskHierarchy(taskList)after yourTaskHolderhas loaded or reset the list of tasks. -
taskListshould be aList<Task.Task>(as used inWatchManagerandTaskHolder).
- Call
-
Step Completion:
- When a step is completed (typically from
WatchManager.CompleteStep), call:
- When a step is completed (typically from
ActionManager.Instance.LogStepCompletion(finishedStep);-
finishedStepshould be a reference to the completedTask.Stepinstance.
-
Summary Generation:
- To generate a progress summary (for display in the tablet UI, for example), call:
ActionManager.Instance.TaskSummary();- The summary is stored in
ActionManager.Instance.LatestSummaryas an HTML-formatted string with colored progress stats
(this should be updated to Text Fields on gameObjects or the like... at least it shouldn't be in the ActionManager....
-
Global Chat Logs:
- Add messages via
AddChatMessage(Message msg) - Retrieve via
GetGlobalChatLogs()
- Add messages via
- Message DTO:
public class Message {
public string role; // e.g. "user" or "assistant"
public string content;
}-
AI Functionality Toggle:
- Controlled by
SetToggleBool(bool)/GetToggleBool() - Used by AI NPCs (e.g. “AIna” in ReceptionOutdoor scene) to determine if AI features are enabled
- Controlled by
-
Data Collector:
- All info is built into
_uploadData(typeUploadDataDTO) - Sent to
AIRequestwhen conversing with an NPC
- All info is built into
- Recording Custom Actions:
ActionManager.Instance.GetUploadData()
.user_actions
.Add("myCustomAction: details");
// Optionally trim:
// ActionManager.Instance.ShortenList(ActionManager.Instance.GetUploadData().user_actions, 20);-
Common Warnings:
-
“IdleTimer component not found…” → add
IdleTimerto prefab -
“Could not find step X” → ensure
LogStepCompletionis called with the correctStepinstance
-
“IdleTimer component not found…” → add
- Resetting Logs for Tests:
ActionManager.Instance.GetUploadData().user_actions.Clear();
ActionManager.Instance.GetGlobalChatLogs().Clear();
// or replace with new List<T>()Authors:
Trym Lund Flogard
Emil Aron Andresen Mathiesen
Tor Jacob Neple
Quynh-Lan Nguyen Pham
Markus Aleksander Råkil Johansen
Jon Pape Hallem
Herman Sætre
Mikkel Emil Lange Friis
Peter Olai Johnsen
The reception scene is the first scene the player will find themselves in after the application has started. It serves as a central hub between the different work place scenarios.
The fish laboratory is a subsystem of blue-sector, which runs a simulation of tasks related to analysing the health of the salmon population in a fish farm.
The fish factory is a subsystem of blue-sector, which runs a simulation of several tasks at a farmed Atlantic salmon processing facility.
Fish feeding is a subsystem of blue-sector, which runs a simulation of feeding salmon in a fish farming facility.
This section is related to the improvements to the NPC AI functionality and the connecting system that it now works with.