The above debate has been going on for a long time, but when I was bored I read tupper’s reply on reddit.
I’ve been reading tupper’s replies on reddit in my boredom, so I’m going to give my opinion here.
I’m a bit curious if you guys have actually tried to do specific experiments? Or are you just quoting data without trying to reproduce and get as much avatar and world udon as possible from the game, stripping it down to have a standalone version, exporting it and using Unity3d’s analytics tools to monitor the exported version using the API to report back?
Then I have to say something kind of funny, actually Unity3D if you show the color during analysis it will be the animator’s overhead, but if you take the time to look at it you’ll see that it’s actually the constraints.
The difference between overhead and export doesn’t seem to be that big in the new Unity editor, but it’s really time-consuming since I didn’t do my best to decompile all the Unityplayers and really compare them one by one in detail.
Through VRchat’s stand-alone simulation test and using the profile tool, and the actual online comparison, it seems that there should not be much difference between the frame rate and the scene change difference, so we can assume that there is no difference.
Then VRchat stand-alone simulation and compared to the editor to execute the process, I’m not VRchat staff I do not know for Unity3D’s tools are more detailed and the implementation of the difference.
It just seems to be close in frame rate and number of people (I’m using a single repetitive avatar), so I’m guessing the difference won’t be too huge.
Because on average each avatar will accumulate frametime due to constraints is about the same.
Let’s say one avatar with 0.33ms, ten avatars would be 3.3ms, which would reduce the frametime from 3000fps to 300fps, ignoring the other costs of the scene.
Roughly speaking, a 0.25ms/50MB/1000 bones/500 phybones/250MB VRAM for 40 avatars would be reduced to 100fps, plus a world overhead would result in only 50fps.
Looking in the editor, you can see that 5.23ms out of 6.45ms is ConstaintManager::Update.
Then in ConstrainManager::update::jobsetup is 3.63ms.
and then sortConstraintsbydependencies is 3.57ms.
Note that this is only a two or three level animator.
What if it’s a 30+ layer animator?
My test condition is the CPU overhead caused by not seeing the avatar.
Based on my understanding of the constraints, I'm guessing this is an issue caused by a C# script written by VRchat or Unity3D's implementation.
(There is a similar load, which has to be doubted. Moreover, in the case of other people's testing, the constraint should be much less expensive, but the editor results are still higher than the actual operation)
In fact, there are too many issues to complain about. I just didn’t understand them in detail. I just decompiled the source code and took a look.
Let me explain here why I think it is Vrchat’s script problem?
Theoretically, the CPU overhead of the editor is higher than that of the export. However, the frametime is lower than expected, in other words, the fps is higher.
The fps of the same 4 avatars (including one insignificant avatar, a total of five) without being seen can be compared with the results of the same vrchat official version executed in a single machine. The editor is much higher, especially the one that is not running the world of udon#.
Results measured while ensuring there are no multi-core CPU bottlenecks or other bottlenecks
(However, there are animators and AnimatorOverrideController during the actual execution, so the overhead is higher)


What if I deliberately changed it to full action?

update transforms
avatar 16x Always Animate(There is update transforms version above)
Generally, others are update transforms and oneself is always animate, but there are some cases where other people’s avatars will be close to the latter state.
But no matter what, the animator’s overhead is always much less compared to constraints.
In order to better understand the problem, I changed it to the basic model of this avatar, from 68->14 constraints.
Then the number of avatars is doubled.
(There are some minor issues to be corrected here and provided
Compare update transforms with Always Animate version)
(avatar 16x->32x)
Seriously, there shouldn’t be many people who add 20 animation layers to the basic avatar in the booth.
And it has to be in an always animated state, and besides that, many PBs and bones are not added, so the cost is disproportionate.
In addition, the number of animation layers seems to increase the overhead of constraints? (I’m not sure, but it does seem to be more in comparison)
However, compared to the number of animation layers in Always Animate, the increase is not so huge.
In addition, there are 20 layers compared to 3 layers of Always Animate, a total of 32 avatars.
The animator in the editor seems to be less efficient? (If you have some own data, you can compare it)
Comparison object 5600X
(0.255ms vs 1.17ms)
We assume that six times the number of layers increases the frametime by about 4.5 times. Assuming 120 layers, it may add 5.265ms in the editor? Don’t take this data seriously.
(In fact, it will increase approximately linearly before 100 layers, and then it will increase squarely)
As far as personal observation is concerned, it is unlikely that most avatars have such an exaggerated number of animation layers, and before this, this number of avatars has already caused the fps to be quite exaggeratedly low.
However, it is actually necessary to consider that an avatar has more than one animator operating, so the cost may be higher but not much higher. After all, the main increase in animation layers comes from FX.
Then completely peel off the constraints on the avatar
Without constraints you can see that basically the color layer is rendered without much animation
But one thing is very important, because it is not uploaded in the editor, so the VRC avatar Descriptor is not used.
I’m quite skeptical about the coliders part.
As mentioned at the beginning, animated colors contain constraints.
The following is the result obtained by the editor directly by externally connecting other profiles.
And then there’s also the unusual CPU overhead data for some of these
2023/10/09 Very similar reproducible results
Seriously, I don’t really want to post this data. I would rather wait until others have studied it or even the official has dealt with it themselves.
I am very lazy.
You can find matching functions through their signatures
Seriously, the above diagram does not have a very detailed reverse direction, I cannot guarantee that it is 100% correct, and the load composition varies a lot in different scenarios, so I cannot guarantee that it is correct.
In fact, I want to see other people learn about it here. If more people do this, we can find the cause and solve it faster, clearer and more problem-free.
For ordinary people, under the load of many animators, they may think that the load is like this
It is about 33% of the main thread, which is equivalent to using three threads.
However, the biggest problem is that the signature obtained from the editor looks fundamentally different from the result reversed by IDA.
Compilation doesn’t make anything fundamentally different.
This is the reason why I would deny it. Secondly, by turning off custom animation, if no abnormal culling occurs, it will affect about 10~15% or even lower percentage of CPU frames. Compared with the case where the impact is large (that This kind of serious avatar (avatar) that causes the CPU frame rate to drop is not considered to be the main cause, and the multiple difference is too large.
However, officials believe that the animators are the source of the problem and are looking to solve it through imposters.
So I started to wonder if officials had successfully done some very in-depth tracking analysis?
This was in a certain world called “Chinese Bar” in the early years
There are less than ten people collected, and all avatar situations are fully activated.
If you compare similar payloads one by one, can you get a close signature?
So it’s very difficult to do…
This profile’s loaded objects start with a high-cost avatar Due to the design of the PB and the bones, it is equivalent to all activities for itself. Compared to other people wearing it, the frame time may increase several times.
Second, in the Chinese-speaking world, poorly optimized avatars are everywhere, so they are a good target for comparison.
In addition, many people in VRchat are accustomed to being on standby for long periods of time in public places.
This is an ideal environment to measure the problem.
Seriously, if VRchat is currently free to use profiles and exclude EAC, I’m afraid there’s already enough data to easily understand the problem.
In fact, this article is not to blame anyone, but the actual problems of VRchat are too complicated to imagine.
You can’t think of a free combination. Although it’s not as free as I imagined, it’s still so complicated that it’s difficult to find out the reason with limited data.
Collecting a large amount of data and sorting out matching and comparison requires a lot of basic knowledge training. I think this level is not too difficult for someone with a college degree or above.
The current hardware cost of VRchat environment and performance is too exaggerated, and I don’t know how to effectively solve it.
Even with the high cost of VR equipment, we can’t assume that all VRchat players are reasonably wealthy and have powerful enough accessories to solve any performance issues.
I hope the issue is resolved soon.
Add several animator objects with multiple layers to the avatar, each with complex animations.
This is my understanding of the official view of the high cost of animators.
It should be noted that the animations below are basically Always Animate.
Each avatar mounts four additional objects and four animators
There are 32 avatars in total, and the rest remain as they are.
Replace the animator on the avatar with a three-layer animation
If that’s how you guys think animators are extremely overhead… I don’t know what to say, and custom animations that switch to safe modes don’t always get such a huge boost.
__
If we design according to this idea, we can get an fps that is very close to the results monitored by Intel.
Based on this reasoning, the fps and overhead of 16avatar

About 100fps at this time
Then double to 32 avatars

This fps is very close to the real experience, and the udon on the world is ignored. If added, it is estimated to be less than 30fps.
I wonder if some people often monitor fps and get similar values
However, animators are gradually marginalized.
And from the above simple experiment, it can be concluded that it does not require a high number of constraints to have a big impact, and about 68 per avatar is not too many (although it is still on the high side)
Also compare the boost from replacing the animation layer, which is about 20% fps (however I personally never actually get that good to such a high boost)

In addition, the difference between the four avatars not added above in vrchat and the editor is actually not small.
It is best to spend time analyzing both gameassembly and unityplayer
Let me update the cause of the problem:
The C# animation AnimatorOverrideController combines the full motion of the animation to cause the bones to fully work in its own state, and then combines the malicious structure (possibly non-malicious) constraint nesting with thousands of bones, resulting in a few avatars that can easily occupy 1ms~2ms or even 3ms of CPU frametime.
Also, I think the reason why many people think the animators are the root of the problem is because simply measuring massive avatar stacks leads to a deterioration of the structural hierarchy of the scene, resulting in a massive waste of CPU overhead. Animation is inevitably cited as the main cause in attempts at reproduction.
However the constraints brought the problem much more seriously and much earlier than the animation, so I think he is the main cause, but a better solution would be to find a way to improve the single-threaded scene API.
(You can also try setting the animator status of the objects in the avatar yourself (?))
I’m not going to write more than that, I’ve already exaggerated.