Observer Pattern with Unity Events for Normcore

Hello everyone:

My name is Chesco and I am an independent VR developer, specifically for Oculus Quest. Right now I’m creating a multiplayer game and after looking at various options I’ve opted for Normcore for now.

I have a number of questions and would appreciate advice and guidance on the subject.

  • Is it possible and recommended to implement an observer pattern with Unity Events for Normcore?

I have been studying this system a bit and as I come from the Android world and I am far from mastering Unity and C#, the Updates and Coroutines that are used with the engine are very “annoying” to me. Being more in favor of the use of observers of the events that of the mentioned methods.

Given that in the examples that I have seen all the “observation” is made on the updates method, my doubt is about the convenience or not of using Unity Events and in the case of data using the scriptable object, (personally they seem wonderful to me) .

And of course, if someone can guide me, if I can use them, what is the most appropriate way to implement them.

In Ryan Hipple tutorial he mentions copying data into variables at runtime, and not using ScriptableObjects directly. So I’ve thought of creating entity classes on one hand (Player, Enemies, etc…) and using ScriptableObjects on the other for Room, Death, or cases where I need to pass data between scenes.

And for the events, like in the Youtube example with Normcore catch a ball, the documentation brush, etc… Instead of using Update(), use ScriptableObjects with Unity Events.

I don’t know how effective this implementation is and how difficult it is, so I would be very grateful for any advice, ideas or opinions.

On the other hand…

  • What is the recommended maximum number of players per room?

My idea of ​​the game for the Oculus Quest is that it be “massive” and a very extensive territory. So at the time of design I want to weigh up creating, or many rooms, with what the terrain to use has to be designed so that players are not “lost” during the game (a forest divided into several rooms so as not to saturate the server, but with an effect that your partner enters the forest area that is another room and disappears in front of your nose… I don’t know if I’m explaining myself).

Or if it supports a reasonable number of simultaneous players and creates large enough expanses of land to avoid that effect.

Thank you very much in advance, and I hope I have posed the questions with some clarity. Excuse my English that is null and I am using the translator to communicate with you, greetings.

You can definitely use an event-based pattern. C# has its own event type that Normcore uses for all models. If you check out the Synchronizing Custom Data guide, you can see I use this same pattern to avoid updating things in Update().

Maximum number of players is really tough. It depends heavily on how much data you’re trying to synchronize. Typically VR players with voice chat, you can get 4-8 players per room on Normcore Public before the server hits CPU limits we have in place. On Normcore Private you can remove these limits and get to about 80 avatars with voice chat before you hit CPU/GPU limits on the Oculus Quest.

Max

Thank you very much for the answer, everything you comment is very good news for me. As soon as the project is more advanced I will go private. A hug and I hope that in a few months I can launch the beta.

Sure thing! Good luck!

Max