Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Playerlist sorting by name is not identical to 'Sorted by Name' in VRChat itself #704

Open
Wasmachineman-NL opened this issue Dec 14, 2023 · 5 comments · Fixed by #882
Labels
bug Something isn't working niche Niche request/bug fix Uninstall Avast

Comments

@Wasmachineman-NL
Copy link

Title. VRChat's playerlist ignores special characters while VRCX doesn't, making crossreferencing the ingame playerlist significantly harder.

@Wasmachineman-NL Wasmachineman-NL added the bug Something isn't working label Dec 14, 2023
@Wasmachineman-NL Wasmachineman-NL changed the title [Bug] Playerlist sorting by name is not identical to 'Sort by Name' in VRChat itself [Bug] Playerlist sorting by name is not identical to 'Sorted by Name' in VRChat itself Dec 14, 2023
@Natsumi-sama
Copy link
Member

This sounds like the correct alphabetical order to me, how does it differ?

@Wasmachineman-NL
Copy link
Author

Wasmachineman-NL commented Dec 30, 2023

This sounds like the correct alphabetical order to me, how does it differ?

What I would like to see is that VRCX sorts players exactly as the game itself does, since I often crossreference the playerlist for reasons I will not go into publicly.

@Natsumi-sama
Copy link
Member

But how does the game sort differently, what weird sorting are they using?

@Wasmachineman-NL
Copy link
Author

Wasmachineman-NL commented Dec 30, 2023

Special characters are ignored by VRChat itself when sorting the playerlist ingame.

If user X is called Bart and user Y is called Вart then VRCX doesn't sort them properly when using Sort by Name in VRCX.

@Natsumi-sama Natsumi-sama added the niche Niche request/bug fix label Apr 28, 2024
@loukylor
Copy link
Contributor

loukylor commented Aug 26, 2024

So I actually did some investigation into this, and long story short it's a lot harder than it may seem. I'm just gonna gloss over the details, but because VRChat is built using Il2Cpp, the .NET backend is (a custom fork of) mono. As a result, string comparison is different than regular .NET, yielding different sorting orders when dealing with unicode characters. Therefore, to fix this issue, VRCX would have to reimplement mono's string comparison behavior.

I'm fairly certain that VRChat uses this method while sorting. However this presents many challenges:

  • Reimplementing it would involve several thousand lines of code.
  • It would probably need to be done in JavaScript to avoid the performance drawbacks interop has.
  • There is a chance that VRChat uses a different comparison method, leading to many wasted hours coding and starting at square one.
  • There is also a chance that Unity's fork of mono changes sorting behavior. I already saw small differences when I was doing my investigations, so this is relatively likely.

That being said, I am 100% sure that it compares the display names of users directly and does no preprocessing (as of writing this). I'm also almost certain the only CompareOptions it passes in is IgnoreCase.

I'd also like to say that investigating this has taken about 30 hours off my life for such a simple small little fix and still no satisfying conclusion. So, to end off, I would just like to curse VRChat, Unity, Il2Cpp, and mono. Anyway, I think this should be marked with Good First Issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working niche Niche request/bug fix Uninstall Avast
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants