[Mod] Advanced Trains [advtrains] [2.4.3]

User avatar
orwell
Member
Posts: 958
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell
Location: Raxacoricofallapatorius

Re: Request for comments: Vertical vehicles like linetrack

by orwell » Post

Blockhead wrote:
Tue Jun 08, 2021 08:58
Hi advtrains experts.. I know that advtrains can be a decent basis for other vehicles too, as in linetrack. But I was wondering if it's possible to build vehicles that travel arbitrary distances in the vertical axis? Currently the train tracks (and linetrack (if that still works/was ever properly implemented)) as far as I know NEED to be either flat on the horizontal axes or defined in terms of a gradient for slope tracks. Does this make it infeasible to build, for example, elevators (wonkavators?) or hot air balloons? If so, how ingrained in advtrains is this limitation?
Straight vertical travel is currently impossible due to how "track directions" work. Every track node has at least two connections (the ends of the track node; for normal tracks there are 2, for switches 3, for crossings 4), and each connection has two values:
  • The direction number, a number between 0 and 15
  • The y level of the connection
The direction numbers are purely horizontal (x and z). Slopes are handled in a way that an "y level" of >=1 is considered "next node is 1 y position higher". It's currently not supported to have a gradient steeper than 1m up/down per 1m horizontal (because to find downward slopes, the pathfinder only looks at the position one node below and not further)

EDIT: What would work is an elevator that goes back and forth between two horizontal positions - nothing prohibits that both track connections point to the same direction.

To change that, we would need to rewrite the way connections work and the code that generates the path from the tracks in the world (which is mostly in path.lua). Also, I'm not sure what the wagon placement logic would do if you would pass it a purely vertical path, I'm quite sure there will be a division by 0 somewhere.

EDIT 2: Hmmm, it should not be that complicated to add an alternative format for the "connection table" for vertical travel, and handle that special case in path.lua. This leaves only the problem with the wagon placement - but for elevators it would probably be better to have "wagons" not tilt at all (like it used to be pre-5.0)

EDIT 3: like this:

Code: Select all

at_conns = {
 [1] = { vertical = -1, dir = 0 }, -- points downward
 [2] = { vertical = 1, dir = 0 } -- points upward
}
-- "dir" is horizontal angle to transfer into path_dir array so wagons can orient horizontally
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

yw05
Member
Posts: 366
Joined: Tue May 07, 2019 12:59
GitHub: y5nw
IRC: y5nw
In-game: ywang
Location: Germany

Re: Request for comments: Vertical vehicles like linetrack

by yw05 » Post

orwell wrote:
Tue Jun 08, 2021 10:29
Blockhead wrote:
Tue Jun 08, 2021 08:58
Hi advtrains experts.. I know that advtrains can be a decent basis for other vehicles too, as in linetrack. But I was wondering if it's possible to build vehicles that travel arbitrary distances in the vertical axis? Currently the train tracks (and linetrack (if that still works/was ever properly implemented)) as far as I know NEED to be either flat on the horizontal axes or defined in terms of a gradient for slope tracks. Does this make it infeasible to build, for example, elevators (wonkavators?) or hot air balloons? If so, how ingrained in advtrains is this limitation?
Straight vertical travel is currently impossible due to how "track directions" work. Every track node has at least two connections (the ends of the track node; for normal tracks there are 2, for switches 3, for crossings 4), and each connection has two values:
  • The direction number, a number between 0 and 15
  • The y level of the connection
The direction numbers are purely horizontal (x and z). Slopes are handled in a way that an "y level" of >=1 is considered "next node is 1 y position higher". It's currently not supported to have a gradient steeper than 1m up/down per 1m horizontal (because to find downward slopes, the pathfinder only looks at the position one node below and not further)

EDIT: What would work is an elevator that goes back and forth between two horizontal positions - nothing prohibits that both track connections point to the same direction.

To change that, we would need to rewrite the way connections work and the code that generates the path from the tracks in the world (which is mostly in path.lua). Also, I'm not sure what the wagon placement logic would do if you would pass it a purely vertical path, I'm quite sure there will be a division by 0 somewhere.

EDIT 2: Hmmm, it should not be that complicated to add an alternative format for the "connection table" for vertical travel, and handle that special case in path.lua. This leaves only the problem with the wagon placement - but for elevators it would probably be better to have "wagons" not tilt at all (like it used to be pre-5.0)

EDIT 3: like this:

Code: Select all

at_conns = {
 [1] = { vertical = -1, dir = 0 }, -- points downward
 [2] = { vertical = 1, dir = 0 } -- points upward
}
-- "dir" is horizontal angle to transfer into path_dir array so wagons can orient horizontally
Also, coupling. First we couple JR E231 engines onto freight wagons, then we couple ferries together, and soon we will have https://www.youtube.com/watch?v=xVgxeuK7i90 :P (not hot air balloons though, sadly)

User avatar
loppi
Member
Posts: 162
Joined: Sat May 29, 2021 11:30
In-game: loppi Lolstadt
Location: Niedersachsen,Germany

Re: [Mod] Advanced Trains [advtrains] [2.3.1]

by loppi » Post

i have one question: how to add sounds to trains?
i have installed rubberducks moretrains mod,and sadly i noticed that my favourite trains,the mt silberling and the old german diesel,dont have a sound. i have some diesel sand electric sound and i want to add it! but how to? 😒
"ich liebe industrie!" And yes, its a Russian Bulldozer 😁

User avatar
Blockhead
Member
Posts: 1622
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: [Mod] Advanced Trains [advtrains] [2.3.1]

by Blockhead » Post

loppi wrote:
Thu Jun 10, 2021 16:52
i have one question: how to add sounds to trains?
i have installed rubberducks moretrains mod,and sadly i noticed that my favourite trains,the mt silberling and the old german diesel,dont have a sound. i have some diesel sand electric sound and i want to add it! but how to? 😒
Currently custom sounds are only possible with custom_on_velocity_change callbacks written in lua. See the source code of some of the trains that have sound like the subway wagon, the JRE E231 and also the boat from linetrack for examples. Also if you want to share your sounds, please make sure that any sound files you contribute are licensed with a creative commons license or similar so that it's legal for it to be included.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

