[Mod] Advanced Trains [advtrains] [2.0.1 TSS]

User avatar
h-v-smacker
Member
 
Posts: 78
Joined: Wed Nov 29, 2017 23:04
GitHub: h-v-smacker
In-game: Smacker

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

by h-v-smacker » Wed Dec 12, 2018 17:11

orwell wrote:To add-on/extension developers:
Code: Select all
   get_inventory_formspec = function(self, pname, invname)
      return "size[8,11]"..
         "list["..invname..";box;0,0;8,3;]"..
         "list[current_player;main;0,5;8,4;]"..
         "listring[]"
   end,



What is pname for?
Linux Forks, the Best Forks: linux-forks.de // Play @ LinuxWorks Next Generation
 

User avatar
Stix
Member
 
Posts: 1367
Joined: Fri Aug 04, 2017 14:19
Location: USA
IRC: nil
In-game: Stix [+alts]

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

by Stix » Wed Dec 12, 2018 17:59

h-v-smacker wrote:
orwell wrote:To add-on/extension developers:
Code: Select all
   get_inventory_formspec = function(self, pname, invname)
      return "size[8,11]"..
         "list["..invname..";box;0,0;8,3;]"..
         "list[current_player;main;0,5;8,4;]"..
         "listring[]"
   end,



What is pname for?

It most likely refers to playername, as it needs to find the name of the player who did (im guessing) a specified action so it can then send the proper inventory formspec to the client.
Hey, what can i say? I'm the bad guy.
Next release of your favorite game? "Bugfixes" --Wuzzy
[OLD]The new Minetest-offtopic can be found here: https://minetestoftopic.createaforum.com/index.php
 

User avatar
h-v-smacker
Member
 
Posts: 78
Joined: Wed Nov 29, 2017 23:04
GitHub: h-v-smacker
In-game: Smacker

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

by h-v-smacker » Wed Dec 12, 2018 18:21

> It most likely refers to playername, as it needs to find the name of the player who did (im guessing) a specified action so it can then send the proper inventory formspec to the client.

This parameter is not used in the function.
Linux Forks, the Best Forks: linux-forks.de // Play @ LinuxWorks Next Generation
 

User avatar
Stix
Member
 
Posts: 1367
Joined: Fri Aug 04, 2017 14:19
Location: USA
IRC: nil
In-game: Stix [+alts]

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

by Stix » Wed Dec 12, 2018 18:32

hmm, seems to me that the code uses the pname parameter of the function to find current_player.

Then again i cant really code anything yet, just make sense out of code i see, so i could be wrong.
Hey, what can i say? I'm the bad guy.
Next release of your favorite game? "Bugfixes" --Wuzzy
[OLD]The new Minetest-offtopic can be found here: https://minetestoftopic.createaforum.com/index.php
 

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

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

by orwell » Thu Dec 13, 2018 12:32

Yes, pname refers to the player name, and no, it is not used in the function.
But since pname has always been the (documented) second parameter, although never used, I didnt want to break things and just appended the "invname" as the third parameter
Current_player is automatically "found" by minetest
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

pheonixfire
Member
 
Posts: 88
Joined: Sun Oct 21, 2012 06:25
Location: Australia
In-game: pheonix

Re: The ominous TSS branch and the interlocking system

by pheonixfire » Thu Dec 20, 2018 07:33

orwell wrote:The ominous TSS branch and the interlocking system
Hello people,

I post this to clean the confusion over terms like "tss branch" and "interlocking system":

About half a year ago, I started reimplementing large parts of some internal logic of advtrains. The version control system (git) allows to create separate branches that do not affect the "stable" main version ("master branch") and can be independently developed. Back then, I created such a branch, named "tss" (short for "track section signalling", see after)
That rewrite was done some months ago, and I started with the original goal of the whole operation, which was implementing an interlocking system (search the internet for what that is, or see http://advtrains.bleipb.de/interlocking) on top of this new "tss branch". But I didn't want to "merge" my rewrite back into the stable "master" branch because it was possible that there were bugs I was unaware of, and wanted it to prove working. On the "master" branch, only important bugfixes were still made.

The interlocking system has progressed pretty far in the last months, and during this time it seems like I've eliminated all critical bugs in the core logic that have shown up. Therefore, I will declare the "tss" stable and make it the new "master" branch somewhen around the new year.

However, you can already do this step now if you don't want to wait. But before "upgrade" advtrains to "tss", I recommend you to make a backup of all worlds you use advtrains in and don't wish to be broken, because:
1. Once you switch to "tss", you cannot go back*
2. It might be possible that some things get lost or even the whole world gets corrupt during the upgrade.
3. I should note that the "add-on" mods that are linked in the main post are probably not compatible to TSS

To do this, follow these steps:
If you've installed using git:
1. back up your world(s)
2. $ git checkout tss
If not:
1. back up your world(s)
2. delete old "advtrains" folder
3. https://git.bananach.space/advtrains.git/log/?h=tss
4. Select top entry in list
5. select one of the download formats
6. save, unpack, as you would install any other modpack.

Please report any bugs, inconveniences, data losses or weird behaviors you encounter at https://www.linux-forks.de/advtrains/ (or here)! You will be helping me a lot.

Small note in between: the difference between "safety" and "security"
Safety means a system is secured against failure caused by itself or some component inside the system (for a railway, this would be the tracks, vehicles and the train driver)
Security means a system is secured against external disturbances, components outside of the system (for our mod, this would be malicious players randomly decoupling wagons or throwing sand onto tracks)

What follows is an incomplete list of the most important changes that happened in "tss":
- Completely rewritten path logic:
-- inofficial internal "API" for path update callbacks
-- reverse lookup of positions to train path indices
-> This simplified a lot of code and probably eliminated some minor bugs that existed before, especially the buggy coupling behavior

- Fix yaw/looking direction behavior
-> Trains now finally appear in the direction they were placed

- Reworked security
-> Things now actually work
-> There are no longer "couple locks" because this only confused players.

- Track sections
-> Trains can occupy certain track sections, which can be used in combination with the latter features

- Signals and "LZB"
-- There are some new signals and a unified API for "signal aspects" (things that a signal tells to a train driver)
-- By setting an "Influence Point", the obeyance of those aspects is enforced automatically using a system similar to ETCS, LZB and the like (but without technical equipment, because the whole mod is a simulation and all parameters are known at any time)

- Train (and shunt) routes
-- Trains can be guided along secured paths to prevent collisions or accidents, where all turnouts are locked and cannot be reversed

- Speed restrictions
-- Both signals and special signs can set up speed restrictions for trains
-> all of them work using the Signal API and the aforementioned "Influence Points"

If I forgot something you've noticed, tell me.
I look forward to hear feedback from you.
- orwell

* There is a possibility to downgrade, but this might still result in data loss or might not work at all:
1. revert back to "master" (don't start world)
2. go into world directory, open the file "advtrains" with a text editor
3. Using the "Find" function (Ctrl-F), locate "version"
4. change value there to 1
5. save file, close, start world.


to download the tss branch, am I supposed to put the address in step 3 of the if not instructions into a browser?
if so I can't find the list described in steps 4 and 5

any help is appreciated
pheonixfire
 

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

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

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

by orwell » Thu Dec 20, 2018 10:41

Dan2018 wrote:Just trying out AT on the server. Few questions

On startup we get the message
"Undeclared global variable "id" accessed at ..\advtrains\advtrains\trainlogic.lua:111"

Also normal users dont seem to be able to attach wagons. Given train_operator but they dont attach.

Is there a train_admin priv now? Read in documentation but doesnt seem to exist.

Is there away to stop people loosing their stuff when hit by a train? Have the server setup to keep their items but with trains they loose it all.

Running minetest 0.4.17

Thanks

Oh, seems like I overlooked your post
1. What version? Can't find mentioned line
2. The wagons they want to couple must be owned by them or whitelisted (wagon properties)
3. Privilege_guide.txt line 15
4. No, not directly. Tell me which advtrains version you are using, so I can tell you which code to change.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
gpcf
Member
 
Posts: 315
Joined: Fri May 27, 2016 10:48
In-game: gabriel

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

by gpcf » Mon Dec 24, 2018 20:19

bananach.space is currently down. If it does not come up by itself, I will start migrating it to a new server, since the server it is currently on is quite unreliable.
 

BuckarooBanzay
Member
 
Posts: 258
Joined: Tue Apr 24, 2018 05:58
Location: Switzerland
GitHub: thomasrudin-mt
In-game: BuckarooBanzai

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

by BuckarooBanzay » Wed Dec 26, 2018 15:02

Hi there

I wanted to test some automation in the new tss branch.
The gui/objects to compose a route are fantastic :)
I added 4 route segments in my test track. Each with a circuit breaker and signal.
For each segment i made a single route (i hope thats correct).
For the station halt and return on the end i added atc-tracks:

Station halt:
Code: Select all
B0 W OL D5 OC S4


Station halt and return:
Code: Select all
B0 W OL D5 OC R S4


That works quite well for a single train.
After i place another train the following messages appear and the routes get cancelled:
Code: Select all
Train xxx hit route Route 'yyy' from Signal at (x,y,z), semgment #1 !
Route was cancelled.


Am i doing something wrong there??

Overall track:
Image

This is the return route config:
Image


screenshot_20181226_155149.png
(456.55 KiB) Not downloaded yet

screenshot_20181226_155110.png
(429.65 KiB) Not downloaded yet
 

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

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

by orwell » Thu Dec 27, 2018 21:01

Hm...
The message "train x hit route y" appears when a route is set into a section and suddenly a train not supposed for it suddenly occupies the section (either when it is placed into such a section or it enters the section from a "wrong" TCB.
One thing I noticed is that your layout does not obey a design principle of real-world railways that I implicitly assumed: Routes should not involve changes of the driving direction. This means that after each supposed driving direction change, there should be a signal in the opposite direction from which a new route can be set. The route for the movement up to the reversing location needs to be set as usual: from a signal to the next signal in the same direction.
see also https://www.simsig.co.uk/Wiki/Show?page ... erse_train under "Reversing examples"

Also, your layout requires that the train drives on the turnout from the wrong side, which is bad practice.I recommend a layout like this:
Code: Select all
           /-|-------p--/--q----
----p--/--q-------|-/
p: left-facing signal, signalling trains coming from the left
q: the opposite
|: TCB without signal

Then, the 2 inner signals lock the turnout straight, and the outer 2 signals lock it reverse (curve)
You need the extra TCBs so another train can enter the terminal section once one has cleared the turnout. Note that the routes of the outer signals have to be programmed over 2 track sections then.

Another question: Have you set the influence points for the signals? If not, automatic trains won't stop at red signals by themself.

A way how you can check whether your interlocking setup works is by trying to set conflicting routes manually. When the system allows it and the signal turns green though it should not (because a section is occupied etc.) you've made a mistake.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

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

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

by orwell » Sat Dec 29, 2018 19:33

Since bananach.space is down, here's the latest TSS branch version:

http://advtrains.bleipb.de/advtrains_tss.zip
(this is the newer, unofficial version)

Latest master can be found in the content DB:

https://content.minetest.net/packages/orwell/advtrains/
(this is the officially supported, but somewhat old version)
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

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

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

by orwell » Tue Jan 15, 2019 20:14

TSS branch update: ARS (Automatic Routesetting) has been implemented. For explanation see the interlocking manual at http://advtrains.bleipb.de/interlocking/

Download TSS (bananach.space is still down :( ):
http://advtrains.bleipb.de/advtrains_tss.zip

EDIT: Happy new year everyone!
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

Mikola
Member
 
Posts: 16
Joined: Fri Nov 24, 2017 18:01
GitHub: Mikola314
In-game: mikola

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

by Mikola » Tue Jan 15, 2019 20:22

Hooray! New examples and explanations with screenshots! This is what was really needed.

P.S. With past holidays.
 

User avatar
gpcf
Member
 
Posts: 315
Joined: Fri May 27, 2016 10:48
In-game: gabriel

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

by gpcf » Wed Jan 16, 2019 14:25

Bananach.space will be up again soon. @orwell: Please push your mods via ssh to git@luxemburg.gpcf.eu, just the same way as you would do with bananach.space.
 

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

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

by orwell » Wed Jan 16, 2019 20:29

uh, another server
EDIT: done
EDIT2: cgit does not seem to update
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
gpcf
Member
 
Posts: 315
Joined: Fri May 27, 2016 10:48
In-game: gabriel

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

by gpcf » Thu Jan 17, 2019 16:55

I think the cgit problem should be fixed now, it was a permission problem. I'll see if it returns.
 

BuckarooBanzay
Member
 
Posts: 258
Joined: Tue Apr 24, 2018 05:58
Location: Switzerland
GitHub: thomasrudin-mt
In-game: BuckarooBanzai

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

by BuckarooBanzay » Sat Jan 19, 2019 15:22

Good to see the advtrains repo back online :D
I updated the mod on my server (from the master to the tss branch) and now
i'm getting a bunch of error messages:

Image
Bildschirmfoto_2019-01-19_16-16-18.png
(243.44 KiB) Not downloaded yet


What did i do wrong?

Anyways, cool mod and no pressure, this is on a test-copy of the main server :)
 

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

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

by orwell » Sun Jan 20, 2019 19:56

I guess nothing. Are there any trains missing in your world? Else, you can ignore this.
The message "remove_train failed" should be harmless. However, can you PM me just the file called "advtrains" from the world directory of the pre-update world, so I can check the cause?
Thanks
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

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

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

by orwell » Fri Feb 01, 2019 10:14

We have deployed the TSS branch on the LinuxWorks server, which acts as a "public beta" for it. So far, it has proven working and stable. I will officially deprecate the current "master" branch in the next week.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

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

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

by orwell » Sun Feb 03, 2019 16:15

TSS update - advtrains version 2.0 released!

After over a year of development, I finally announce the official release of what was formerly known as the TSS branch. The old master branch has been deprecated and is further available as "master_old"

If you were using Git to install the "master" branch, delete and re-pull your local repository or rename your local "tss" branch to "master". I renamed the tss branch to "master" and the former "master" branch to "master_old". A merge of both branches was not practical, because they had diverged too much and the things on old master were mostly backported bugfixes.

When you install this update, some trains in your world will probably flip their driving direction and/or "mirror" around one end. This is due to an inevitable change in the save data and will only occur a single time. Also, the brake distance of ATC rails has slightly increased.

I suggest that you make a backup of all advtrains-related files in your world directory before updating.

+ Major changes


I also updated the version in the Content DB and rewrote the main post.

+ Old main post
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
h-v-smacker
Member
 
Posts: 78
Joined: Wed Nov 29, 2017 23:04
GitHub: h-v-smacker
In-game: Smacker

Re: [Mod] Advanced Trains [advtrains] [2.0 TSS]

by h-v-smacker » Tue Feb 05, 2019 08:01

We found an issue with ATC conditional orders and train's order queue last night.

Suppose you have two ATC tracks looking in different directions (placed close enough though), having conditional orders, and a train approaching:

==========▭▭▭▭▭⇨==========[<<¹]===[>>²]==========

Each of ATC tracks has some order conditional on the direction of travel, for example "I+ B0W OR D15 OC D1 S16;"

Now in the situation above, the train passes the first ATC track ([>>]), doesn't react, passes to the second, and executes the order. Seemingly everything as it should be. Now imagine the tracks being placed differently (notice the direction of arrows on ATC tracks):

==========▭▭▭▭▭⇨==========[>>¹]===[<<²]==========

In this case, the train will begin executing the order given by the first ATC track it passes over, the orders will queue to be executed, then it will pass over the next track... and the train's ATC order queue will be purged! In my experiments, it will just roll to stop. Presence of braking order doesn't seem to make an difference, an order of opening and closing doors repeatedly is similarly purged by another such order.

Now, when I see an order like "I+ B0W OR D15 OC D1 S16;" I expect it to mean "If moving in the direction of ATC track, execute this sequence, otherwise perform no action". However, what happens in advanced trains as implemented is "If moving in the direction of ATC track, execute this sequence, otherwise make the train perform no action". So there is an implicit "no operation" passed with such order, as if it was "I+ ... E NOP;"

I don't think this is how it should be. After all, there is a construction with explicit "or else" order set. If a train meets an ATC track with an order which is purely direction-dependent, literally nothing should change for the train.
Linux Forks, the Best Forks: linux-forks.de // Play @ LinuxWorks Next Generation
 

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

Re: [Mod] Advanced Trains [advtrains] [2.0 TSS]

by orwell » Wed Feb 06, 2019 11:02

@Smacker: I fixed this problem yesterday. Before "replacing" the train's ATC command, 1 top-level condition is evaluated, and the command is not sent when it would result in an empty command.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

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

Re: [Mod] Advanced Trains [advtrains] [2.0.1 TSS]

by orwell » Thu Feb 21, 2019 10:31

There's now an official Wiki for advtrains, located at https://advtrains.de/wiki/.
It has to be filled with content. You are invited to contribute!
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

BuckarooBanzay
Member
 
Posts: 258
Joined: Tue Apr 24, 2018 05:58
Location: Switzerland
GitHub: thomasrudin-mt
In-game: BuckarooBanzai

Re: [Mod] Advanced Trains [advtrains] [2.0.1 TSS]

by BuckarooBanzay » Sun Feb 24, 2019 19:53

Hey there

You might find that useful:

I managed to integrate your trains in my latest mapserver version:
viewtopic.php?f=14&t=21999

The trains, along with the composition and display text will now be displayed on the map:
Image
Image

(end of shameless self-promotion:)
 

PreviousNext

Return to Mod Releases



Who is online

Users browsing this forum: qwrwed and 4 guests