Too high message rate

Options
Hey there! I'm having some issues with my message rate, I recently noticed the graphics in the User Panel, and today I stumbled into something scary. I am developing a Third Person Shooter and a Futuristic racing game, but at the moment I'm using my time in the TPS. The most players I've tried it with are just 2. but most of the time I'm going solo into the rooms for making tests. However.... I have a 350 mgs/s weekly average. That's crazy for one player and an ocational second. Just a couple our ago I went into the game and cheked the hourly rate... I sent almost 300 messages in a second, and I was alone. I'm sure I must be doing something wrong and I don't know what it is. Here's what I'm serializing:
void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
	{
		if (stream.isWriting)
		{

			stream.SendNext(transform.position);
			stream.SendNext(transform.rotation);
			stream.SendNext( anim.GetFloat("Speed") );
			stream.SendNext( anim.GetFloat("Direction") );
			stream.SendNext(GunAim.eulerAngles);
			stream.SendNext(cam.transform.rotation);


		}
		else
		{

			this.correctPlayerPos = (Vector3)stream.ReceiveNext();
			this.correctPlayerRot = (Quaternion)stream.ReceiveNext();
			this.correctSPEEDanim = (float)stream.ReceiveNext();
			this.correctDIRanim = (float)stream.ReceiveNext();
			this.correctBoneEuler = (Vector3)stream.ReceiveNext();
			this.correctBoneRotation = (Quaternion)stream.ReceiveNext();

		}
	}



I'm also sending an RPC for the shooting sound and muzzle flash:
[RPC]
public void ShootingRPC(){


		if(!Sound.audio.isPlaying){
			

			MuzzleFlash.SetActive(true);
			Sound.SetActive(true);

			
		}



	}




And if the player gets hit I call an RPC to tell him that he was hit so he can reduce his health depending on where he was hit. It also gives a kill point to the player responsible for sending the killer shot.
[RPC]
	public void TankingDamage(int Damage, PhotonPlayer player){

		CurHealth -= Damage;

		if(CurHealth <= 0){
			int curKills = 0;
			curKills = (int)player.customProperties["Kills"] + 1;

			ExitGames.Client.Photon.Hashtable Kills = new ExitGames.Client.Photon.Hashtable(){{"Kills", curKills}};
			player.SetCustomProperties(Kills);

		}


	}



Most of this is not being called since I am alone in the map syncronizing with myself. So how is it that I'm sending about 300 msgs/s??? ain't that kind of crazy? Thankyou beforehand for any help you can give me!


Paul O.

Comments

  • Tobias
    Options
    Sorry for the late reply, Paul.

    I think if you're alone, most of the time PUN doesn't send anything. I don't see how the message count could be that high.
    You check the Dashboard?
    And aside from you, no one is playing?

    If you call ShootingRPC constantly (every frame) you might easily run into a lot of messages/sec. You could call "beginning to shoot" and "end shooting" RPCs instead or "inline" the shooting info into your OnPhotonSerializeView. Send if you shoot there and you re-use some messages you have to send anyways.