User avatar
loppi
Member
Posts: 162
Joined: Sat May 29, 2021 11:30
In-game: loppi Lolstadt
Location: Niedersachsen,Germany

Re: [Mod] Advanced Trains [advtrains] [2.3.1]

by loppi » Post

so i can just copy the subway sound and put it in the diesel file?
i will try it,thanks.
"ich liebe industrie!" And yes, its a Russian Bulldozer 😁

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

Re: [Mod] Advanced Trains [advtrains] [2.3.1]

by VanessaE » Post

So, a few of us were building-out the the rail network on my Traintable server, and one of the players wanted to start a tunnel descending into an underground rail system.

We built the tunnel, laid rails, made everything look nice. The rails descend at a rate of 1m per 3, the shallowest grade the mod has.

But when you place a wagon near the top, on level track just ahead of the slope, and accelerate forward, the wagon stops at the edge and won't go any further. The in-cab display reads "[LZB] [000]" which I take to mean the track safety system stopped the wagon because it thinks there's 0 meters of track ahead.

I tried this with a few other kinds of trains, even a handcart. One person tried a minecart also (the advtrains one of course). All behave the same.

Here is the tunnel:

Image
Image

If I place the wagon directly onto the slope, even just one meter in from the top, the wagon will descend as intended, and the in-cab display correctly indicates that there's plenty of track ahead (around 65m from the top). Similarly, if I place the wagon on level track at the bottom of the grade, I can drive it all the way up the hill and back onto level track at the top without a problem.

What do I need to do to correct it?

Two other things:

A) I'd like to request a slope that'll fill-in those "stairsteps" at the sides. I might suggest simply widening the existing N/S/E/W slope models, since you often can't place anything in the spaces next to the tracks anyway without making trains think there's an obstruction. Sometimes gravel slopes (moreblocks/stairsplus) will fit, but since they're at most 2m long, they look kinda bad next to 3m-long rail slopes.

B) I'd like to request that collision detection be reigned in a bit, so that slabs can be placed vertically next to tracks to create the look of a maglev or similar. For example:

Image

The "Japanese" train juuuuuuust barely fits -- it may not look like it, but there's a minuscule gap on both sides. On a somewhat "broader" usage, consider this three meter wide platform with thin fences on the edges:

Image

Here, there's an ample gap between the train and the fences, but it can't move because it thinks the track is obstructed. BUT, if I move those fences out by one meter and then flip them around so that they're just barely further out, it works. For example, here I've left one segment of the fence at the position I'd have preferred it at, while the rest has been moved and flipped around:

Image

This works (that one fence segment notwithstanding). Although it looks similar to the "proper" way, it's also more cumbersome to build this way, since you need to first put down something for the fences to place on/against, then remove that extra bit once the fences are in place, and may not look right with some fence types that have a "front" and a "back" side.
Attachments
Screenshot_2021-06-21_04-34-54.png
Screenshot_2021-06-21_04-34-54.png (883.32 KiB) Viewed 2215 times
Screenshot_2021-06-21_04-29-44.png
Screenshot_2021-06-21_04-29-44.png (810.77 KiB) Viewed 2215 times
Screenshot_2021-06-21_04-17-05.png
Screenshot_2021-06-21_04-17-05.png (771.6 KiB) Viewed 2215 times
Screenshot_2021-06-21_03-48-14.png
Screenshot_2021-06-21_03-48-14.png (823.94 KiB) Viewed 2215 times
Screenshot_2021-06-21_03-31-38.png
Screenshot_2021-06-21_03-31-38.png (896.18 KiB) Viewed 2215 times
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

yw05
Member
Posts: 366
Joined: Tue May 07, 2019 12:59
GitHub: y5nw
IRC: y5nw
In-game: ywang
Location: Germany

Re: [Mod] Advanced Trains [advtrains] [2.3.1]

by yw05 » Post

VanessaE wrote:
Mon Jun 21, 2021 08:36
So, a few of us were building-out the the rail network on my Traintable server, and one of the players wanted to start a tunnel descending into an underground rail system.

We built the tunnel, laid rails, made everything look nice. The rails descend at a rate of 1m per 3, the shallowest grade the mod has.

But when you place a wagon near the top, on level track just ahead of the slope, and accelerate forward, the wagon stops at the edge and won't go any further. The in-cab display reads "[LZB] [000]" which I take to mean the track safety system stopped the wagon because it thinks there's 0 meters of track ahead.

I tried this with a few other kinds of trains, even a handcart. One person tried a minecart also (the advtrains one of course). All behave the same

Here is the tunnel:

Image
Image

If I place the wagon directly onto the slope, even just one meter in from the top, the wagon will descend as intended, and the in-cab display correctly indicates that there's plenty of track ahead (around 65m from the top). Similarly, if I place the wagon on level track at the bottom of the grade, I can drive it all the way up the hill and back onto level track at the top without a problem.

What do I need to do to correct it?
In case you built it with WorldEdit, try:

Code: Select all

/at_sync_ndb
/at_reroute
And start the train again.

Also, try to reverse the train and see if it helps (especially when you place trains at the end of a track).

The tunnel looks nice btw (or is it just the texture pack?)
I'd like to request a slope that'll fill-in those "stairsteps" at the sides. I might suggest simply widening the existing N/S/E/W slope models, since you often can't place anything in the spaces next to the tracks anyway without making trains think there's an obstruction. Sometimes gravel slopes (moreblocks/stairsplus) will fit, but since they're at most 2m long, they look kinda bad next to 3m-long rail slopes.
Sounds like someone should make a mod with 33% slopes.
I'd like to request that collision detection be reigned in a bit, so that slabs can be placed vertically next to tracks to create the look of a maglev or similar. For example:

Image
You can simply add the slabs to the "not_blocking_trains" group for now, but I can expect that to be abused.

IMO a possible implementation in advtrains would be to call a "blocks_train"-ish function in node definitions. That could get more complicated, though.

Regarding maglev trains, @orwell: IIRC the assets directory has some nice models, including maglev trains and tracks, which IMO can be added to the basic_trains modpack or possibly a separate maglev train modpack.

