Hololens / "There are no graphs in the scene"

Hello,

When running the project on Hololens, I get this message:
“There are no graphs in the scene” each time I try to update the graph and I also get an exception when I try to relocate the graph with:

GridGraph graph = (GridGraph)pathFinder.graphs[0];
graph.RelocateNodes(transform.parent.transform.position, Quaternion.Euler(0, transform.parent.transform.rotation.eulerAngles.y, 0), 0.1f, 0.74f);

As far as I can see in the doc, it may be related to mobile device support but since build parameters are not the same than iphone platform, I am a bit lost.

Hi

Is pathfinding working well otherwise?
With that message I would have expected some error message before this one. Most likely graph deserialization that (for some reason) has failed.

Yeah I have found in the forum this topic:

Seems to be the same problem:

Caught exception while deserializing data.
System.NotSupportedException: This operation is not supported.
at System.IO.Compression.DeflateStream.get_Position()
at Pathfinding.Serialization.AstarSerializer.DeserializeNodeReferenceMap()
at Pathfinding.Serialization.AstarSerializer.DeserializeExtraInfo()
at Pathfinding.AstarData.DeserializeGraphsPartAdditive(AstarSerializer sr)
at Pathfinding.AstarData.DeserializeGraphsAdditive(Byte bytes)

Ah. Thought I had fixed that.
Yeah when targeting Windows Store then (for some reason) the Position property is not supported.
Sorry again for this. I would have automated tests for these kinds of things, but since I don’t use Windows myself, it’s not very practical to put it with my other tests.

I have replaced that code with this in my dev version:

#if !NETFX_CORE
			// For Windows Store apps the BaseStream.Position property is not supported
			// so we have to disable this error check in that platform
			if (reader.BaseStream.Position != reader.BaseStream.Length) {
				throw new Exception((reader.BaseStream.Length / 4) + " nodes were serialized, but only data for " + (reader.BaseStream.Position / 4) + " nodes was found. The data looks corrupt.");
			}
#endif

Ok this is good news if you already have a fix :smile_cat:
In which script is it located ?

It’s the JsonSerializer.json file, around line 655 (but line numbers can vary depending on version).

Solved :blush:
Nice support man !

Awesome! Good luck with your game!

We are working on a UWP build of the game and are running into the same exception when trying to build UWP standalone. We’ve tried the suggested work-around, but we still end up with the error shown below. We are on version 3.8.1 of A* Pathfinding Project.

