Search Unity

Third Party Photon 2 synchronization questions

Discussion in 'Multiplayer' started by Noxirus, Jun 10, 2020.

  1. Noxirus

    Noxirus

    Joined:
    Sep 18, 2019
    Posts:
    40
    Hello,

    I have been getting to know the Photon 2 plugin and had a question about how to make clients sync with the host a bit more.. .consistently?

    Im trying to add object pooling to my projectiles (lasers) so when my AI bots get added into the game they create the lasers that they will use throughout the game. However, when a client joins the game those lasers need to be assigned to the AI again, meaning that I have to PhotonNetwork.Instantiate a whole new set of lasers for the AI (essentially bloating the host client with lasers needed for all clients).

    I feel like there is a better way to assign the PhotonNetwork instantiated lasers and keep those values on the AI for an additional clients (players) that join?

    I am also having difficulty syncrhonizing the movement of my AI that are in the game, for the most part they are synchronized but not always...? I am using the Photon Transform View to track the AI and laser location.

    Thanks very much for your time.
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    The Photon Transform View (and related components) are very generic and not optimal. The idea was that each game needs it's own solution to get best results. However, this is more complex for the developer...

    So, we teamed up with the maker of Simple Network Sync and we work together on a PUN 2 addon: SNS 2.
    It is tick based and provides components to sync movement, shooting and health, works with moving platforms, pickups and sends data optimally.

    Have a look. Join the discord channel (linked from the readme) to get help and discuss!
     
  3. Noxirus

    Noxirus

    Joined:
    Sep 18, 2019
    Posts:
    40
    Thanks very much! I will look into this addon more and see if I can get it into my game!