User avatar
loppi
Member
Posts: 162
Joined: Sat May 29, 2021 11:30
In-game: loppi Lolstadt
Location: Niedersachsen,Germany

Re: [Mod] Advanced Trains [advtrains] [2.3.1]

by loppi » Post

where is this "not_blocking_trains" file?
i want to add stone walls and fence rails
"ich liebe industrie!" And yes, its a Russian Bulldozer 😁

yw05
Member
Posts: 366
Joined: Tue May 07, 2019 12:59
GitHub: y5nw
IRC: y5nw
In-game: ywang
Location: Germany

Re: [Mod] Advanced Trains [advtrains] [2.3.1]

by yw05 » Post

loppi wrote:
Mon Jun 21, 2021 17:32
where is this "not_blocking_trains" file?
i want to add stone walls and fence rails
It's not a file. It's a group in the node definition.

Alternatively, you can add the itemstring (something like "default:stone") to the nonblocknodes table at the end of advtrains/trainlogic.lua, which automatically registers certain nodes as ones that do not block trains.

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

Re: [Mod] Advanced Trains [advtrains] [2.3.1]

by VanessaE » Post

In case you built it with WorldEdit, try:
And start the train again.
The tunnel, rails, platform, and landscaping were all built by hand.
Also, try to reverse the train and see if it helps (especially when you place trains at the end of a track).
First thing I tried. It's as if the train senses the start of the slope and just goes "Nope!"
The tunnel looks nice btw (or is it just the texture pack?)
Thanks :-) The texture pack is HDX-256, by the way.
I'd like to request a slope that'll fill-in those "stairsteps" at the sides. I might suggest simply widening the existing N/S/E/W slope models
Sounds like someone should make a mod with 33% slopes.
While that's certainly easily done, it makes more sense to goad orwell or someone else to just alter the existing slope models to take advantage of the fact that they already always overlap their neighboring nodes. They presently occupy a 1.5 meter space, so just extend them to the full width needed to cover what's under them.

Make their gravel sections 3 meters wide, and tile the gravel texture so that the textures line-up properly in the space between the rails where the models would overlap (assuming two rails spaced 1m apart, on a 5m wide roadbed, as in my screenshots), to prevent Z-fighting.

I did a quick test in Blender. It can be done very easily with access to the original work files. Working from the distributed OBJ files is also doable, but is much more cumbersome since materials/groups information is lost at that point. Here's what one of them looks like, altered as I suggest:

Image
I'd like to request that collision detection be reigned in a bit, so that slabs can be placed vertically next to tracks to create the look of a maglev or similar.
You can simply add the slabs to the "not_blocking_trains" group for now, but I can expect that to be abused.
Exactly why I figured this should be considered a collision detection issue. What if someone lays the slabs flat? Then they definitely *would* be obstructing the track.
Attachments
Screenshot_2021-06-21_19-21-34.png
Screenshot_2021-06-21_19-21-34.png (401.87 KiB) Viewed 2215 times
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

yw05
Member
Posts: 366
Joined: Tue May 07, 2019 12:59
GitHub: y5nw
IRC: y5nw
In-game: ywang
Location: Germany

Re: [Mod] Advanced Trains [advtrains] [2.3.1]

by yw05 » Post

VanessaE wrote:
Mon Jun 21, 2021 22:50
In case you built it with WorldEdit, try:
And start the train again.
The tunnel, rails, platform, and landscaping were all built by hand.
Also, try to reverse the train and see if it helps (especially when you place trains at the end of a track).
First thing I tried. It's as if the train senses the start of the slope and just goes "Nope!"
That's weird. I don't think anything in particular changed since 2.3.1.
Sounds like someone should make a mod with 33% slopes.
While that's certainly easily done, it makes more sense to goad orwell or someone else to just alter the existing slope models to take advantage of the fact that they already always overlap their neighboring nodes. They presently occupy a 1.5 meter space, so just extend them to the full width needed to cover what's under them.

Make their gravel sections 3 meters wide, and tile the gravel texture so that the textures line-up properly in the space between the rails where the models would overlap (assuming two rails spaced 1m apart, on a 5m wide roadbed, as in my screenshots), to prevent Z-fighting.
That might work as well.

Another solution I see (at least with 50% slopes) is to design a type of track that can be placed on top of the slopes, except I'm quite sure that would break a "few" things.
I'd like to request that collision detection be reigned in a bit, so that slabs can be placed vertically next to tracks to create the look of a maglev or similar.
You can simply add the slabs to the "not_blocking_trains" group for now, but I can expect that to be abused.
Exactly why I figured this should be considered a collision detection issue. What if someone lays the slabs flat? Then they definitely *would* be obstructing the track.
Which is why I suggested allowing nodes to have some sort of function to detect train collision as an alternative to "not_blocking_trains". That would be quite some work, though.

IMO the real solution should be (along with the "not_blocking_trains" group) comparing the train model and the nodes it goes through to check for collisions. However, I don't think MT provides such a mechanism.

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

Re: [Mod] Advanced Trains [advtrains] [2.3.1]

by VanessaE » Post

IMO the real solution should be (along with the "not_blocking_trains" group) comparing the train model and the nodes it goes through to check for collisions. However, I don't think MT provides such a mechanism.
Well, while I also don't think Minetest has a generic API call to check for collisions, it should be possible to do it in Lua, as you can already read a node, get its definition to find its collision box, and look at its param2 to determine its rotation.

