Efficiency of entities that have no power.

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Stevetrov
Fast Inserter
Fast Inserter
Posts: 125
Joined: Tue Jun 14, 2016 7:04 am
Contact:

Efficiency of entities that have no power.

Post by Stevetrov »

I have noticed that UPS doesn't change noticeably when nearly all of my factory is powered down.

Potentially this could be easy fix and this would help a lot building megabases as then I could power down some parts of my factory whilst working on other parts without massive slow down. Of course if it requires major reworking it probably not worth the effort.

Many thanks for the great game.

User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: Efficiency of entities that have no power.

Post by Deadly-Bagel »

I don't think we need to tell the devs how to make the game more efficient... they've proven themselves more than capable =P besides 0.15 will bring a ton of optimisations to make the game even more ludicrously efficient.

And it's possible your performance is due to graphics processing or memory speed.
Money might be the root of all evil, but ignorance is the heart.

Stevetrov
Fast Inserter
Fast Inserter
Posts: 125
Joined: Tue Jun 14, 2016 7:04 am
Contact:

Re: Efficiency of entities that have no power.

Post by Stevetrov »

I am not telling anyone what to do.

My point is that the game is very well optimised but it seems to spend a lot of CPU cycles on entities that are inactive because they don't have power. Of course this may have already been addressed, but I had the idea and so I suggested it, which is what this forum is for after all.

User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: Efficiency of entities that have no power.

Post by Deadly-Bagel »

I didn't say you were telling them what to do, I meant it that they know what they're doing in terms of optimisation.

This forum is more for suggestions for the gameplay, as we don't know the inner workings we can't suggest improvements to them.

Just saying.
Money might be the root of all evil, but ignorance is the heart.

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

Re: Efficiency of entities that have no power.

Post by Rseding91 »

"Powering down" things is one of the worse ways you can stop a factory. Simply not giving it any resources to consume/use is the ideal way.

The problem is: "powering down" an entity means the normal update logic on the entity can't run because there's no power to do things like "move the inserter arm". The entity has no update notification when power is restored so it can't disable itself.

Adding such a notification would be a gigantic waste of CPU time because 99% + of the time the entity has power or will have power next tick.
If you want to get ahold of me I'm almost always on Discord.

Stevetrov
Fast Inserter
Fast Inserter
Posts: 125
Joined: Tue Jun 14, 2016 7:04 am
Contact:

Re: Efficiency of entities that have no power.

Post by Stevetrov »

Fair enough thanks for the reply. I will work out another way of doing this.

hoho
Filter Inserter
Filter Inserter
Posts: 677
Joined: Sat Jan 18, 2014 11:23 am
Contact:

Re: Efficiency of entities that have no power.

Post by hoho »

Stevetrov wrote:My point is that the game is very well optimised but it seems to spend a lot of CPU cycles on entities that are inactive because they don't have power.
This is your gut feeling or did you test it somehow?

I don't really think that dealing with drain power usage is all that expensive in the big picture. I'd be surprised if it's more than a couple of percentages of total load in a megabase.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2915
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Efficiency of entities that have no power.

Post by Optera »

Rseding91 wrote:"Powering down" things is one of the worse ways you can stop a factory. Simply not giving it any resources to consume/use is the ideal way.

The problem is: "powering down" an entity means the normal update logic on the entity can't run because there's no power to do things like "move the inserter arm". The entity has no update notification when power is restored so it can't disable itself.
Another reason for making beacons switch on/off on signals. Sadly switching beacons wasn't voted higher in circuit feature poll.
Currently you have to decide between draining power for more UPS or switch power off at the expense of continuous "needless" UPS updates. Placing an inserter loop, removing/inserting modules on signals, next to every beacon simply takes too much space to be a feasible alternative.

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

Re: Efficiency of entities that have no power.

Post by Rseding91 »

Optera wrote:
Rseding91 wrote:"Powering down" things is one of the worse ways you can stop a factory. Simply not giving it any resources to consume/use is the ideal way.

The problem is: "powering down" an entity means the normal update logic on the entity can't run because there's no power to do things like "move the inserter arm". The entity has no update notification when power is restored so it can't disable itself.
Another reason for making beacons switch on/off on signals. Sadly switching beacons wasn't voted higher in circuit feature poll.
Currently you have to decide between draining power for more UPS or switch power off at the expense of continuous "needless" UPS updates. Placing an inserter loop, removing/inserting modules on signals, next to every beacon simply takes too much space to be a feasible alternative.
Making beacons switch off on signals would be the exact same as switching off through loss of power. It wouldn't save any additional UPS.

Circuit "switch off" is just a flag in the entity that forces it to not run the normal update logic. It's also one of the worse ways to "power down" something.
If you want to get ahold of me I'm almost always on Discord.

BenSeidel
Filter Inserter
Filter Inserter
Posts: 584
Joined: Tue Jun 28, 2016 1:44 am
Contact:

Re: Efficiency of entities that have no power.

Post by BenSeidel »

Rseding91 wrote:Circuit "switch off" is just a flag in the entity that forces it to not run the normal update logic. It's also one of the worse ways to "power down" something.
I have found that removing the power gives greater UPS benefits than just stopping the material flow when you have heavy use of enabled conditions on your inserters. It could just be my imagination though.

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

Re: Efficiency of entities that have no power.

