[Mod] Advanced Trains [advtrains] [2.4.3]

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:43, 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:
Sun Jun 26, 2022 14:15
yw05 wrote:
Sun Jun 26, 2022 13:58
  • Server maintenance and extra content are usually not relevant to the development of advtrains unless these are significant enough. These also tend to lead to bug reports or feature requests, which are mentioned above.
Take a minute to think. Who do we make advtrains for? The users. Who tends to be the biggest users of advtrains? server admins.

Server maintenance is quite important. Maybe we need to tell server admins NOT to give out LuaATC by default after a server admin brings up a fork bomb attack on the server.
To what extent is this relevant to the development of advtrains?
Take Vanessa's forum reply. They asked for what is essentially forgiving collision mode, and they got what is essentially forgiving collision mode. Their server was important to the development of advtrains.

Advtrains also causes server maintenance, so finding ways to make it easier is important to increase adoption.
There is the mailing list (and the forum) for feature requests.
I have come up with an idea: Press conferences. The Advtrains developer team give out tips and information to server admins at regular intervals, summarising the git history, and potential features and retrofits needed to ensure future-compatibility with new features. These do not need to be live, instead possibly kept as wiki pages. I could actually do this myself.
That sounds like release notes and proper documentation, the former of which is made for every release anyway and the latter is WIP (-> the doc branch)

"Future compatibility" is IMO BS in that you can not tell what will ever be added to advtrains (or MT) that involves breaking things. Backward compatibility will obviously be kept, but that is a completely different matter.

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:44, edited 1 time in total.
Warnig: Al my laguage ekscept English is bad, includig Hungarian (magyàränoлиски), Spanish (esпagnyoл), and Russian (рÿсскïанöл).

W3RQ01
Member
Posts: 157
Joined: Sat Nov 28, 2020 06:33
GitHub: W3RQ01
In-game: Dario23 or W3RQ01
Contact:

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

by W3RQ01 » Post

56independent_actual wrote:
Sun Jun 26, 2022 18:34
I think we need an ATC interface for choosing which doors to open and what units to use (Cariage index (C, which opens doors on carriage numbers until the number which does not fit), length index (L, which measures metres of train and uses command until specific metre), or door index (D, measures by each door on the wagon, lengthwise), each works in a different way).

On the London Underground, some stations are not long enough for the entire train, so sometimes the back carriages do not open their doors (this is warned before however).

Personally, i believe that by adding a number to the end of a door command would work best. For example, take OL20L. This tells us to open the left doors until index 20, in distance units. This means after 20 metres, the doors do not open.

I understand that this may be hard to implement. How i can imagine it working is that advtrains uses the model length*multiplier to find the true length of a carriage and train mods possibly supplying position of the doors. Then Advtrains takes the wagons of the train and adds their distances together until it finds a wagon which surpassess the index, and refuses to open the doors on that specific wagon and the trailing wagons.

On approach to an ATC rail with a command, it warns that people in wagon x and beyond will have their doors not opened.

This is simple a little proposal, but i hope this can be accepted to allow me to make longer trains without worrying about station length
1) instead of using the single doors would be better the entire wagon since every wagon has a road number

2) put down a good proposal and post it on the wiki or submit it at the mailing list

3) too long trains are bad ahah
OneUnitedPower

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:44, 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:45, 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
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

56independent_actual wrote:
Tue Jun 28, 2022 06:43
Why does advtrains need the .new files? Should i just do touch?
Definitely don't touch the new files - my best guess is they would override the main files and then all your advtrains data would be gone! These errors come from the advtrains serialize_lib code. The .new files are written to before the original files are deleted. Then the original files are deleted, and then the .new files are moved to the main file name. This makes the entire operation safely atomic.

What operating system does your server run? Have you configured serialize_lib_no_auto_windows_mode in your minetest.conf? You may want to enable advtrains_enable_logging to save a sparate advtrains.log file.

Are there any other error messages from serialize_lib and/or advtrains? The most likely message I would expect before these is "[serialize_lib] (?): Unable to save data to '<filename>'.new:".

Do you have a very large number of any object such as trains, wagons, TCBs, signals etc? Have you been putting any funny symbols into advtrains formspecs e.g. wagon properties, onboard computer, LuaATC environments?

Finally, if troubleshooting doesn't help, can you upload your advtrains files for debugging? + Mention any train mods you have. We don't need the actual Minetest world file - one can change advtrains' init.lua with advtrains.IGNORE_WORLD = true to run the advtrains without the actual world file then use singlenode.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ 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:45, 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:45, edited 5 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:45, 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 Jun 28, 2022 16:30
Do you have a very large number of any object such as trains, wagons, TCBs, signals etc? Have you been putting any funny symbols into advtrains formspecs e.g. wagon properties, onboard computer, LuaATC environments?
I don't know what you mean by "very large", but i run an hourly survey of advtrains nodes and put them all inside my website: http://56i.duckdns.org/maps/.

