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