[Mod] Advanced Trains [advtrains] [1.7.2]

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: [Mod] Advanced Trains [advtrains] [r. 1.5]

by orwell » Sat Jan 28, 2017 17:04

1.5
Changelog:
- implement wagon properties and seat group access check
- fix a server warning about unassigned variable
- refill advtrains.detector.on_node every step
- reorder train step function(s):
- fixed bug that some atc rails were not recognized
- saving some extra calculations
- integrate path prediction directly to step functions and separate it
(also see comment directly above train_step_a())
- add couple lock feature (can't couple or discouple from wagon with locked couples)

---
I managed to build a fully automated subway system. You can create end stations by using the trick that trains can drive over wrong switched switches when all 3 tracks are in line.
Station:
###B2########________B0WOLD10OCD1SM_#####
End station:
###### \
\
B2##### \ ##___________B0WOLD10OCD1RSM_##:\
EDIT: To do this, a code change is needed. Either ask me or just build loops at the end stations!
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: [Mod] Advanced Trains [advtrains] [r. 1.5]

by orwell » Sat Jan 28, 2017 22:06

https://youtu.be/e1ZrCUz5Vd4
My first youtube video. Sorry for:
- no sound
- bad text overlays
- lags
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

gbl08ma
New member
 
Posts: 4
Joined: Sun Jan 29, 2017 01:19
GitHub: gbl08ma

Re: [Mod] Advanced Trains [advtrains] [r. 1.5]

by gbl08ma » Sun Jan 29, 2017 01:28

I have a relatively big map where I finally converted all of the tracks to advtrains, here's a shorter video showing ATC rails successfully controlling the arrival and departure of a subway train:
https://tny.im/dl/advtrains_atc.mp4

As you can see there's some lag, the wagons flash a bit, etc. but this is light years ahead of what any other mod has ever done. After some years dealing with previous train/cart mods where nothing reliably worked, this is great. I never thought I'd be able to make trains reliably stop and start without clogging the whole line. This one's already fully automated, just waiting for a solution for the end stations that doesn't require building loops.

Now I'm just waiting for even more advanced ATC so I can start showing the waiting time on those displays :)
 

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

Re: [Mod] Advanced Trains [advtrains] [r. 1.5]

by gpcf » Sun Jan 29, 2017 10:37

@orwell, was that station inspired by Dresden HBF? It really looks like it with the elevated tracks on the side. Awesome videos, btw.
 

User avatar
Andrey01
Member
 
Posts: 431
Joined: Wed Oct 19, 2016 15:18
In-game: Andrey01

Re: [Mod] Advanced Trains [advtrains] [r. 1.5]

by Andrey01 » Sun Jan 29, 2017 14:50

I have watched that video, really can trains go on rails themselves?
 

User avatar
Andrey01
Member
 
Posts: 431
Joined: Wed Oct 19, 2016 15:18
In-game: Andrey01

Re: [Mod] Advanced Trains [advtrains] [r. 1.5]

by Andrey01 » Sun Jan 29, 2017 15:40

I have written ATC command in ATC controller but train isn`t going automatically
 

User avatar
Nathan.S
Member
 
Posts: 679
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21

Re: [Mod] Advanced Trains [advtrains] [r. 1.5]

by Nathan.S » Sun Jan 29, 2017 19:11

Great work on the mod and video.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website.
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: [Mod] Advanced Trains [advtrains] [r. 1.5.1]

by orwell » Sun Jan 29, 2017 20:54

1.5.1 bugfix release
Changelog:
- fix wagon properties not being saved
- limit dtime to prevent trains from moving veerrryyy far in a single server step (that entirely breaks it)
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

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

Re: [Mod] Advanced Trains [advtrains] [r. 1.5.1]

by gpcf » Sun Jan 29, 2017 21:21

The itrainmap mod is just an empty zip, could you upload it to a git hosting website?
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: [Mod] Advanced Trains [advtrains] [r. 1.5]

by orwell » Sun Jan 29, 2017 22:34

gbl08ma wrote:I have a relatively big map where I finally converted all of the tracks to advtrains, here's a shorter video showing ATC rails successfully controlling the arrival and departure of a subway train:
https://tny.im/dl/advtrains_atc.mp4

As you can see there's some lag, the wagons flash a bit, etc. but this is light years ahead of what any other mod has ever done. After some years dealing with previous train/cart mods where nothing reliably worked, this is great. I never thought I'd be able to make trains reliably stop and start without clogging the whole line. This one's already fully automated, just waiting for a solution for the end stations that doesn't require building loops.

Now I'm just waiting for even more advanced ATC so I can start showing the waiting time on those displays :)

Lua stuff in progress. You will be able to control switches and signals, and displays, and mesecons, a.s.o.

gpcf wrote:@orwell, was that station inspired by Dresden HBF? It really looks like it with the elevated tracks on the side. Awesome videos, btw.

Yes it is. Are you from Dresden? (you can also write pms)

Andrey01 wrote:I have watched that video, really can trains go on rails themselves?
I have written ATC command in ATC controller but train isn`t going automatically

Yes they can. As a simple start, enter the command 'B0' and drive on the ATC rail with any train. It should stop.
Then try the other commands (atc_command.txt)
Conditional is most complex, but you probably won't need it.

gpcf wrote:The itrainmap mod is just an empty zip, could you upload it to a git hosting website?

Alright, fixed, it now contains stuff. Github not yet. Note that the map takes 1.5s to generate each time on large areas, causing lag on servers and disturbing the train simulation (latest version fixes a problem with dtime growing too large).
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: [Mod] Advanced Trains [advtrains] [r. 1.5.1]

by orwell » Sun Jan 29, 2017 22:38

The mentioned code change for the switch trick to work:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
-- trainlogic.lua, line 261
local gen_front=math.max(train.index, train.detector_old_index) + 2
local gen_back=math.min(train.end_index, train.detector_old_end_index) - 2

Increase both values to 10, so that the lines look like
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local gen_front=math.max(train.index, train.detector_old_index) + 10
local gen_back=math.min(train.end_index, train.detector_old_end_index) - 10
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
mbb
Member
 
Posts: 162
Joined: Sat Jan 17, 2015 17:47
GitHub: mbblp
IRC: mBb
In-game: MBB

Re: [Mod] Advanced Trains [advtrains] [r. 1.4]

by mbb » Mon Jan 30, 2017 08:27

Andrey01 wrote:
mbb wrote:server with advtrains mod :
alpha.firc.de

What is port of that server?

the port is 30000
I like trains....and: minetest, blender, gaming, linux, cats, computers
 

gbl08ma
New member
 
Posts: 4
Joined: Sun Jan 29, 2017 01:19
GitHub: gbl08ma

Re: [Mod] Advanced Trains [advtrains] [r. 1.5]

by gbl08ma » Mon Jan 30, 2017 12:51

orwell wrote:
gbl08ma wrote:I have a relatively big map where I finally converted all of the tracks to advtrains, here's a shorter video showing ATC rails successfully controlling the arrival and departure of a subway train:
https://tny.im/dl/advtrains_atc.mp4

As you can see there's some lag, the wagons flash a bit, etc. but this is light years ahead of what any other mod has ever done. After some years dealing with previous train/cart mods where nothing reliably worked, this is great. I never thought I'd be able to make trains reliably stop and start without clogging the whole line. This one's already fully automated, just waiting for a solution for the end stations that doesn't require building loops.

Now I'm just waiting for even more advanced ATC so I can start showing the waiting time on those displays :)

Lua stuff in progress. You will be able to control switches and signals, and displays, and mesecons, a.s.o.


Getting information to luacontrollers via digilines would be very useful, but I'm not sure how well that would play with the fact that while advtrains stuff (including ATC, thankfully!) works even in unloaded chunks, digilines and mesecons only work in loaded chunks. Which means that if I try to build any advanced system based on logic programmed into luacontrollers, it will quickly fall apart once that chunk is unloaded.

For other things in my world, like the ticketing system used by the subway (which is synchronized across stations - spanning many chunks, the world is big - and built entirely with luacontrollers), I used a dirty hack: I developed a digiline block that basically allows luacontrollers to read and write Lua tables that are common to the whole world (like globals). This allows multiple luacontrollers to share a single "memory" even if they are very distant. But this has its problems and would be of little help here, since trains going through unloaded chunks will still be invisible to the digilines/mesecons stuff.
 

User avatar
krokoschlange
Member
 
Posts: 38
Joined: Sat Jul 02, 2016 08:33
GitHub: krokoschlange
In-game: krokoschlange

Re: [Mod] Advanced Trains [advtrains] [r. 1.5.1]

by krokoschlange » Mon Jan 30, 2017 17:51

Would it be possible to make trains tilt when they move slopes up or down?
Because it doesnt look too well:Image
Attachments
screenshot_20170130_184901.png
screenshot_20170130_184901.png (332.99 KiB) Viewed 4064 times
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: [Mod] Advanced Trains [advtrains] [r. 1.5.1]

by orwell » Tue Jan 31, 2017 07:36

Krokoschlange: Yes, with set_bone_rotation, but I didn't figure out yet how that works.
gbl08ma: The advanced automation features will contain components that interface to each other through a global LUA environment (sandboxed,of course), exactly as you mentioned
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
krokoschlange
Member
 
Posts: 38
Joined: Sat Jul 02, 2016 08:33
GitHub: krokoschlange
In-game: krokoschlange

Re: [Mod] Advanced Trains [advtrains] [r. 1.5.1]

by krokoschlange » Tue Jan 31, 2017 12:44

Take a look at DS-minetest's military vehicles mod if you haven't already.
Edit:
And better call it "mvehicles" or "Military Vehicles" but not "MVehicles".
Last edited by krokoschlange on Tue Jan 31, 2017 15:27, edited 1 time in total.
 

User avatar
DS-minetest
Member
 
Posts: 707
Joined: Thu Jun 19, 2014 19:49
GitHub: DS-Minetest
In-game: DS

Re: [Mod] Advanced Trains [advtrains] [r. 1.5.1]

by DS-minetest » Tue Jan 31, 2017 13:37

orwell wrote:Krokoschlange: Yes, with set_bone_rotation, but I didn't figure out yet how that works.

It's easy if you have the bone in the model.
Note that you can't set the animation of a model if you set the bone pos of it (or a parent entity, I think). So, if you want to animate the wheels, use attachment.

krokoschlange wrote:Take a look at DS-minetest's MVehicles mod if you haven't already.

I used it there to set the position of the tank tower ("mvehicles:tank_top").
And better call it "mvehicles" or "Military Vehicles" but not "MVehicles".
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

User avatar
mbb
Member
 
Posts: 162
Joined: Sat Jan 17, 2015 17:47
GitHub: mbblp
IRC: mBb
In-game: MBB

Re: [Mod] Advanced Trains [advtrains] [r. 1.5.1]

by mbb » Tue Jan 31, 2017 15:21

krokoschlange wrote:Would it be possible to make trains tilt when they move slopes up or down?
Because it doesnt look too well:Image

i see you are using my rail textures +1
I like trains....and: minetest, blender, gaming, linux, cats, computers
 

User avatar
krokoschlange
Member
 
Posts: 38
Joined: Sat Jul 02, 2016 08:33
GitHub: krokoschlange
In-game: krokoschlange

Re: [Mod] Advanced Trains [advtrains] [r. 1.5.1]

by krokoschlange » Tue Jan 31, 2017 15:32

mbb wrote:i see you are using my rail textures +1

Sure, I made myself a small texturepack with all of your textures :)
 

