Receive acknowledgement on destroyed network object

Options
For my roulette game, I am destroy all networked chips using following code when one round complete.
foreach (GameObject mineChips in mineChipsObjects)
        {
            PhotonNetwork.Destroy(mineChips);
        }

There is no problem with removal of network objects. Above code remove chips from all connected players.
But now I want to play animation for each networked chips either win or loss.

So I want some callback for removal of network chips objects so I can place some animation over there before removing object.
I hope you understand my question perfectly so please give some guidance over here.

Comments

  • vadim
    Options
    You can't play animation on object after it's destroyed. Play animation first, then destroy it.
    If some action before destroy required, use RPC to trigger that action.

    Setting PhotonView on every chip is too expensive. Instead, use single object for synchronization of general parameters such as chips count. Instantiate and animate chips locally basing on synchronized parameters without per-chip synchronization.
  • Tobias
    Options
    Think about sending the "turns" instead of individual chips. You can trigger all needed animations when you send "player x puts y chips on numer z" and "result of this spin is number A".
  • Thanks for your reply I understand your point but I want some more clarification regarding following lines.
    vadim wrote:
    Setting PhotonView on every chip is too expensive. Instead, use single object for synchronization of general parameters such as chips count. Instantiate and animate chips locally basing on synchronized parameters without per-chip synchronization.

    Yes you are right, I have added photon view component in each placed chips but in observe field I have set nothing. So it creates any network traffic or not that I don't know?
    Please give some information about this.

    You written about some type of synchronization but I don't know more about that.
    If you give some focused information then it will help me a lot.

    Although one more thing I forgot to mention. I have added functionality to change chips place at any time. Based on that I have attached photonview to each chips.
  • Tobias
    Options
    I would send your actions/turns as RPCs when they happen.
    RPCs are not very complex and shown in the Marco Polo Tutorial.
    http://doc.exitgames.com/en/pun/current ... marco-polo
    Do this tutorial, if you didn't yet. It will show you some of the things you should know.

    You can store the player's state via PhotonPlayer.SetCustomProperties() and the general game state via Room.SetCustomProperties().
    Alternatively to RPCs you can use the custom properties also to store each player's bets. You just need some way to store and update the bets per round.

    If a PhotonView does not observe anything, it won't create updates. However, I don't think you really want/need to track individual chips over the network.
  • I got your point clearly.
    In my game it is easily possible to move chips from one place to other so that I attached network view to this game object. Because position synchronization is really necessary for this game.

    Using RPC, management of chips placement become difficult so that after reading many of tutorials available for PUN, I decided to follow this approach.

    I want to know one more thing, If I don't observe anything in photon view then it creates any type of network traffic or not?
    Thanks for all your help and such a good framework because environment for multiplayer gaming in Photon is really good. I am saying this thing after using other multiplayer server.
  • Tobias
    Options
    Thanks for the nice feedback! Good to read you like Photon compared to other solutions :)

    A PhotonView does not send anything when it doesn't observe something.
    When set to "Unreliable" will send updates no matter if the content changed since the last update.
    "Unreliable On Change" should be your best option. It sends updates unreliable while things change. Once your chips got to the target position, a last update will be sent reliable and then updates only start again when values changed. This is based on whatever you provide in OnPhotonSerializeView.
    You can also not modify the stream and you also skip the updates.
    See: http://doc.exitgames.com/en/pun/current ... e-overview "Observe Options"