"terciary" power usage_priority is acting weird

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
luc
Fast Inserter
Fast Inserter
Posts: 225
Joined: Sun Jul 17, 2016 9:53 pm
Contact:

"terciary" power usage_priority is acting weird

Post by luc »

1) It's tertiary, not terciary.

2) It seems nicer to have a numeric (int or float) usage_priority, rather than strings. The strings "primary-input", "secondary-input" and "terciary" are 2a) inconsistent, 2b) overly long where "primary", "secondary" and "tertiary" makes perfect sense (it seems it actually was like this in the past, but it was changed for no apparent reason?) and 2c) it doesn't scale.

3) Objects with "terciary" usage_priority are super weird. The game seems to think it's an accumulator... but also not. In my test environment, there is no steam at all. Only solar panels and regular accumulators. I have a custom entity with energy_source={type=electric, usage_priority=terciary}. I observe:

3a) If "buffer_capacity" is not given (in electric_source) and energy_usage is very large (test case: 9PW), the game seems to assume it has an infinite buffer. In the electric overview screen (when you click a power pole), the "accumulator charge" bar is completely empty, while showing a value like "104GJ" (if my accumulators have 37GJ). It keeps filling this non-existent buffer with power before filling the other accumulators' buffer.

3b) If "buffer_capacity" is not given (in electric_source) and energy_usage is very large (test case: 9PW), the game seems to assume the buffer is infinitely full. It will draw from this buffer before drawing from real accumulators (even though electric output flow is not given, just like in a roboport, which also does not deliver back to the network). The other accumulators' capacity is 37GJ. In the electric overview screen (when you click a power pole), the "accumulator charge" bar shows something like 37.5GJ when it gets night. Early in the night, 0.5GJ is used up and the accumulator charge now shows 37GJ. This means all accumulators are full, except the custom entity, which must now be empty. Still, the accumulators do not turn on and the factory says it has plenty of power, even though none is produced. 119MW which comes from nowhere. See screenshot [1].

3c) If "buffer_capacity" is 0J and energy_usage is smaller (test case: 9MW), the game will pump an infinite amount of electricity into it. While it is getting day, I place this custom entity. The solar panels work at peak performance (producing 496MW) and the factory needs much less, only about 120MW, but the accumulators immediately stop charging. See screenshot [2]. If I remove the custom entity, the accumulators will start charging again (not shown in screenshot).

Screenshot [1]: https://snag.gy/s56lIi.jpg

Screenshot [2]: https://snag.gy/SqbWzx.jpg

---

What I am trying to do, is make an object that can use an almost infinite amount of power. In order to not drain the factory during the night, it needs to have "terciary" priority (if it's primary or secondary, it will try to draw before the accumulators, which means the accumulators will be permanently empty). I'd actually like to give it quaternary priority but that string is undefined ("Error, invalid electric usage priority: quaternary"). It seems nicer if the priority is just a float, so people can have something like priority 2.5 (before accumulators, below everything else) or 4 (after everything else). Using "terciary" priority, the object currently behaves super weird so I'm not sure it's possible to make this mod with the current API :(
Rseding91
Factorio Staff
Factorio Staff
Posts: 14253
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: "terciary" power usage_priority is acting weird

Post by Rseding91 »

Priorities are fixed values associated with a specific order and way energy is transferred in the C++ code. Making it a float is never going to happen. Additionally the "terciary" type was created exclusively for accumulators - anything using it will act like an accumulator. If that's not the behavior you want then don't use it.
If you want to get ahold of me I'm almost always on Discord.
luc
Fast Inserter
Fast Inserter
Posts: 225
Joined: Sun Jul 17, 2016 9:53 pm
Contact:

Re: "terciary" power usage_priority is acting weird

Post by luc »

Is there any way I can let something draw an infinite amount of power with a lower priority than (or equivalent to) accumulators?
Rseding91
Factorio Staff
Factorio Staff
Posts: 14253
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: "terciary" power usage_priority is acting weird

Post by Rseding91 »

luc wrote:Is there any way I can let something draw an infinite amount of power with a lower priority than (or equivalent to) accumulators?
No.
If you want to get ahold of me I'm almost always on Discord.
luc
Fast Inserter
Fast Inserter
Posts: 225
Joined: Sun Jul 17, 2016 9:53 pm
Contact:

Re: "terciary" power usage_priority is acting weird

Post by luc »

Well, I guess thanks for the clear, quick and concise replies.
luc
Fast Inserter
Fast Inserter
Posts: 225
Joined: Sun Jul 17, 2016 9:53 pm
Contact:

Re: "terciary" power usage_priority is acting weird

Post by luc »

Supercheese wrote:Can we at least fix the spelling, though? ;)
Nope, it's hardcoded in the C++ code and therefore it cannot even be considered. Rseding just said so ;) :P
Supercheese
Filter Inserter
Filter Inserter
Posts: 841
Joined: Mon Sep 14, 2015 7:40 am
Contact:

Re: "terciary" power usage_priority is acting weird

Post by Supercheese »

luc wrote:Nope, it's hardcoded in the C++ code and therefore it cannot even be considered. Rseding just said so ;) :P
Well, Rseding himself can fix it, of course -- that was what I meant.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: "terciary" power usage_priority is acting weird

Post by bobingabout »

We have seen other spelling fixes, usually at major version increases, like, I dunno, 0.12-0.13.
Wait, aren't we expecting that to happen shortly? I vote fix it.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
luc
Fast Inserter
Fast Inserter
Posts: 225
Joined: Sun Jul 17, 2016 9:53 pm
Contact:

Re: "terciary" power usage_priority is acting weird

Post by luc »

Supercheese wrote:
luc wrote:Nope, it's hardcoded in the C++ code and therefore it cannot even be considered. Rseding just said so ;) :P
Well, Rseding himself can fix it, of course -- that was what I meant.
Yeah, just like checking whether object has a buffer and output flow rate -> then it's an accumulator (rather than going "oh low prio, let the game assume it's an accumulator even though it has no output and no buffer").
Post Reply

Return to “Modding interface requests”