Friday Facts #198 - Rail segment visualisation

Regular reports on Factorio development.
Koub
Global Moderator
Global Moderator
Posts: 7784
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Friday Facts #198 - Rail segment visualisation

Post by Koub »

I really look forward to see what you'll come up with concerning rail blocks visualization :)
Koub - Please consider English is not my native language.
User avatar
y.petremann
Filter Inserter
Filter Inserter
Posts: 421
Joined: Mon Mar 17, 2014 4:24 pm
Contact:

Re: Friday Facts #198 - Rail segment visualisation

Post by y.petremann »

Really cool for the rails, maybe you could simply add a line like you does bou only on the current block and adjacent one. The current One would always be of a specific color or a vibrant color where other segment would be of an attenuated color.
Last edited by y.petremann on Fri Jul 07, 2017 5:24 pm, edited 1 time in total.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: Friday Facts #198 - Rail segment visualisation

Post by Mooncat »

How about tinting the rails instead?
User avatar
ledow
Fast Inserter
Fast Inserter
Posts: 102
Joined: Sat Sep 24, 2016 3:00 pm
Contact:

Re: Friday Facts #198 - Rail segment visualisation

Post by ledow »

4-colour theorem says that you should only need four different (hopefully harmonising) colours to display any such rail-markers.

If you can find four nice colours, that go well together without circus effects (e.g. pastelly or something), it should be easily do-able and you only have to worry about what's on the screen so running a colouring algorithm shouldn't be intensive to select one of A, B, C, D for each visible block on screen.

Personally, I don't see why you can't combine all the various the lines.

One line, with end markers, with tick-marks indicating the possible positions of signals.

And CRC is going to come back to bite you. Computationally, it costs almost nothing in a one-off CRC generation for a new blueprint to just replace it with SHA-1 or something and make it really modular so you can replace it if there are problems with that.
User avatar
MrGrim
Fast Inserter
Fast Inserter
Posts: 241
Joined: Sat Apr 09, 2016 7:58 pm
Contact:

Re: Friday Facts #198 - Rail segment visualisation

Post by MrGrim »

Would it be too performance intensive to do a full compare if checksums match? Everything that optimizes comparisons with checksums has to deal with this eventuality, from hash table data type implementations to filesystem deduplication engines.

The item stack change is a cool example of a little change to help deal with cache misses. I look forward to the combined impact of things like this in the next major release. :)
Bidoas
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri Jul 07, 2017 5:22 pm
Contact:

Re: Friday Facts #198 - Rail segment visualisation

Post by Bidoas »

What if there was a key to toggle between showing stations/signals and the block indicator as shown in the FFF? The same way we use tab to show assembler recipes etc.
Hyratel
Inserter
Inserter
Posts: 34
Joined: Sun May 15, 2016 10:35 pm
Contact:

Re: Friday Facts #198 - Rail segment visualisation

Post by Hyratel »

ledow wrote:4-colour theorem says that you should only need four different (hopefully harmonising) colours to display any such rail-markers.

If you can find four nice colours, that go well together without circus effects (e.g. pastelly or something), it should be easily do-able and you only have to worry about what's on the screen so running a colouring algorithm shouldn't be intensive to select one of A, B, C, D for each visible block on screen.
complex intersections can give you the lie on such small palettes - IIRC, there was already a demonstrable case where colors were being reused adjacently. you're not *just* dealing with a 2-line intersection; there's complex interrelations going on here that might necessitate as many as 8-10 unique colors to prevent ambiguity
User avatar
y.petremann
Filter Inserter
Filter Inserter
Posts: 421
Joined: Mon Mar 17, 2014 4:24 pm
Contact:

Re: Friday Facts #198 - Rail segment visualisation

Post by y.petremann »

ledow wrote:4-colour theorem says that you should only need four different (hopefully harmonising) colours to display any such rail-markers.

If you can find four nice colours, that go well together without circus effects (e.g. pastelly or something), it should be easily do-able and you only have to worry about what's on the screen so running a colouring algorithm shouldn't be intensive to select one of A, B, C, D for each visible block on screen.

Personally, I don't see why you can't combine all the various the lines.

One line, with end markers, with tick-marks indicating the possible positions of signals.

And CRC is going to come back to bite you. Computationally, it costs almost nothing in a one-off CRC generation for a new blueprint to just replace it with SHA-1 or something and make it really modular so you can replace it if there are problems with that.
Four color theorems don't apply for rails because a single segment could have more than 4 element and if one segment connect to 4 rails that connect to another common segment that connect to the first segment ... you got the idea ...
Neotix
Filter Inserter
Filter Inserter
Posts: 599
Joined: Sat Nov 23, 2013 9:56 pm
Contact:

Re: Friday Facts #198 - Rail segment visualisation

Post by Neotix »

I think that we don't need colors because if separators are clearly visible then it's enough to see each rail block.
It can be green like signals indicators.
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Friday Facts #198 - Rail segment visualisation

Post by kovarex »

y.petremann wrote:
ledow wrote:4-colour theorem says that you should only need four different (hopefully harmonising) colours to display any such rail-markers.

If you can find four nice colours, that go well together without circus effects (e.g. pastelly or something), it should be easily do-able and you only have to worry about what's on the screen so running a colouring algorithm shouldn't be intensive to select one of A, B, C, D for each visible block on screen.

Personally, I don't see why you can't combine all the various the lines.

One line, with end markers, with tick-marks indicating the possible positions of signals.