So it should be trivial (if you're good at maths, which I am not :-) ) to poll the nodes ahead of the train while it's moving, to determine if the train's bounding box (I wouldn't use the entity's actual collision box) overlaps any of them.

You'd only bother checking the 8 nodes [*] in front of the engine or behind whatever's at the back end of the train [**], and you'd only do this check every so often, say a few times per second per moving engine car (then you could back the whole train off if a collision is detected), so it should be pretty easy on the CPU.

[*] the two nodes flanking the tracks just ahead of the engine, plus the three nodes in a sideways line just above them, plus the three nodes above those, so the 3x3 square in front of the train, minus the node the tracks occupy.

[**] if the sides of a train would collide, then the front or back end would have already done so, so there's no point in checking things to the side of the engine, let alone the cars coupled to it.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

yw05
Member
Posts: 366
Joined: Tue May 07, 2019 12:59
GitHub: y5nw
IRC: y5nw
In-game: ywang
Location: Germany

Re: [Mod] Advanced Trains [advtrains] [2.3.1]

by yw05 » Post

VanessaE wrote:
Tue Jun 22, 2021 10:36
IMO the real solution should be (along with the "not_blocking_trains" group) comparing the train model and the nodes it goes through to check for collisions. However, I don't think MT provides such a mechanism.
Well, while I also don't think Minetest has a generic API call to check for collisions, it should be possible to do it in Lua, as you can already read a node, get its definition to find its collision box, and look at its param2 to determine its rotation.

So it should be trivial (if you're good at maths, which I am not :-) ) to poll the nodes ahead of the train while it's moving, to determine if the train's bounding box (I wouldn't use the entity's actual collision box) overlaps any of them.
That sounds plausible to me at least, but IMO that should be its own mod.

(And I wonder how many mods we will end up writing for advtrains. We have serialize_lib already.)
You'd only bother checking the 8 nodes [*] in front of the engine or behind whatever's at the back end of the train [**], and you'd only do this check every so often, say a few times per second per moving engine car (then you could back the whole train off if a collision is detected), so it should be pretty easy on the CPU.

[*] the two nodes flanking the tracks just ahead of the engine, plus the three nodes in a sideways line just above them, plus the three nodes above those, so the 3x3 square in front of the train, minus the node the tracks occupy.

[**] if the sides of a train would collide, then the front or back end would have already done so, so there's no point in checking things to the side of the engine, let alone the cars coupled to it.
Now let me introduce slopes (and my handwriting that is not as good as you might expect). Sometimes there would be more than 8 nodes that need to be checked ...
Spoiler
Image
(The "2.5m" is chosen arbitrarily)
I'm currently too lazy to draw curves (etc). Perhaps I will add that later.

Also, there is linetrack with ferries, and we might have double-decker wagons in the future.

TL;DR: IMO node collision should be checked for every node (at least the front of) the train potentially overlaps with.

Anyway, I can not yet tell whether my understanding of mathematics is sufficient to implement such collision checks (and I also need to look into the object/model file formats), and I am not sure whether orwell currently has the time to implement it. :(
Attachments
Untitled-1.png
Untitled-1.png (323.22 KiB) Viewed 2215 times

User avatar
Blockhead
Member
Posts: 1622
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: VanessaE's request for collision

by Blockhead » Post

VanessaE wrote:
Mon Jun 21, 2021 08:36
...

But when you place a wagon near the top, on level track just ahead of the slope, and accelerate forward, the wagon stops at the edge and won't go any further. The in-cab display reads "[LZB] [000]" which I take to mean the track safety system stopped the wagon because it thinks there's 0 meters of track ahead.
...

What do I need to do to correct it?
This is a well-known bug we have experienced often on the linuxforks server. If ywang's advice didn't work, you will just have to remove the tracks, run the train through an alternate path, place them back where they're meant to go. Oh, and make absolutely sure there's no nodes secretly blocking your path you haven't noticed yet.
VanessaE wrote:
Mon Jun 21, 2021 08:36
Two other things:

A) I'd like to request a slope that'll fill-in those "stairsteps" at the sides. I might suggest simply widening the existing N/S/E/W slope models, since you often can't place anything in the spaces next to the tracks anyway without making trains think there's an obstruction. Sometimes gravel slopes (moreblocks/stairsplus) will fit, but since they're at most 2m long, they look kinda bad next to 3m-long rail slopes.
Your new model idea makes a fair bit of sense, but I'm not sure about diagonal slopes. There's a lot of potential overlap with surrounding terrain. On LinuxForks, our fork of moreblocks includes gravel slopes in 1:2 and 1:3 gradients called gravel slope 2a, 2b, 3a, 3b and 3c. With careful placement these work nicely on both straight and diagonal slopes to give a smooth look. You can see these nodes on linuxforks just north of Apple Grove or Nimbyton stations.
VanessaE wrote:
Mon Jun 21, 2021 08:36
B) I'd like to request that collision detection be reigned in a bit, so that slabs can be placed vertically next to tracks to create the look of a maglev or similar. For example:

The "Japanese" train juuuuuuust barely fits -- it may not look like it, but there's a minuscule gap on both sides. On a somewhat "broader" usage, consider this three meter wide platform with thin fences on the edges:

Here, there's an ample gap between the train and the fences, but it can't move because it thinks the track is obstructed. BUT, if I move those fences out by one meter and then flip them around so that they're just barely further out, it works. For example, here I've left one segment of the fence at the position I'd have preferred it at, while the rest has been moved and flipped around:

This works (that one fence segment notwithstanding). Although it looks similar to the "proper" way, it's also more cumbersome to build this way, since you need to first put down something for the fences to place on/against, then remove that extra bit once the fences are in place, and may not look right with some fence types that have a "front" and a "back" side.
The case of these fences from cottages on LinuxForks server is something we take for granted as inevitable. It's pretty straightforward to place such an arrangement with a digtron, which doesn't require you to arduously rotate stuff with a screwdriver.
VanessaE wrote:
Tue Jun 22, 2021 10:36
IMO the real solution should be (along with the "not_blocking_trains" group) comparing the train model and the nodes it goes through to check for collisions. However, I don't think MT provides such a mechanism.
Well, while I also don't think Minetest has a generic API call to check for collisions, it should be possible to do it in Lua, as you can already read a node, get its definition to find its collision box, and look at its param2 to determine its rotation.

So it should be trivial (if you're good at maths, which I am not :-) ) to poll the nodes ahead of the train while it's moving, to determine if the train's bounding box (I wouldn't use the entity's actual collision box) overlaps any of them.

You'd only bother checking the 8 nodes [*] in front of the engine or behind whatever's at the back end of the train [**], and you'd only do this check every so often, say a few times per second per moving engine car (then you could back the whole train off if a collision is detected), so it should be pretty easy on the CPU.

[*] the two nodes flanking the tracks just ahead of the engine, plus the three nodes in a sideways line just above them, plus the three nodes above those, so the 3x3 square in front of the train, minus the node the tracks occupy.

[**] if the sides of a train would collide, then the front or back end would have already done so, so there's no point in checking things to the side of the engine, let alone the cars coupled to it.
Trains move as fast as 20 or even 30 m/s. It's fast enough that if the server hardware is having a hard time keeping up then the mapblocks won't load. Compound the fact that advtrains needs those mapblocks for your proposed collision system, and only bad things can happen.

I would make the structure gauge collision pre-computed when the track is placed and updated when any nearby node updates - unless that needs an expensive on-tick callback or something. This computation could only possibly work for nodebox nodes, not mesh nodes. Most of the shapes in the technic CNC machine are meshes not nodeboxes, so that rules out compatibility with them, leaving moreblocks, mymillwork and possibly a few others.

In addition to the straight tracks case that you outlined, you would also would need to account for curves and slopes and trains on curves going up a slope. To be properly realistic, the calculation on curves would need to account for the wagon length as well as the normal 3 metre clearance.

Newly-placed train cars would also need to be pre-calculated to let us know if they are valid placement. Your definition of 'the engine' seems to imply the 'front of train'. Remember that there might not be a locomotive at the back of the train - and the train's direction can change at any point if the train stops and is reversed. So then with your 'engine-only' system, you could place nodes behind the locomotive which don't collide at the time of placement, reverse the train, and it would be stuck. It's better to make the train stuck at the time of placement as it currently does - imagine lining a tunnel wall and it not sticking the train in place, only for it to later come back and bite you later when you reverse the train and it can't move!

As for hiding the tracks to give a 'maglev look' - I suggest you should just make custom tracks. The end result will be much better.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

Re: [Mod] Advanced Trains [advtrains] [2.3.1]

by VanessaE » Post

yw05 wrote:Now let me introduce slopes (and my handwriting that is not as good as you might expect). Sometimes there would be more than 8 nodes that need to be checked ...
I get that there may be more nodes to check than I suggested when going around a curve or negotiating a grade, but the mod is *already* checking all those nodes -- after all, the train is hitting *something* isn't it? I'm just suggesting to take those nodes' collision boxes into account, so as not to treat a thin fence as if it's a block of stone.
Blockhead wrote:Your new model idea makes a fair bit of sense, but I'm not sure about diagonal slopes
Honestly, I don't much care about the slopes that go off at angle. Just fixing the NSEW ones would be enough; the angled ones can be dealt with using regular gravel slopes -- considering the limits imposed by a blocky landscape, I don't think angled slopes can be made to look all that great no matter what you do.
This computation could only possibly work for nodebox nodes, not mesh nodes. Most of the shapes in the technic CNC machine are meshes not nodeboxes, so that rules out compatibility with them, leaving moreblocks, mymillwork and possibly a few others.
Moreblocks uses meshes for some of its shapes, like slopes, but like node boxes, all mesh nodes in Minetest have to use boxy collision info set in the node definition, similar in format to a node box. Therefore the logic used to check a mesh node would be identical -- to the point that you simply don't bother to look if it's a mesh node, as it won't matter. When present, a collision box in the node def always overrides the collision info that's provided by the node box, regardless of drawtype, so if a node has a both a node box and a collision box defined, just ignore the node box, since that's how it works for player collision detection (and some other stuff too, like particles and I think animals/mobs).
It's better to make the train stuck at the time of placement as it currently does - imagine lining a tunnel wall and it not sticking the train in place, only for it to later come back and bite you later when you reverse the train and it can't move!
No! A train that's always stuck because the mod is limiting players' creativity for the sake of collision detection is a useless train, and just annoys the player, possibly to the point that they stop using trains. Who cares if a train fails to collide with something in some edge case? Just let the damn thing pass on through and leave it to the player to make it not look stupid. I mean, this is a just game, and there's a fine line between realism and irritation.

Hell, you could just check the 1x1 column of nodes directly ahead of the "lead" car, even if it's going up or down a slope or around a curve, and players will almost certainly not complain if it looks like something "should" collide but doesn't.
Newly-placed train cars would also need to be pre-calculated to let us know if they are valid placement. Your definition of 'the engine' seems to imply the 'front of train'.
That's just a terminology issue. Whatever it is that's at the leading end of a train in motion, whether it's an engine pulling a line of cars, or a caboose or just some rolling stock being pushed backward from the other end, there's *always* a "front" car of some kind, and that's the only one that needs collision checking. "Front" does not imply "engine", it only implies "the thing that will collide first".
As for hiding the tracks to give a 'maglev look' - I suggest you should just make custom tracks. The end result will be much better.
Absolutely not. Based on my own experience in my own mods, I don't advise use of "custom" nodes when it can be avoided, as players like to actually *build* stuff, which would include constructing the channel that would provide most of the maglev look.

I mean, it's okay to have a custom node that would just be the "tracks" (well, the lines of electromagnets) under the train, but a model that's a whole section of "track" with the enclosing walls is right out. That spoils creativity, and would require many custom models to account for curves and slopes, when existing slabs or other nodes would do. Maybe I'd build one out of concrete, but someone else wants to use white baked clay (turns out this is a popular choice for builds that shouldn't have much "texture" to their walls). You'd have to define dozens of nodes for each possible material, and you'd still end up leaving something out.

All of that aside, the "maglev" idea was merely an example, as was the wooden platform, as I was thinking more along the lines of generally-narrow throughways, nevermind the technology used to make the train move. I mean, real life subways are sometimes really narrow on routes that go through areas that don't need much in the way of worker access (let alone pedestrians or riders), whether underground or elevated. I seem to recall Chicago's "El" is like that in some areas. A more extreme example would be something like an in-game equivalent to Elon Musk's Hyperloop, or even just a recreation of the (failed) Beach Pneumatic Transit system in New York, which both need close spacing to look right. I probably should have built one of these for my screenshots, but I didn't think it would have been needed.

---

Bottom line: either simplify the collision handling to make fewer checks, at the expense of trains not colliding with things when they seem like they "should", and let players deal with making sure that this doesn't become an issue (since it's just visuals anyway), or make the collision handling take into account the the nodes' defined collision boxes, so that things stop colliding when they definitely shouldn't, because based on my players' actual use and their complaints, what's being done now is broken.

