Advice on what Networking framework I should use for my game made on Unity

Started by
3 comments, last by Christian Tucker 3 years, 9 months ago

I feel I'm in some sort of cross roads. I'm not sure what networking framework I should use for my social VR game I'm making in Unity. I've found the following options so far:

  • Photon 2
  • Dark Rift 2
  • A YouTube tutorial on making a networking framework from scratch (Tom Weiland)

Photon 2 seems easy but I'm not sure if a game like let's say VRChat would benefit from it's pricing. I might be wrong though since I know nothing about Photon.

I also read a free account with them is limited to 500 messages per second. Is that enough for a game that involves moving around only? I do need to send the hand, head, etc to all players too .

Photon is winning for me, but I just don't want to reach a limit and get cut off until next month just because I'm constantly testing. Btw, I'm referring to the total messages per month, not per second.

Any good advise? Thanks!

Advertisement

The “messages” you send could be larger messages, including position/orientation of all the bits of state you need to replicate. You also could limit updates to 10 or 20 times a second. At 20 times a second, you can have 5 players all joined to the same game without going over 500 messages a second, even if you used a full mesh of connectivity.

As for whether Photon is “worth the money," that kind of depends on how much money you have, how much time you have, and how much network development expertise you have!

enum Bool { True, False, FileNotFound };

hplus0603 said:

The “messages” you send could be larger messages, including position/orientation of all the bits of state you need to replicate. You also could limit updates to 10 or 20 times a second. At 20 times a second, you can have 5 players all joined to the same game without going over 500 messages a second, even if you used a full mesh of connectivity.

As for whether Photon is “worth the money," that kind of depends on how much money you have, how much time you have, and how much network development expertise you have!

Hey thanks for your answer and sorry about the late response.

Hey there, as an indie developer that probably operates on a tighter budget I would recommend to completely forget about Photon. It's a great service, but it definitely charges a premium. Think about how you want to structure your game during development. Do you want to have a separate client & server project? You mentioned that you're making a social VR game so how much of that needs to be authoritative? Is this the type of system where a cheating player would negatively impact the game? Depending on the nature of your game there's going to be client-authoritative aspects, such as the position of certain body parts, however the over-all position of your character may be server-authoritative.

Separating your projects means you need to make sure that your scenes are identical when it comes to physics simulations. Unity's PhysX system is “mostly-deterministic” by nature, but there will always be floating-point precision loss which means that if you're doing client-prediction and server reconciliation there will always be some corrections based on the floating-point tolerance you have set.

I would suggest using Mirror as a beginner as it's quite friendly to those starting up. There's some performance optimizations you'll definitely want to do once you start getting a larger amount of players, but it allows you to get started quite quickly. Once you understand the game, you should more-than-likely use an already-designed low-level networking library as writing one yourself will likely result in lower performance. For example, in the YouTube series you referenced it's a very basic implementation that he teaches and isn't highly optimized.

This topic is closed to new replies.

Advertisement