Traffic question
Options
I am working on a system to synchronize the damage of weapons, they need a series of data.
Locally to launch the event I only need two, but this event collects a series of information that is necessary to execute another series of events, and this information is serialized to object type -> sent the rpc (with that information) -> deserialized the data and I run events with that information [so far so good]
These are the data that I currently send, and in a burst of 6 bullets the ping increases to 300 per player, imagine that we have 10 players in the room .... 300x10: |
[I can assume it is from the volume of data I send]
Float damage, IdGUN
String IdLocalPlayer, IdReceiverPlayer,
vector3, lookat hitpoint, direction
public part HitSite <- ENUM
bool: hit, impact
functions for serializate and deserializate
public static object Deserialize (object [] Info)
public static object [] Serializes (WeaponDamageStruct WDS)
This has a high consumption.
My questions:
I can abstract all this information to two variables, 1 type vector3 and another type string for the id of the player that sends. Would it be correct to make this decision? I would send the fire event and it would collect all the information necessary to execute the following functions
On the other hand, I do not use istanciated projectiles to generate the damage, what consumes more, create a projectile or send two variables of type vector3 and string?
Any suggestions to optimize this event that is repeated over and over again during the course of the game?
Locally to launch the event I only need two, but this event collects a series of information that is necessary to execute another series of events, and this information is serialized to object type -> sent the rpc (with that information) -> deserialized the data and I run events with that information [so far so good]
These are the data that I currently send, and in a burst of 6 bullets the ping increases to 300 per player, imagine that we have 10 players in the room .... 300x10: |
[I can assume it is from the volume of data I send]
Float damage, IdGUN
String IdLocalPlayer, IdReceiverPlayer,
vector3, lookat hitpoint, direction
public part HitSite <- ENUM
bool: hit, impact
functions for serializate and deserializate
public static object Deserialize (object [] Info)
public static object [] Serializes (WeaponDamageStruct WDS)
This has a high consumption.
My questions:
I can abstract all this information to two variables, 1 type vector3 and another type string for the id of the player that sends. Would it be correct to make this decision? I would send the fire event and it would collect all the information necessary to execute the following functions
On the other hand, I do not use istanciated projectiles to generate the damage, what consumes more, create a projectile or send two variables of type vector3 and string?
Any suggestions to optimize this event that is repeated over and over again during the course of the game?
0
Comments
-
up !0