Photon Cloud : Optimizing "packages"

Hi. I'm trying to make a helper.
What I'm doing right now is creating a ExitGames Hashtable, add some information:

hash.Add("P",IsOnPit);
hash.Add("D",IsOnDeck);
hash.Add("I",IsOnPile);

and send it with an RPC;

My question is, If I do this:

MyHelper.Add("P",IsOnPit);
MyHelper.Add("D",IsOnDeck);
MyHelper.Add("I",IsOnPile);

and in my helper, maybe change the string encoding, or I don't know, cast to byte some stuff??
Will It be less heavy ? will it be more performant?
If not, How can I make more performant this kind of things?
My idea is to be able to add stuff the the hash table and optimize it. Does anyone knows how to do this?
I can use some tips.

Thanks in advance!!

Comments

  • Sending a byte has less overhead than using a string (which has length info). Sending a object-array (each item carries it's type around) or a byte[] is more effective than a hashtable but has drawbacks: While the hashtable has keys, the arrays use the index position and if you ever change this, things might break more easily.
    In your case, a bool[] or byte[] might do the same trick.

    In general: It makes more sense to try to send less and less often than trying to optimize message size early on.
    Yours was a card game? It's not as active as an FPS, so you already have a less stressful game to begin with.