Page 1 of 1

[0.15.21] Rail_category bug?

Posted: Fri Jun 16, 2017 3:55 am
by evildogbot100
Seems like rails with different rail_category are interconnected together when they are occupying exact same space.
I tried to make a second rail entity with different rail_category with collision_box = nil and collision_mask = {}.
Place both rail at the exact same place using onbuilt script.
Try to give them rail signal then they act wonky.
The rail must be at least 2 length for them to be wonky.
bug report.png
bug report.png (976.65 KiB) Viewed 2313 times
Those 2 rails type has exact same picture so it's not so clear that they are overlapping.
The weird thing is the rail signal flickering color from green yellow red.
One more thing, this doesn't happen when collision_box is unchanged in second rail.
But they still seems to interfere with the rail block. When they are built they seems to update rail block of vanilla rail.

Re: [0.15.21] Rail_category bug?

Posted: Fri Jun 16, 2017 8:21 am
by TruePikachu
I can't confirm it, but I think the other rail piece is acting as a way to get between both ends of the first rail piece (effectively like a passing loop). The signal then binds to only one of the tracks, but since both sides are part of the same effective block (because of the track section bridging across the other), it errors out.

Re: [0.15.21] Rail_category bug?

Posted: Fri Jun 16, 2017 9:08 am
by evildogbot100
Want me to post the mod I used to help recreate the bug?
Anyway, let's just call the rail type as "modded" and "vanilla", the modded one is the one with no collision. I think rail signal search for rail in front of it based on collision box, then they succeed to separate the vanilla rail block since it is found in the search. The modded one isn't found because it has no collision box, so the signal doesn't separate that modded rail block. Now the vanilla and the modded rail is somehow interconnected when they occupy same space even though they have different rail_category. So, they make some kind of loop and it broke the signal. I think the bug can be easily solved by checking for same rail_category when 2 rail tried to connect, forming a block.

This is how I think the current mechanic is
This is what I think how it currently works
This is what I think how it currently works
What happened.png (6.88 KiB) Viewed 2285 times
This is how I think the correct implementation should be
This is what I think how it should be
This is what I think how it should be
What I think should happen.png (6.89 KiB) Viewed 2285 times
Also The bug doesn't happen when the 2 rail doesn't occupy the same space, they are completely detached if you just place them like vanilla-modded-vanilla-modded-vanilla. Only happen when it is (vanilla/modded)-(vanilla/modded).

Re: [0.15.21] Rail_category bug?

Posted: Mon Jun 19, 2017 2:22 pm
by Klonan
Could you post a mod and a save game clearly demonstrating the issue?

Re: [0.15.21] Rail_category bug?

Posted: Mon Jun 19, 2017 3:48 pm
by kovarex
To be honest, it was never tested to have more than one rail category, and I don't doubt that there are plenty of things we would have to change to actually make it work.
For now, I would say it is just feature that is not implemented. We might, or might not implement it in the future, but I don't consider it a bug now.

Re: [0.15.21] Rail_category bug?

Posted: Mon Jun 19, 2017 5:34 pm
by evildogbot100
This is the mod, just create new sandbox world and use the modded rail and vanilla rail at same space