User avatar
mbb
Member
 
Posts: 162
Joined: Sat Jan 17, 2015 17:47
GitHub: mbblp
IRC: mBb
In-game: MBB

Re: [Mod] Advanced Trains [advtrains] [r. 1.5.1]

by mbb » Tue Jan 31, 2017 15:43

krokoschlange wrote:
mbb wrote:I see you are using my rail textures +1

Sure, I made myself a small texturepack with all of your textures :)

cool can you give it too me i will make the textures in may texturepack https://forum.minetest.net/viewtopic.php?f=4&t=11099
I like trains....and: minetest, blender, gaming, linux, cats, computers
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: [Mod] Advanced Trains [advtrains] [r. 1.5.1]

by orwell » Tue Jan 31, 2017 20:20

DS-minetest wrote:
orwell wrote:Krokoschlange: Yes, with set_bone_rotation, but I didn't figure out yet how that works.

It's easy if you have the bone in the model.
Note that you can't set the animation of a model if you set the bone pos of it (or a parent entity, I think). So, if you want to animate the wheels, use attachment.

If I don't add any keyframes into the armature for the root bone, it should be left untouched by the animation. Or am I wrong?
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
krokoschlange
Member
 
Posts: 38
Joined: Sat Jul 02, 2016 08:33
GitHub: krokoschlange
In-game: krokoschlange

