Feedback on my train system

Surprisingly, my system doesn’t jitter too much, how does it build the nodes.

It lays a node every 2 seconds(adjustable) after you press a button on the control GUI and you just move the train, its basically a physics-based train that lays down nodes for CFrame trains then you just copy it and paste it into studio after testing, and it’s a very simple script, you just want it to find a folder to dispense the nodes inside

Oh nice, I wouldn’t mind looking into CFrame trains but then it makes more work to do for signalling systems and switch track systems.

that is true, especially at terminus stations, but my solution(for turning back) is usually changing the Current ObjectValue of the PrimaryF/PrimaryB parts of the trains to the return journey nodes and the train doesn’t move. Of course checking that its the correct station so it doesnt just randomly turn back and spaz out at an intermediate station

I’m not sure of the answer but, has someone ever built a player driven CFrame train before?

Yep! I have modified some SPCC trains which are manually driven and just turned it into CFrame trains from physics trains by adding a few things here and there, replacing qPerfectionWeld scripts with Weld 2.2 so that i can weld everything to the Base (which connectes PrimaryF and PrimaryB) which is better than setting primary part CFrame. (The CFrame trains are manually drivable still) Sadly, you can’t use .Touched as it will not be detected by CFraming objects.
One solution is to use Raycasts which i use for detecting sensors on my Automatic train game. I’m not the first person to do this, but I certainly have done it, and i am happy to help in any way

If you’d like, I can give a tutorial of my train system so you could see how smooth it looks?

CFrame trains just seem like a lot of work and seem complex to do, I want to add suspension to my train system oneday which could make it even more smoother.

Do you mean I couldn’t use .Touched for my couplers or signalling system? They rely heavily on using touched events at the couplers to know when the trains past a signal, level crossing, passenger information displays stuff

Suspension may not work for CFrame trains since one is just changing the position of the trains and orientation. It may seem daunting but it’s not too complex once you have it figured out.

Yea you cannot use .Touched, you can use Raycasting via workspace:Raycast() which is what i used after migrating to CFrame trains. Make sure to use a pcall function so that you are not spammed with errors in the console.

If however, you want to find what is not working and dont mind the errors being spammed cuz the raycast cant find a part(I think it was the local rayInstance = ray.Instance that was spamming it), you can use

coroutine.wrap(function()

end)() -- () is important for coroutine wrap functions, im not sure about other ones, but not needed on pcall

Yeah, I think I’m going to stick to physical trains for now, I think I’ve got enough raycasts for the pantograph to find an overhead wire and adjust its height all the time lol, anyways let me know if you’d like to give my system a try.

CFrame trains seem to have a lot of limitations and might be more harder on performance

Spamming raycasts can be pretty expensive especially on every frame but as long as the server has low amount of players it should be alright imo

Speaking of suspension, i once asked my friend who owns the aforementioned group (not the partner) if we could use suspension system on physics trains, he said that he once used them on his old airplane game and stuff would glitch out.

CFrame trains do have some limitations, but you can overcome some of them (i.e sensor detection) by raycasting. Jittering trains occur in CFrame trains because the server to communication is 20hz from what i’ve heard
I may develop a localscript to lerp the trains on the client if possible with some server replication to sync it up so yeah

If you need help with making a physics train CFrame train then you can always DM me, i will also provide the node layer for you and maybe a few instructions on how to adapt it into a CFrame train if possible

I do it on the client, the pantograph adjusts ALOT smoother than what it did when I did it on the server, in that same script also sets the bones positions to some attachments for the trains below.

Suspension for trains is also harder to do since the trains would be riding on smooth rails and not over rocks and whatever like cars would so the suspension wouldn’t really bounce as much.

If you’d like to make a basic CFrame train for me then go for it with sensor detection, player driven and using different tracks.

The train network owner of my country actually released a track centreline thing on their website which I could download and import to Roblox as a mesh and then I’d use editable mesh to create the vertices as normal parts and then create parts between each vertex and I could use those for the nodes.

Thats fantastic!

That’s true, train suspension is pretty harder aswell. The main reason i switched to a CFrame train-based system is because the train finds any opportunity it can to derail, so if it finds an empty spot where i forgot to fill in an invisible rail but it has a visible fake rail, it would derail.

Node laying imo is good for me because creating NodeReferences that have to be generated every time a new server starts is pretty tiring, so node laying while it can make some misalignments, it’s far better than NodeReferences unless they are all laid down together, and at that point I’d just copy it from playtesting and paste it in workspace anyways.

Did you want me to give you a look around in my train system?

Maybe not, since I mostly like to work on my own projects and stuff and occasionally I may help others on improving their projects and stuff and yeah

Thanks for the question though!

Alright no worries then!

You may be interested in this,

Basically my coding and things for it is a bit of a mess so I’m trying to get some suggestions on improving it.

Anyone have any improvement suggestions? Specifically UI suggestions for now.

You could add more depth to make it a bit realistic? or some textures, that could improve it.
I’m not a UI designer, but i think it could make some improvements to add those.

What’s the approach on CFrame or physics, specifically for the players riding on the train. How would you go about making players stay on?

What do you mean more depth?

I want to combine meshes into 1 that don’t need to be seperated and make a plugin or something that uses editable images that allows me to draw whatever on the train and paint it to make liveries and other things (If thats even possible with editable images.)

The train uses physics to move, the doors use CFrame to open and close.

Players seem to be able to stay on and walk around the train perfectly fine with a bit of sliding around. If the player jumps then the player won’t be standning in the same spot as they were before. I hope to improve this one day by a system similar to jailbreak but hopefully Roblox some how improves it so I don’t have to.