I’ve built a (fairly) basic 1 vs 1 multiplayer VR game for the Vive that uses motion controllers. One hand is used to control a ray-gun that launches spherical projectiles (bouncy balls); the other holds a shield that blocks the projectiles. Players face each other and try shooting balls in to the opposing goal. The game is a mix of playing racquetball and being a hockey goalie. The room is rectangular and the projectiles continue to bounce around the room until they either land in a goal or they timeout (10 seconds) and explode/destroy.
I’m having a difficult time smoothly syncing the projectiles. If I check the box to have my projectile “replicate movement”, the client sees jittery/jagged movement on the balls. They seem to be relatively in the correct place and projection, but graphically, very jumpy/twitchy.
If I uncheck “replicate movement” and then multicast spawn the projectile on the server and client, it’s perfectly smooth on the client, but after a bounce or two, becomes wildly out of sync to where server/client are seeing the projectile in completely different locations. I tried a few different things with this method, such as replicating the projectiles transform and velocity when the server copy bounces; the thought was if the client was slightly off, we could catch up to the server during the bounces, but this did not work: every server bounce, the client would teleport to the bounce and then to some new direction, basically teleporting all over the map.
If I uncheck “replicate movement” and then have the client update it’s position every tick based on the server’s replicated transform, the projectiles are perfectly synced in location (not jumpy/twitchy), but appears as if it’s running at 1/3 the framerate (i.e. strobey); it’s not silky smooth like on the listen server. This feels like the best option so far because the game is actually playable and the balls appear to sync position; but I’d REALLY like to get the movement closer to how smooth the server is. I’ve tried a handful of things with this method, such as LERPing the server transform to the client transform every tick, but this yielded no discernible change.
Is there some permutation of these strategies that will yield acceptable results? Should I change my approach from a “Projectile” to some other kind of actor? Is this even possible to accomplish in Blueprints?
I’ve scoured the internet for this issue. There’s a handful of discussions around replicating projectiles and I’ve implemented the various techniques, but they all seem to have some kind of undesirable side-effect as outlined above.
Thanks in advance!