If that means moving collision handling into a separate mod that can be swapped-out according to how complex or simple a server admin wants the collision detection to be, well, so be it.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

yw05
Member
Posts: 366
Joined: Tue May 07, 2019 12:59
GitHub: y5nw
IRC: y5nw
In-game: ywang
Location: Germany

Re: [Mod] Advanced Trains [advtrains] [2.3.1]

by yw05 » Post

VanessaE wrote:
Thu Jun 24, 2021 02:30
yw05 wrote:Now let me introduce slopes (and my handwriting that is not as good as you might expect). Sometimes there would be more than 8 nodes that need to be checked ...
I get that there may be more nodes to check than I suggested when going around a curve or negotiating a grade, but the mod is *already* checking all those nodes -- after all, the train is hitting *something* isn't it? I'm just suggesting to take those nodes' collision boxes into account, so as not to treat a thin fence as if it's a block of stone.
I drew that to show the nodes that should be checked if realistic collision detection was implemented.
As for hiding the tracks to give a 'maglev look' - I suggest you should just make custom tracks. The end result will be much better.
Absolutely not. Based on my own experience in my own mods, I don't advise use of "custom" nodes when it can be avoided, as players like to actually *build* stuff, which would include constructing the channel that would provide most of the maglev look.

I mean, it's okay to have a custom node that would just be the "tracks" (well, the lines of electromagnets) under the train, but a model that's a whole section of "track" with the enclosing walls is right out. That spoils creativity, and would require many custom models to account for curves and slopes, when existing slabs or other nodes would do. Maybe I'd build one out of concrete, but someone else wants to use white baked clay (turns out this is a popular choice for builds that shouldn't have much "texture" to their walls). You'd have to define dozens of nodes for each possible material, and you'd still end up leaving something out.
Not really.

