improve train block overlay: add directions

Moderator: ickputzdirwech

Prymal
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue Aug 02, 2016 11:28 am
Contact:

Re: improve train block overlay: add directions

Post by Prymal »

Nice mockups. Perhaps a slightly different arrowhead for chain and rail signals would help as well. Possibly an arrow similar to the fast-forward style, where it has a second set of rear points behind the first? That might help players realize that trains will wait behind that signal until they can get to the next normal style arrow.
User avatar
ickputzdirwech
Filter Inserter
Filter Inserter
Posts: 793
Joined: Sun May 07, 2017 10:16 am
Contact:

Re: improve train block overlay: add directions

Post by ickputzdirwech »

[ick] Merged with two additional older posts about the same suggestion.
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write
Irrehaare
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sat Sep 11, 2021 1:37 pm
Contact:

Re: improve train block overlay: add directions

Post by Irrehaare »

Ok, after like 12 hundred hours in Factorio I've created an account to post here, after finding the thread in reddit.

I like the idea and I seem to not be the only one. Could someone more experienced in modding suggest how difficult would that be to make?
A) arrows?
B) would dashed lines after chain signals be possible? Or no, because there can simultaneously be chain and normal signal leading into the same segment?

Would such project be a good one to start the adventure with Factorio modding?
User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: improve train block overlay: add directions

Post by Impatient »

Irrehaare wrote: Sat Sep 11, 2021 1:43 pm
Forget about it. The modding API is not made for this. Track sections might not be accessible at all through the API.
User avatar
Silari
Filter Inserter
Filter Inserter
Posts: 531
Joined: Sat Jan 27, 2018 10:04 pm
Contact:

Re: improve train block overlay: add directions

Post by Silari »

Impatient wrote: Sat Sep 11, 2021 5:44 pm
Irrehaare wrote: Sat Sep 11, 2021 1:43 pm
Forget about it. The modding API is not made for this. Track sections might not be accessible at all through the API.
There are some calls to work with them, like https://lua-api.factorio.com/latest/Lua ... egment_end


You can't change the overlay with the modding API, but you maybe could find all rail/chain signals and use LuaRendering to draw the appropriate arrow between the signal and the rail it is connected to.
mrvn
Smart Inserter
Smart Inserter
Posts: 5860
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: improve train block overlay: add directions

Post by mrvn »

Silari wrote: Sat Sep 11, 2021 8:31 pm
Impatient wrote: Sat Sep 11, 2021 5:44 pm
Irrehaare wrote: Sat Sep 11, 2021 1:43 pm
Forget about it. The modding API is not made for this. Track sections might not be accessible at all through the API.
There are some calls to work with them, like https://lua-api.factorio.com/latest/Lua ... egment_end


You can't change the overlay with the modding API, but you maybe could find all rail/chain signals and use LuaRendering to draw the appropriate arrow between the signal and the rail it is connected to.
That would be a total performance kill. Never find all unless it's a migration.
dabalciunas
Inserter
Inserter
Posts: 24
Joined: Sat Apr 11, 2020 10:51 am
Contact:

Re: improve train block overlay: add directions

Post by dabalciunas »

Ok devs, please help us with this one... a mod is definitely not the solution here.

The following reddit thread shows how much this feature is missing in Factorio:

https://www.reddit.com/r/factorio/comme ... _of_train/
mrbaggins
Fast Inserter
Fast Inserter
Posts: 102
Joined: Wed Apr 26, 2017 9:08 am
Contact:

Re: improve train block overlay: add directions

Post by mrbaggins »

Impatient wrote: Sat Sep 11, 2021 5:44 pm
Irrehaare wrote: Sat Sep 11, 2021 1:43 pm
Forget about it. The modding API is not made for this. Track sections might not be accessible at all through the API.
This doesn't require accessing track sections, for a quick mod that gives just the arrows.

Find any signals, use a look up table to work out the offset for an arrow, draw an arrow pointing the right direction at that offset. Matching colours requires knowing the block colours (probably impossible currently) but is only nice, not necessary.

Performance requires finding signals in the chunks near the player, and only while holding signals.

Ideally devs simply change the display of the -------||----------- block display to be ---------->|----------- instead.
User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: improve train block overlay: add directions

Post by Impatient »