And CRC is going to come back to bite you. Computationally, it costs almost nothing in a one-off CRC generation for a new blueprint to just replace it with SHA-1 or something and make it really modular so you can replace it if there are problems with that.
Four color theorems don't apply for rails because a single segment could have more than 4 element and if one segment connect to 4 rails that connect to another common segment that connect to the first segment ... you got the idea ...
The color theorem applies here, you can always transform the segment into a point, and all the connections to other segments to a graph connections while still being planar.
But it is much easier to do 5 colors than 4.
User avatar
y.petremann
Filter Inserter
Filter Inserter
Posts: 421
Joined: Mon Mar 17, 2014 4:24 pm
Contact:

Re: Friday Facts #198 - Rail segment visualisation

Post by y.petremann »

Neotix wrote:I think that we don't need colors because if separators are clearly visible then it's enough to see each rail block.
It can be green like signals indicators.
I think that they should include a "faulty separator" when a rail signal is used to separate part of the same segment.
User avatar
y.petremann
Filter Inserter
Filter Inserter
Posts: 421
Joined: Mon Mar 17, 2014 4:24 pm
Contact:

Re: Friday Facts #198 - Rail segment visualisation

Post by y.petremann »

kovarex wrote:
y.petremann wrote:
ledow wrote:4-colour theorem says that you should only need four different (hopefully harmonising) colours to display any such rail-markers.

If you can find four nice colours, that go well together without circus effects (e.g. pastelly or something), it should be easily do-able and you only have to worry about what's on the screen so running a colouring algorithm shouldn't be intensive to select one of A, B, C, D for each visible block on screen.

Personally, I don't see why you can't combine all the various the lines.

One line, with end markers, with tick-marks indicating the possible positions of signals.

And CRC is going to come back to bite you. Computationally, it costs almost nothing in a one-off CRC generation for a new blueprint to just replace it with SHA-1 or something and make it really modular so you can replace it if there are problems with that.
Four color theorems don't apply for rails because a single segment could have more than 4 element and if one segment connect to 4 rails that connect to another common segment that connect to the first segment ... you got the idea ...
The color theorem applies here, you can always transform the segment into a point, and all the connections to other segments to a graph connections while still being planar.
But it is much easier to do 5 colors than 4.
Proof of concept of what I've said :
20170707194403_1.jpg
20170707194403_1.jpg (953.4 KiB) Viewed 16571 times
Here their is two magenta part connected together
The fact here
is that there is
A -> {B1,B2,B3, ... Bn] -> C -> A

EDIT : The fact is that I just realised that it's not the four theorem that was in wrong, it simply the actual coloring method ...
Last edited by y.petremann on Fri Jul 07, 2017 5:53 pm, edited 1 time in total.
dee-
Filter Inserter
Filter Inserter
Posts: 416
Joined: Mon Jan 19, 2015 9:21 am
Contact:

Re: Friday Facts #198 - Rail segment visualisation

Post by dee- »

I also propose CRC -> SHA-* as you don't use it permanently (only when loading/saving) so performance hit is a non-issue and it's more future-proof.
Actually, I was astounded to get to know you use a meager CRC for creating object-hashes...
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Friday Facts #198 - Rail segment visualisation

Post by Optera »

Rail segment indicators are nice for inexperienced players.
For myself I'd like to turn it on manually while designing new crossings and have it turned off otherwise. As I currently do with the debug option.

What I like to display are train paths and breaking distance. Turning those into option available when you eventually lock down debug displays would make manually driving a little bit safer.

Another very useful display would be rail usage to find bottlenecks in train networks.
OTTD has a very nice and visually pleasing way of showing this by slowly growing grass on tracks and adding rust to the rails in a few stages. If a train passes the counter is reset.
Last edited by Optera on Fri Jul 07, 2017 5:54 pm, edited 1 time in total.
User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Friday Facts #198 - Rail segment visualisation

Post by prg »

y.petremann wrote:Proof of concept of what I've said : Image
Here their is two magenta part connected together
a.jpg
a.jpg (100.63 KiB) Viewed 16538 times
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
pleegwat
Filter Inserter
Filter Inserter
Posts: 278
Joined: Fri May 19, 2017 7:31 pm
Contact:

Re: Friday Facts #198 - Rail segment visualisation

Post by pleegwat »

Yes, but you may want to colour all those 2's as if they're adjacent for clarity. And such preferences may lead to non-planar problems which aren't 4-colourable.
Vinnie_NL
Inserter
Inserter
Posts: 39
Joined: Tue Mar 01, 2016 8:03 pm
Contact:

Re: Friday Facts #198 - Rail segment visualisation

Post by Vinnie_NL »

I spent so much time trying to fix incorrect rail crossings, until I discovered the debug mode. I'm happy to see you're considering a UI change to include it in standard gameplay. But then I still like to have one other debug option enabled: show_rail_paths. With this it's very easy if it's safe to cross a rail or not, haven't died once after this.

Or I should build safe circuit-based railway crossings everywhere, as they are already in the busier areas.
User avatar
MrGrim
Fast Inserter
Fast Inserter
Posts: 241
Joined: Sat Apr 09, 2016 7:58 pm
Contact:

Re: Friday Facts #198 - Rail segment visualisation

Post by MrGrim »

dee- wrote:I also propose CRC -> SHA-* as you don't use it permanently (only when loading/saving) so performance hit is a non-issue and it's more future-proof.
Actually, I was astounded to get to know you use a meager CRC for creating object-hashes...
You can throw as many bits onto the checksum as you like, collisions are still inevitable and surprisingly likely.
hykns
Manual Inserter
Manual Inserter
Posts: 1
Joined: Thu Jun 08, 2017 5:51 pm
Contact:

Re: Friday Facts #198 - Rail segment visualisation

Post by hykns »

With the T-ends on the rail indicators, they don't really need to be different colors. What is important is the clarity of separation between blocks. Another suggestion for the graphic is to have a rectangular box of the same width as the T you showed, again all the same color.
Post Reply

Return to “News”