[Mod] Advanced Trains [advtrains] [2.4.3]

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.4.1]

by yw05 » Post

56independent_actual wrote:
Sat Jul 02, 2022 20:00
yw05 wrote:
Sat Jul 02, 2022 18:26
LuaATC provides the atc_set_lzb_tsr function if you want the train to pass the track without exceeding a given speed limit. You can then use B0 to stop the train when the train is on the track. The time to brake from 1m/s to 0m/s can generally be neglected.

atc_set_lzb_tsr(1)
I have already done this in the approach code which tells passengers what's going on.

I feel it fits the world better if the track checks that the train is actually moving before doing departure. Maybe a driver manually stops the train and does some checks and then accelerates.
Alternatively, you can send the departure commands when the interrupt is received instead of using ATC Dx.

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.4.1]

by 56independent_actual » Post

💥🚄
Last edited by 56independent_actual on Sun Jan 15, 2023 16:38, edited 1 time in total.
Warnig: Al my laguage ekscept English is bad, includig Hungarian (magyàränoлиски), Spanish (esпagnyoл), and Russian (рÿсскïанöл).

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.4.1]

by 56independent_actual » Post

💥🚄
Last edited by 56independent_actual on Sun Jan 15, 2023 16:38, edited 1 time in total.
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.4.1]

by yw05 » Post

56independent_actual wrote:
Tue Aug 09, 2022 10:17
I've recently hacked advtrains to reach higher speeds of 40 m/s, and this has worked without problem on some lines, for example the Pr-n, which has no speed restrictions at all on the line.

However, the Pr-n2 and Pr-w3 exist, which both have speed restrictions on the throat to the biggest station.It is lifted upon departure with a s with a green arrow, which for some reasons keep trains at 20 m/s.
The "proceed as main" sign (the one you described) does not lift the speed limit.
What can i do to lift the speed limit entirely? How do i modify the code to go from 20 to 40 (i've had a look and can't find much).
The train step seems to limit the speed of the train to 20m/s. This is the main thing that limits the speed of the trains, from what I understand.

I would, however, not recommended lifting the speed limit entirely, considering the following factors (the list is not exhausive):
  • From my understanding, certain callback mechanisms have undefined behavior when run across a long distance in a single step. This is one of the main reasons behind dtime clipping.
  • The train HUD may need considerable rework for a speed of over 100m/s.
  • Signal signs, in particular the Lf 7, may need some work.
  • Signals may be set too early, which is a problem for (for example) exit signals.
  • World loading may become a problem for servers. (If you do not want this behavior, please look at the hyperloop mod instead)

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.4.1]

by 56independent_actual » Post

💥🚄
Last edited by 56independent_actual on Sun Jan 15, 2023 16:39, edited 2 times in total.
Warnig: Al my laguage ekscept English is bad, includig Hungarian (magyàränoлиски), Spanish (esпagnyoл), and Russian (рÿсскïанöл).

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.4.1]

by 56independent_actual » Post

💥🚄
Last edited by 56independent_actual on Sun Jan 15, 2023 16:40, edited 2 times in total.
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.4.1]

by yw05 » Post

