Masterclient keeping track of game score

Options
Hi everyone,

My game's coming along nicely thanks to Photon Cloud! My current goal is to have a "death recap" window popup when one of the players die. I have this working fine, but the data inside isn't what I'm after. My logic that I'm currently using is I have a gameobject called Master Score Tracker with my script attached which is there on screen load. In this script there are a few lists<int>, one to hold score, one for kills, one for deaths, each player representing a slot in each list that I reference by their name. Whenever a player gets a kill or dies, I call a function in Master Score Tracker to save the current stats. This works well so far, except that it will only display the local data. For example, If I'm testing with two people, A and B, if A dies, the death recap screen correctly displays A's data, but just has 0s for B's data. If B dies, B's data is correctly displayed, but A's data is 0. I know this must be something simple, but can't get my head around it currently. A nudge in the right direction would be greatly appreciated. Thanks for your time.

-Jarryd

Comments

  • 2Kin
    Options
    In your position, I'd like to use the player's customproperties. For me it seems like the simpliest solution for achieving this.
    If player A dies or makes a kill, he updates his customproperties. And each players do the same... something like this :
    function dy(){
    			var score : Hashtable = new Hashtable();
    			score.Add("death", death++);
    			score.Add("kill", kill);
    			PhotonNetwork.player.SetCustomProperties(score);
    }
    function kill(){
    			var score : Hashtable = new Hashtable();
    			score.Add("death", death);
    			score.Add("kill", kill++);
    			PhotonNetwork.player.SetCustomProperties(score);
    }
    
  • Awesome thanks, I'll give that a try
  • Am I right in saying a Photon 'room' is just a game? The documentation is rather confusing. Would I be able to remove the entire rooms/lobby concept and simply have my game run from one server to which all clients connect once logging in? Could someone perhaps provide me with a tutorial on doing this? I suppose the server would come down in size after removing what I don't need, I just don't know how to go about it.
  • Tobias
    Options
    Come down in size? You can't mean disk size, cause that's 10MB or so. Memory wise: The memory is more or less reserved by the Core, which you can't modify. It takes the memory early but re-uses it, which is good performance wise. Why shouldn't we use all the GBs you have in your machine ;)

    You could modify the server to not have rooms but we don't have a tutorial for that. It's a rare case (for our usage at least). We do have tutorials to start from scratch:
    http://doc.exitgames.com/photon-server/ ... -tutorials
    http://doc.exitgames.com/photon-server/ ... lo%20World