Character Customization

Hi

I want my players to be able to change the colours of their players clothes.

Would I send this info via the photonView.instantiationData. Then have the others players construct the
new players clothes texture from the colour data sent then instantiate the player.

thanks
R

Comments

  • Yes, that's a good idea.
    You could also use the player properties, if you wanted to. This way, the colors can be changed and you still don't have to send update after update (as properties can get new values).
  • Thanks for your reply.

    So are you saying this if I use player preferences, if a player changes something about themselves on their client, this data is automatically synched to all other players?

    I am having trouble understanding photon instantiation as the in examples all players are essentially the same.

    R
  • doc wrote:
    13.12.3.4 void PhotonPlayer.SetCustomProperties ( Hashtable propertiesToSet )
    Updates the custom properties of this Room with propertiesToSet. Only string-typed keys are applied, new properties (string keys) are added, existing are updated and if a value is set to null, this will remove the custom property.
    This method requires you to be connected and be in a room. Otherwise, the local data is updated only as no remote players are known. Local cache is updated immediately, other players are updated through Photon with a fitting operation.

    Note : Don't use "PhotonPlayer.customProperties" to set your properties, as it's only a "getter" (contrary to what the documentation says).
  • "Don't use "PhotonPlayer.customProperties" to set your properties"
    Good point. Will have to check the doc for it, if that's misleading. There is a setter method.
  • Thanks for your help :D

    Just another question - sort of off topic.

    All data from players is sent through the master client. If the master client has a slow connection speed
    does this not jeopardize the quality of the game for other players?

    R
  • Yes it will ! By default, PUN is working in peer to peer. Modify it by sending all datas on the MasterPlayer who will send them back to players will reduce the amount of data which are sent (I assume it will be 2n instead of n²), but the drawback is that datas will be delayed by the MasterPlayer's latency.
    It's ok if you synchronize lot of data and your game doesn't need to be very reactive (game at turn by turn vs FPS).
  • Thanks.

    So I just have to hope that my master clients at connecting with decent bandwith.

    I really know nothing about the backend, but it would be great if Photon could switch master clients depending
    on connection speeds of the clients.

    R
  • reset wrote:
    I really know nothing about the backend, but it would be great if Photon could switch master clients depending
    on connection speeds of the clients.

    Or you host the master clients on your own backend making the users connecting to them.
    Then you have 100% control.


    there is no way to measure the connection speed of a user in any halfway reasonable form as too many factors play in, so anything that works 'automatic' will not work well if at all
  • We don't want to switch the master more than necessary. Only if this player leaves, we pick a new one. Based on speed, we could also switch when someone's ping improves, etc. Customize this, if you like!
    If you needed to, you could send your players' ping to the Master and make it decide who is the quickest player. Then set a property in the room.
    You can also change how PUN does it for you. It's all client based.