56independent_actual wrote:
Tue Aug 09, 2022 14:46
yw05 wrote:
Tue Aug 09, 2022 13:54
The "proceed as main" sign (the one you described) does not lift the speed limit.
Which one does? (oh wait i've just read the docs and i need that weird "e" (using the English word "end", German translation probably "Ealtepunkt De Das Signallen"). Main now means "40 m/s" so someone (maybe me) should tie it to the global max_speed. (wait no it's the black up arrow...?) Turns out the docs show no signal which allows mainline speed after a Lf7 (once an LF, always a LF lol).
This depends on the type of the speed restriction (again, please read orwell's post on this matter). There is (as far as I know) no signal that lifts Lf 7 restrictions IRL, which is why there is currently a 20m/s restriction sign.
The train step seems to limit the speed of the train to 20m/s. This is the main thing that limits the speed of the trains, from what I understand.
Do you mean line 1042 of trainlogic.lua? Is it something else? Remember, lines with no speed limits freely travel at 20
Seems like it
The train HUD may need considerable rework for a speed of over 100m/s.
The UK signalling system would need a considerable rework for a speed of over 55 m/s (125 mph, the speed limit). And i have my systems inspired by the UK (40 m/s is 90 MPH, which is the same top speed as a TfW Diesel train).
Relevance?
Signals may be set too early, which is a problem for (for example) exit signals.
"Too early" is subjective. I personally want no loss in speed for trains approaching at full speed.
What I mentioned above is related to the fact that signals beyond the necessary braking distance would be set, which is, for example, a problem at exit signals because the exit route would be set before the train actually departs the station, which may, in some cases, prevent other trains from exiting. This also means that setting such signals later is theoretically possible without forcing the train to brake, which is partly why the ATC A command is introduced, as far as I know. (In practice, the fact that calculations take place in dtime steps needs to be considered, and fixing what I mentioned above would likely involve implementing dtime-independent train movement calculation, which is not easy)

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.4.1]

by 56independent_actual » Post

💥🚄
Last edited by 56independent_actual on Sun Jan 15, 2023 16:40, edited 1 time in total.
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.4.1]

by yw05 » Post

56independent_actual wrote:
Tue Aug 09, 2022 18:27
yw05 wrote:
Tue Aug 09, 2022 16:35
This depends on the type of the speed restriction (again, please read orwell's post on this matter). There is (as far as I know) no signal that lifts Lf 7 restrictions IRL, which is why there is currently a 20m/s restriction sign in-game as a workaround.
I don't know what you mean by "orwell's post". Could you link it?
Sorry about this. I mentioned orwell's post when I started writing my "first" response and removed that paragraph later (before submitting).

This is the relevant post: viewtopic.php?p=401863#p401863

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.4.1]

by 56independent_actual » Post

💥🚄
Last edited by 56independent_actual on Sun Jan 15, 2023 16:41, edited 1 time in total.
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.4.1]

by yw05 » Post

56independent_actual wrote:
Tue Aug 09, 2022 18:43
yw05 wrote:
Tue Aug 09, 2022 18:35
Sorry about this. I mentioned orwell's post when I started writing my "first" response and removed that paragraph later (before submitting).

This is the relevant post: viewtopic.php?p=401863#p401863
Signalbunch is now a 404 error. Could we have a mirror of it somewhere? I could host it illegally if given a copy.
The original one does not seem to be available anymore, but there appears to be a reformatted version at https://www.bahnstatistik.de/Signalbuec ... G_2006.pdf

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.4.1]

by yw05 » Post

I reformatted part of the LaTeX manual as manual pages and got these to work with man-db. The manpages are inserted into the LaTeX manual, so there should not be much difference.

Code: Select all

node_definition (7advtrains) - node definition entries specific to Advtrains
rwt (7advtrains)     - Advtrains railway time
rwt_add (3advtrains) - add or subtract railway time objects
rwt_copy (3advtrains) - create and copy railway time objects
rwt_last_rpt (3advtrains) - calculate time for repeating events
rwt_now (3advtrains) - get the current railway time
signal_aspects (7advtrains) - signal aspect tables for Advtrains
speed (7advtrains)   - Advtrains speed limit library
speed_lessp (3advtrains) - compare speed limits
speed_set_restriction (3advtrains) - apply speed limits to trains
(The advtrains suffix is added to the section names of the manpages to avoid potential naming conflicts)

As always, feedback is appreciated. I would also like to know which section to put node-/item-related manpages in.

User avatar
ulla
Member
Posts: 142
Joined: Wed Feb 04, 2015 09:22
GitHub: IIIullaIII
IRC: ulla
In-game: ulla

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

by ulla » Post

Hi, I have removed from my server moretrain, I have removed all the placed trains of moretrain and replaced with the basic ones, I do not need many types of trains, now I have a small problem advtrain looks for those registered trains and spams the console, servercleaner does not act on adv train and I can't figure out if advt has a register right in the worlds folder and if it exists which one it is, can you help me or do I have to reinstall moretrain?
X4cna2d4UqsiawIzUumDgPoYNx3JLGII

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.4.1]

