Addressable UMA 2.10 and Unity 2019.3 issues
nakedfighter3d opened this issue · 4 comments
Hey! I have issues with switching UMA race/dna. The bug is pretty random. Sometimes everything works fine, but sometimes when I
- create default Male character
- create default Female character
- switching between them in the select character window
female loading with completely broken sizes/dna. Sometimes it works well in solo game mode, but bugged in MMO mode. Very random.
UMA has a major 2.10 update with the addressables support and many loading\performance improvements. Maybe it's somehow related. Also, it requires some changes in the pipeline and some integration fixes with MMO Kit as well. Here are my steps to set up a new project and reproduce the bug.
- Setup new project with Unity 2019.3
- Import MMORPG Kit
- Import Addressables package
- Copy latest UMA 2.10a3 from github
--- start UMA setup part --- - Add UMA_ADDRESSABLES to project settings/player settings
- In the new UMA / Global Library select Addressables/Generate Shared Group (fast)
- In Window/Asset Manager/Addressables create new setup and Build Player Content
--- end UMA setup part --- - Import UnityMultiplayerARPG_UMA_1.13_2018.2
- in UIUmaDnaSlider.cs add to header using UMA;
- Open 00init_UMA/00init_MMO_UMA/ and replace UMA_DCS with UMA_GLIB
OK, I see that it's somehow connected with the error I got when switching from male race to female.
KeyNotFoundException: The given key was not present in the dictionary. System.Collections.Generic.Dictionary
2[TKey,TValue].get_Item (TKey key) (at <437ba245d8404784b9fbab9b439ac908>:0)
MultiplayerARPG.UIUmaDnaSlider.OnSliderValueChanged (System.Single value) (at Assets/UMAExtension/Scripts/UI/UIUmaDnaSlider.cs:55)
MultiplayerARPG.UIUmaDnaSlider.Setup (MultiplayerARPG.UICharacterCreateUMA ui, System.Byte slotIndex, UMA.DnaSetter dnaSetter) (at Assets/UMAExtension/Scripts/UI/UIUmaDnaSlider.cs:47)
MultiplayerARPG.UICharacterCreateUMA+d__40.MoveNext () (at Assets/UMAExtension/Scripts/UI/UICharacterCreateUMA.cs:158)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at :0)`
After that, the character file we saved to the database has most of the DNA switched to zero.
i.e.
ArmLength = 0.5
ArmWidth = 0.5
BreastClevage = 0.5
...and after that all the DNA = 0
UPD.2
it's definitely something related to the new UMA library approach.
With legacy UMA_DCS - everything is fine
With new UMA_GLIB - female character drops an error and fails to set/save DNAs
UPD: SOLUTION
I reach out with UMA developers and they kindly provide me with this edit.
in UIUmaDnaSlider.cs, change the following:
ui.UmaModel.CacheUmaAvatar.GetDNA()[dnaName].Set(value);
to:
var DNA = ui.UmaModel.CacheUmaAvatar.GetDNA();
if (DNA.ContainsKey(dnaName))
{
DNA[dnaName].Set(value);
}
Oh, thank you, I will update the package later :)