Udon scans all assets on play, causing long 'play' times even in blank scene
complete
Kosyne
Same as the title, projects with SDK3 imported do something (scan/reimport?) with the entire project that makes load times scale with the number of assets in your project.
Having a project with just a few asset packs can cause a huge delay in loading when you try to play a project, even on a completely blank scene.
Removing SDK3 fixes this issue.
Log In
Phasedragon
complete
This was improved a while ago. There was a specific step in the process that scanned and serialized udonbehaviour variables. It could take multiple minutes in large scenes. It received multiple optimizations to reduce it down to about 5% of it's previous time.
Kosyne
This seems to be fixed now in a recent update (at least for me). My large project that took 15 mins to load now loads in about a minute. (I did have some issues regarding prefabs losing references to which udon script was attached to them upon first upgrading, but I'm not sure that's related.)
Tupper - VRChat Head of Community
Kosyne: I can close this if you'd like, then.
Kosyne
Tupper - VRChat Head of Community: This one was really nasty for a lot of people, If possible I'd like at least one other confirmation from someone else to be 100% sure.
Talox
Running into the same issue here, i have over 3k prefabs and its taking longer that 5 min to enter play state.
tsuna vr
My main project takes 15 minutes to enter play mode. So I cant test my scenes there basically. Would be appreciated if something can be done.
T
TCL
tracked
mzx987
With what naqtn stated, it is indeed that particular method that slows down the 'play' time, because of the unnecessary loading. Simply changing the folder path it needs to search in to something that has far less prefabs in it speeds up load times drastically (especially with projects using large amounts of prefabs).
I don't know the exact consequences in changing this, but I thought I'd share what happens upon doing so.
naqtn
This happens because UdonEditorManager.PopulateAllPrefabSerializedProgramAssetReferences loads all prefabs and searches UdonBehaviour. Candidate files are gathered by UdonEditorManager.GetAllPrefabAssetPaths. That are actually "all prefabs". It is completely wasteful to load pre-existing assets that are not made for Udon or VRChat.
T
TCL
naqtn: This method needs to be run but we'll look into making it more specific to avoid processing so many unused prefabs.
This method and much of how Udon is serialized is done specifically to work around a number of issues we encountered when dealing with Unity's Prefab and Asset systems. UdonBehaviours depend on a SerializedUdonProgram asset that contains the serialized data built from the UdonProgramSource asset. UdonBehaviours in the scene can easily be found and checked to make sure they have a valid reference to their SerializedUdonProgram asset. Prefabs on the other hand may not even exist in the scene if they are only referenced by a scene object. If a prefab loses its reference to the SerializedUdonProgram asset for its ProgramSource then it will fail to run. To avoid this prefabs are checked before the world is run or built to ensure that their references are valid. Unfortunately there is no way to know whether a prefab is "pre-existing" or "made for Udon" without checking for an UdonBehaviour.
kawashirov
Don't get why it's necessary to scan
all
prefabs? Why not to just scan prefabs referenced by scene, especially defined in VRCSceneDescriptor. In Play mode all prefabs unpacked anyways and things that can be instantiated should be defined in descriptor. Is there another way how UdonBehaviours in prefabs can get into running scene?Also full-checks might be necessary when building final bundle for upload. But at editor-time we have acces to entire project anyways, so why not to check necessary UdonBehaviours at run-time and do necessary fixes in editor, where it's necessary?
Loli 13
Please fix this, it takes minutes to get into playmode wtf -.-
Jasper Raine
Would this explain why my udon world has been so huge in file size despite being really small?
Vowgan
Jasper Raine: Unfortunately no, this just means Udon has to think about every asset in your project before it will let Unity go into Play mode. What you're probably running into is either from lots of audio of high lightbaking settings.
Jasper Raine
Vowgan: I figured out it's actually a bug with setting items to static batching. For some reason that feature is bugged at the moment and causes file size to skyrocket.
Tacct
Found this out myself today. Put together a project with a bunch of assets I planned to use, took a couple minutes to build even though I barely had anything in the scene to do a quick test.
Put together two new projects to test what was going on, one with sdk2 another with sdk3. Both were setup with only a plane and the corresponding world prefab. With nothing else imported sdk2 took 2 seconds to enter play mode, sdk3 took 5 seconds. Then imported a single asset pack but did not use it in the scene, sdk2 still took 2 seconds, sdk3 started taking near 30 seconds.
Tacct
Decided to load everything I had into a project to see how bad this gets... project takes 10 minutes to get into play mode with an empty scene. well then.
Load More
→