Really, I don't think any of those solutions would cut it. Do you know that for the arrows to draw, you would need to analyse the whole track network? You could have a track, with one signal on one side of the map and the 2nd, which makes it a two-way section, on the other side of the map. IMO - although it is possible to make such an algo in lua - it is very unrealistic.

But I don't want this to turn into a trench fight here. Just stating my opinion.
Prymal
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue Aug 02, 2016 11:28 am
Contact:

Re: improve train block overlay: add directions

Post by Prymal »

The direction of a track is determined at each signal, there is no need to look any further than the other side of the track segment to determine if that piece of track is single- or bi-directional. The reality is that tracks are not directional, that limitation is imposed by the signals themselves, and evaluated at each signal independently. Therefore, a path may be broken by a missing signal far down the line, wherein the track becomes impassible in a particular direction, but that doesn't affect the nearby signaling. This would not become a problem anywhere except long unbroken sections of entirely chain signals, which would be the only way a train would wait a long ways off from a path break due to a signaling error. Even in such a case, finding the break should be easy enough, if one investigates the route ahead of the stopped train. I've included a rudimentary diagram to help illustrate, in case my explanation was confusing. Note that the center junction only has one signal, and thus left to right traffic will halt, while right to left traffic will be permitted. The missing signal has no effect on travel through either of the outer junctions.

.....S.....S..........S
==><==|<====><==
.....S.................S
mrvn
Smart Inserter
Smart Inserter
Posts: 5860
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: improve train block overlay: add directions

Post by mrvn »

A few thoughts:

- To draw the arrows for blocks you only need to walk along the rails until you find the next signal, not the whole map. And signals are usually not that far apart compared to the map size.
- You could catch signals and rails being build and calculate blocks in lua (in the background, doing a bit of work every tick). Displaying it then is basically a table lookup. Advantage of this would be that you could give global alerts for broken blocks.
- I'm not sure all broken blocks are broken. Maybe some rail networks have intentionally broken blocks for some signaling / combinator magic? But I guess a mod could simply have an option not to give a global alert on broken blocks.

I think it would be really nice to have this in the game engine directly, including detecting broken blocks. Seems like a lot of work for a mod to do for something the game engine already does internally, just not display it. The path finding should be able to generate broken block alerts as a side effect of a train trying to path through it. So it shouldn't even add lag. The downside of using the path finder would be that you only get an alert when a train actually tries to path through there. But given the amount of path finding done I'm not worried a broken block would be missed long.
Irrehaare
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sat Sep 11, 2021 1:37 pm
Contact:

Re: improve train block overlay: add directions

Post by Irrehaare »

I've had a busy weekend at work and had no idea what discussion have I sparked. Though you people have surely answered my question: it is not a good idea to learn modding with that. That's disappointing, a I'd be very happy to have this feature.
mrvn
Smart Inserter
Smart Inserter
Posts: 5860
Joined: Mon Sep 05, 2016 9:10 am
Contact:

OT: if you want to learn about modding ...

Post by mrvn »

removed because OT
Last edited by mrvn on Wed Sep 15, 2021 2:22 pm, edited 1 time in total.
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: improve train block overlay: add directions

Post by ssilk »

@Irrehaare, mrvn: Please discuss this in another thread or via PM, this one is about the directions of block overlay.
(which is indeed a good idea)
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
dabalciunas
Inserter
Inserter
Posts: 24
Joined: Sat Apr 11, 2020 10:51 am
Contact:

Re: improve train block overlay: add directions

Post by dabalciunas »

Yeah... I would really, really enjoy this feature!
User avatar
ickputzdirwech
Filter Inserter
Filter Inserter
Posts: 793
Joined: Sun May 07, 2017 10:16 am
Contact:

Re: improve train block overlay: add directions

Post by ickputzdirwech »

[ick] Merged with yet again another even older thread about showing directions when placing signals.
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write
sparr
Smart Inserter
Smart Inserter
Posts: 1446
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: improve train block overlay: add directions

Post by sparr »

Implemented in 2.0?
Koub
Global Moderator
Global Moderator
Posts: 7784
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: improve train block overlay: add directions

Post by Koub »

[Koub] Indeed, nice catch, moved to "Implemented for 2.0"
Koub - Please consider English is not my native language.
Post Reply

Return to “Implemented in 2.0”