#Hello everyone, is there a mod in which

1 messages · Page 1 of 1 (latest)

upper roost
#

Does anyone have any ideas?

gray sigil
#

whats the use case

upper roost
upper roost
gray sigil
#

usually the best circuit solution is to use less or no circuits, so that will always be superior, maybe different schedules would be the most optimal
but if you really wanna have a try at this are you good with binary?

#

factorio uses 32 bit integers for circuit values which leaves you with 32 1s or 0s to use as information
a part of those 32 bits will be dedicated for wagon/car count, another part for identifying cargo type and whatever bits are left are used for the value of the material value

#

lets say you want to differentiate 1-1, 1-2 and 1-4 trains with iron and copper

upper roost
gray sigil
#

you can represent the 3 train setups with 2 bits
00 - 1-1
01 - 1-2
10 - 1-4
and you would have the binary value 11 unused and free for an extra train configuration

with 2 cargos, 1 bit is enough
0 - iron
1 - copper
now a binary value of
0111010
which would be
10 for wagons
0 for material
and
0111 for material value
decoding this in the model i gave means a 1-4 train with iron and an iron value of 7

#

tried to keep the example simple but this can be expanded as long as you can fit your information in 32 bits

#

you have bitwise operations on the arithmetic combinators to do operations with bits for "extracting" the different parts of the encoded signal

upper roost
#

It's all cool, of course, but I can't decipher it. Because other queries will overlap with these values. For example, I have 2 fabries that require 1 train, 2 wagons with copper, and another plant may require the same thing, and all these 2 plants will send a combined signal.

gray sigil
#

one of the solutions to overlapping signals is using clocks to make sure only 1 plant can send a signal in a given tick

#

you run a clock over X ticks and give each plant a unique numeric ID that is less than the clock limit X
then only send a request signal when the current clock tick equals X

upper roost
#

Can you demonstrate a simple principle, give a blueprint? My trains operate on the "LTN" principle.

gray sigil
#

ill send an example later

upper roost
languid impBOT
gray sigil
#

cant really adapt it fully to an existing train network, that would be up to you
this blueprint demonstrates how to encode/decode multiple signals into 1
top left and bottom left are two stations that send encoded requests every 10 seconds, 5 seconds inbetween
bottom right is the clock
the rest is decoding with a memory cell showing the last read state of whatever came from the radars

#

id like to reiterate since i tried adapting complex stuff like this into a base before, more simple solutions exist and "good enough" is often better, but either way this is a very good exercise for improving with circuits if you wish to try it