Exactly.
Player presses a control -> client sends it to server(L) -> server indicates that the train should start moving -> server sends movement to client(L)
The steps with (L) are where network latency comes into effect. In singleplayer games, this should hardly be noticable, but it is on servers.
Regarding the computation efficiency of Lua advtrains, I have not much experience, gpcf can probably tell you better how it impacts performance. What I know is that on the Linuxworks server we have about 100 trains running simultaneously, and the performance loss is (still) acceptable compared to the perfomance loss caused by large factories of certain people, which employ thousands of item entities.

Lua is great!List of my mods
I like singing. I like dancing. I like ... niyummm...

gpcf was thinking about offloading the whole train logic into a separate process, independent of minetest, and only communicating required details into the minetest engine through some communication channel. However this is a large amount of work, and we haven't started things like this yet.

Lua is great!List of my mods
I like singing. I like dancing. I like ... niyummm...

orwell wrote:gpcf was thinking about offloading the whole train logic into a separate process, independent of minetest, and only communicating required details into the minetest engine through some communication channel. However this is a large amount of work, and we haven't started things like this yet.

About that: how about a communication channel over http/curl with an advtrains-backend?

Super mod, I installed it on my server, (mt.dogmine.fr, pass: youki) and I love it. I have not started the automation that looks very complicated, but would not it be possible to have the red and green signs that indicates the position of the switch, it would be great.
Otherwise good luck for this very promising project.
Sorry for the translation.

dogMine wrote:Super mod, I installed it on my server, (mt.dogmine.fr, pass: youki) and I love it. I have not started the automation that looks very complicated, but would not it be possible to have the red and green signs that indicates the position of the switch, it would be great.
Otherwise good luck for this very promising project.
Sorry for the translation.

The switches (I use the more uncommon word "turnout" because I want to evade misunderstandings with mesecon switches) can be controlled with mesecons. You can create a small Mesecon circuit with a microcontroller, two lightstones and a button to create such a display.
EDIT: Smacker has created very cool turnout levers. I don't exactly know where to find them, gpcf can probably tell you. They are in use on the Linuxworks server.

Lua is great!List of my mods
I like singing. I like dancing. I like ... niyummm...

thankyou but I have an error
2018-09-06 14:16:35: ERROR[Main]: ModError: Failed to load and run script from /var/games/minetest-server/.minetest/mods/railroad/init.lua:
2018-09-06 14:16:35: ERROR[Main]: /usr/share/games/minetest/builtin/game/register.lua:65: Name railroad_paraphernalia:switch_with_arrow does not follow naming conventions: "railroad:" or ":" prefix required

A simple hack would be to place invisible light-emitting nodes that decay when there's no train on top of them. Though that could be expensive due to modifying the world and triggering lighting calculations.

I found the problem in advtrains-tss.
The mod advtrains_itrainmap does not work. In a stable version, this mod works.
In the tss version there are no functions advtrains.detector.on_node and advtrains.detector.get .