Page 1 of 1

Combinator which can read entity

Posted: Sat Mar 20, 2021 5:53 pm
by DirtyBitch
It would be awesome to have combinator which can read neigbour entity like a SINGLE train wagon or a car or a tank and output it on wire.

Re: Combinator which can read entity

Posted: Sun Mar 21, 2021 12:37 am
by DaleStan

Re: Combinator which can read entity

Posted: Sun Mar 21, 2021 1:47 am
by ptx0
DaleStan wrote: Sun Mar 21, 2021 12:37 am You're looking for https://mods.factorio.com/mods/Optera/I ... y%20Sensor
mods have to implement this in a really performance intensive manner, but the base game could implement it as a part of the entity update.

Re: Combinator which can read entity

Posted: Sun Mar 21, 2021 7:45 am
by Optera
ptx0 wrote: Sun Mar 21, 2021 1:47 am
DaleStan wrote: Sun Mar 21, 2021 12:37 am You're looking for https://mods.factorio.com/mods/Optera/I ... y%20Sensor
mods have to implement this in a really performance intensive manner, but the base game could implement it as a part of the entity update.
Yes, polling trains (in manual mode) and cars really hurt performance. That's why IS has an option to only read automatic trains, which is a fair bit better than polling every n ticks.
Reading entire trains from train stops though is the way to go.

Re: Combinator which can read entity

Posted: Sun Mar 21, 2021 2:05 pm
by ptx0
Optera wrote: Sun Mar 21, 2021 7:45 am Yes, polling trains (in manual mode) and cars really hurt performance. That's why IS has an option to only read automatic trains, which is a fair bit better than polling every n ticks.
Reading entire trains from train stops though is the way to go.
or use a buffer box at each wagon and measure that - it'll indicate when one is empty and the others aren't

doesn't it poll every n ticks even for automatic trains?

Re: Combinator which can read entity

Posted: Sun Mar 21, 2021 5:17 pm
by Optera
ptx0 wrote: Sun Mar 21, 2021 2:05 pm doesn't it poll every n ticks even for automatic trains?
Technically yes, but it reads from a cached entity and doesn't have to run find_entities to see if the thing is still there.