Closed chaojian-zhang closed 4 years ago
Thanks for the detailed bug report.
What is happening:
Xenko
package used to contain everything, but this is not the case anymore. Recently (with #12) Xenko runtime became plugin based (i.e. if Xenko.Navigation
is not referenced by the game, it is not going to be referenced/linked anymore).GetOrCreate<NavigationSettings>
. This worked before, but not anymore if Xenko.Navigation
is not referenced.As a result, editor adds NavigationSettings
to the game, but the game doesnt reference Xenko.Navigation
so don't recognize this type when deserializing the settings.
A quick fix would be to change all those occurences of GetOrCreate<NavigationSettings>
to just do a Get<NavigationSettings>
and handle null case.
A longer term fix will be to turn the editor to be aware of plugins as well. This would likely go as far as having editor-side plugins for Physics, Navigation, etc... As a result, all editor code concerning NavigationSettings
wouldn't even be loaded in the editor if the game doesn't use Xenko.Navigation
. Part of this is tracked in #13.
Thank you very much for your reply, that's very helpful.
I will try to follow your instruction adding reference to the Navigation package to see whether it works just to verify the cause when I get a chance and update this comment.
In the meantime I will mark the issue closed.
I will reopen the issue to track the fact we need to fix those GetOrCreate<NavigationSettings>()
.
Closing this one as #580 is more explicit.
Background
Release Type: Official Release
Version: 3.1.0.1-beta02-0615
Platform(s): Windows 10
Describe the bug
Symptom:
If debug the solution inside Visual Studio will receive following error at
game.Run()
insideMain()
:(Potentially) Similar Issue: Xenko.Core.Serialization.Contents.ContentManagerException when trying to run project
Cause and (Failed) Solution:
Search through the whole solution for text appearance
f6e78a35184f6fe1d27096e38ec09340
andf6e7
because I realized it's not an actual GUID format, but no result, could it be from some some sort of "Cache"? Clean solution doesn't help. I think it would be helpful if I can see what actually happened inside this function call but I don't know how I can possibly step into engine code to see what happened?People see online talking about Serialization error mentioned something related to scripts or project settings, but I didn't change those? Wrong name space could have affected but all namespaces I use in scripts are correct. The game settings and project settings are almost exact as default FPS tmeplate. Except I moved folders around a bit.
How to re-create
(0,0)]: Info:Deployment of XenkoSerializationError.Windows successful.
but the game can no longer runXenko.Core.Serialization.Contents.ContentManagerException: 'Unexpected exception while loading asset [GameSettings]. Reason: No serializer available for type id f6e78a35184f6fe1d27096e38ec09340 and base type Xenko.Data.Configuration. Check inner-exception for details.'
. Notice the very specific ID string:f6e78a35184f6fe1d27096e38ec09340
- usually when we create a new template all assets have a new set of ID, but this ID is always the same.Expected behavior
Everything should just work.
Notice:
Xenko.Core.Serialization.Contents.ContentManagerException
: and there seems no way to fix this[RouterClient]: Error: Could not connect to connection router using mode Connect. Xenko.Engine.Network.SimpleSocketException: Connection router did not connect back to our listen socket at Xenko.Engine.Network.RouterClient.<InitiateConnectionToRouter>d__5.MoveNext() Xenko.Engine.Network.SimpleSocketException: Connection router did not connect back to our listen socket at Xenko.Engine.Network.RouterClient.<InitiateConnectionToRouter>d__5.MoveNext()
and some other issues.Screenshots
Below are screenshots showing git-version controlled diff between me creating a Scenes folder, putting MainScene into that folder, do a save, then move MainScene back into Assets folder and delete Scenes folder.
Additional context
Remark
This is very bad (not morally, but confusing), because I once setup several scenes with First Personal Template and moved MainScene into Scenes folder, only to discover the whole game cannot no longer run and there is no way to fix it, and I would have to start creating all those scenes again because apprantly there is currently no way to migrate assets between projects and I am not sure whether it's safe to just copy assets around. Please help! Thanks.
Final Remark
Apparently, reverting all changes in
Assets\GameSettings.xkgamesettings
will resolve the problem, specifically, it's below lines that's causing the issue: