UE1 - UT Projectile not damaging online

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Rajada

Member
Jan 21, 2008
213
0
16
rajada.tumblr.com
I have a weapon that fires a projectile that drops several small, explosive projectiles via a spawn function. However, these projectiles only damage players when not in an online game. In online games they are totally harmless.

When I spawn these, is there a specific remote role I should be giving them or does the problem lie elsewhere?
 

meowcat

take a chance
Jun 7, 2001
803
3
18
If you post some code we might be able to help out. Depending on how you want to handle the spawning there are two ways I could see doing this:

1. Server spawns multi projectiles (with their RemoteRole=ROLE_SimulatedProxy and maybe bNetTemporary) at appropriate time (make sure the client version does not perform any spawning). Any TakeDamage calls they make should be from the server's version of the actor (use the usual Role check and only perform on the server). This can be network expensive as a bunch of new projectiles have to be replciated. The benefit is that the client and server will probably better match each other, which could be very important for large slow moving projectiles that could be avoided.

2. Clients can spawn their own multi projectiles (although server also spawns them) based on some kind of physics notification (hitWall, Landed etc.) in the projectile or having been destroyed (LifeSpan reaches 0), and their RemoteRole is Role_None. This is nice if the physical locations of the small projectiles on the client's machine don't matter much as you would not expect the server's and client "area of effect" to be too different, or the projectiles move so fast as to not be "dodgeable" anyways. This is how I now handle the shotguns firing in my mod: the server spawns a single "master shotgun pellet" that is replicated to the client (RemoteRole=ROLE_SimulatedProxy) and then in the PostNetBeginPlay function, both the server and client each spawns additional pellets (with a little bit of spread) that have their RemoteRole=ROLE_None which improves network performance at the (very very minor) cost of some client/server accuracy (which does not matter given how fast the pellets fly).
 
Last edited:

Rajada

Member
Jan 21, 2008
213
0
16
rajada.tumblr.com
You know, I was going to paste the code, but my gun went through some design changes and I'm eliminating some features for some more fun ones. Thanks anyway.