Bulk Teleporters

by dorfl

Use spare gigajoules to teleport shipments of items.

Content
3 years ago
0.17 - 1.1
1.99K
Logistics

i how to combine iron ore and copper ore with your suggestion O(2) and O(3) ?

5 years ago
(updated 5 years ago)

i didn't use and test this mod yet, only just saw the mod review by Xterm ...

you answered some other questions by suggesting to use a naming scheme like O(2) for iron ore, O(3) for copper ore, etc. and on the other hand you somewhere said that signals are combined before your mod gets them and thus you currently rely on item signals being used only as indicator of chest contents, leaving only virtual signals available for the channel numbers. and even if you change this, the channel numbers probably will still be summed up just like factorio does on all wires.

thus my question: with your suggested naming scheme, would it be possible at all to have a shared teleporter for iron ore and copper ore ? wouldn't the two signals be added to show only O(5) to your mod which is no intended network at all, might send all iron and copper ore to an uranium receiver which listens on channel O(5), and would only work by chance, eg when you send iron and copper from a shared teleporter and also receive iron and copper (but not also uranium since then it would add up to O(10) :-) with a shared teleporter since all would be in network O(5), but fail if you want to send iron ore to one destination O(2) and copper to another O(3) ? similar would also apply if you want to receive red and green circuits with a single receiver.
did i understand this limitation of your suggestion correctly ?

an alternate approach to this problem might be to use bitwise encoded channel numbers, thus O(2), O(4), O(8), O(16), etc. although that would make setting up channels a bit (pun not intended :-) more difficult, and require the mod to additionally process channel numbers to separate the bits for accessing channels.

i once saw something similar on another mod (sorry, i don't remember which one or even in which version of factorio) that used channel numbers, and where default behavior was to access only the exact number of a given channel (thus allowing 1,2,3,4,... or -1 for "any"). with some mod option it should be possible to get different default behavior of the mod to use comparisons like (if (channel AND filter) != 0) instead of direct comparisons (if channel == filter). using that trick, we would have less channels per virtual signal but overall still in the hundreds (maybe 36 x 30 instead of 36 x 2^31), and several things would (optionally!) be more complicated (but only by a bit), but with the advantage of allowing eg a filter with the value O(6) to mean both channel O(2) as well as (O4), but not O(1) or O(8).

5 years ago

You are correct about O(n) network signals being summed, so simply hooking up a single teleporter to two subnets using the same virtual signal won't work properly. You would need to do some circuit network combinator checks to switch the teleporter network based on current buffer contents.

Bitwise encoded networks occurred to me but I never really liked that sort of complexity in LTN so went with simple numeric subnets. I figure anyone prepared to think about bit maps and masks is probably also skilled enough to use the circuit network to dynamically set teleport network :-)

5 years ago

understanding binary (or hex) numbers might not be easy for some people, but there should be lots of information about number systems, and people also wouldn't have to know any details as long as they understand to only use multiples of 2 as indices for their network. this different behavior could also be a non-default option in the mod settings, so that by default everything would still behave like now, and only if you enable this "alternate mode" in the settings the other comparison would be used.
this is a bit of additional effort for you (the mod author), but all this is a magnitude easier than setting up timed synchronized data processing at distant distributed locations by using factorio combinators.

the big problem with all such logic setups is synchronization. eg what happens when a transfer has started and takes a while. will that transfer be interrupted when a different network is connected? and maybe a synchronized transfer will randomly start again just when the other indices have been skipped and the same type is selected for the transfer, never getting to alternate types for transfer. and then the synchronzation itself (to connect sender and receiver at the same time to the same network) is some work too, either connecting everything with wires across long distances (at least a clock signal or a running count to trigger all the possible indices of networks needs to be transmitted, and in the future possibly across sufaces :-) , or using another mod for wireless signals.
of course (at least in theory) we could even invent some system that periodically sends special testitems and from that determine the timing of the entire setup when they should start counting indices. but that would be really complicated for most users and also cost additional space, time, bandwidth and power in the setup.

in contrast to all these problems, (at least to me) it looks quite simple to just use 2,4,8,16,32,etc instead of all numbers, and to sum these numbers when more than one subnet shall be enabled at once (no need for users to do that at all since this isn't possible at all now when using integers).
btw: I'm not sure, but it might have become slightly more difficult in 0.17 since i noticed several additional checks in factorio that disallow using the same signals multiple times in the same constant combinator or requester chest. you used to be able simply setting O(2) in slot 1 and O(4) in slot 2. if that is not possible any longer (can't check right now) you have to either add 2+4 yourself and use O(6), or use one constant combinator for O(2), another for O(4), and wire them together. for the user that should be all to take care of, and the mod does the rest by checking for "(channel AND filter) != 0"

5 years ago

Had some time to think about this last night. You're right -- a mod setting for network numbering mode would be doable without drastic change to the code as it is. Let people use which ever approach suits them. So, it's now on my todo list.

I'm working on Shortwave for UPS-friendly wireless signals. In theory it should be possible to do quite complex network synchronization.

New response