Circuit-Controlled Routers


Adds a belt-based router network to the game. Make a network of smart routers, connected by belts and by green circuit wires. Request items from the network, or provide items to the network, using I/O terminals connected to chests. This mod is intended to provide another logistics option for complex mods, such as Seablock, Krastorio 2, Space Exploration, Industrial Revolution 3, or Pyanodon's.

Content
a month ago
1.1 - 2.0
823
Logistics Circuit network

i Some suggestions

2 months ago

First of all, I want to thank you once again (and not the last :) ) for the great mod!

Suggestion #1: Come up with something about the priorities of requests and deliveries. For example, sometimes at the far end of the chain (far from the supplier chest) I need a small amount of some resources, but they are "eaten" by those terminals that are closer and/or require this resource more. This occurs when the supplier has a resource deficit.

Suggestion #2: There is an unpleasant moment, from time to time there are congestions in the routers, caused, probably, by an excess of some resource, for which the demand has waned. It would be happy to send it to the terminal "by default", but the conveyor belts are clogged with something else. Maybe it is worth thinking about issuing alerts when the movement stops for more than N seconds (configurable), if possible.

Suggestion #3: It would also be nice to have a mechanism for viewing the internal inventory of the router and terminals, with the ability to take away excess from there. Now you just have to remove the router, collect everything that fell out of it on the ground and put it back.

And also, to be more specific about priorities, we need signals for "delivery priority" and "request priority" - they must be different. Ideally, we could somehow make them specific to the resource.. Although I can't imagine how. :))

2 months ago

Thanks, noted! I'm a bit busy right now and probably can't address these for a while, but they're good to go on the list.

I think alerts would be straightforward. The routers use a somewhat bigger chest as a buffer, and then decide with a circuit condition whether they're jammed (so that they still jam on say 50 py ash even though ash stacks to 1000), so I could connect that to a hidden "speaker", or holographic sign, or something else that can show an alert.

Clicking a router and getting its internal chest inventory might also be reasonably straightforward... I'm not experienced in Lua GUI programming but I've been trying to learn it to make another mod (recipe info combinators).

There is some degree of priority control for supplying items, which is the "threshold trim" combinator. This lets you make routers only send items (either all items, or just a few) if their demand exceeds a certain amount. It's not exactly the control I would want, but it's something.

Demand is a lot harder though. It might be possible to add a priority system using both red and green wires, or using multiplexed signals on one color of wire (or Lua I guess), but it's tricky. The main challenge is that routing has to be based on both priority and demand: it's relatively easy to route according to static priority, and the same plan as for the current routers would work, but if you have two stations with different priority requesting copper then some of the copper in the network has to be routed according to one plan and some according to a different plan, so I think you simply need multiple layers, and that's not easy to accomplish with one signal ... it would need to be multiplexed, either according to time, or bits within a word, or maybe quality. Time division probably has the fewest side effects but it would flicker the poles a lot, and eat a fair bit of UPS.

If quality is installed, it seems kind of cute to split it as eg legendary copper means highest priority request for regular copper, but it'd have to be designed so that you can still send quality items through the router network.

2 months ago

I think, for a start, we can try to divide the resources sent proportionally to the requests.

From what I see now, until the terminal closest to the sender is completely satisfied, the resource simply does not go further. Considering that the consumption rate often exceeds the bandwidth of the tape, this leads to permanent starvation of distant terminals. Satisfaction and proportional to the size of the requests would solve the problem, at least partially. Maybe this is exactly what you call "multiplexed according to time"?..

2 months ago
(updated 2 months ago)

Well, for example, here's what I'm designing at the moment :) A large mall with the help of your mod, Factorissimo and a few others :))

