Trains crashing - could be due to setting network owner to player?

In this game, TRR Roblox Star Line - Roblox,

The whole idea of setting the train’s network owner to the lowest-pinged player seems like a very bad idea. You are essentially just making one player’s experience smoother while risking network-related problems, such as collisions. My personal recommendation is to keep trains on the server and utilize constraints / body movers. These replicate nicely and smoothly throughout clients, which means that they will both be handled globally by the server AND be smooth to (almost) everyone.

If you really do not want to compromise on a smooth experience, then my suggestion is to make the trains move on the client for each separate client (server does nothing but teleport trains to appropriate stops or even just handle events), having local scripts drive the train. This will maximize smoothness but will in-turn look desynced from player to player.

My recommendation is to use the server. That way, you are avoiding player lag and everything is in-sync with each other.

How many trains do you have? I’ve ran some pretty intensive things on Roblox in the past and it seemed to be holding up, so I would assume that it has to do with the code itself rather than Roblox servers not being able to hold up. My best recommendation is to try to optimize it as much as you can.

If you do not want the server to take care of it, then you got to set the ownership of all the trains to a single client if you wish to have them in sync. In short, for as long as they do not have the same NetworkOwner, they are bound to desync.

Try to remove all Trains exept one in your Game and drive it and then add more and check at which Point your Trains would lag and are in your Train Models the Propertie LevelOfDetail set to Automatic or Enabled?

What if u would just load the Map where the Player currently is, and if they are heading to another Place u could load this map and remove other Maps then, is that something for u?

Try to make PhysicsSteppingMethod to Adaptive instead of Fixed (The Default is Fixed), the Propertie is in the Workspace, this also worked for me when my Game was lagging.

Yes, it is completely feasible, and you could even optimize it more that way by making it so that trains that aren’t nearby or visible will not be rendered. The only possible issue is that there is a small possibility of not looking smooth, so you’d have to try it out and see. Overall though, you could certainly do this.

1 Like