Page 13 of 18

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

PostPosted: Sat Jan 28, 2017 17:04
by orwell
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!

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

PostPosted: Sat Jan 28, 2017 22:06
by orwell
https://youtu.be/e1ZrCUz5Vd4
My first youtube video. Sorry for:
- no sound
- bad text overlays
- lags

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

PostPosted: Sun Jan 29, 2017 01:28
by gbl08ma
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 :)

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

PostPosted: Sun Jan 29, 2017 10:37
by gpcf
@orwell, was that station inspired by Dresden HBF? It really looks like it with the elevated tracks on the side. Awesome videos, btw.

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

PostPosted: Sun Jan 29, 2017 14:50
by Andrey01
I have watched that video, really can trains go on rails themselves?

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

PostPosted: Sun Jan 29, 2017 15:40
by Andrey01
I have written ATC command in ATC controller but train isn`t going automatically

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

PostPosted: Sun Jan 29, 2017 19:11
by Nathan.S
Great work on the mod and video.

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

PostPosted: Sun Jan 29, 2017 20:54
by orwell
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)

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

PostPosted: Sun Jan 29, 2017 21:21
by gpcf
The itrainmap mod is just an empty zip, could you upload it to a git hosting website?

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

PostPosted: Sun Jan 29, 2017 22:34
by orwell
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).

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

PostPosted: Sun Jan 29, 2017 22:38
by orwell
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

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

PostPosted: Mon Jan 30, 2017 08:27
by mbb
Andrey01 wrote:
mbb wrote:server with advtrains mod :
alpha.firc.de

What is port of that server?

the port is 30000

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

PostPosted: Mon Jan 30, 2017 12:51
by gbl08ma
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.

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

PostPosted: Mon Jan 30, 2017 17:51
by krokoschlange
Would it be possible to make trains tilt when they move slopes up or down?
Because it doesnt look too well:Image

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

PostPosted: Tue Jan 31, 2017 07:36
by orwell
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

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

PostPosted: Tue Jan 31, 2017 12:44
by krokoschlange
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".

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

PostPosted: Tue Jan 31, 2017 13:37
by DS-minetest
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".

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

PostPosted: Tue Jan 31, 2017 15:21
by mbb
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

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

PostPosted: Tue Jan 31, 2017 15:32
by krokoschlange
mbb wrote:i see you are using my rail textures +1

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

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

PostPosted: Tue Jan 31, 2017 15:43
by mbb
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

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

PostPosted: Tue Jan 31, 2017 20:20
by orwell
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?

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

PostPosted: Wed Feb 01, 2017 13:02
by krokoschlange
It just contains your textures... DOWNLOAD

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

PostPosted: Wed Feb 01, 2017 13:11
by DS-minetest
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.

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

PostPosted: Wed Feb 01, 2017 14:17
by mbb
I made a train depot(gcpf wanted one)
download:
https://ia601503.us.archive.org/4/items/TrainDepot/train%20depot.zip

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

PostPosted: Thu Feb 02, 2017 12:02
by orwell
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

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

PostPosted: Thu Feb 02, 2017 21:29
by orwell
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

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

PostPosted: Thu Feb 02, 2017 21:35
by orwell
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

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

PostPosted: Fri Feb 03, 2017 19:57
by orwell
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

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

PostPosted: Fri Feb 03, 2017 19:58
by orwell
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.

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

PostPosted: Sat Feb 04, 2017 22:39
by gbl08ma
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.