Replication help

Subject: Optimizing Train Movement Replication in a Dead Rails-like Game

Hello,

I’m developing a game similar to Dead Rails and need help with optimizing train movement replication. Currently, I want to avoid replicating every frame of the train’s movement to clients. Instead, I plan to send one-time events like “train started moving” and “train stopped”, then calculate movement locally on each client using workspace:GetServerTimeNow() for synchronization.

However, there’s a complication: like in Dead Rails, monsters can climb onto the train. My main question is:

How can I make the train move only on the server without replicating its movement to clients? Essentially, I need to prevent the server from replicating the train’s position/rotation updates while still allowing other interactions (like monsters riding it).

Thanks in advance for your insights!

Dead Rails uses physics to move the train via PrismaticConstraints

I think using Roblox physics to move a train along straight rails is inefficient in terms of optimization

Im pretty sure that it will be more inefficient in terms of optimisation and safety against haxors. Thom alr said that dead rails using PrismaticConstraints and its the best way, i know, to recreate something like train or elevator in roblox. Also before u use PrismaticConstraints, if ur train made using parts, then union them.

1 Like

Parent it to workspace.CurrentCamera on the server (but then it wouldn’t replicate its creation either, so if you initialize the train model on the server you could make the clients locally make a train model on the client themselves), that stops it from replicating its properties
For the moving part, since you don’t wanna use physics movers, you could try sending a position every few frames and use interpolation so you can move the train’s position smoothly on the clients. Or you could just use the method you thought of, but you’ll have to know the velocity the train gets, and this might take some more work if you have more possibilities