by yw05 » Post

ulla wrote:
Mon Aug 22, 2022 13:58
Hi, I have removed from my server moretrain, I have removed all the placed trains of moretrain and replaced with the basic ones, I do not need many types of trains, now I have a small problem advtrain looks for those registered trains and spams the console, servercleaner does not act on adv train and I can't figure out if advt has a register right in the worlds folder and if it exists which one it is, can you help me or do I have to reinstall moretrain?
(My 2c here) I don't think Advtrains records the registered trains actoss reboots. Other than that, Advtrains replaces undefined trains with some sort of "dummy train" and records these. (Note: I only ran into situations with undefined trains while working on a profiler, and it happened simply because the save was from another world and I was too lazy to fetch all the relevant mods)

What exactly are you getting in the server logs?

User avatar
ulla
Member
Posts: 142
Joined: Wed Feb 04, 2015 09:22
GitHub: IIIullaIII
IRC: ulla
In-game: ulla

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

by ulla » Post

Hi ,yes I found the dummy trains and unpaired and removed them but the server keeps repeating that: warning: "wagon ..... advtrains couldn't be found, please check that all required modules are loaded". maybe I have some train left, but in addition to not having a position of where it can be, I remember well not having put many and above all, despite having also removed a steam train that was the only messenger, continues to give me warnings about all the trains of the moretrain mod, so I exclude having left around others. For now I have put the mods back
X4cna2d4UqsiawIzUumDgPoYNx3JLGII

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.4.1]

by 56independent_actual » Post

💥🚄
Last edited by 56independent_actual on Sun Jan 15, 2023 16:41, edited 2 times in total.
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.4.1]

by yw05 » Post

ulla wrote:
Mon Aug 22, 2022 16:14
Hi ,yes I found the dummy trains and unpaired and removed them but the server keeps repeating that: warning: "wagon ..... advtrains couldn't be found, please check that all required modules are loaded". maybe I have some train left, but in addition to not having a position of where it can be, I remember well not having put many and above all, despite having also removed a steam train that was the only messenger, continues to give me warnings about all the trains of the moretrain mod, so I exclude having left around others. For now I have put the mods back
This is weird. The only thing I can find regarding this warning message is with wagons that do not have a registered type.

Does the https://lists.sr.ht/~gpcf/advtrains-devel/patches/34849 patch give you anything useful? (you can apply it with git am path/to/file.patch)

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.4.1]

by yw05 » Post

56independent_actual wrote:
Mon Aug 22, 2022 17:44
Ywang has just submitted a Patch which logs the co-ordinates of unregistered wagons. After waiting a while for the publishing process to work, you can download the latest version and run it to find your broken trains.
While I appreciate how quickly you mentioned this, I should point out that this patch is not (yet) applied upstream, so pulling from the source repo will not help.

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.4.1]

by 56independent_actual » Post

💥🚄
Last edited by 56independent_actual on Sun Jan 15, 2023 16:41, edited 1 time in total.
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.4.1]

by yw05 » Post

On a less related note (as I just noticed), it seems like submitting patches does not trigger the CI process.

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.4.1]

by Blockhead » Post

I would suggest that a chat command available to train_admin that removes wagons of a specified type would be helpful as a cleanup procedure after removing a wagon mod, though it could only function on trains made entirely of unknown wagons I suppose. The wagon transition code I wrote for bettersubway (still unreleased) could also work if you're good at modding.. I can't find the code right now, but basically it would let you specify a new wagon type to replace old ones. It was intended to be used to transition wagon mods like disco_trains out of existence when bettersubway comes out.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

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.4.1]

by 56independent_actual » Post

💥🚄
Last edited by 56independent_actual on Sun Jan 15, 2023 16:41, edited 2 times in total.
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.4.1]

by yw05 » Post

