Page 1 of 1

Linked-belt

Posted: Sun Dec 13, 2020 9:09 am
by y.petremann
TL;DR
Linked-belt would link two belt-lines wherever there are (could be on two different surfaces).
linked-belt-concept.png
linked-belt-concept.png (198.61 KiB) Viewed 5401 times
What ?
Linked-belt would link two belt-lines and merge them into one belt-line wherever the links are, they can be really far appart or on two different surfaces.

Linked-belt would be displayed like special underground belts.

Linked-belt would be configured like linked-container.

Linked-belt would already be protected against reconfiguration with the entity.operable=false

If speed is not defined in linked-belt prototype,
Linked-belt output would set his speed depending of belt_neighbors,
Linked-belt input would set his speed depending of sibling linked-belt,
Because mods like Factorissimo shouldn't search for existing linked-belt or declare new linked-belt depending of existing belts to match speed of existing belts,
but mods like Beltlayer could directly use the linked-belt as placeable by the player to replace the underground belts

Linked-belt would stop working if linked to no sibling.
Linked-belt would stop working if linked to more than one sibling.
Linked-belt would stop working if no belt is connected on the linked-belt sibling.
Linked-belt would display a "closed door" if it's not working

Linked-belt would not allow sideloading input in the same way input dloader-1x1 works.

Lua-Api should permit to probe :
- with LuaEntity.link_id to read and write link id
- with LuaEntity.neighbours to get an array of all siblings connected on it, working or not
- have the list of entities, associated with a link_id
Some more ?
Optionally, a feature could be added to have a sideload parameter in the linked-belt prototype:
- sideload=0 : no sideload (by default)
- sideload=1 : sideload like underground belts on one line only
- sideload=2 : sideload like straight belt on two lines
- sideload=3 : sideload like a belt (can be curved exactly like a belt)
linked-belt-sideloading.png
linked-belt-sideloading.png (207.76 KiB) Viewed 5401 times
Why ?
Beltlayer and Factorissimo are two mods that heavily use a script to teleport items on a belt from a surface to another, while those scripts are quite good at doing their jobs, they have a limit in performance, with linked-belt, mods like these could be a lot more UPS-friendly

Re: Linked-belt

Posted: Sun Dec 13, 2020 11:13 am
by ssilk
Since 1.1 there are linked chests (or so), and I think this mod use them:

https://mods.factorio.com/mod/SIEXHyperspaceStorage

And more generally seen, this is a modding-request.

Re: Linked-belt

Posted: Sun Dec 13, 2020 6:27 pm
by y.petremann
Sorry for posting in the wrong section, in fact if you can, can you move this in the Modding Interface Request since it is where it belong.
I'm not asking about another mod doing things, I'm asking about a feature fors mods to use.
Linked-chest are cool and there is a lot of cool things we can do with them, but they have some limitation, for example even with loaders, they are not aware of belt lines, just to recreate the feature I asked, I needed to do this contraption.
I can't imagine factorisimo doing this multiplied by 32 inside a 8x8 square or even beltlayer hiding 16 entities just to send entities to another surface with the risk of accidental connection.
linked-belt-workaround.png
linked-belt-workaround.png (245.9 KiB) Viewed 5317 times

Re: Linked-belt

Posted: Mon Dec 14, 2020 5:19 am
by ssilk
moved from suggestions to modding interface requests — ssilk

Re: Linked-belt

Posted: Mon Dec 14, 2020 7:48 pm
by boskid
Moving this to implemented. In 1.1.6 there was entity type "linked-belt" added. It was implemented a little differently than suggested but it should still be usable by mods.

Re: Linked-belt

Posted: Mon Dec 14, 2020 8:58 pm
by orzelek
boskid wrote:
Mon Dec 14, 2020 7:48 pm
Moving this to implemented. In 1.1.6 there was entity type "linked-belt" added. It was implemented a little differently than suggested but it should still be usable by mods.
Just out of curiosity:
Will we also get a linked pipe?

That would make it possible to use entities to move stuff between surfaces without scripting.

(*dreams about linked rails*)

Re: Linked-belt

Posted: Mon Dec 14, 2020 9:11 pm
by DaveMcW
<boskid> NOOO
<boskid> linked pipes are more likely than linked rails
<boskid> with linked rails there is so many obstacles, with most basic one being trains pathfinder heuristic, that i would have to disable it completly if there would be any linked rail in use
<boskid> and rolling stocks having 2 joints so it would be hard to decide on which surface it should be and what orientation it should report while being in half on one surface and half on another
<boskid> basically it would be immediately forcing linked rails to be on different surface, have exactly the same position, the same orientation and the same bending type
<boskid> and still rolling stocks when traveling across linked rail would be effectively teleported to different surface
<boskid> so if you would have rolling stock with grid and roboport in that grid, and construction robots flying to a rolling stock, when that rolling stock would switch to different surface all the robots would have to be immediately teleported to that other surface
<boskid> i think electricity can be connected between surfaces (there are some distance checks bypassed if both ends are on different surfaces, not sure if it was for all wires or only for PowerSwitch), now belts, there are chests
<boskid> pipes are strong next candidate, but please do not mention rails, i have nightmares because of that idea

