"terciary" power usage_priority is acting weird
Posted: Sun Apr 02, 2017 5:24 pm
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
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