Blockhead wrote:
Mon Aug 22, 2022 18:30
I would suggest that a chat command available to train_admin that removes wagons of a specified type would be helpful as a cleanup procedure after removing a wagon mod, though it could only function on trains made entirely of unknown wagons I suppose. The wagon transition code I wrote for bettersubway (still unreleased) could also work if you're good at modding.. I can't find the code right now, but basically it would let you specify a new wagon type to replace old ones. It was intended to be used to transition wagon mods like disco_trains out of existence when bettersubway comes out.
56independent_actual wrote:
Mon Aug 22, 2022 20:55
Maybe as unknown wagons part of a larger train are deleted, the train snaps together instantly to fill the vacuum generated. Maybe the command can also replace wagons (/advtrains/replace moretrains:wagon_basic moretrains:wagon_advanced anyone?), so you can swap out ugly wagons with modern ones.
The problem with replacing wagons is that the original and new wagons would need to be metric-compatible in multiple aspects. Otherwise an automatic conversion can lead to multiple side effects: (the list below is not comprehensive)
  • Replacing wagons with longer ones may cause trains to no longer fit certain tracks. This may become problematic at e.g. rail yards or stations at the end of the track (e.g. Stuttgart Hbf in real life)
  • Replacing wagons with shorter ones may break certain (Lua)ATC setups that depend on the train still being on the track after braking.
  • Replacing wagons with ones with a different door size/position may break setups involving screen doors.
  • Replacing wagons with ones with a smaller paggener/inventory may break things in situations where a higher capacity is expected (the problem with lowering passenger capacity could be solved by removing passengers off the train, but this is very ugly and has its own side effects)
  • The use of a different livery system may result in wagons requiring some conversion.
Regardless of the side effects, certain more specific requirements may need to be considered, such as converting subway wagons to wagons that have variants between locomotives and the middle part.

Basically, IMO combining the chat command with formspecs is likely more sensible, but I would make this a bit more restrictive depending on how exactly this is implemented.

User avatar
ulla
Member
Posts: 142
Joined: Wed Feb 04, 2015 09:22
GitHub: IIIullaIII
IRC: ulla
In-game: ulla

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

by ulla » Post

56independent_actual wrote:
Mon Aug 22, 2022 20:55
Blockhead wrote:
Mon Aug 22, 2022 18:30
I would suggest that a chat command available to train_admin that removes wagons of a specified type would be helpful as a cleanup procedure after removing a wagon mod, though it could only function on trains made entirely of unknown wagons I suppose. The wagon transition code I wrote for bettersubway (still unreleased) could also work if you're good at modding.. I can't find the code right now, but basically it would let you specify a new wagon type to replace old ones. It was intended to be used to transition wagon mods like disco_trains out of existence when bettersubway comes out.
Maybe as unknown wagons part of a larger train are deleted, the train snaps together instantly to fill the vacuum generated. Maybe the command can also replace wagons (/advtrains/replace moretrains:wagon_basic moretrains:wagon_advanced anyone?), so you can swap out ugly wagons with modern ones.
Would it be like register_alias_force? I have a script, however, that replaces a registered node or entity, with whatever else you want to replace it with, but I think that with advtrain this doesn't work
X4cna2d4UqsiawIzUumDgPoYNx3JLGII

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.4.1]

by yw05 » Post

ulla wrote:
Tue Aug 23, 2022 10:05
56independent_actual wrote:
Mon Aug 22, 2022 20:55
Maybe as unknown wagons part of a larger train are deleted, the train snaps together instantly to fill the vacuum generated. Maybe the command can also replace wagons (/advtrains/replace moretrains:wagon_basic moretrains:wagon_advanced anyone?), so you can swap out ugly wagons with modern ones.
Would it be like register_alias_force? I have a script, however, that replaces a registered node or entity, with whatever else you want to replace it with, but I think that with advtrain this doesn't work
You can not replace trains by replacing entities. Advtrains stores train- and wagon-related information in the advtrains table and spawns the entities of the wagons correspondingly when a player is nearby (the idea is to avoid loading the entities when players can't see them)

An API to register aliases could be implemented, but its use in automatically convering trains to transition to a new mod will likely be limited, as I have explained in my previous post (I recall bringing this up myself a few months ago but did not really think about it until someone else responded)

(By the way, I hope you resolved the issue related to the dummy trains)

Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests