on_combinator_recieve_circuit_update (changeable)

Things that we aren't going to implement
User avatar
LuziferSenpai
Filter Inserter
Filter Inserter
Posts: 380
Joined: Tue Jul 08, 2014 10:06 am
Contact:

on_combinator_recieve_circuit_update (changeable)

Post by LuziferSenpai »

Hey,

is it possible to get a Event that triggers when a Combinator recieves a Circuit Network Update as Input?
This would be VERY helpful for Modifications like: And other.

How would the Event work?
It triggers everytime the Input of a Combinator Type Entity Updates.

Greetz,

Luzifer
Coding is awesome!
Animes are love!
Factorio is life!

My MODs:
Click

Greetz,

Senpai
Rseding91
Factorio Staff
Factorio Staff
Posts: 14720
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: on_combinator_recieve_circuit_update (changeable)

Post by Rseding91 »

I realistically don't see this happening. That's essentially on_tick with some extra flare and quickly runs into performance concerns with firing the event too frequently.
If you want to get ahold of me I'm almost always on Discord.
User avatar
LuziferSenpai
Filter Inserter
Filter Inserter
Posts: 380
Joined: Tue Jul 08, 2014 10:06 am
Contact:

Re: on_combinator_recieve_circuit_update (changeable)

Post by LuziferSenpai »

The current Problem is that mostly every Modification named has a massiv UPS Problem, because we need to check each entity and that can lead to MASSIV Problems. So I was searching for a Way to fix this Problem.
Coding is awesome!
Animes are love!
Factorio is life!

My MODs:
Click

Greetz,

Senpai
Rseding91
Factorio Staff
Factorio Staff
Posts: 14720
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: on_combinator_recieve_circuit_update (changeable)

Post by Rseding91 »

LuziferSenpai wrote: Fri Sep 13, 2019 8:17 pm The current Problem is that mostly every Modification named has a massiv UPS Problem, because we need to check each entity and that can lead to MASSIV Problems. So I was searching for a Way to fix this Problem.
Yes, what those mod(s) are trying to do is well outside of what the mod API was designed for and as such there's typically performance concerns.
If you want to get ahold of me I'm almost always on Discord.
User avatar
LuziferSenpai
Filter Inserter
Filter Inserter
Posts: 380
Joined: Tue Jul 08, 2014 10:06 am
Contact:

Re: on_combinator_recieve_circuit_update (changeable)

Post by LuziferSenpai »

Okay ...
Coding is awesome!
Animes are love!
Factorio is life!

My MODs:
Click

Greetz,

Senpai
mrvn
Smart Inserter
Smart Inserter
Posts: 5969
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: on_combinator_recieve_circuit_update (changeable)

Post by mrvn »

The problem I see here is that events are global and not bound to any entity. Even assuming you add a prototype flag "mod-circuit-update" so the event only triggers for special entities every time any one of possibly millions of such entities gets a changed input signal the event would trigger for all mods. Not just the mod that handles the entity with changes.

Secondly there is no rate limiting for
a) a million entities change input the same tick.

Mods might want to only process a handful entities each tick in a round-robin fashion and rather get slower response time instead of halting the game.

b) one entity changes input every tick.

Mods might only want to respond to changes every so often to save on processing time.


On the other hand how would this be worse? Currently all those mods do on_tick() and for each of their entities they get the signals, check if anything has changed and if so update the outputs. With the proposed signals worst case you still do basically on_tick. But now the event could have a table of entity with changes. So instead of the expensive callback to get the signals and comparing them you check if the table contains any entities you are responsible for. I can see a huge potential for saved time there.
Post Reply

Return to “Won't implement”