It has been awesome turning my game into a multiplayer one in a matter of days, but before I get too deep into finishing It I'd like to know about optimization of observable components and such.
In my two player game, each player controls a set of units. To sync the unit positions and stats, I created my own IPunObservable class instead of using the TransformView. It sends the unit's 2 dimentional position along with rotation in a single Vector3, health as a float, a few ints for data, and a bunch of booleans.
It all works fine, but how could I optimize it to allow for 10-30 units for each of my 2 players
In my list below by saying 'better' i mean does it use less of the network, does it send less data, is it faster, Does it result in less messages sent per minute, is it the best solution
1. Is doing stream.SendNext() less better, or does it not matter?
2. Is sending a byte better than sending a bool? is sending another object type better?
3. Is sending all my bools as a single int and determining on the other player's side what bools were true (for example if first digit is a 1, boolean1 is true and if the tens digit is a 1, then boolean2 is true, etc)
4. Is sending data only when it changes better? (I assume so)
5. Are more networkviews that send a little bit of information each better, or a few network views that send a lot of information.
6. Are networkviews that don't observe anything but just send rpcs bad? Do they create any sort of network latency when they aren't syncing anything.
I'm asking all of this because I don't know how photon sends data and if i should optimize and think about it, or if photon does that automatically.
Thanks in advance for any help, and excuse me if i missed something on the docs explaining how this works.
Also if you don't mind me asking, (if you are a developer using photon in in one of your published games especially mobile) how stable are your ccus? Do they change a lot dramatically even if you have small audiences? What are your relative max and min ccu counts throughout the day? Thanks.
In my two player game, each player controls a set of units. To sync the unit positions and stats, I created my own IPunObservable class instead of using the TransformView. It sends the unit's 2 dimentional position along with rotation in a single Vector3, health as a float, a few ints for data, and a bunch of booleans.
It all works fine, but how could I optimize it to allow for 10-30 units for each of my 2 players
In my list below by saying 'better' i mean does it use less of the network, does it send less data, is it faster, Does it result in less messages sent per minute, is it the best solution
1. Is doing stream.SendNext() less better, or does it not matter?
2. Is sending a byte better than sending a bool? is sending another object type better?
3. Is sending all my bools as a single int and determining on the other player's side what bools were true (for example if first digit is a 1, boolean1 is true and if the tens digit is a 1, then boolean2 is true, etc)
4. Is sending data only when it changes better? (I assume so)
5. Are more networkviews that send a little bit of information each better, or a few network views that send a lot of information.
6. Are networkviews that don't observe anything but just send rpcs bad? Do they create any sort of network latency when they aren't syncing anything.
I'm asking all of this because I don't know how photon sends data and if i should optimize and think about it, or if photon does that automatically.
Thanks in advance for any help, and excuse me if i missed something on the docs explaining how this works.
Also if you don't mind me asking, (if you are a developer using photon in in one of your published games especially mobile) how stable are your ccus? Do they change a lot dramatically even if you have small audiences? What are your relative max and min ccu counts throughout the day? Thanks.