Re: [Mod] Advanced Trains [advtrains] [r. 1.5.1]

by krokoschlange » Wed Feb 01, 2017 13:02

It just contains your textures... DOWNLOAD
 

User avatar
DS-minetest
Member
 
Posts: 707
Joined: Thu Jun 19, 2014 19:49
GitHub: DS-Minetest
In-game: DS

Re: [Mod] Advanced Trains [advtrains] [r. 1.5.1]

by DS-minetest » Wed Feb 01, 2017 13:11

orwell wrote:
DS-minetest wrote:
orwell wrote:Krokoschlange: Yes, with set_bone_rotation, but I didn't figure out yet how that works.

It's easy if you have the bone in the model.
Note that you can't set the animation of a model if you set the bone pos of it (or a parent entity, I think). So, if you want to animate the wheels, use attachment.

If I don't add any keyframes into the armature for the root bone, it should be left untouched by the animation. Or am I wrong?

I'm not that experienced in blender.
I think keyframes are only there to give the bone a specific pos, rot and scale for a specific frame.
I'm not sure what you mean with "root bone".
But if the bone does something at the animation or not tells you the light you can see by playing the animation in blender.
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

User avatar
mbb
Member
 
Posts: 162
Joined: Sat Jan 17, 2015 17:47
GitHub: mbblp
IRC: mBb
In-game: MBB