0eNrtHV2P47jtryzSl2vhLKxvadH2pUDf+lagD4fFIDPx7BiXSXJ2srfbw/73SrKT2Ik1kiglA6SHebCZsSmKpESREunfZ4+rfbVt6vVu9un3Wf20WbezTz//PmvrL+vFyvy2XrxWs0+zRdtWr4+rev1l/rp4eqnX1ZzMfhSzer2svs0+oR+fi1m13tW7uuowWOD7w3r/+lg1+oHigOl58bTbNN/nuq119bSrN+u5RlI/LfSv86e6edrXu/ljOStm201bm/8bMnQbc0w/smL2Xd8h+ZH9+FFctIIvW+kR9q1tmim8xIeXHPEuFvW81Wiql82+rSaQIdWhwuUUInpE1Gz2u0p3ePO63az1U/PtptnNd039an57rNeLaWKR+siVwkiKA81C01zMdAd3zWb18Fi9LL7W+lX9fNvxtx3fa+EcpFbMnuuVJuP81933raHxa93s9loNzonutGO+e2mq9mWzWuoHftXP6Y7qZ9ab5tW+Y7q2aGw3Ps3+Zn/YGz1D5Y/P+m+KPey8JfqNzp8X7W5eb97gdc+CZd10nZx9ku/CkGX1vNivdrHsKN0M4W59qTfDIbRavG59HJrALwYDpjXqt1i3VhEfK9uPi6GCj0OFXvB8Ar+E42ch+FUsfu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YeZ7jjp6yuyfdPT28yy3J3fP23tRztwA1/2DdPTP3fce4uRfdvTD3sruX5l5196ZhUdp7cylE10tzKUSH31wK0XVG2Ib7ngnDOiEtdeZSyI5d5lLIjhPmUmhP3N4bdmn3zt6bd2X3rrkUqnvXXArVvWsuhereNZdCde8qK7Kye1lJC3QC1OZPv4M6iZgfkX0OWUiYB2nZ/6+DUEEtJO2Tqn/SosS8f9JCRHSQVRFz3qiDLJZDe+ZamK/TWQhbbcOkh8gQJ7Y9wD1ObLGQnjJzLcxHejoIWYj2EB3SQgxlJozS6SvqdYJYqNOQTl3stTBl4TvI8oXyHuIWEj0kLNTzjFq+0J4vVqtNJWsLmWthykJ3kG2d4R7CAzVBVrvNaSE7fkpDmSnr00HUQqyHmIV4D3ELHd4TFpI9JC2kesi2gMp+hHbD9TBe7YBFuIewhUgPGVqMmbSQlZjZb7JjHtMRxEeQHEJWYidohIWMsJARFjLCQkdY6AiLnTfMyagOEpbqnoPMcqIfq+Zwk35SddpjTgYNsHAygtgIEiNIDSExwmKnAxP0RAOIHCHzJD0+aSA+guQQ6ieMA9S3YKgvjLWkFrItqL4FCx37rqwuqQNkdUn1uqSsLqlel5TVJdXrkrK6pHpdUpaDqtclcy3M2tRA9lqYZV8HoYG+GCqIpRN9/txVjDYux2pfbZt6bdY9q4VeAOnf/rVYrT78CX346Z/WptVtW79uPvwbf9CP/Vk/97VqWmvBGNedUIoxIgVR5MeP/wFN2//G

The same at factoriobin: https://factoriobin.com/post/eh2k71

2 months ago

From what I see now, until the terminal closest to the sender is completely satisfied, the resource simply does not go further. Considering that the consumption rate often exceeds the bandwidth of the tape, this leads to permanent starvation of distant terminals. Satisfaction and proportional to the size of the requests would solve the problem, at least partially. Maybe this is exactly what you call "multiplexed according to time"?..

Yeah, this is probably a bug, I will check it out.

The routing algorithm is currently "routers may route in any direction where the demand exceeds the average". It could be changed to "routers must route in the direction(s) of maximum demand" but my experience before was that usually the average thing works better. But maybe it would fix this starvation issue.

2 months ago

If the terminal that is closer requests 1000 units (for example), and the one that is further away requests 10 units, how will the algorithm behave?

2 months ago
(updated 2 months ago)

In general, the more I use the mod, the less clear the scenario for its use is to me :)

The idea itself is great, it's essentially Cybersyn for belts.

But by the time the conveyors of the third tier appear, it is already easier to use the railway, the belts have too little throughput anyway. But I have not tried Seablock, Krastorio 2, Space Exploration, Industrial Revolution 3, or Pyanodon :)))))

2 months ago

I believe that if one terminal requests enough-more units, then it will take all the traffic, and also this is probably what is wanted. The problem is if a nearby terminal requesting 20 can starve a distant terminal requesting 200, or vice-versa.

This mod is definitely useful for certain modded games. It's good for midgame Py at least, especially if I can fix this starvation issue. Py has a lot of items that you make at ~1/s or slower for a long time, and many of them need to be sent across your base. You could send them by train but it feels wasteful to send a whole train for only 100 items, and it's still a couple minutes between deliveries.

It's also useful for Space Exploration (if it's compatible anyway), and maybe for some of the others too. Those don't have as many low-rate items but they do have some, such as catalysts or high-end chips in Seablock, or science catalogs in Space Exploration. Those can be delivered by train but a router network is a viable alternative.

2 months ago

Maybe if in modded games the situation is as you describe, transferring small amounts of items over a large distance, then your mod is useful... On the other hand, there are drones? or aren't they there?

2 months ago

Yeah, bots are an option in Py, but they're slow and expensive, and bases are large. So routers are useful, even though they are not much better than trains or bots.

Space Exploration has a mechanic where if you have more than 50 logistic bots in a network (upgradeable with an expensive repeatable tech), they start randomly exploding. In space and on some planets, this happens more often than on Nauvis.

2 months ago

Well, that makes sense then. Your mod is certainly incredibly useful in these scenarios :)
Maybe I'll try it someday :)

New response