To Fusion from Pun

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on Fusion.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

To Fusion from Pun

GuavaJam710
2023-01-22 19:57:32

Hi I hope all is well,

We recently launched our game and are using PUN2 as our multiplayer architecture (this was the simplest for me to learn in early days of game dev). I now feel very confident in my knowledge of the PUN2 library, and think it would be wise to switch to Fusion for a more robust networking library. Here is my question(s), to which I understand if they cannot be answered with accuracy (any advice or input is greatly appreciated):

Currently my character controller has 1 custom IPunObservable component on it, that networks the players inputs (for fluid animations, and attack states) and networks the players transform. My game logic is fairly simple as well, where I update the players custom properties showing items collected, coins collected, and total KOs. How quickly would I be able to port this simple controller + network logic over to Fusion?

My main reason for wanting to switch is problems with the peer-to-peer networking style. I have AI enemies in my matches that are controlled by the master client. The problem is if the master client lags, then all the AIs lag. Would Fusion have a solution for this? Im still trying to fully understand the extent to which I can utilize authoritative server side logic with fusion. If it is the case where this issue can be better approached in fusion, how would I go about setting up my own server. Can I do this through photons services? What does that work flow look like

In short, I definitely want to switch to fusion because it’s framework looks a lot more updated and modern, however I’m curious as to how I can go about moving my current logic with ease to fusion, and then using Fusion to help establish less “master-client oriented” game logic, to more server side oriented game logic. Thanks!

Comments

Tobias
2023-01-23 09:30:32

Great to read you consider making the jump.

It is impossible to guess how complex it will be to port your logic over. Fusion has great replacements for the PhotonTransformView and you can use Networked variables instead of Custom Properties. Both solutions should be better and easy to use.

Did you find this doc for Fusion: "Coming from PUN".

In Fusion, the Host (or server) runs the logic for AI. To be fair, if the connection to the host lags, then affected players may also notice the lag. The lag compensation of Fusion is better, however and Fusion does not rely on reliable messages, so it's also avoiding lag for repeats on the network level.

Aside from this, there no way to really avoid lag in some cases. You can potentially measure the lag of hosts and keep bad ones from hosting further games. Or you could run dedicated servers.

Back to top