Post by Rseding91 »

BenSeidel wrote:
Rseding91 wrote:Circuit "switch off" is just a flag in the entity that forces it to not run the normal update logic. It's also one of the worse ways to "power down" something.
I have found that removing the power gives greater UPS benefits than just stopping the material flow when you have heavy use of enabled conditions on your inserters. It could just be my imagination though.
Enable conditions also force the entity to stay active in the case of inserters because the inserter can't work due to the condition but otherwise is ready to go. There's no alarm system for when the logistic network changes.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2915
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Efficiency of entities that have no power.

Post by Optera »

What would be the most CPU friendly way to manage 1k+ beacons?
  • Have them on all the time?
    Requires more power producing entities.
  • Use inserters to remove the modules on circuit condition?
    Adds at least 2 inserters per beacon for another 2k entities.
  • Switch them off with power switches?
    "one of the worse ways you can stop a factory", but it doesn't add a lot of extra entities.

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

Re: Efficiency of entities that have no power.

Post by Rseding91 »

Optera wrote:What would be the most CPU friendly way to manage 1k+ beacons?
  • Have them on all the time?
    Requires more power producing entities.
  • Use inserters to remove the modules on circuit condition?
    Adds at least 2 inserters per beacon for another 2k entities.
  • Switch them off with power switches?
    "one of the worse ways you can stop a factory", but it doesn't add a lot of extra entities.
Leave them fully powered at all times. Solar panels have zero CPU cost to exist so you can just make more of them to give power to your beacons.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2915
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Efficiency of entities that have no power.

Post by Optera »

Rseding91 wrote:
Optera wrote:What would be the most CPU friendly way to manage 1k+ beacons?
  • Have them on all the time?
    Requires more power producing entities.
  • Use inserters to remove the modules on circuit condition?
    Adds at least 2 inserters per beacon for another 2k entities.
  • Switch them off with power switches?
    "one of the worse ways you can stop a factory", but it doesn't add a lot of extra entities.
Leave them fully powered at all times. Solar panels have zero CPU cost to exist so you can just make more of them to give power to your beacons.
What about accumulators? I doubt calculating remaining charge is free.

bobucles
Smart Inserter
Smart Inserter
Posts: 1669
Joined: Wed Jun 10, 2015 10:37 pm
Contact:

Re: Efficiency of entities that have no power.

Post by bobucles »

It's been my experience that thousands of idling biters is more CPU demanding than factory stuff. All those health regeneration checks, those random wandering motions, and always looking for something to kill. There has to be a better way.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Efficiency of entities that have no power.

Post by orzelek »

Optera wrote:
Rseding91 wrote:
Optera wrote:What would be the most CPU friendly way to manage 1k+ beacons?
  • Have them on all the time?
    Requires more power producing entities.
  • Use inserters to remove the modules on circuit condition?
    Adds at least 2 inserters per beacon for another 2k entities.
  • Switch them off with power switches?
    "one of the worse ways you can stop a factory", but it doesn't add a lot of extra entities.
Leave them fully powered at all times. Solar panels have zero CPU cost to exist so you can just make more of them to give power to your beacons.
What about accumulators? I doubt calculating remaining charge is free.
AFAIK both solar panels and accumulators follow same mechanics - they work as one grouped entity if the are connected to same networks.

hoho
Filter Inserter
Filter Inserter
Posts: 677
Joined: Sat Jan 18, 2014 11:23 am
Contact:

Re: Efficiency of entities that have no power.

Post by hoho »

orzelek wrote:AFAIK both solar panels and accumulators follow same mechanics - they work as one grouped entity if the are connected to same networks.
I don't think they do. It's possible to have accumulators with different charge in same network. You have that every time you connect a new one to the network.

Though I wouldn't be surprised if all accumulators with equal charge level are grouped into one.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2915
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Efficiency of entities that have no power.

Post by Optera »

hoho wrote:
orzelek wrote:AFAIK both solar panels and accumulators follow same mechanics - they work as one grouped entity if the are connected to same networks.
I don't think they do. It's possible to have accumulators with different charge in same network. You have that every time you connect a new one to the network.

Though I wouldn't be surprised if all accumulators with equal charge level are grouped into one.
Every entity can be part of multiple networks causing different charge and drain. Destroyed poles, newly placed entities and power switches switching once a tick at worse make generating groups from scratch every tick necessary. I don't see much potential to save CPU time by grouping accumulators.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Efficiency of entities that have no power.

Post by ssilk »

Solar panels and accumulators work as one entity if in one network (and have the same charge level). :)
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

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

Re: Efficiency of entities that have no power.

Post by Rseding91 »

Optera wrote:
Rseding91 wrote:
Optera wrote:What would be the most CPU friendly way to manage 1k+ beacons?
  • Have them on all the time?
    Requires more power producing entities.
  • Use inserters to remove the modules on circuit condition?
    Adds at least 2 inserters per beacon for another 2k entities.
  • Switch them off with power switches?
    "one of the worse ways you can stop a factory", but it doesn't add a lot of extra entities.
Leave them fully powered at all times. Solar panels have zero CPU cost to exist so you can just make more of them to give power to your beacons.
What about accumulators? I doubt calculating remaining charge is free.
Accumulators are grouped like solar panels are.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Ideas and Suggestions”