About the funny symbols... I have a station called "Monshō crest", which has been put inside a station track. The name borrows the Japanese word for crest, just like "Shahara Desert" means Desert Desert.
I don't think "funny symbols" should be a problem from what I have tested so far.
56independent_actual wrote:
Wed Jun 29, 2022 09:41
What is a TS lock? How does the routesetting routine even come across TS locks?

These messages have been annoying chat

Code: Select all

Encountered ts lock during real run of routsetting routine, at ts=481109 While setting route L3 of S[(52, 22, -2985)/1]
How do i prevent them?
From what I know this is likely a very bad setup or a bug.

From my knowledge Advtrains does two runs of the routesetting routine when setting a route: once to check whether the route can be set and once to actually set the route (the latter is the "real run" and obviously only runs when the route can be set).

What the message says is basically that it should be possible to set the route, but, during the second run (i.e. when actually setting the route), the track section is already "locked" (i.e. occupied by a train or reserved for a route). Perhaps the route goes through the same section more than once?
56independent_actual wrote:
Wed Jun 29, 2022 09:48
I have a problem with ARS rules on station tracks.

Below is the entire list of ARS rules.

Code: Select all

RC O
!RC S
!RC C
!RC F
However, when i have a train with RC of F or C, the train does not stop, however routing code F stops at this station:

Code: Select all

RC O
RC S
RC C
!RC F
Without this working, i am unable to run express services on the same line as local services.
What is the full RC you use for these trains? In particular, does the routing code only contain F or C?

Edit: regardless of this situation, the return nil line does not look right here:

Code: Select all

for arskey, arsent in ipairs(ars) do
	--atdebug(arsent, line, routingcode)
	if arsent.n then
		-- rule is inverse...
		if arsent.ln and (not line or arsent.ln ~= line) then
			return arskey
		elseif arsent.rc and (not routingcode or not string.find(" "..routingcode.." ", " "..arsent.rc.." ", nil, true)) then
			return arskey
		end
		return nil
	end

	if arsent.ln and line and arsent.ln == line then
		return arskey
	elseif arsent.rc and routingcode and string.find(" "..routingcode.." ", " "..arsent.rc.." ", nil, true) then
		return arskey
	end
end

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:47, 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:
Sat Jul 02, 2022 09:36
yw05 wrote:
Sat Jul 02, 2022 09:20
I don't think "funny symbols" should be a problem from what I have tested so far.
As a sidenote, it is also potentially an offensive phrase, a westerner (although they are more of a south-easterner) calling any other language (sic) "funny symbols" could be a cancellable offence on Twitter (using quote marks and possibly sic may help prevent this). I think many people would prefer the phrase "non-roman symbols" or "foreign symbols". I always think that the capability to handle Unicode is of high priority in an increasingly globalised world with people needing ß, ĥ, or ñ to be able to actually speak.
I think Blockhead meant characters with codepoints outside the 0000-007F range. I have not had any problem using advtrains with these characters.

In addition, UTF-8 encodes multibyte characters in such a way that it does not interfere with serialize_lib's (un)escaping code.
(i have heard of informal internet Spanish neglecting to use diacritics, relying on context and autocorrect)
And I have seen messages written in romanized form in a language where Latin alphabets are not the official script, and yes, it was awkward.
What is the full RC you use for these trains? In particular, does the routing code only contain F or C?
Yes, generally the RC is only these. I have a three-tier system of "stoppage", where O (Often) is very often and stops at every station, S (Skipper) the most useless and stopping only at "select stations", and C (Chronic Skipper) which only stops at important stations, such as termini or important interchanges. F means Freight, which is equivalent to FREIGHT on LF. So, on passenger networks, a train would be given a line, which dictates the route it takes, and a routing code (on lines which use them, such as L3 on the metro or some Potemkin lines, which allow skipping services by only using RC O, but i would like to be explicit on what i allow to stop and what i allow to skip). The routing code is normally a single character as that is all that is needed.

I've had no problem with diesel locomotives pretending they are freight (despite not having any wagons) using only F.
With only the RC F or C, I could not reproduce any of the behavior you described (which is, from hindsight, not surprising):
56independent_actual wrote:
Wed Jun 29, 2022 09:48
Below is the entire list of ARS rules.

Code: Select all

RC O
!RC S
!RC C
!RC F
However, when i have a train with RC of F or C, the train does not stop, however routing code F stops at this station:

Code: Select all