Advtrains now supports adding custom tracks/track types. Look at linetrack if you need an example (except it's not particularly well implemented).

User avatar
Blockhead
Member
Posts: 1622
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: [Mod] Advanced Trains [advtrains] [2.3.1]

by Blockhead » Post

VanessaE wrote:
Thu Jun 24, 2021 02:30
This computation could only possibly work for nodebox nodes, not mesh nodes. Most of the shapes in the technic CNC machine are meshes not nodeboxes, so that rules out compatibility with them, leaving moreblocks, mymillwork and possibly a few others.
Moreblocks uses meshes for some of its shapes, like slopes, but like node boxes, all mesh nodes in Minetest have to use boxy collision info set in the node definition, similar in format to a node box. Therefore the logic used to check a mesh node would be identical -- to the point that you simply don't bother to look if it's a mesh node, as it won't matter. When present, a collision box in the node def always overrides the collision info that's provided by the node box, regardless of drawtype, so if a node has a both a node box and a collision box defined, just ignore the node box, since that's how it works for player collision detection (and some other stuff too, like particles and I think animals/mobs).
Good point, I forgot about that.
VanessaE wrote:
Thu Jun 24, 2021 02:30
It's better to make the train stuck at the time of placement as it currently does - imagine lining a tunnel wall and it not sticking the train in place, only for it to later come back and bite you later when you reverse the train and it can't move!
No! A train that's always stuck because the mod is limiting players' creativity for the sake of collision detection is a useless train, and just annoys the player, possibly to the point that they stop using trains. Who cares if a train fails to collide with something in some edge case? Just let the damn thing pass on through and leave it to the player to make it not look stupid. I mean, this is a just game, and there's a fine line between realism and irritation.

Hell, you could just check the 1x1 column of nodes directly ahead of the "lead" car, even if it's going up or down a slope or around a curve, and players will almost certainly not complain if it looks like something "should" collide but doesn't.
As for hiding the tracks to give a 'maglev look' - I suggest you should just make custom tracks. The end result will be much better.
Absolutely not. Based on my own experience in my own mods, I don't advise use of "custom" nodes when it can be avoided, as players like to actually *build* stuff, which would include constructing the channel that would provide most of the maglev look.
---

Bottom line: either simplify the collision handling to make fewer checks, at the expense of trains not colliding with things when they seem like they "should", and let players deal with making sure that this doesn't become an issue (since it's just visuals anyway), or make the collision handling take into account the the nodes' defined collision boxes, so that things stop colliding when they definitely shouldn't, because based on my players' actual use and their complaints, what's being done now is broken.

If that means moving collision handling into a separate mod that can be swapped-out according to how complex or simple a server admin wants the collision detection to be, well, so be it.
Let's enumerate all the track types you need to make a basic custom track set. Let's We have straight, curve and turnout rails in four different rotations. For the turnouts, we have left and right hand turnouts and turnouts set straight and set diverging. Ignore diamond crossings, as they don't make sense for monorail or maglev. That makes:

st
st_30
st_45
st_60

cr
cr_30
cr_45
cr_60

swlst
swlst_30
swlst_45
swlst_60

swlcr
swlcr_30
swlcr_45
swlcr_60

swrst
swrst_30
swrst_45
swrst_60

swrcr
swrcr_30
swrcr_45
swrcr_60

In total, 24 nodes. However the right-hand turnouts are simply mirror images of the left-hand ones. That takes us back to 16 . The curve/straights are also very similar models. That makes 12 models that are actually quite different, and the other half of the 24 are small variations on those, which you can make relatively quickly by flipping them and moving vertices with proportional editing in Blender.

Anyway, if you did want, shall we say 'real number' collision instead of integer, how wide would you make trains? Would you set a width on each wagon? The subway wagon is much narrower than the JR E231 for instance.

The easiest way I can think to make your request work is just an way to reduce the collision down to 1 metre for a specific wagon. We already allow bumping it up to 5 metres or maybe higher, which is what the linetrack ferries use. Note that there are bugs with this, like not being able to get off platforms properly. You could then apply that to wagons that you want narrow collision on.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

Re: [Mod] Advanced Trains [advtrains] [2.3.1]

by VanessaE » Post

