Performance issues with my automatic train game

Hello. I was wondering if there’s any way to improve performance with my trains for my automatic train game.

At max there are around eight trains to make sure that there are enough trains on the map. Each train has around 700 moving parts, equaling to about 5600 moving parts at once. In game it causes the trains to lag a lot (physics throttling down to at lowest, 33% speed), leading to even more lag. Note that all the trains are running on the server.

Is there a way to improve this or even fix this issue without lowering the amount of trains?

2 Likes

I have a lot of experience with lag reduction in train games and the absolute best things you can do is keep the part count as low as possible. If there are some parts all in the same area and the same material you can use CSG to union them together.

Using MeshParts can also help to reduce lag, but for a game such as this I would recommend CSG. If you need any more support for your project, please let me know. Hope this helps! :grinning:

1 Like

Thank you for the suggestion. I will consider this.

Alright, I optimized my train by removing one carriage and unioning some parts last week. It worked for a moment, the throttling was around 87-100%.

Until it started throttling suddenly (50-87%) again. Why is this happening?

How are the carriages connected? Are they using RopeConstraints? If so, I would very strongly recommend using RodConstraints instead as this creates more rigid and smooth motion.

If parts of the train are too heavy, maybe making most/all of it Massless except one balanced part to make sure it doesn’t float away could help.