Upgrade Guide
General Upgrade Guide¶
Since the folder structure of this plugin might change frequently, the best way to upgrade Utility Intelligence to a newer version is to first delete your old asset folders and then re-import the new version:
- Backup your project
- Delete the following folders:
- v1
- Assets/CarlosLab/Common
- Assets/CarlosLab/UtilityIntelligence
- v2
- Packages/com.carloslab.common
- Packages/com.carloslab.utilityintelligence
- v1
- Download the new version and then re-import the package.
However, if the changes are minor, such as upgrading from v2.0.1 to v2.0.2, you can re-import the new version without having to delete the old asset folders.
Upgrading from v1 to v2¶
2.0.0 is a major release with a lot of changes. It includes some breaking changes that require manual updates when upgrading from v1 to v2. Sorry for the inconvenience.
Caution
These changes may break your project, so please backup your project before upgrading.
Intelligence Asset¶
We’ve made some breaking changes to the data structure of Intelligence Assets and increased the data version from v1 to v2. Therefore, you need to update your intelligence assets to data v2 so that this framework can deserialize them.
- Update the intelligence data.
- Select File -> Show Data to show the intelligence data.
- Change
MyDistanceToTargetInput
toDistanceToTargetInput
. - Change
NavMeshMoveTowards
toMoveToTarget
. - Remove all InputNormalizations from all Considerations.
- Move Decisions from DecisionMakers to the outer scope.
Data Structure - v1
{ "$type": "CarlosLab.UtilityIntelligence.UtilityIntelligenceModel", "DecisionMakers": [ { "$type": "CarlosLab.UtilityIntelligence.DecisionMakerModel", "Id": "6f5616e5-a485-4c3b-9bc4-1eb1f10530fa", "Name": "Warrior", "Decisions": [ { "$type": "CarlosLab.UtilityIntelligence.DecisionModel", "Id": "a36b4f16-d8d0-4069-94ab-925828eb3c7d", "Name": "MoveToHealthStation", ... } ], ... } ], ... }
Data Structure - v2
{ "$type": "CarlosLab.UtilityIntelligence.UtilityIntelligenceModel", "DecisionMakers": [ { "$type": "CarlosLab.UtilityIntelligence.DecisionMakerModel", "Id": "6f5616e5-a485-4c3b-9bc4-1eb1f10530fa", "Name": "Warrior", ... } ], "Decisions": [ { "$type": "CarlosLab.UtilityIntelligence.DecisionModel", "Id": "a36b4f16-d8d0-4069-94ab-925828eb3c7d", "Name": "MoveToHealthStation", ... } ], ... }
- Select File -> Import Data to import the new intelligence data to the asset.
- Create new input normalizations in the Input Normalization Tab.
- Select the appropriate input normalization for your considerations in the Consideration Tab.
- Add decisions to your decision makers in the Intelligence Tab.
Source Code¶
Input¶
Add the in
keyword before InputContext
in the OnGetRawInput
function.
v1
v2
InputNormalization¶
Change InputContext
to in InputNormalizationContext
in the OnCalculateNormalizedInput
function.
v1
v2
protected override float OnCalculateNormalizedInput(int rawInput, in InputNormalizationContext context)
If you like Utility Intelligence, please consider supporting it by leaving a 5-star review on the Asset Store.
Your positive feedback motivates me to keep improving and delivering more updates for this framework.
Thank you so much for your support. I love you all! 🥰

Created : September 1, 2024