Re: [Mod] Advanced Trains [advtrains] [r. 1.5.1]

by mbb » Wed Feb 01, 2017 14:17

I made a train depot(gcpf wanted one)
download:
https://ia601503.us.archive.org/4/items/TrainDepot/train%20depot.zip
I like trains....and: minetest, blender, gaming, linux, cats, computers
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: [Mod] Advanced Trains [advtrains] [r. 1.5.1]

by orwell » Thu Feb 02, 2017 12:02

DS-minetest wrote:
orwell wrote:
DS-minetest wrote:It's easy if you have the bone in the model.
Note that you can't set the animation of a model if you set the bone pos of it (or a parent entity, I think). So, if you want to animate the wheels, use attachment.

If I don't add any keyframes into the armature for the root bone, it should be left untouched by the animation. Or am I wrong?

I'm not that experienced in blender.
I think keyframes are only there to give the bone a specific pos, rot and scale for a specific frame.
I'm not sure what you mean with "root bone".
But if the bone does something at the animation or not tells you the light you can see by playing the animation in blender.

I will just try and look what happens
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: [Mod] Advanced Trains [advtrains] [r. 1.6]

by orwell » Thu Feb 02, 2017 21:29

Version 1.6
Changelog:
- New mod: advtrains_luaautomation
The long awaited LUA automation features. See the readme in this directory for manual.
Note: Code of components is not properly saved! Rails don't work anymore after restart! Will be fixed soon!
- Included improved version of itrainmap in mod directory
Last edited by orwell on Fri Feb 03, 2017 15:28, edited 1 time in total.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: [Mod] Advanced Trains [advtrains] [r. 1.6]

by orwell » Thu Feb 02, 2017 21:35

Demo video of test subway system with track section locks and proper signalling.
Trains wait 10 seconds in station and then check every 2 seconds if signal is green.

Edit: can't upload ATM
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: [Mod] Advanced Trains [advtrains] [r. 1.6.1]

by orwell » Fri Feb 03, 2017 19:57

Version 1.6.1
I was able to resolve the issue that led to components being incorrectly saved: The integer precision was not sufficient on some systems to handle position hashes.
This version reenables the old way of indexing stuff through pos_to_string() and rewrites the track database to use unique coordinates.
See also the note in the first post.
Changelog
- (see above)
- Add mbb's PR: better crafting recipes and textures
- Add wall-mounted signals (for use in tunnels)
- Fix other small errors
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: [Mod] Advanced Trains [advtrains] [r. 1.6.1]

by orwell » Fri Feb 03, 2017 19:58

Version 1.6.1
I was able to resolve the issue that led to components being incorrectly saved: The integer precision was not sufficient on some systems to handle position hashes.
This version reenables the old way of indexing stuff through pos_to_string() and rewrites the track database to use unique coordinates.
See also the note in the first post.
Changelog
- (see above)
- Add mbb's PR: better crafting recipes and textures
- Add wall-mounted signals (for use in tunnels)
- Add quick way to get positions into the LUA code: the last punched node will be remembered and inserted into a text field in /env_setup form, so that you can copy it quickly.
- Fix other small errors

Version 1.6.2
Some bug fixes. Still trying to reproduce train stopping and ATC failure.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

gbl08ma
New member
 
Posts: 4
Joined: Sun Jan 29, 2017 01:19
GitHub: gbl08ma

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

by gbl08ma » Sat Feb 04, 2017 22:39

Did itrainmap break? I'm trying to use the new version that now goes inside the advtrains directory, but all I get (no matter what coordinates I specify) is an empty formspec. No trains, no lines. I already ran /itm_cache_ndb to see if that fixed it, but nope.
 

PreviousNext

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 12 guests

cron