𧱠General Structure
<aside>
<img src="/icons/hexagon-dashed_green.svg" alt="/icons/hexagon-dashed_green.svg" width="40px" /> Blackboard Manager Script
- Contains Enum of keys we wanna keep track of
- The AI focused on
- The objects in use in the Household
- Short term and long term memories
<aside>
<img src="/icons/hexagon-dashed_green.svg" alt="/icons/hexagon-dashed_green.svg" width="40px" /> Blackboard Manager
- Singleton
- Contains Enum of keys of the stats we wanna keep track of
- Contains Dictionary & getters of all individual blackboards and Shared Blackboards
</aside>
<aside>
<img src="/icons/slideshow_green.svg" alt="/icons/slideshow_green.svg" width="40px" /> Blackboard
- Contains Dictionaries for a wide range of value types (Int, FLoat, Bool, String, Vector3, GameObject, AIStat)
- Contains Dictionary for generic values that donât fit in the other ones
- Setters and Getters for all dictionaries based on keys in Enum
</aside>
</aside>
<aside>
<img src="/icons/square-dashed_blue.svg" alt="/icons/square-dashed_blue.svg" width="40px" /> Smart Object Manager
- Singleton
- Registers/Deregisters smart objects
- Contains list of SM
</aside>
<aside>
<img src="/icons/square-alternate_blue.svg" alt="/icons/square-alternate_blue.svg" width="40px" /> Smart Object
- Contains list of Base interactions
</aside>
<aside>
<img src="/icons/cursor_orange.svg" alt="/icons/cursor_orange.svg" width="40px" /> Base Interaction (Abstract)
</aside>
<aside>
<img src="/icons/cursor-button_orange.svg" alt="/icons/cursor-button_orange.svg" width="40px" /> Simple Interaction (inherits from Base Interaction)
</aside>
<aside>
<img src="/icons/die4_brown.svg" alt="/icons/die4_brown.svg" width="40px" /> Outcome(s)
</aside>
đ€ AI
<aside>
<img src="/icons/sliders-horizontal_red.svg" alt="/icons/sliders-horizontal_red.svg" width="40px" /> AIStatConfiguration
- Contains LinkedStat
- Bool to determine if Default values are overridden
- Slider for NEW initial value
- Slider for NEW Decay Rate
</aside>
<aside>
<img src="/icons/robot_purple.svg" alt="/icons/robot_purple.svg" width="40px" /> Common AI Base
- Contains:
- Array of AIStatConfiguration
- Dictionary of all AI StatPanels & Decay Rates
- FeedbackUIPanel LinkedUI
- Reference to Navigation
- An IndividualBlackboard and a HouseholdBlackboard
- References the blackboard to get all the stats (using get and set)
- HouseholdID for shared blackboard
- Long Term Memory Threshold: How many times a memory needs to happen before itâs transfered to long term memory
- Holds the logic to perform action we need to perform and stop it
- Function Start
- Sets up initial values and decay rates of all stats
- Updates blackboard and FeedbackUIPanel in consequence
- Function ApplyTraitsTo.
- Loops through all traits and changes the value of stats based on traitsâ properties
- In Update for decayRates
- In UpdateStats for the Impact when performing actions
- Function Update & UpdateIndividualStat
- Update stats based on their target type (day rate / impact / score)
- Update amount in blackboard & UI
- Ticks all its recent memories and remove them when their duration is over
- Function GetStatValue: get stat from Blackboard
- Function AddMemories et Add Memories
- Ajoute tous les souvenirs dâun Outcome
- Vérifie si chaque souvenir est déjà dans la mémoire du AI
- Supprime les souvenirs qui sâannulent entre eux
- Renforce les souvenirs déjà présents
- Upgrade les souvenirs rĂ©cents en souvenirs permanents sâils atteignent le Long Term Memory Threshold
- Le tout en allant chercher les listes de souvenirs Permanents / RĂ©cents du Blackboard, en les modifiant dans la fonction et en updatant le blackboard avec la nouvelle liste
</aside>
<aside>
<img src="/icons/user_green.svg" alt="/icons/user_green.svg" width="40px" /> Individual Blackboard
</aside>
<aside>
<img src="/icons/home_green.svg" alt="/icons/home_green.svg" width="40px" /> Household Blackboard
</aside>
<aside>
<img src="/icons/heart_pink.svg" alt="/icons/heart_pink.svg" width="40px" /> List of traits
</aside>
<aside>
<img src="/icons/activity_red.svg" alt="/icons/activity_red.svg" width="40px" /> Array of AIStatConfiguration
</aside>
<aside>
<img src="/icons/directional-sign-right_red.svg" alt="/icons/directional-sign-right_red.svg" width="40px" /> Dictionary of StatPanels
</aside>
<aside>
<img src="/icons/thought_yellow.svg" alt="/icons/thought_yellow.svg" width="40px" /> Long Term Memories (Via BlackBoard)
</aside>
<aside>
<img src="/icons/thought_yellow.svg" alt="/icons/thought_yellow.svg" width="40px" /> Short Term Memories (Via BlackBoard)
</aside>
<aside>
<img src="/icons/person-masculine_purple.svg" alt="/icons/person-masculine_purple.svg" width="40px" /> Simple Ai (Inherits from Common AI Base) (Obsolete)
</aside>
- Decay Rate: Les stats diminuent de 0,005 par seconde
- Pick Interaction interval: LâAI attend 2 secondes avant de choisir une nouvelle interaction
<aside>
<img src="/icons/child_purple.svg" alt="/icons/child_purple.svg" width="40px" /> Not So Simple AI (Inherits from Common AI Base)
- Default Interaction Score
- Pick interaction interval
- Interaction Pick Size
- Lâagent va piger les 5 premiĂšres interactions les plus pertinentes et en choisir une au hasard parmis celles-ci (voir Weighted-random Action selection)
- Lâagent utilise lâobjet seulement sâil nâest pas utilisĂ© par un autre agent, en vĂ©rifiant dans le HouseholdBlackboard si lâobjet est utilisĂ©
- Bool AvoidInUseObjects
- Chaque statistique peut ĂȘtre modifiĂ©e individuellement pour chaque instance du AI si nĂ©cessaire
- Function ApplyTraitsTo inherited from CommonBaseAI to adapt values of scoring based on traits properties in ScoreChange
- Function Score Interaction
- Scoring to pick the interaction will be influenced by the memories and the traits
- Function Score Change
- Function Pick Best Interaction
</aside>
â„ïž Trait
<aside>
<img src="/icons/heart-outline_pink.svg" alt="/icons/heart-outline_pink.svg" width="40px" />
</aside>
đ Stat
đ Memory Fragment