Blockhead wrote:Anyway, if you did want, shall we say 'real number' collision instead of integer, how wide would you make trains? Would you set a width on each wagon? The subway wagon is much narrower than the JR E231 for instance.
Because cars can be arbitrarily-shaped, the collision box would have to be based on the inner bounds of the model. That is, the narrowest points of the model in each dimension. Of course you'd need some reasonable compromise if you're talking about something like a bullet train with a pronounced "nosecone". Since there's surely a fixed function used to register each car, that collision box would be specified in the parameters/table passed to it (I.e. no one's saying that the mod should somehow read it from the model).

But...
The easiest way I can think to make your request work is just an way to reduce the collision down to 1 metre for a specific wagon. We already allow bumping it up to 5 metres or maybe higher, which is what the linetrack ferries use. Note that there are bugs with this, like not being able to get off platforms properly. You could then apply that to wagons that you want narrow collision on.
When I mentioned the 1x1 stack, I had in mind 1 meter for all types of engines and cars.

Let's turn this around: what advantage is there to the player to have detailed, wide area collision detection in front of and around the car, instead of just a 1m stack of nodes above the track in the direction of movement? Why make it more probable to collide with things rather than easier to pass through questionable stuff?
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
Blockhead
Member
Posts: 1622
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: [Mod] Advanced Trains [advtrains] [2.3.1]

by Blockhead » Post

VanessaE wrote:
Fri Jun 25, 2021 03:50
Blockhead wrote:Anyway, if you did want, shall we say 'real number' collision instead of integer, how wide would you make trains? Would you set a width on each wagon? The subway wagon is much narrower than the JR E231 for instance.
Because cars can be arbitrarily-shaped, the collision box would have to be based on the inner bounds of the model. ... Since there's surely a fixed function used to register each car, that collision box would be specified in the parameters/table passed to it (I.e. no one's saying that the mod should somehow read it from the model).
That is how I saw things, a wagon_width additional to the existing wagon_span for each wagon in the train.
VanessaE wrote:
Fri Jun 25, 2021 03:50
...
When I mentioned the 1x1 stack, I had in mind 1 meter for all types of engines and cars.

Let's turn this around: what advantage is there to the player to have detailed, wide area collision detection in front of and around the car, instead of just a 1m stack of nodes above the track in the direction of movement? Why make it more probable to collide with things rather than easier to pass through questionable stuff?
We could make the wagon width globally configurable down to a default of 1, but I think it's better to be the exception to have narrow wagons rather than the rule.

Why make it easier to collide with stuff? To err in the safe side when it comes to collision. Right now trains get a nice 3 or more metre structure gauge, as well as a guide to reasonable width according to how close the platforms are to the train. If you don't err on this side, you risk making stuff look ugly. I'd rather give the trains heaps of breathing room then let people place blocks right beside them. To me, and to plenty of other observers, it'd look pretty ugly, pretty botched to just let trains clip straight through the nodes beside them.

Yes I know that's an opinion, and that's why I think an option and not a default of 1 metre clearance is the sensible way to do it. I know other people are more lax or creative about what they use for what; I'm talking about the type of people who make things that look like 'trains' out of blocks, especially Minecraft players where a lot of both the Youtuber/streamers and their fans don't like to go outside what's in vanilla. 'Trains' will get made out of trapdoors, fences, triphooks, buttons, all sort of weird stuff. Again, this is my opinion; others just consider it creative use of shapes, even if I think the textures all mismatch.

In contrast I think Minetest players are much more in favour of modding nice custom nodes in; the seamless way mods just work for multiplayer unlike Minecraft is part of that. That's how I arrive at the conclusion that you should customise your experience rather than shoehorn stuff in and break the rules a bit.

Let's go back to your problem domain again: you want a 2 metre (from the centre of the tracks) clearance around the Japanese wagons. That's a pretty reasonable request if you consider only travelling in a straight line. After all, the platform nodes are 0.5 metres wide themselves. But consider the problem of curves:

Image

It would complicate the collision even further to handle cases like this curve that goes from straight to 30 degrees; it has to be based on wagon length as well as width. Subway wagons are pretty narrow and pretty short compared to some others as well. Would you rather make a compromise and ignore this edge case, or enforce collision in cases like this? This is another reason I like the 3 metre clearance requirement. But I do have to admit the way platform nodes work is a hack: they simply allow trains through, even if the platform is rotated wrongly.
Attachments
screenshot_20210627_122251.png
screenshot_20210627_122251.png (622.57 KiB) Viewed 2215 times
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

Re: [Mod] Advanced Trains [advtrains] [2.3.1]

by VanessaE » Post

Blockhead wrote:'Trains' will get made out of trapdoors, fences, triphooks, buttons, all sort of weird stuff.
And that's purely a style decision the players should make, not the maintainers of the mod they're using. For another example, do table legs and light slabs go together? No, but one time I saw a player use Home Decor wrought iron table legs, two of them placed one node apart on a ceiling, with a line of thin glowlight slabs under them. Bingo, a hanging fluorescent shop light.

Yeah, table legs. It sounds totally weird to write it but in-game it looked great.

