Problem with Msg/s Room

Options
Hi, I trying to make a 2d Shooter multiplayer game, but I note that I have a problem, the number of messages per second/room are more than 900 when I start to shoot bullets per 2 minutes, that i check in the Dashboard -> APP -> Analyze-> Show Data for : LAST HOUR.

I have set this value in the code in the Start() function:
PhotonNetwork.sendRate = 60;
PhotonNetwork.sendRateOnSerialize = 30;

for the OnPhotonSerializeView() I only send this:
for Bullets: i send a Bool value to active.
for the Player: is have "transform.position", "transform.localScale", "rigidbody2D.velocity".

I'm not sure if I'm misinterpreting the data from the Analyze, but in a tests for 2 minutes shooting bullets the Analyze tells me I'm sending more than 900 Msg / s.

So i dont know what Im doing wrong, can you help me?

PD: sorry for my english.

Regards

Comments

  • Tobias
    Options
    If you send a message per bullet, then you might send a lot, yes. Also you modify the sendRateOnSerialize. That produces more messages in your case.
    Check:
    http://doc.exitgames.com/en/pun/current ... -and-state
  • mrwayne
    Options
    Hi tobias! but then what is the best solution for spawn multiple bullets or projectiles for my case? or some simulation of that?.
    I dont know if i doing wrong, im VERY new with photon. Also I had already tried with the RPC method, doing a simple "photonView.RPC ("FireProjectile", PhotonTargets.Others);", but with this solution I had even more Msg/s ROOM.

    Sorry for the question, Im very new with photon.
  • mrwayne
    Options
    anyone can help me? :S
  • vadim
    Options
    Did you find out what is the source of that high message rate? Disable different components until rate gets to reasonable level.

    In my reply to your mail to support I wrote:
    Bullets should not have PhotonView attached or count of PhotonView 's in scene will exceed any reasonable limits very soon.
    Instead, on each shot, send Player's RPC which triggers local 'shot' on each client (sound or visuals) w/o engaging any network sync on bullets.
    Detect hits on one client only (usually shooter) and notify others about this via RPCs.
    Did you try to rework your code basing on these considerations?
    Also I had already tried with the RPC method, doing a simple "photonView.RPC ("FireProjectile", PhotonTargets.Others);", but with this solution I had even more Msg/s ROOM.
    Is this rework result? How many PRCs per sec. you call?
    If you use machine gun with tens of bullets per sec. then probably you need 'start shooting' and 'end shooting' RPC's and hit logic based on these 2 events.
  • mrwayne
    Options
    Hi! i fix the problem :)
    my problem was that Cliens had very high ping and sent lots of information simultaneously.
    Thx for your support vadim