I am trying to implement a Subway surfer type environment for my game. The problem is I am trying come up with a method that will not cause jitters in player movement and lag.
So far my options are this:
Keep the player area static and move the background map in a loop
Now, in this method, a player is allowed to move within certain area in X-Z plane. The background maps which has no effect on player’s interaction will continue to move and loop in background locally
Pros = No jitter movement among players
Cons = Moving large maps locally could cause lag
Move the players constantly in one direction and load the map dynamically
This is the most common method used in games. The background map dynamically loads in depending on the player’s position
Pros = Lag reduction
Cons = Jittery movement among players.
My goal is to have 0 Jittery movement. This is possible in option 1 as players are not moving constantly in one direction. If they do, players with slightly high ping can see jittery visuals on other player’s movement.
What should I do ? I need help asap. If you got a separate method, I am all ears.
Thanks for the help in advance
if you want zero jitter, you have to move the map on each client separately instead of on the server. Send the starting timestamp for the animation to the client so it’s synced and just move the background there.
Map syncing for all players is not mandatory. It has 0 value in player’s interaction. Its just for visuals. And all the maps load locally ( client side ). But if I do this, client will face fps drops because the entire map is moving on the background
PVInstance:PivotTo() is pretty efficient, you shouldn’t run into issues even with a few hundred parts, but the most efficient way would probably be to weld all the parts together and set the CFrame of one primary part.
Truly hard to say… Depends on a lot of things… The outcome performance is even hard to gage. You’ll have to mock a few up and try it both ways to really know.
If your looking for an infinite type method your gonna want to keep the players static and move the map. You may have to develop some workarounds for certain things at least to get the desired effect but you will at least be able to have it run infinitely without worrying about the player running into the weird areas of the world as they get further from 0, 0, 0. They most likely won’t have to worry about that regardless but still something to think of.