Using Photon Realtime Cloud. The game is a co-op game for up to 4 players. If there are 4 players, each player will control 1 player unit, if there are 2 players, each player will control 2 player units. 3 players means 1 player will control 2 player units while the other 2 players control 1 player unit each. This means that one player may be sending position updates for more than 1 player unit. This works well.
Now take into account the master client is sending position updates for each AI enemy. Most AI enemies send position updates infrequently and it appears to work out fine. However, some units need a higher update rate and that's when the problems start.
To be clear, the problem is what appears to be network congestion. AI units will go from moving smoothly to stalling as updates are dropped.
When I was using UNET (LLAPI) this issue was non-existent. I was able to have a higher degree of control of when messages were sent and also the rate for different unit types (enemy vs player units). I created a group position package (so groups of enemies will have their position updates in the same message). This doesn't seem to work well with photon at all, I'm guessing the messages are too large even when I stripped as much data as possible. I also tried observing each unit with a single photon view for each player. On the units controller script I added OnPhotonSerializeView and I serialized and deserialized the units position only. Loved the simplicity of this method, it worked to a degree but I experienced the same problems as before. If I were to put a photon view on each unit, would this help at all?
Is there a solution to this problem (outside of rewriting the game to work in lockstep)?
Without having to rewrite the game to work in lockstep or switching networking libraries/relay services, is there a solution to this problem?
Now take into account the master client is sending position updates for each AI enemy. Most AI enemies send position updates infrequently and it appears to work out fine. However, some units need a higher update rate and that's when the problems start.
To be clear, the problem is what appears to be network congestion. AI units will go from moving smoothly to stalling as updates are dropped.
When I was using UNET (LLAPI) this issue was non-existent. I was able to have a higher degree of control of when messages were sent and also the rate for different unit types (enemy vs player units). I created a group position package (so groups of enemies will have their position updates in the same message). This doesn't seem to work well with photon at all, I'm guessing the messages are too large even when I stripped as much data as possible. I also tried observing each unit with a single photon view for each player. On the units controller script I added OnPhotonSerializeView and I serialized and deserialized the units position only. Loved the simplicity of this method, it worked to a degree but I experienced the same problems as before. If I were to put a photon view on each unit, would this help at all?
Is there a solution to this problem (outside of rewriting the game to work in lockstep)?
Without having to rewrite the game to work in lockstep or switching networking libraries/relay services, is there a solution to this problem?