stride3d / stride

Stride Game Engine (formerly Xenko)
https://stride3d.net
MIT License
6.33k stars 918 forks source link

Can't load assets when the root asset/folder name has # prefix #2282

Open Basewq opened 1 month ago

Basewq commented 1 month ago

Release Type: Official Release

Version: 4.2.0.2122 (affects 4.1 as well)

Platform(s): Windows

Describe the bug Naming a root asset folder or root asset with # prefix will not load the content.

To Reproduce Steps to reproduce the behavior:

  1. Create 'New game' project
  2. Rename 'MainScene' asset to '#MainScene' (alternatively make a folder called #Scene and move MainScene in there)
  3. Run game

Expected behavior Game scene should load.

Additional context Potentially a YAML loading bug, since # prefix represents a comment.

Workaround Use a different symbol to prefix, eg. $, !, @, etc.

Eideren commented 1 month ago

Pinging @IXLLEGACYIXL just to make sure that's something you're aware of for your current yaml rework

IXLLEGACYIXL commented 1 month ago

the root assets name isnt even stored in the yaml the file name decides the root assets name

IXLLEGACYIXL commented 1 month ago

having special tags in a string should trigger quoting automatically, which the current one and mine do

Basewq commented 1 month ago

Sorry I haven't really looked into this as I'm looking at other things, so it might not be a YAML issue. The steps to make the issue happen should be reproducible easily.

Only reason why I speculated on YAML, is because I noticed the diff in file in GameSettings.sdgamesettings

-DefaultScene: 98c3bc8c-99b9-4bd6-a0d3-a4aec9d94845:MainScene
+DefaultScene: 98c3bc8c-99b9-4bd6-a0d3-a4aec9d94845:#MainScene

and then the scene no longer loaded. I guess GameSettings.DefaultScene stores the scene reference differently.