Goob morning! We're back with more server development news! I'm excited to share the progress we've done with you!
server-rewrite State 📜
As mentioned in the last devblog, we've been rewriting the whole SlimeVR Server's backend from scratch, improving it as we do.
This has been taking more time than expected and going a bit out of scope but we're doing our best to finish it by the time Butterfly Trackers are shipped out.
We have been actively testing the rewrite to make sure that there won't be any regression compared to v21 and will likely start public beta testing soon once the final big features are implemented.
Why rewrite❓
"Why didn't you just improve the current code instead of rewriting everything?", you might say.
Because all of the old server's code has been built on its magnificient and very thoughtful OOP architecture... that consisted of everything being public and anything reading and calling anything else. This resulted in a lot of components being heavily interconnected with others, making it hard to change something without breaking something else.
To port that code over to our now actually organized architecture built on the observe reducer pattern requires a lot of work and in pretty much all cases it is easier to just rewrite the code than trying to port it over with minimal changes.
The new architecture we use is now organized by modules, each module holding a state and running mostly functional code that affects that state. A module can read from another module's state and even listen to it changing. We also have an event system that allows dispatching events to a module. For example, a tracker listens to its own state changing to decide when it should be dispatching its rotations to the skeleton.
To give you a scale of how much things changed, let's take the skeleton code, the core of SlimeVR, as an example.
The old skeleton code was contained in HumanSkeleton.kt (1792 lines), Legtweaks.kt (1011 lines), LegtweaksBuffer.kt (728 lines) and Localizer.kt (417 lines).
Now, the skeleton has 16 processors (each 40 to 200 lines each) that run one after the other, doing anything from filtering (smoothing/prediction) to imputing missing spine bones' rotations, to running skating correction.
The new architecture is also much easier to test since everything isn't dependant on everything else. We currently have hundreds of unit tests compared to a couple dozens in the old server!
New and improved features 🆕
While we've been busy re-implementing past features, we've also been working on improving them and making new ones on the side such as a better skeleton preview, a new assignment page, better Wi-Fi provisioning, a performance graph for trackers and more!
The new assignment page now allows the assignment of finger and toe trackers. Yes, toe tracking is real! You can see it being showed off in VRChat by ZRock35 here https://www.youtube.com/watch?v=Ht6rM4bMW3I (might need to copy-paste the link, there's no adult content, just toes).
Missing features 😿
We have already re-implemented most of the big features from the old server into the rewrite apart from Mocap Mode (localizing the head position without any external reference for mocap) and Autobone (automatically adjusting proportions.
We also have many things we still need to iron out, like skating correction, and we will take our time to make sure all bugs are squashed for its release.
- Erimel the fox dev 🦊