Fake Train Movement?

How would I fake the movement of a train while also having the best performance?
I would rather like to keep the train stationary though since I want the player to run on it easily without the problem of it moving.

I thought of having a moving background while the train stays stationary though I don’t know how performance friendly that would be since I also would like it to be detailed.

What would be the best way to fake the movement of a train while also making sure performance is friendly for all players including mobile or console?

2 Likes

Keep the train stationary, move the background. You can do this on the client and experience minimal to no performance hits. If the backdrop isn’t important to interact with, then you need not worry about synchronisation between clients either (also known as do not tween this on the server) nor how detailed you make said background.

Moving the train itself may give you performance and design troubles. Think about how each scenario fairs out in a practical situation by assessing what is happening.

If you move only the backdrop, then you’re only managing two static objects - an unmoving train and a background that’s moved around to give the illusion of movement. Realistically, the only thing that you are moving is the backdrop itself. After that, you aren’t worrying about anything else.

If you move the train, you have a dynamic object to be concerned about (the train) as well as the characters on board it. So, physics needs to be taken into account. Now to add onto this, if you actually move your train, then you need to be prepared to get a large background. Considering you said you want to detail it, now you have to factor in map rendering.

So let’s table that up to get it into quick wording.

Method Operations to be completed
Stationary train Move background in a cyclical manner on the client
Moving train Train physics, character physics, map size, map rendering

Here, you aren’t just thinking about performance, but efficiency and applicability. I think the choice is quite obvious for you. Static all-around wins over accounting for multiple factors which some alone can incur performance concerns.

5 Likes

What if the backdrop is consists of multiple parts, maybe lets say 50 or 100 for both sides?, would that impact performance alot or would it be very minimal?

Nope, the performance impact would still be minimal so long as you keep the operation on the client. 100 parts is nothing on performance, frankly. If you believe that you will experience a performance drop, implement the feature first and then give it a go.

I will tell you that you’re going to experience more than just performance issues if you decide to move the train, though. The benefits of moving a backdrop outweigh moving the train itself (surprisingly).

I’ve created fake movement and seen fake movement in many different mediums. Two notable ones were cloning a segment of the map and tweening it a certain way to give the illusion of movement and using particles, trails and beams to accomplish the same.

1 Like

So let’s say that if it was going to be 3D in my use case, I could basically “regenerate” parts and objects and CFrame them, right?
On second thought I am having doubts that this will save performance