RC O
RC S
RC C
!RC F

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:48, 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:
Sat Jul 02, 2022 10:39
(unsurprisingly, from hindsight):
What hindsight have you gotten?
I thought you had problems with ARS not behaving in the way it is expected? I could not reproduce any of the behavior you described.

On my device, with only the RC F or C, the train did stop at the station with the following rules:

Code: Select all

RC O
!RC S
!RC C
!RC F
I originally did not expect this to be the case, but later I figured out the reason for this behavior. Specifically, the train matches the rule !RC S and short-circuits.

With only the RC F, the train did not stop at the station:

Code: Select all

RC O
RC S
RC C
!RC F

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

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

by LMD » Post

56independent_actual wrote:
Sat Jul 02, 2022 10:39
yw05 wrote:
Sat Jul 02, 2022 10:24
I have seen messages written in romanized form in languages where Latin alphabets are not the official script.
Such as Chinese pinyin, which uses diacritics to mark tones. Or romanized Russian, in which some systems use many diacritics. But this can be considered a westernisation of other cultures, a European attack on native writing systems. [...]
But most importantly: All of this can be considered offtopic. This is a thread about advtrains, not about your thoughts on westernization or how others call non-ASCII characters. As long as there is no advtrains bug here (for which only UTF-8 encoding specifics would be relevant, mind you) I'd advise you to keep this out of here.
My stuff: Projects - Mods - Website

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:48, 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:49, 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:
Sat Jul 02, 2022 16:21
yw05 wrote:
Sat Jul 02, 2022 10:56
On my device, with only the RC F or C, the train did stop at the station with the following rules:

Code: Select all

RC O
!RC S
!RC C
!RC F
That is my issue. The train stops when it's not supposed to.
That behavior is likely intended.

A train matches a set of ARS rules if it matches at least one of the rules. This means that a train with only the RC F would match the set of ARS rules as it matches !RC S.
I originally did not expect this to be the case, but later I figured out the reason for this behavior. Specifically, the train matches the rule !RC S and short-circuits.
What does "short-circuit" mean?
In the context of ARS, this means that, if a train matches an ARS rule in a set, the system does not check whether it also matches other rules in the set as doing so would not affect the result (i.e. the fact that the train matches the set of ARS rules).
56independent_actual wrote:
Sat Jul 02, 2022 17:13
How do i take ATC delays and use them in LuaATC?
You can not.

Internally, the ATC Dx and W commands work by saving the rest of the ATC commands and setting specific properties of a train. This is possible with plain ATC largely because of its simplicity and the fact that it can easily be represented by a string.

A blocking "wait" function is not possible with LuaATC largely because Lua functions/coroutines can not be saved across restarts. A non-blocking "wait" function similar to interrupt or schedule could be possible, but I suppose there is not much need for this feature.
Say we were waiting for the point a train was at 1 m/s, using B1W.

Once W is over, the next part of the LuaATC code continues.

I have tried using:

Code: Select all

__approach_callback_mode = 1

if event.type == "approach" then
    digiline_send("a", "Train is stopping")
    atc_send("B0W")
    digiline_send("a", "Train has stopped")
end
However, the digilines display displays only the second message without waiting for the train to stop before sending..
This seems more like a XY problem to me.

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.

The code would look something like this:

Code: Select all

__approach_callback_mode = 1

if event.type == "approach" then
	atc_set_lzb_tsr(1)
	digiline_send("a", "Train is stopping")
elseif event.type == "train" then
	atc_send("B0")
	digiline_send("a", "Train has stopped")
end

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:49, 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:
Sat Jul 02, 2022 19:20
When a train finishes at a station, i want to display different information.

An example ATC command i would like to run is (without the spaces) BO W OL D10 OC D3 SM Once execution finishes, a different piece of code is made.

I made this sketch in a rushed state:

Code: Select all

if event.train then
    -- Arrival code

    atc_send("BOWOLD10OCD3SM")

    interrupt_safe(1)
    if train_speed == 0 or stopped then -- Check if train has stopped
        stopped = true
        if train_speed == 1 then
            clear_interrupts() -- Prevent future interrupts
            -- Departure code here
        end
    end
end
What is the reason you can not use interrupt(13) to run code at around the time the train departs (which is what I think you want)?

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:49, 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:49, 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:
Sat Jul 02, 2022 19:49
yw05 wrote:
Sat Jul 02, 2022 19:26
What is the reason you can not use interrupt(13) to run code at around the time the train departs (which is what I think you want)?
That's a good idea. Thanks. Except for the lack of interrupt_safe()...?
From my experience interrupts are generally safe as long as you know what you are doing.
I'd like to find out for myself when the train departs; slowing down to 0 can take a few seconds.
Did I not explain this already?
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)

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:50, edited 1 time in total.
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 20 guests