Re: Linked-belt

Posted: Wed Jan 06, 2021 10:34 am
by darkfrei
y.petremann wrote:
Sun Dec 13, 2020 9:09 am
Linked-belt would link two belt-lines wherever there are (could be on two different surfaces).
See my implementation: Linked Belts

Re: Linked-belt

Posted: Tue Feb 23, 2021 2:39 pm
by chugin_iv
DaveMcW wrote:
Mon Dec 14, 2020 9:11 pm
<boskid> NOOO
<boskid> linked pipes are more likely than linked rails
<boskid> with linked rails there is so many obstacles, with most basic one being trains pathfinder heuristic, that i would have to disable it completly if there would be any linked rail in use
<boskid> and rolling stocks having 2 joints so it would be hard to decide on which surface it should be and what orientation it should report while being in half on one surface and half on another
<boskid> basically it would be immediately forcing linked rails to be on different surface, have exactly the same position, the same orientation and the same bending type
<boskid> and still rolling stocks when traveling across linked rail would be effectively teleported to different surface
<boskid> so if you would have rolling stock with grid and roboport in that grid, and construction robots flying to a rolling stock, when that rolling stock would switch to different surface all the robots would have to be immediately teleported to that other surface
<boskid> i think electricity can be connected between surfaces (there are some distance checks bypassed if both ends are on different surfaces, not sure if it was for all wires or only for PowerSwitch), now belts, there are chests
<boskid> pipes are strong next candidate, but please do not mention rails, i have nightmares because of that idea
Um... Might not be a good idea, but how about "underground tunnel" view on this? As in, not linked rails per se, but specific structure built at the end of a rail line, into which train enters entirely, and only then begins to reappear out the other (connected) one? That way, there's no parts of the train that have to simultaneously exist on different surfaces, have different orientations or any other duality stuff.

Might look a bit strange for long trains if they're placed really close together, though.

Re: Linked-belt

Posted: Thu Oct 21, 2021 4:53 pm
by mrvn
chugin_iv wrote:
Tue Feb 23, 2021 2:39 pm
DaveMcW wrote:
Mon Dec 14, 2020 9:11 pm
<boskid> NOOO
<boskid> linked pipes are more likely than linked rails
<boskid> with linked rails there is so many obstacles, with most basic one being trains pathfinder heuristic, that i would have to disable it completly if there would be any linked rail in use
<boskid> and rolling stocks having 2 joints so it would be hard to decide on which surface it should be and what orientation it should report while being in half on one surface and half on another
<boskid> basically it would be immediately forcing linked rails to be on different surface, have exactly the same position, the same orientation and the same bending type
<boskid> and still rolling stocks when traveling across linked rail would be effectively teleported to different surface
<boskid> so if you would have rolling stock with grid and roboport in that grid, and construction robots flying to a rolling stock, when that rolling stock would switch to different surface all the robots would have to be immediately teleported to that other surface
<boskid> i think electricity can be connected between surfaces (there are some distance checks bypassed if both ends are on different surfaces, not sure if it was for all wires or only for PowerSwitch), now belts, there are chests
<boskid> pipes are strong next candidate, but please do not mention rails, i have nightmares because of that idea
Um... Might not be a good idea, but how about "underground tunnel" view on this? As in, not linked rails per se, but specific structure built at the end of a rail line, into which train enters entirely, and only then begins to reappear out the other (connected) one? That way, there's no parts of the train that have to simultaneously exist on different surfaces, have different orientations or any other duality stuff.

Might look a bit strange for long trains if they're placed really close together, though.
Sorry for hijacking this thread but I couldn't find where the original was quoted from.

Actually why is teleporting trains over to the other surface a problem. How is that even something new? Why would it matter to robots? (code wise)

Lets ignore the visual effect of the train hanging over the end of rail till it reaches the midpoint and then disappearing. Obviously any use of a linked rail could construct some kind of portal or tunnel graphic around the linked tile that hides the train car before it teleports. So the train would drive into the tunnel, become invisible beneath the graphics of the tunnel entrance, teleport, and reappear out the other tunnel entrance. The tunnel entrance just has to cover at least the size of a cargo wagon on each surface.

Roboports in a grid and construction bots flying around? What happens now if I teleport a player, car, tank, spidertron with those to another surface? Programmatically how is that different from what a linked rail would do?

Do you think it's different because the user would expect the bots to somehow magically follow the train through the portal or tunnel? I would say tough luck. Don't drive your train through linked rails with bots in the air. If the train comes back to the original surface the bots can aim for it again. Even the RFC 1149 on "IP over avian carriers" says that pigeons ignore bridges and tunnels. Same for bots.


Aside from that: Any update on linked pipes? Or linked tanks? Anything with a fluid box on separate surfaces?