This message was deleted.
# helpdesk
s
This message was deleted.
m
oh boy, here it comes @millions-honey-92294
b
I actually love that question @magnificent-art-43333 šŸ˜‚šŸ˜‚ and looking forward to the answer also šŸ™‚
m
i’ll share this on Neil’s behalf, but I’m sure he has more thoughts: https://twitter.com/dwyer_neil/status/1665162343766949889?s=20
šŸ™Œ 1
šŸ”„ 2
i
Oh wow, so in-short, the answer is yes? Interested to hear more @powerful-garage-56223! šŸ™‚
The options are somewhat limited for good multiplayer tech for Unity, so I'd be quite excited to try out LiveKit for this use-case, depending on any caveats.
p
hey @important-megabyte-62876 yeah I made a LiveKit transport for DOTS multiplayer: https://github.com/chef-studios-inc/webtick-unity which was used in that example.
i
Nice! So then in your opinion, could LiveKit be used as a reliable production-ready alternative to other networking solutions such as Photon Fusion/PUN2, Normcore, and Mirror? Any caveats or things to watch out for if using LiveKit in this manner? (Note - I probably wouldn't use DOTS in my implementation)
p
In my opinion LK is a fantastic solution (specifically LK cloud) because it handles the mesh networking which is great for connecting people around the world with high quality (low packet loss) connections. I was most interested in web gaming which is why I was exploring WebRTC. Other products like Photon use websockets on web. Normcore is a pretty good product but doesn’t mesh network like LK does. I’ve used them in the past. But my interests have increasingly moved towards true server side authoritative + client side predictive multiplayer so I went with DOTS. It’s a treat to work with this style of multiplayer because it almost feels like you are developing for split screen with one simulation instead of using the object ownership model that the non server-authoritative products use. The downside is then you must run Unity server-side. If you aren’t using DOTS, I’d invite you to create a LK transport for Unity Netcode for Game Objects! Otherwise i’d use normcore
i
@powerful-garage-56223 Ok, very interesting! I'm not sure I'm ready to take a swing at DOTS or Netcode for Game Objects... I'm not very familiar with either yet, but I'll take a look through some docs - can't hurt to get up to speed. But if I decided to use my own non-authoritative networking pattern similar to Photon or Normcore where I'm just relaying data to all other clients (such as positions of transforms such as VR hands/head, or RPC-style events), could LiveKit still replace Photon/Normcore? Could I even go so far as to integrate a "datastore" type of system in the middle where I can keep "room data" and dump it to a database when the last person leaves the room? I know I could just use Normcore or Photon, but what I'm really interested in here is an open-source alternative that I could self-host in the future if I ever had to. Mirror seems like a strong contender far as that goes, but I wanted to explore the possibility of using LiveKit for everything. I think LiveKit Cloud's infrastructure is impressive, and knowing that I could switch over to self-hosted at some point in the future (if needed) is great for resiliency (and clients of mine who need to manage data in a specific way).
p
I think Mirror is a pretty good Open Source option by the looks of it. I haven’t personally used them. LiveKit by itself would work. You’d create a server-side participant. Depending on your use case - you’d have to re implement the normcore or photon features. What those products do well is simplify the developer experience of simulated + networked game objects (in a non-authoritative way). This typically entails generating serialization code, atomically handling ownership handoffs (i.e. if I pass a basketball to you in VR, you our now the owner of that basketball), and interpolating/extrapolating movement for a smoother ā€œfeelā€. They also handle player joins/leaves and delta updates and things like that. There’s no reason that couldn’t be a server side participant of a livekit room. On the networking side, livekit is fantastic. Truly state of the art. The synchronized game state stuff is the stuff you’d have to build.
i
Okay cool! Yeah totally - I would have to create my own implementations for data "ownership", movement interpolation/extrapolation, etc, but based on what you're telling me, it sounds like it's possible (and production-ready) if you put in the work? šŸ™‚ A couple other semi-related questions: 1. Can a LiveKit client connect to multiple rooms at the same time? A common use-case for this is "sharding", where a 3D game world is partitioned into a grid and players are connected to networking rooms based on whichever grid cell they are in, as well as all of the surrounding grid cells. 2. Could this scale-up fairly well compared to other infrastructures? Any idea how far you could push it with concurrent users in the same room? Usually games don't go beyond 40-ish players that can all see each other at the same time, but say I'm building a VR app where everyone is gathered in a huge auditorium for an event. Could I push it to 100 people? 200? More? (Potentially along with some "interest management" techniques to optimize bandwidth?)
p
So actually with LK cloud, a room can scale infinitely so you’d just have multiple ā€œserver side participantsā€, each one representing it’s own shard. But livekit clients can also connect to multiple rooms no problem. Yeah the name of the game is interest management. 100-200 people is no problem. A single LK OSS server could handle that no problem. We haven’t load tested data channels but we’ve put 150 publisher and subscribers of audio video on a single open source instance: https://docs.livekit.io/realtime/self-hosting/benchmark/
i
@powerful-garage-56223 Wow, that's pretty amazing! šŸ™‚ From what I have read and been told, most other multiplayer networking solutions start running into bandwidth issues after 40 or so VR players (since all players are constantly streaming their head and hands transform data, which the server must constantly send to all other players in the room, and even more data if doing stuff like hand tracking). Does this mean that LiveKit has the potential to be a disruptive technology (in a positive sense) for multiplayer gaming, significantly increasing the number of concurrent users that can all see and interact with each other in the same 3D world instance? Any issues as far as latency goes when dealing with a very large number of users? For competitive games, an acceptable ping is usually 40-60ms, but can be slightly more forgiving for social apps (like a virtual concert app or something).
b
I'm thinking that maybe a queue / batching might be an option, to reduce the number of messages being blasted out. I haven't tested this out just yet, but I might need to do exactly that since it does adds up pretty quickly.
p
well there’s a lot of nuance and design choices to consider on distributing the simulation itself. But if you are network bound server side then livekit can help. There is still interest-management needed to make sure clients can handle the bandwidth coming in but overall I’d expect livekit to help scale yeah! The main thing livekit can do is what @brief-refrigerator-69901 touches on. If 100 participants all need the same message, the server only needs to send out one message with a list of recipients (instead of sending out 100 messages to 100 different connections)
i
I am definitely network bound - on the rendering side of things it's entirely possible to render 1000+ avatars at the same time (even on a mobile device) via simplification for distant avatars and instancing techniques. Not that I would do that due to visual clutter, but you could imagine how amazing a virtual concert would be if you could have even several hundred people all in the same 3D world instance enjoying a concert together. So let's say I want to do a simulation with up to 300 VR users in a large 3D world for a virtual concert (or even 150 users if that's too many). All clients would need to constantly send up their position & rotation data for their head and hands. So that's 3 transforms per-person (not worrying about hand tracking or other custom data for now). And proximity-based spatial audio voice chat where you hear other people within a 10 meter radius. Realistically, how could this be set up? Would I want to use a "data room" for syncing all of the head and hands transforms? And some custom server code of to batch the head/hands data into a "frame" (kind of like a "server tick" and send that message out to all recipients? And another room for proximity voice chat? I know this is a somewhat complex problem to solve, and would likely involve some interest management, but just want to think through how to build an actual implementation of this with LiveKit (and sounds like @brief-refrigerator-69901 may have some interest in a similar use-case as well).