How many network objects per game session can be handled by Photon Fusion.


Please see the image above. I am trying to make a puzzle bubble multiplayer game. Each bubble is a network object with NetworkTransform script attached.

My question is that will Photon Fusion have any problem handling above number of objects? Aslo which topology is better? Client/Host VS Shared?


Game runs good in start on mobiles but after some seconds, game becomes very slow. Why?

Best Answers

  • Niels
    Niels
    Answer ✓

    It will not, but it's not a great design. Since all you need for each of the bubbles is a color and an X and a Y, having a full NetworkObject with a transform on it is a bit overkill. Just create an array of structs and place the information you need in there (presumably a Color index, X and Y).

    Hosted and shared mode are different, not better or worse. Since there is no interaction between the two clients above (they're each in their own little sandbox), and you're aiming for mobile, I'd recommend shared mode. If you care enough about cheating to pay for dedicated servers, then hosted.

    As for why it becomes slow - it's really hard to say, but you're probably doing something wrong. Have you profiled it?

  • Tobias
    Tobias admin
    Answer ✓

    Mobiles are not the best to host games: Variable network and calls or distractions may mean the game goes to the background and iOS then drops the connection.

    If that's not a reason for you to use Shared Mode, then you can run host mode on mobiles, yes.

    It is simply more efficient to use an array of structs instead of transforms. The bubbles are essentially just an array of color-codes, so we point out a recommended approach.

    You can use the NetworkObjects and they should not be a bottleneck usually.

Answers

  • Niels
    Niels
    Answer ✓

    It will not, but it's not a great design. Since all you need for each of the bubbles is a color and an X and a Y, having a full NetworkObject with a transform on it is a bit overkill. Just create an array of structs and place the information you need in there (presumably a Color index, X and Y).

    Hosted and shared mode are different, not better or worse. Since there is no interaction between the two clients above (they're each in their own little sandbox), and you're aiming for mobile, I'd recommend shared mode. If you care enough about cheating to pay for dedicated servers, then hosted.

    As for why it becomes slow - it's really hard to say, but you're probably doing something wrong. Have you profiled it?

  • minaammunir
    edited August 2022

    Hi,

    Thanks for the informative answer. Just some follow-up questions:

    • My game was getting slow because of a bug. It was not related to Photon. An object was continuously making copies of its one component. I resolved that bug and now the game is running smoothly on AutoHostOrClient mode.
    • I am using AutoHostOrClient mode. So one client becomes the host of the game. Is it bad for mobile platforms? Do I really need to rewrite the game with Shared mode?
    • Doesn't NetworkObject just copy Transformations (XYZ) over the network? I have [Networked] property for color index (int). Do I really need to rewrite the game without NetworkObjects? Also, how to use an array of structs over the network? Is there some example in the documentation?


  • Tobias
    Tobias admin
    Answer ✓

    Mobiles are not the best to host games: Variable network and calls or distractions may mean the game goes to the background and iOS then drops the connection.

    If that's not a reason for you to use Shared Mode, then you can run host mode on mobiles, yes.

    It is simply more efficient to use an array of structs instead of transforms. The bubbles are essentially just an array of color-codes, so we point out a recommended approach.

    You can use the NetworkObjects and they should not be a bottleneck usually.

  • Thanks, @Tobias ,