UnityException: Failed to run serialization weaver with command “Temp\StagingArea\Data\Managed\Pathfinding.JsonFx.dll” “-pdb” “-verbose” “-unity-engine=Temp\StagingArea\Data\Managed\UnityEngine.dll” “Temp\StagingArea\TempSerializationWeaver” “-lock=UWP\project.lock.json” “-additionalAssemblyPath=D:\Windows Kits\10\UnionMetadata\10.0.15063.0\Facade” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.ApplicationModel.Calls.CallsVoipContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.ApplicationModel.SocialInfo.SocialInfoContract\2.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Devices.DevicesLowLevelContract\3.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Devices.Printers.PrintersContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Foundation.FoundationContract\3.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Foundation.UniversalApiContract\4.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Graphics.Printing3D.Printing3DContract\3.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Networking.Connectivity.WwanContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Services.Store.StoreContract\2.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Services.TargetedContent.TargetedContentContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.System.Profile.ProfileHardwareTokenContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.System.Profile.ProfileSharedModeContract\2.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.UI.ViewManagement.ViewManagementViewScalingContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.ApplicationModel.Activation.ActivatedEventsContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.ApplicationModel.Activation.ActivationCameraSettingsContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.ApplicationModel.Activation.ContactActivatedEventsContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.ApplicationModel.Activation.WebUISearchActivatedEventsContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.ApplicationModel.Background.BackgroundAlarmApplicationContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.ApplicationModel.Calls.Background.CallsBackgroundContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.ApplicationModel.Calls.LockScreenCallContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.ApplicationModel.FullTrustAppContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.ApplicationModel.Preview.InkWorkspace.PreviewInkWorkspaceContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.ApplicationModel.Preview.Notes.PreviewNotesContract\2.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.ApplicationModel.Resources.Management.ResourceIndexerContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.ApplicationModel.Search.Core.SearchCoreContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.ApplicationModel.Search.SearchContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.ApplicationModel.StartupTaskContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.ApplicationModel.Wallet.WalletContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Devices.Custom.CustomDeviceContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Devices.Portable.PortableDeviceContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Devices.Printers.Extensions.ExtensionsContract\2.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Devices.Scanners.ScannerDeviceContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Devices.Sms.LegacySmsApiContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Gaming.Input.GamingInputPreviewContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Gaming.Preview.GamesEnumerationContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Gaming.UI.GameChatOverlayContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Globalization.GlobalizationJapanesePhoneticAnalyzerContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Management.Deployment.Preview.DeploymentPreviewContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Management.Workplace.WorkplaceSettingsContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Media.Capture.AppBroadcastContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Media.Capture.AppCaptureContract\4.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Media.Capture.CameraCaptureUIContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Media.Capture.GameBarContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Media.Devices.CallControlContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Media.MediaControlContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Media.Playlists.PlaylistsContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Media.Protection.ProtectionRenewalContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Networking.NetworkOperators.LegacyNetworkOperatorsContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Networking.Sockets.ControlChannelTriggerContract\2.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Perception.Automation.Core.PerceptionAutomationCoreContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Security.EnterpriseData.EnterpriseDataContract\4.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Security.ExchangeActiveSyncProvisioning.EasContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Services.Maps.GuidanceContract\2.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Services.Maps.LocalSearchContract\3.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.System.Profile.SystemManufacturers.SystemManufacturersContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.System.Profile.ProfileRetailInfoContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.System.UserProfile.UserProfileContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.System.UserProfile.UserProfileLockScreenContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.UI.ApplicationSettings.ApplicationsSettingsContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.UI.Core.AnimationMetrics.AnimationMetricsContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.UI.Core.CoreWindowDialogsContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.UI.Xaml.Hosting.HostingContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Web.Http.Diagnostics.HttpDiagnosticsContract\2.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.System.SystemManagementContract\3.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.ApplicationModel.Calls.CallsPhoneContract\3.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.ApplicationModel.CommunicationBlocking.CommunicationBlockingContract\2.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Devices.SmartCards.SmartCardBackgroundTriggerContract\3.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Devices.SmartCards.SmartCardEmulatorContract\4.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Embedded.DeviceLockdown.DeviceLockdownContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Networking.NetworkOperators.NetworkOperatorsFdnContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Phone.PhoneContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.Phone.StartScreen.DualSimTileContract\1.0.0.0” “-additionalAssemblyPath=D:\Windows Kits\10\References\10.0.15063.0\Windows.UI.WebUI.Core.WebUICommandBarContract\1.0.0.0” “-additionalAssemblyPath=Temp\StagingArea\Data\Managed”.
Symbols will be read from Temp\StagingArea\Data\Managed\UnityEngine.pdb
No symbols for Temp\StagingArea\Data\Managed\Pathfinding.JsonFx.dll
Weaving assembly D:\Projects\TheLongDark-uwp\game\Temp\StagingArea\Data\Managed\Pathfinding.JsonFx.dll
Will export symbols of pdb format
Mono.Cecil.ResolutionException: Failed to resolve System.Reflection.BindingFlags
at Mono.Cecil.Mixin.CheckedResolve(TypeReference self)
at Mono.Cecil.MetadataBuilder.GetConstantType(TypeReference constant_type, Object constant)
at Mono.Cecil.MetadataBuilder.AddConstant(IConstantProvider owner, TypeReference type)
at Mono.Cecil.MetadataBuilder.AddField(FieldDefinition field)
at Mono.Cecil.MetadataBuilder.AddFields(TypeDefinition type)
at Mono.Cecil.MetadataBuilder.AddType(TypeDefinition type)
at Mono.Cecil.MetadataBuilder.AddTypeDefs()
at Mono.Cecil.MetadataBuilder.BuildTypes()
at Mono.Cecil.MetadataBuilder.BuildModule()
at Mono.Cecil.ModuleWriter.<>c.b__1_0(MetadataBuilder builder, MetadataReader _)
at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func`3 read)
at Mono.Cecil.ModuleWriter.WriteModuleTo(ModuleDefinition module, Stream stream, WriterParameters parameters)
at Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parameters)
at usw.Weaver.WeaveAssembly(String assemblyPath, AssemblyDefinition unityEngineAssemblyDefinition, ReaderParameters readerParameters)
at usw.Weaver.Weave()
at usw.Program.RunProgram(ConversionOptions options)
at usw.Program.Main(String[] args)

at PostProcessWinRT.RunSerializationWeaver () [0x00138] in C:\buildslave\unity\build\PlatformDependent\WinRT\SharedSources\CSharp\PostProcessWinRT.cs:492
at PostProcessWinRT.Process () [0x001e1] in C:\buildslave\unity\build\PlatformDependent\WinRT\SharedSources\CSharp\PostProcessWinRT.cs:149
at UnityEditor.WSA.BuildPostprocessor.DoPostProcess (BuildPostProcessArgs args) [0x0008e] in C:\buildslave\unity\build\PlatformDependent\MetroPlayer\Extensions\Managed\ExtensionModule.cs:155
at UnityEditor.WSA.BuildPostprocessor.PostProcess (BuildPostProcessArgs args) [0x00004] in C:\buildslave\unity\build\PlatformDependent\MetroPlayer\Extensions\Managed\ExtensionModule.cs:162
UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck(String[], String, String, BuildTargetGroup, BuildTarget, BuildOptions, Boolean)
UnityEditor.BuildPlayerWindow:BuildPlayerWithDefaultSettings(Boolean, BuildOptions, Boolean) (at C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindow.cs:485)
UnityEditor.BuildPlayerWindow:BuildPlayerWithDefaultSettings(Boolean, BuildOptions) (at C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindow.cs:339)
UnityEditor.BuildPlayerWindow:GUIBuildButtons(IBuildWindowExtension, Boolean, Boolean, Boolean, BuildPlatform) (at C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindow.cs:1390)
UnityEditor.BuildPlayerWindow:ShowBuildTargetSettings() (at C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindow.cs:1317)
UnityEditor.BuildPlayerWindow:OnGUI() (at C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindow.cs:913)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
System.Reflection.MethodBase:Invoke(Object, Object[]) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView:Invoke(String, Object) (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:262)
UnityEditor.HostView:Invoke(String) (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:255)
UnityEditor.HostView:OnGUI() (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:84)

@alan Version 3.8.1 is pretty old and there are several fixes for the UWP platform in later versions (most notably in 3.8.6, 3.8.8 and 3.8.8.1). Is it possible for you to upgrade to a newer version?

Upgrading isn’t a good option at this point, but I was able to get past the errors by definging ASTAR_NO_JSON and ASTAR_NO_ZIP, and then disabling the associated DLLs.

Will this require any changes to how navmesh is configured per scene? We are using recast graphs.

Ok.
You will have to reconfigure all your graphs after those settings are changed, but after that there shouldn’t be any other significant differences.
If you are using cached startup, the data files may use more space since zipping is disabled.

Thanks for the info – what exactly needs to be changed per graph?

When you enable those settings it will not be able to load your previous graph settings. If you open the A* Inspector you will notice that they are missing. So you will have to add the graphs again.
If you configure the graphs purely from scripts then nothing needs to be changed.