4
votes

I am not able to decide whether to use PUN or Bolt in my Unity based multiplayer game. The game must have LAN and over the internet playing options.

According to documentation on photon website, PUN is meant for multiplayer games over the internet. Master Server is hosted either in the photon cloud or dedicated servers running Photon Server.

Bolt, on the other hand, is meant for LAN games. One of the clients becomes the server.

My game needs both, LAN and Internet. Should I use both the SDKs? Can't there be common code for both options?

6

6 Answers

4
votes

EDIT:

UNET is now depricated!

You can also go with the new network from Unity (UNet) It has both lan and Internet (if you portforward, but I think that there should be an option for that non the less. Quote me on this).

You however can take a look in the UNet manual to see if you like it.: https://docs.unity3d.com/Manual/UNet.html

I am currently working on a 3v1 game with this. And it takes some time to understand, but you don't have to worry about payments or other things.

(I don't have 50 reputation so I can only give an answer)

1
votes

Photon Support replied,

1] Should I use both the SDKs?

Combining PUN + Bolt does not make sense. Bolt works fine for LAN and online gameplay. Bolt is not based on UNET, it is written from the ground up. Photon Cloud and Dedicated servers can be used with Bolt as well. https://doc.photonengine.com/en-us/bolt/current/advanced-tutorials/headless-server

2] Should i write separate code for online and LAN feature?

No, this is not necessary - you "just" need to deal with the higher latency in online gameplay.

0
votes

I would recomment you Photon. It's pretty easy to use and it's really cheap. Photon server are way MUCH cheaper than the UNET servers. Both UNET and Photon have a great documentation, lots of tutorials and a big community, so you should't have a problem with that if you pick one or another :)

0
votes

Bolt work with "internet" game as well if you prefer to differentiate games by internet and LAN. However choose which one is highly depend on your game itself. If the game required central secure server to handle logic process, you should go with Photon or similar approach. If the game is p2p, fast faced and doesn't care much (not meaning doesn't care at all) to secure (avoid cheating, speed, wall hack for example) then you should go with Bolt.

0
votes

Photon made a comparison here: https://doc.photonengine.com/en-us/pun/current/reference/pun-vs-bolt

The major difference to me is the Host Migration, Bolt and UNet are not support Host Migration yet (UNet support LAN but not Internet)...

If your game is really fast pace (~30s per game) and don't care about Host Migration (Master client disconnected), then PUN or own dedicated server (which I wouldn't consider) are the only choices.

0
votes

I have heard that if you want to do something well done do it yourself. This does not mean that PUN or Bolt or UNet do not work, on the contrary they serve perfectly for the scenarios that were created, but for your particular scenario they may not fit well. If you want LAN, Internet, Central Server or a client as a server, in addition to algorithms that avoid latency, such as interpolation and prediction you must do it from scratch, creating your own framework, for this use the Unity Networking API.