improve train block overlay: add directions
Moderator: ickputzdirwech
Re: improve train block overlay: add directions
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.
- ickputzdirwech
- Filter Inserter
- Posts: 793
- Joined: Sun May 07, 2017 10:16 am
- Contact:
Re: improve train block overlay: add directions
[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
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
Re: improve train block overlay: add directions
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?
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?
Re: improve train block overlay: add directions
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.
Re: improve train block overlay: add directions
That would be a total performance kill. Never find all unless it's a migration.Silari wrote: ↑Sat Sep 11, 2021 8:31 pmThere 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.
-
- Inserter
- Posts: 24
- Joined: Sat Apr 11, 2020 10:51 am
- Contact:
Re: improve train block overlay: add directions
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/
The following reddit thread shows how much this feature is missing in Factorio:
https://www.reddit.com/r/factorio/comme ... _of_train/
Re: improve train block overlay: add directions
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.
Re: improve train block overlay: add directions
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.
But I don't want this to turn into a trench fight here. Just stating my opinion.
Re: improve train block overlay: add directions
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
.....S.....S..........S
==><==|<====><==
.....S.................S
Re: improve train block overlay: add directions
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.
- 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.
Re: improve train block overlay: add directions
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.
OT: if you want to learn about modding ...
removed because OT
Last edited by mrvn on Wed Sep 15, 2021 2:22 pm, edited 1 time in total.
Re: improve train block overlay: add directions
@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)
(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...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
-
- Inserter
- Posts: 24
- Joined: Sat Apr 11, 2020 10:51 am
- Contact:
Re: improve train block overlay: add directions
Yeah... I would really, really enjoy this feature!
- ickputzdirwech
- Filter Inserter
- Posts: 793
- Joined: Sun May 07, 2017 10:16 am
- Contact:
Re: improve train block overlay: add directions
[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
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
Re: improve train block overlay: add directions
Implemented in 2.0?
Re: improve train block overlay: add directions
[Koub] Indeed, nice catch, moved to "Implemented for 2.0"
Koub - Please consider English is not my native language.