Jerky projectile movement on clients

As discussed here:

Client projectiles were moving jerkily, whereas server projectiles worked fine. Specifically happened more often when more projectiles were in scene, or when they bounced. Had to implement this blueprint in projectile object to make it constantly update client machines.

Hi Russ,

I can’t seem to reproduce any jerky projectile movement on my end here. Can you send along a test project with which this happens? You can upload it somewhere like Dropbox or Google Drive and get me a download link, if it’s too big to attach here. Thanks!

Hey Russ,

We haven’t heard back from you in a while, so I’m resolving this post for now. If you’re still having trouble with jerky projectile movement on Client, please feel free to respond with information requested above and we can continue investigating. Thanks!

Hi, so, still having problems here, sorry for not getting back sooner, thought I’d fixed this by setting projectile position manually, by getting it’s location on server each tick and firing it to all clients. That quite understandably seems to have caused a silly amount of lag when there’s lots of projectiles going on…

So, what i want to happen is; player presses fire to spawn a turret, then projectile is fired from that turret

I’m triggering firing like this:

On client:

To an event on server (reliable)

59425-capture2.png

Which does some checks and sends some info to turret, to tell it to fire:

turret then fires:

And projectile should just do its job from there, as it has nothing attached to tick.

Here’s network settings for both turret and projectile:

59428-capture5.png

I’m running in editor, with 2 multiplayer games running at same time (1 server, 1 client)

Any ideas?

My guess without seeing project is that this has something to do with calculations being run on projectile at spawn, since it appears you are setting a number of variables on spawn and these are probably being used immediately. It would be helpful to see this in a test project. Are you able to reproduce this in a new project, or only your current project? If in a new project, would you upload it someplace like Dropbox or Google Drive and get me a link? Thanks!

Here’s a link to dropbox folder - i’m getting problem when running in editor, 2 multiplayer screens on same PC.

email russ_earwaker@hotmail.com if there are problems

Just removed everything from projectile spawn apart from this:

so it can set speed in construction script:

59740-capture2.png

then getting projectile and setting all variables as before on that variable, and I’m still getting problems :confused:

Can you up project before adding it to your Dropbox, please? It’s too large for me to download unless it’s zipped first. Thanks!

Hey ,

First, thanks for quick replies, really appreciate it, this thing has been driving me crazy for a while now!

I’ve added 2 new archives to folder - one with and one without starter content folder, in case files are too big :slight_smile:

Hey Russ,

It looks like your projectile is doing a lot over network. A useful tool for determining load on network is Network Profiler. Run your game and use console command, “netprofile” on server, then fire projectile a bunch. Exit Play and find .nprof file for session and open it in standalone network profiler tool.

I did this for your game and compared it to a blank First Person Blueprint template project (with projectile set to Replicates and Replicate Movement). projectile on FP project has a much lower profile on network than one in your project.

My suggestion would be to remove as much of functionality as you can out of projectile class itself, and instead call functions in other classes or from other classes as appropriate. If you place projectile from FP template in your project and spawn that instead, I think you’ll notice lag ceases.

Hope that helps!

Hey ,

On further investigation, you’re right, creating a new blank projectile type seems to fix problem. As info, when I tried to set speed of projectile within projectile itself, judderyness came back. Seems like if i set initial speed with an a spawn variable and construction script, or set velocity with a message sent to projectile, it gets all shivvery and confused. Setting speed by getting projectile movement component externally in parent object seems to work fine though :slight_smile:

Cheers again,
Russ

For anyone coming around late to this like me. In part because I had this issue. Here’s what I bet was happening with OG poster. If you make a projectile that’s just spawn and forget, then both client and server know speed and importantly, velocity of projectile. But if you spawn projectile first, finesse it, then set its velocity… well velocity is only known to server. And client gets intermittent, even jerky appearing updates. But if you multicast initial velocity setting, then both server and client have projectile close enough and moving together smoothly.

1 Like

Brefin you are 100% correct. Thank you! Anyone struggling with this, make sure you manually set speed etc on your Multicast method, instead of relying ProjectiveMovement replication.