Hi there !
We are porting our game to PS4 and XboxOne, and so far NC was not causing any issues, but Sony EU itself found a blocker when setting the console to French (France) and then launching the game.
When a AI is created inside the game, here is the log we get:
Deserialization Error: ‘Error while parsing: Bad double format with 2.0; context = <{“version”:2.0,”type”:”NodeCanvas.BehaviourTrees.B>’
04:00:14 ‘ at ParadoxNotion.Serialization.FullSerializer.fsResult.AssertSuccess () [0x0000d] in C:\Subaeria\Assets\IllogikaNC\NodeCanvas\_ParadoxNotion (s
04:00:14 hared)\Serialization\FullSerializer\fsResult.cs:138
04:00:14 at ParadoxNotion.Serialization.FullSerializer.fsJsonParser.Parse (System.String input) [0x0000c] in C:\Subaeria\Assets\IllogikaNC\NodeCanvas\_Pa
04:00:14 radoxNotion (shared)\Serialization\FullSerializer\fsJsonParser.cs:469
04:00:14 at ParadoxNotion.Serialization.JSON.Deserialize (System.Type type, System.String serializedState, System.Collections.Generic.List1 objectRefere
04:00:14 nces) [0x00039] in C:\Subaeria\Assets\IllogikaNC\NodeCanvas\_ParadoxNotion (shared)\Serialization\JSONSerializer.cs:53
04:00:14 at ParadoxNotion.Serialization.JSON.Deserialize[GraphSerializationData] (System.String serializedState, System.Collections.Generic.List1 object
04:00:14 References) [0x00000] in <filename unknown>:0
04:00:14 at NodeCanvas.Framework.Graph.Deserialize (System.String serializedGraph, System.Collections.Generic.List1 objectReferences) [0x00024] in C:\Su
04:00:14 baeria\Assets\IllogikaNC\NodeCanvas\Framework\Graphs\Graph.cs:83 ‘
04:00:14 Please report bug
04:00:14 UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
04:00:14 UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
04:00:14 UnityEngine.Logger:Log(LogType, Object, Object)
04:00:14 UnityEngine.Debug:LogError(Object, Object)
04:00:14 Debug:LogError(Object, Object) (at C:\Subaeria\Assets\Features\Debug\Debug.cs:193)
04:00:14 NodeCanvas.Framework.Graph:Deserialize(String, List1) (at C:\Subaeria\Assets\IllogikaNC\NodeCanvas\Framework\Graphs\Graph.cs:94)
04:00:14 NodeCanvas.Framework.Graph:OnAfterDeserialize() (at C:\Subaeria\Assets\IllogikaNC\NodeCanvas\Framework\Graphs\Graph.cs:48)
Looks like there is an issue when deserializing the graph. It only happens with this very specific language, everything is fine on all others.
Unity 2017.2.0p4 and NodeCanvas unknown version (looks like beginning of 2017 if I’m not wrong).
Feel free to ask me any more informations. Thanks !
It looks like in French double values are written like with a comma and not a dot (xx,xxx and not xx.xxx). That might explain why the parser can’t read them when opening the file on this system language. I will try to change the fsJsonParser TryParseNumber function.
Ok guys, I’ve fixed it by changing the way fsJonsParser is parsing double values.
The issue was that double.TryParse with a value like “2.0” when the system is running in French (France) will fail because in French decimal values are written with a comma (2,0).
So I had to change the call to double.TryParse, from: if (double.TryParse(numberString, out doubleValue) == false) {
to: if (double.TryParse(numberString, NumberStyles.Number, CultureInfo.InvariantCulture, out doubleValue) == false) {
I don’t know if this issue was fixed on recent version of NC, but if not, this might be a huge blocker.
One more thing, I didn’t check the code, but maybe when serializing the BT in JSON the code should serialize it using no culture as well to avoid the same issue.
Thanks a lot 🙂
I wasn’t aware, or even been reported something similar before, so it is a nice thing to know and be aware of now!
Sounds like a good thing to take care of. I will make a pass in the serialization code.