Another common one I see a lot is putting some kind of full cube light (like mtg's mese lamp) atop a short pole, with wooden trap doors on the top and all four sides of the light. Another odd-sounding thing to write, but it looks good in practice.

In my earlier wooden platform pic, that's actually a miniature version of how I've been building rail bridges in-game. That's Home Decor/building_blocks hardwood. Those fences are mob fences or something like that. By their names, they have no relationship, but when used together, the result looks nice; I was aiming for something resembling the old wooden rail bridges/trestles where I grew up.
It would complicate the collision even further to handle cases like this curve that goes from straight to 30 degrees;
Which is why I wouldn't bother, not if the minor overlaps visible in your image (the yellow trains) is typical of what you're worried about. Considering the limits imposed by the engine, that not-quite-collision looks perfectly reasonable, and if players don 't like that the car overlaps, the player can move the wall to avoid it.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
orwell
Member
Posts: 958
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell
Location: Raxacoricofallapatorius

Re: [Mod] Advanced Trains [advtrains] [2.3.1]

by orwell » Post

Blockhead and ywang have pretty much said everything.

Regarding your tunnel, in case you haven't fixed it yet: I suspect you have dug nodes away under straight tracks. This way, the no-longer-existing straight tracks remain in the track database and cause trouble - unless you run /at_sync_ndb at the place where the problem exists, which should fix this.

Regarding the collisions: it would certainly be possible to implement various fancy algorithms for the collision checking - but I'm not sure if it's worth the trouble. There will always be edge cases, it might introduce additional bugs, and consume additional CPU (which on large servers is already a problem).

I'd suggest a very simple approach: Everything that is not a full opaque cube does not collide; and the players are responsible for making it look realistic. If we make fancy collisions, it should be an option.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

Re: [Mod] Advanced Trains [advtrains] [2.3.1]

by VanessaE » Post

orwell wrote:Regarding your tunnel, in case you haven't fixed it yet: I suspect you have dug nodes away under straight tracks. This way, the no-longer-existing straight tracks remain in the track database and cause trouble - unless you run /at_sync_ndb at the place where the problem exists, which should fix this.
Yeah, this happens a lot when we're digging/rebuilding rails. I'll have to ask again how he did it, but I believe the player who originally wanted that tunnel used that command, as the trains seem to navigate the grade just fine now (both tracks, both up and down), so it's working as intended.
I'd suggest a very simple approach: Everything that is not a full opaque cube does not collide; and the players are responsible for making it look realistic. If we make fancy collisions, it should be an option.
I could live with that.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
56independent_actual
Member
Posts: 452
Joined: Sun May 23, 2021 16:10
IRC: independent56
In-game: 56independent
Location: Girona Province
Contact:

Re: [Mod] Advanced Trains [advtrains] [2.3.1]

by 56independent_actual » Post

I have a handful of questions about advtrains:

1 - why do routes refuse to set sometimes, forcing me to use the map to find the stopped trains and find the front of the queue, and enable that one route?
2 - Do railway maintainers on servers suffer this problem on a regular basis?
3 - Does this happen in LinuxForks?
4 - If not, why not?
Warnig: Al my laguage ekscept English is bad, includig Hungarian (magyàränoлиски), Spanish (esпagnyoл), and Russian (рÿсскïанöл).

yw05
Member
Posts: 366
Joined: Tue May 07, 2019 12:59
GitHub: y5nw
IRC: y5nw
In-game: ywang
Location: Germany

Re: [Mod] Advanced Trains [advtrains] [2.3.1]

by yw05 » Post

56independent_actual wrote:
Mon Jun 28, 2021 17:03
why do routes refuse to set sometimes, forcing me to use the map to find the stopped trains and find the front of the queue, and enable that one route?
I think I should break it down into two cases that I have seen from my experience:
  • The route cannot be set for some reason (e.g. blocking track section)
  • There is no matching route for the given train
In the first case, it is likely that your interlocking setup somewhere is wrong. In a lot of cases I know it is caused by wrong turnout setup (by the way, I think flank protection needs improvement in advtrains), but it can also be caused by track sections being incorrectly set up (e.g. a track section is not continuous, or both sides of a TCB belong to the same track section).

If it's the problem with route matching, there are a few subcases, depending on how the route it set:
  • ARS: make sure you always have a fallback route (i.e. one that matches all trains). This can prevent runaway trains from getting stuck at a junction, for example.
  • Automatic working: make sure you have ARS as a fallback. While using ARS with AW is not necessary, it can be helpful in case of a human error (e.g. accidentally canceling the route).
  • LuaATC: this comes down to your code. A bit of debugging should hopefully fix the problem. If not, you can post your code here and ask for help. You might want to read http://www.catb.org/~esr/faqs/smart-questions.html before asking further.
(I don't know much about mixing signaling modes except for having some experience using AW with ARS fallback, so I can't provide much information on that).
Do railway maintainers on servers suffer this problem on a regular basis?
I think my explanation above should show that it is often caused by an error (hopefully not multiple) in the setup. If that is not the case, file a bug report.

The other two questions you asked are not answered here because the answer is likely the same as above and are server-specific (i.e. ask the server admin).

User avatar
56independent_actual
Member
Posts: 452
Joined: Sun May 23, 2021 16:10
IRC: independent56
In-game: 56independent
Location: Girona Province
Contact:

Re: [Mod] Advanced Trains [advtrains] [2.3.1]

by 56independent_actual » Post

yw05 wrote:
Mon Jun 28, 2021 19:34
56independent_actual wrote:
Mon Jun 28, 2021 17:03
why do routes refuse to set sometimes, forcing me to use the map to find the stopped trains and find the front of the queue, and enable that one route?
I think I should break it down into two cases that I have seen from my experience:
  • The route cannot be set for some reason (e.g. blocking track section)
  • There is no matching route for the given train
In the first case, it is likely that your interlocking setup somewhere is wrong. In a lot of cases I know it is caused by wrong turnout setup (by the way, I think flank protection needs improvement in advtrains), but it can also be caused by track sections being incorrectly set up (e.g. a track section is not continuous, or both sides of a TCB belong to the same track section).

If it's the problem with route matching, there are a few subcases, depending on how the route it set:
  • ARS: make sure you always have a fallback route (i.e. one that matches all trains). This can prevent runaway trains from getting stuck at a junction, for example.
  • Automatic working: make sure you have ARS as a fallback. While using ARS with AW is not necessary, it can be helpful in case of a human error (e.g. accidentally canceling the route).
  • LuaATC: this comes down to your code. A bit of debugging should hopefully fix the problem. If not, you can post your code here and ask for help. You might want to read http://www.catb.org/~esr/faqs/smart-questions.html before asking further.
(I don't know much about mixing signaling modes except for having some experience using AW with ARS fallback, so I can't provide much information on that).
Do railway maintainers on servers suffer this problem on a regular basis?
I think my explanation above should show that it is often caused by an error in the setup. If that is not the case, file a bug report.
I often find this when routes are perfectly settable, but they don't get set. This error is far too general for me to file a bug report with any success of solving it. I think it has something to do about server restarts, but I do not have enough information to come to this conclusion.
Warnig: Al my laguage ekscept English is bad, includig Hungarian (magyàränoлиски), Spanish (esпagnyoл), and Russian (рÿсскïанöл).

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests