How to syncronize values without be owner

Hello friends,

My name is David, i need some info about synchronize values without be owner

I'm developing a game where there are islands with gold. These can be attacked by players
When a player attack an island, the island's gold reduce.

This is the idea, my problem is:
I am using OnPhotonSerializeView to share the values, but only the owner can send them...
Currently, when a player attack an island, he request be the new owner.
After that, he can reduce the island's gold and share the new gold value.

What happen if more than one player attack the island?
Here is the real problem, be the new owner takes 0.5 or 1s.

Other option is use RPC to notify the owner to reduce the gold
I need a way to update the gold fast, without owner requests, any ideas?

Thanks guys,

David

Answers

  • have the masterclient keep track of who hit the island, and how much gold was in the island when hit. Have the master client process this information, deliver the gold to the respective client, and when there is no more gold, the masterclient can remove the island. I hope this makes sense.
  • sdsdink wrote: »
    have the masterclient keep track of who hit the island, and how much gold was in the island when hit. Have the master client process this information, deliver the gold to the respective client, and when there is no more gold, the masterclient can remove the island. I hope this makes sense.

    Thanks friend, I get it
    The players can notify through RPCs and the master update and notify through onPhotonSerializeView

    But I have another question, what happens if the master leave the game? how can i control this easily?
Sign In or Register to comment.