UE3 - UDK Server side vs client side Projectiles

  • 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.

Salzel

New Member
Sep 5, 2013
5
0
0
Hey guys I just have a couple questions that require some clarification after reading the wiki and searching.

1. In UE3 games I've played there's two types of projectiles I've noticed: Projectiles where the location is actually where it is on the server (not simulated by the client), and projectiles that are simulated by the client and sometimes NOT where they actually are on the server. The server side projectiles are accurate, but if the player has high ping, it will be awhile before the shot is registered; while if it's simulated, it's on their client as soon as they click but isn't where the projectile actually is. Which variables are set that decide the projectiles behavior? Is this set with "bNetTemporary", "RemoteRole", or something else?

2. If I want to set a delay on the projectile animation before it appears on the players client (eg they shoot a rocket, walk off a bit and then the rocket spawns on where it was shot originally a couple seconds later) is this done with Delay and DelayLow variables in the ParticleSystem class? Or is this even possible at all?

All help is much appreciated.
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
Actually there are three types of projectiles, though the third one is quite non-standard:
  1. Initially replicated, then simulated (RemoteRole=ROLE_SimulatedProxy, bNetTemporary=True) - this type is used for projectiles the client cannot reliably simulate, but as you already figured out, these have a low network overhead. Using this type makes sense for anything that players don't really interact with and that are easy to simulate without further help.
  2. Constantly updated (RemoteRole=ROLE_SimulatedProxy, bNetTemporary=False) - this type is used for hard to simulate things, such as seeking rockets and shock balls. Here the client simulates as well (it always does), but it receives updates from the server even long after the projectile spawned.
  3. Locally simulated (for ping compensation) - here two projectiles are spawned. One fake projectile on the local client (RemoteRole=ROLE_None) to reduce the perceived network latency and the real one on the server for the actual game-relevant behavior. This kind of approach is the most complicated, as it is part of complex time synchronization and ping calculation logic. The idea is to spawn a non-relevant projectile on the owning client to remove the waiting time that is caused by replicating the shot info to the server and the projectile spawning info back to the client. For projectiles from all other clients the standard approaches 1 or 2 from above are applied instead.
    This approach is easier to apply to type 1 projectiles, because type 2 would require further synchronization between the two projectiles during projectile lifetime.
 

Salzel

New Member
Sep 5, 2013
5
0
0
Thanks for the in-depth reply Wormbo, it really cleared up some confusion I had about projectile types.
 

maryparadox

New Member
Nov 2, 2014
1
0
0
Hey folks,

Sorry to piggyback on an existing topic, but this should be relevant. I'm trying to implement a projectile that will flock around and then home in on an opponent. I've been trying to implement it from scratch rather than use the existing homing implementation because I have a significant number of difference that would be hard to do without the source code to the homing implementation.

My point is, I've been trying to exactly what is listed above in #2 and #3. My plan was to implement #2, then put #3 in place so that fewer updates are needed. The problem is that I can't get replication to happen in the projectiles more than once. Full obnoxious details can be found here: https://forums.epicgames.com/threads/988823-Replication-of-Projectiles?p=31902612#post31902612

In summary, I have bNetTemporary = false, bTearOff = False, but I see no replication of Location or Velocity, which I would assume would happen by my client's L/V being replaced in the background by the server. That doesn't happen -- but perhaps I'm completely misunderstanding how this replication would come about.

I am also unable to replicate my own variables more than once. Using repnotify I only see then being updated one time, which makes me think that I've failed to really tell my projectile to not tear off.

Any suggestions are appreciated. Confirmation of how the Location/Velocity would be replicated from server to clients would also be appreciated.

Cheers.