Friday Facts #409 - Diminishing beacons

Regular reports on Factorio development.
mmmPI
Smart Inserter
Smart Inserter
Posts: 3145
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Friday Facts #409 - Diminishing beacons

Post by mmmPI »

tsen wrote: ↑
Thu May 09, 2024 1:14 am
"In fact" is an English idiom roughly equivalent to "moreso" or "furthermore", It doesn't require that anything involved in the sentence be a fact. Everything I say is, implicitly, my opinion, by virtue of my having said it.
I disagree, twice, the most obvious : I know some people use "literally" when the thing is not "literal". That doesn't mean "literally" means the things they use it for. They just use the word wrong. To me that's the same thing here with "in fact". https://www.wordnik.com/words/in%20fact

The other reason is more subtle :
I invite you to meditate on the fact that your 2nd sentence can be described as inconsistent with the first one.

If you pretend explaining what is an acceptable use of the expression "in fact" in the english langage, it means you refers to some kind of rules that goes beyond one's opinion, the rules of english including the meaning of the words and the way you feel validated using them.

Those, unlike speculations on the future beacons, you consider them more "factual", in your words, as it wouldn't make sense otherwise for you to explain me some rules . If they didn't existed somewhere else than just in your opinion.

I was merely pointing out that there exist such difference. And If there is such difference between facts and opinions, then repeating facts is not the same as stating an opinion and as such it is possible to pretend saying facts while instead giving an opinion but "presenting it as a fact". Be it voluntarily or not.

It is also possible to say a lot of things that are not "opinion" like repeating multiplication table is NOT expressing an opinion, or repeating the % of transmission and energy consumption of the beacon is NOT an opinion. It is only an opinion if you do not have factual data and are making things up according to ... "opinion".

tsen wrote: ↑
Thu May 09, 2024 1:14 am
This is what I meant by "void where prohibited"; it was a jokey way to say "not counting cases where it might not make sense".
But top-quality express splitters probably split faster or something, so I dunno, I might. Even if they just have higher HP.
Do i sound like someone who gets the joke ? To me a jokey is someone who ride a horse with a typo. I think the same people who do not use literally literally also can't see the wrong in using the term "min-max" when they just mean the "max" of everything no-brainer big-number style. Max of everything is not min-max. When min-maxing you should also minimize cost and waste. I think it's fairly obvious from the curve that more beacon is always going to produce more transmission effect.
But also it look like at some point you need 16 beacons around a single machine where you could instead have 4 beacons and 4 machines for the same production i suppose much lower cost. If half of the factory need quality and the other half doesn't that will create several different "optimal build" i suppose. If you compare to a RPG or a MMO, everyone know the best character is the max level character, but a big part of the game is to get there. I see the same for the max beacon setup. And like for RPG there would be different class or optimal build.

I may be wrong though, i'm curious to see the expansion, that would answer things , but it's unlikely my opinion be changed by something else than logic at this point.

Elocutiona
Burner Inserter
Burner Inserter
Posts: 14
Joined: Fri Nov 06, 2020 3:32 pm
Contact:

Re: Friday Facts #409 - Diminishing beacons

Post by Elocutiona »

Mimp wrote: ↑
Thu May 09, 2024 12:51 am
I was driving my daughter (14) home from school and telling her about this FFF. After discussing it she started breaking out into song about beacons, beacons, beacons, a la Jack Black's Peaches from the Mario Movie: https://youtu.be/aW7bzd8uwyQ?t=57 It made my day, hopefully it makes someone else's too...

P.S.: this is the same daughter that created this masterpiece back in '17: https://imgur.com/gallery/urGX3
Bless her :)

tsen
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue Jul 30, 2019 5:41 am
Contact:

Re: Friday Facts #409 - Diminishing beacons

Post by tsen »

mmmPI wrote: ↑
Thu May 09, 2024 5:28 am
I disagree, twice, the most obvious : I know some people use "literally" when the thing is not "literal". That doesn't mean "literally" means the things they use it for. They just use the word wrong. To me that's the same thing here with "in fact". https://www.wordnik.com/words/in%20fact
If you want me to be more specific, the intended meaning of "in fact" in this idiom is "frankly speaking", and the thing that is "more factual" is my description of my position. It's like saying "I don't like yellow. In fact, I think it's the worst color." The second part is more matter-of-fact, which is mainly to say, blunter. It's a very well-established usage in English, complaining about it is pretty pointless.
I invite you to meditate on the fact that your 2nd sentence can be described as inconsistent with the first one.

If you pretend explaining what is an acceptable use of the expression "in fact" in the english langage, it means you refers to some kind of rules that goes beyond one's opinion, the rules of english including the meaning of the words and the way you feel validated using them.

Those, unlike speculations on the future beacons, you consider them more "factual", in your words, as it wouldn't make sense otherwise for you to explain me some rules . If they didn't existed somewhere else than just in your opinion.

I was merely pointing out that there exist such difference. And If there is such difference between facts and opinions, then repeating facts is not the same as stating an opinion and as such it is possible to pretend saying facts while instead giving an opinion but "presenting it as a fact". Be it voluntarily or not.

It is also possible to say a lot of things that are not "opinion" like repeating multiplication table is NOT expressing an opinion, or repeating the % of transmission and energy consumption of the beacon is NOT an opinion. It is only an opinion if you do not have factual data and are making things up according to ... "opinion"..
Nope, not at all. Maybe I made them up! It's your job to figure that out. It's only my opinion that quality modules would probably work the way the devs said they would - an informed opinion based on the previous statement, but it could be changed without my knowledge at any time, or I could even have dreamt the previous statement.

Do i sound like someone who gets the joke ? To me a jokey is someone who ride a horse with a typo.
That's not really my problem, is it? I didn't make the joke just for your personal consumption.
I think the same people who do not use literally literally also can't see the wrong in using the term "min-max" when they just mean the "max" of everything no-brainer big-number style. Max of everything is not min-max. When min-maxing you should also minimize cost and waste. I think it's fairly obvious from the curve that more beacon is always going to produce more transmission effect.
No, no, "min-max" comes from RPGs like D&D and it refers to maximizing the stats you want to use at the expense of the stats you don't so that your character is highly specialized. You minimize your ability to do the things you don't want to do in order to free up chargen points to maximize your ability to do the things you want to do. The key point is that they're both positive things, so some other viable character build might maximize exactly the opposite set of things, like a fighter and a wizard working together - it would be weird to apply it to "cost and waste" because the "min-" part is supposed to be a domain in which you're bad, unless, I suppose, we reverse the polarity and minmax something to be really good at one thing with the drawback of being very expensive or wasteful. Which people do, but it still doesn't really count because there's just not a lot of reason to care about cost or waste in Factorio. I don't really think RPG-style min-maxing is something that could exist in Factorio, where everyone is perfectly interchangeable and there's never any use for complementarity.
But, uh, nobody said "min-maxing" as far as I know so I'm not sure why we're discussing it anyway.
But also it look like at some point you need 16 beacons around a single machine where you could instead have 4 beacons and 4 machines for the same production i suppose much lower cost. If half of the factory need quality and the other half doesn't that will create several different "optimal build" i suppose. If you compare to a RPG or a MMO, everyone know the best character is the max level character, but a big part of the game is to get there. I see the same for the max beacon setup. And like for RPG there would be different class or optimal build.
But try to think it out - what would those "different classes" be? Already, now, there are some places you put prod modules and some places you can't put prod modules, and it's generally agreed that the optimal build is to put prod everywhere you can, and stuff everything else full of speed. This is technically not all the same, because there are two different module sets you're using, but I think most people will agree that it's samey in the sense that it is exactly one pattern expressed as a very simple rule (the previous sentence).

In particular, since modules are strictly monotonic with no clear thresholds, then in the long run, if beacon A (say, prod) is better than beacon B (say, speed) in a given machine, then another beacon A is always still better than another beacon B, so it's better to use all one kind, never a combination. Nothing we've seen has changed this calculus and it seems highly unlikely to change. That's really the biggest factor keeping the module distribution patterns simple.

Sure, not everyone in practice goes with the best solution, but that's just a personality difference - we're already waist deep in "people complaining that other people are using samey optimized blueprints", so the question of whether everyone does it seems moot.
I may be wrong though, i'm curious to see the expansion, that would answer things , but it's unlikely my opinion be changed by something else than logic at this point.
Well, that's, again, not really my problem... you can keep your opinion if you want.


XT-248 wrote: ↑
Thu May 09, 2024 3:21 am
I went back and looked up the bonus from quality to various items (FFF #375). One thing that stood out was that beacons have lower energy drainage, which may or may not be enough to get me to use them.
Well, you can see in this new post that they're changing it so that quality now makes the beacon transmission stronger and the module effect bigger, so using top quality is now substantially better at doing the things beacons are meant to do - certainly enough to get me to use them.
What I found more interesting from #375 is that speed modules will have a quality malus; if that's bad enough that speed modules will reduce rather than increase production of the desired product overall (ie, it outweighs the speed increase), then I wouldn't have any reason to use bacon at all anywhere I wanted quality... which obviously solves the present question a lot more thoroughly than tweaking the bacon effect.
green modules for miners.
I mean, you do you, but... why? Put prod mods in there, you get more ore per ore, meaning you get more production from a particular ore patch before you have to move on to the next one... which may be thought of as better or worse, depending on perspective (I get a little bored with no player action needed), but at least it's a tangible benefit. Greens just reduce the energy consumption, but energy's so cheap I never run out of it even with a major nerf on solar mod, and the amount of pollution, which I guess would matter if all the bugs in the county weren't already dead by then (because I got bored and needed something to do).
I don't use beacons unless I need higher throughput from speed modules, which I don't often do since you can accomplish the same thing by adding more machines.
Yeah, that is the tradeoff. In the long run, beacons tend to be easier because they just sit there and give passive bonuses. It's possible to run into major throughput issues with them, though, but I've only seen that in modded machines. This kind of gets back to the same question of better or worse, though... given that Factorio's design encourages minimizing the need for player action, but then you have nothing to do. Running around building a bunch of bottom-tier "dumb" factories until you have enough to produce what you want at least fills more time.
I might add quality modules to obtain some of the better or more valuable bonuses, but the overall strategy will likely remain the same going into Factorio 2.0.
Well, yes, and that's really my overarching point... it's either one or the other, for any given thing either quality becomes the new meta or the same old applies... which is counter to the assumed goal of adding variation, unless going from all-red to all-white sometimes counts as variation, which is not really how I see it.

mmmPI
Smart Inserter
Smart Inserter
Posts: 3145
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Friday Facts #409 - Diminishing beacons

Post by mmmPI »

tsen wrote: ↑
Thu May 09, 2024 2:35 pm
Nope, not at all. Maybe I made them up! It's your job to figure that out. It's only my opinion that quality modules would probably work the way the devs said they would - an informed opinion based on the previous statement, but it could be changed without my knowledge at any time, or I could even have dreamt the previous statement.
My opinion is that beacon like quality module would work like the dev said they would since they tested it before annoucing it and explained with factual argument, doesn't it mean my opinion is thus an informed opinion based on the previous statement (from the devs written on the internet) too ?
tsen wrote: ↑
Thu May 09, 2024 2:35 pm
Well, that's, again, not really my problem... you can keep your opinion if you want.
You quoted me saying your opinion, i thought it was polite to answer you even if i disagree with the presentation you made of your opinion as facts, and the conclusion of your reasonning. I attempted to explain politely thinking it would adress the reason for which you quoted me in the first place.
I know i could keep my opinion.
tsen wrote: ↑
Thu May 09, 2024 2:35 pm
No, no, "min-max" comes from RPGs like D&D and it refers to maximizing the stats you want to use at the expense of the stats you don't so that your character is highly specialized. You minimize your ability to do the things you don't want to do in order to free up chargen points to maximize your ability to do the things you want to do
Yes i agree, you literally said the same thing than me but you said "no no" before. that's surely a funny way to use idioms x)

you minimize the points spent in useless power to streamline your character, Either strengh or intelligence or agility, can't have all 3, one is maxed, the other minimized.

That's similar to minimizing the cost of energy or ressource consumption or space footprint of your designs by choosing a design with a number of beacons that can varies to adapt to the different conditions that game pace and different planets allows. Can't have the fastest the most efficient the cheapest the greenest the least consuming ressources and the smallest at the same time. You need min-max.
tsen wrote: ↑
Thu May 09, 2024 2:35 pm
what would those "different classes" be?
Space efficient,
ressource efficient,
cheap to build reach the next tier,
energy efficient,
without producing quality output,
with quality output,
made without quality splitters,
made fully of quality item including the splitters even if it cost 10 times as much as not doing it for only HP gain and that could feel like a waste of time and gimping oneself to build the outpost and the solar pannel necessary to support such high quality splitters everywhere.

The only limit is your imagination :)
tsen wrote: ↑
Thu May 09, 2024 2:35 pm
suppose, we reverse the polarity and minmax something to be really good at one thing with the drawback of being very expensive or wasteful. Which people do, but it still doesn't really count because there's just not a lot of reason to care about cost or waste in Factorio.
that's pretty much how i used the word min-max, the "min" part essentially, means something is going to be "bad" , minized, like energy efficency with 16 beacons setups, which translate into tons of solar pannels sometimes it's a waste of time.

True, there's no reason to care about it, factorio is a game, if we were short on time we wouldn't be playing.
tsen wrote: ↑
Wed May 08, 2024 9:18 pm
I'm not even a crazy optimizer, but I'm not gonna gimp myself for no reason.
Rarely it's done on purpose, the main reason is not realizing the other way to do.

tsen
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue Jul 30, 2019 5:41 am
Contact:

Re: Friday Facts #409 - Diminishing beacons

Post by tsen »

mmmPI wrote: ↑
Thu May 09, 2024 3:53 pm
tsen wrote: ↑
Thu May 09, 2024 2:35 pm
Well, that's, again, not really my problem... you can keep your opinion if you want.
You quoted me saying your opinion, i thought it was polite to answer you even if i disagree with the presentation you made of your opinion as facts, and the conclusion of your reasonning. I attempted to explain politely thinking it would adress the reason for which you quoted me in the first place.
I know i could keep my opinion.
That's fair. When you say that your opinion is unlikely to change, I got the impression that you thought I was trying to change it, so I just wanted to let you know that I wasn't.
Yes i agree, you literally said the same thing than me but you said "no no" before. that's surely a funny way to use idioms x)

you minimize the points spent in useless power to streamline your character, Either strengh or intelligence or agility, can't have all 3, one is maxed, the other minimized.

That's similar to minimizing the cost of energy or ressource consumption or space footprint of your designs by choosing a design with a number of beacons that can varies to adapt to the different conditions that game pace and different planets allows. Can't have the fastest the most efficient the cheapest the greenest the least consuming ressources and the smallest at the same time. You need min-max.
[...]
that's pretty much how i used the word min-max, the "min" part essentially, means something is going to be "bad" , minized, like energy efficency with 16 beacons setups, which translate into tons of solar pannels sometimes it's a waste of time.
Ah, the way you originally phrased it, I thought you were suggesting that "min-maxing" should mean minimizing the cost while maximizing the benefit, without any part of it being "bad", which is obviously not consistent with how the word is usually used. If that's not what you meant, just a simple misinterpretation.
Space efficient,
ressource efficient,
cheap to build reach the next tier,
energy efficient,
without producing quality output,
with quality output,
made without quality splitters,
made fully of quality item including the splitters even if it cost 10 times as much as not doing it for only HP gain and that could feel like a waste of time and gimping oneself to build the outpost and the solar pannel necessary to support such high quality splitters everywhere.

The only limit is your imagination :)
Sure, but is there any reason anyone would want all of these things? I mean, the argument being made in general seems to be that people don't only want to be able to build a factory any way they like, but also have a problem with other people building samey optimized factories and/or feel like they "have to" build samey optimized factories themselves, because there's no good reason to use different "classes". In other words, some people want the same kind of complementarity you see with fighters and wizards as mentioned before, so that there's a game-intrinsic reason to build differently.
But in practice... space is (in current Factorio) practically infinite, resources are practically infinite, time is technically finite but trying to minimize the amount of time you spend in a game contradicts the whole point of entertainment... also a lot of people are completionists and are just gonna want to have the pretty orange quincunx on everything because it is Officially Best.
Overall, the mechanics of Factorio are all pushing toward and rewarding one particular "number going up" - making the most of the best stuff possible with minimal player involvement. This is, in a sense, its fundamental Achilles' heel, since it "wants" you to spend less time playing it - but that's a separate discussion and not really something that could be changed anyway. Just in this specific thread's case, though - the problem for most people clearly isn't just about being able to build a "less efficient" design as interpreted by that single principle, which you can certainly already do to your heart's content, but being able to feel like doing so is still playing the game "the right way". The 2.0 expansions certainly offer this in some ways, like platforms having a space limitation, but the beacon changes in the current topic are just fundamentally not changing anything that actually matters in and of themselves.

mmmPI
Smart Inserter
Smart Inserter
Posts: 3145
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Friday Facts #409 - Diminishing beacons

Post by mmmPI »

tsen wrote: ↑
Thu May 09, 2024 6:04 pm
That's fair. When you say that your opinion is unlikely to change, I got the impression that you thought I was trying to change it, so I just wanted to let you know that I wasn't.
I said without "logical argument" it's unlikely to change. I didn't mean it as a idiomatic expression, i really mean that logical arguments can make my opinion change, i'm not closed to hearing them. I attach more importance than you to the litteral meaning of the word obviously, i feel like you are trying again to twist my word to make it sound like i can't hear reason, when i'm just stating that your argument do not seem logical. Those you put in the quote you adressed to me.
tsen wrote: ↑
Thu May 09, 2024 6:04 pm
But in practice... space is (in current Factorio) practically infinite, resources are practically infinite, time is technically finite but trying to minimize the amount of time you spend in a game contradicts the whole point of entertainment...
In fact, you have litterally no way to tell how it is in practice with the new system, only the devs can. You are repeating your opinion but it's not more logical it's still an opinion presented as fact to me. And given the following quote i'm enclined to think it's an opinion coming from not having the full picture.
tsen wrote: ↑
Thu May 09, 2024 6:04 pm
Sure, but is there any reason anyone would want all of these things?
To entertain themselves trying to achieve a more efficient system than just using a simple generic blueprint they found on the internet because the game now has room for min maxing beacons which was something people did with mods already, and such possibilities have been expanded judging from the FFF ;)

XT-248
Fast Inserter
Fast Inserter
Posts: 132
Joined: Sun Jan 29, 2023 4:24 am
Contact:

Re: Friday Facts #409 - Diminishing beacons

Post by XT-248 »

I hope you don't mind. I lightly edited your post for clarification on who said what.
tsen wrote: ↑
Thu May 09, 2024 2:35 pm
XT-248 wrote: ↑
Thu May 09, 2024 3:21 am
I went back and looked up the bonus from quality to various items (FFF #375). One thing that stood out was that beacons have lower energy drainage, which may or may not be enough to get me to use them.
Well, you can see in this new post that they're changing it so that quality now makes the beacon transmission stronger and the module effect bigger, so using top quality is now substantially better at doing the things beacons are meant to do - certainly enough to get me to use them.
What I found more interesting from #375 is that speed modules will have a quality malus; if that's bad enough that speed modules will reduce rather than increase production of the desired product overall (ie, it outweighs the speed increase), then I wouldn't have any reason to use bacon at all anywhere I wanted quality... which obviously solves the present question a lot more thoroughly than tweaking the bacon effect.
I had minimum to no reason to use the beacon effect from before. A stronger transmission and a bigger area of transmission don't change much.

Unless I can stack quality modules in beacons to increase the odd of higher Q# end-products. That said, I am not going to worry too much about optimizing based on speculative information.


Also, the bacon effect sounds delicious. ;)



tsen wrote: ↑
Thu May 09, 2024 2:35 pm
XT-248 wrote: ↑
Thu May 09, 2024 3:21 am
green modules for miners.
I mean, you do you, but... why? Put prod mods in there, you get more ore per ore, meaning you get more production from a particular ore patch before you have to move on to the next one... which may be thought of as better or worse, depending on perspective (I get a little bored with no player action needed), but at least it's a tangible benefit. Greens just reduce the energy consumption, but energy's so cheap I never run out of it even with a major nerf on solar mod, and the amount of pollution, which I guess would matter if all the bugs in the county weren't already dead by then (because I got bored and needed something to do).
If your miners are at 0% productivity from research, the productivity module is the way to go.

Once I reach, say, high productivity for miners from research, the extra ore from productivity modules is not going to do much. Once you put productivity modules in place, the energy demand for miners will spike for tiny gains (80% increase in energy demand from a single productivity tier 3 module along with a -15% malus for speed). It is well documented that if you get really high productivity from research (in the middle between two digits and four digits), they often become idle due to the logistic bottleneck, and productivity modules will not do much at this stage.

There is a hidden effect: increasing the energy demand modifier also increases the pollution generated by the machine itself (the efficiency module has the opposite effect on pollution). Miners are one of the worst pollution-offending machines in Factorio, next to Boilers*. Typically, you need hundreds of electric miners and a non-trivial reduction to one of your largest pollution footprints, with three tier-1 efficiency for each miner as being the only drawback. Yes, please!


*It goes something like this: 30 pollutions per minute for a boiler, 10 pollutions per minute for a miner, and the rest are between 6 and 1 pollutions per minute. Without taking into account using productivity or efficiency where applicable.

The typical late-game megabase usually needs hundreds of miners, if not well into thousands. That is 8 less pollution per minute for each miner. The only downside is that I need some red/green circuits to craft three tier-1 efficiency modules for each miner, which is not a bad trade-off since you can stockpile efficiency modules in preparation for a mining outpost expansion.



tsen wrote: ↑
Thu May 09, 2024 2:35 pm
XT-248 wrote: ↑
Thu May 09, 2024 3:21 am
I don't use beacons unless I need higher throughput from speed modules, which I don't often do since you can accomplish the same thing by adding more machines.
Yeah, that is the tradeoff. In the long run, beacons tend to be easier because they just sit there and give passive bonuses. It's possible to run into major throughput issues with them, though, but I've only seen that in modded machines. This kind of gets back to the same question of better or worse, though... given that Factorio's design encourages minimizing the need for player action, but then you have nothing to do. Running around building a bunch of bottom-tier "dumb" factories until you have enough to produce what you want at least fills more time.
The thing is building a beacon base comes with its own trade-off as well.

You must ensure that you already have the necessary throughput to feed those beaconated production lines. Otherwise, they will sit idle, consume considerable energy, and yield nothing in return.


The last time, I did an intensive megabase with beaconated production lines. Beacons were my top number 1 source of energy demand, and a large consideration number of them had no module slot (it's easier to mass-produce beacons than modules, go figure!).


I only did it because I needed to increase my electric circuit consumption (the why doesn't matter in this conversation; just know that was the goal).



tsen wrote: ↑
Thu May 09, 2024 2:35 pm
XT-248 wrote: ↑
Thu May 09, 2024 3:21 am
I might add quality modules to obtain some of the better or more valuable bonuses, but the overall strategy will likely remain the same going into Factorio 2.0.
Well, yes, and that's really my overarching point... it's either one or the other, for any given thing either quality becomes the new meta or the same old applies... which is counter to the assumed goal of adding variation, unless going from all-red to all-white sometimes counts as variation, which is not really how I see it.
I agree.

I only mention quality modules as a possible variation if there is a good reason to get higher quality something.

Otherwise, the overall strategy with usage of modules will likely remain the same.

dominis
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Oct 18, 2018 3:57 pm
Contact:

Re: Friday Facts #409 - Diminishing beacons

Post by dominis »

Is a 1/sqrt(n) lookup table faster than doing the computation directly? Maybe if Lua I guess.

Nidan
Filter Inserter
Filter Inserter
Posts: 252
Joined: Sat Nov 21, 2015 1:40 am
Contact:

Re: Friday Facts #409 - Diminishing beacons

Post by Nidan »

dominis wrote: ↑
Mon May 13, 2024 1:00 am
Is a 1/sqrt(n) lookup table faster than doing the computation directly? Maybe if Lua I guess.
Yes. Only the most simple functions will break even or be faster than a predictable memory load. But more importantly, having it as a table makes it trivially modable.

User avatar
MeduSalem
Smart Inserter
Smart Inserter
Posts: 1564
Joined: Sun Jun 08, 2014 8:13 pm
Contact:

Re: Friday Facts #409 - Diminishing beacons

Post by MeduSalem »

Nidan wrote: ↑
Mon May 13, 2024 7:11 am
dominis wrote: ↑
Mon May 13, 2024 1:00 am
Is a 1/sqrt(n) lookup table faster than doing the computation directly? Maybe if Lua I guess.
Yes. Only the most simple functions will break even or be faster than a predictable memory load. But more importantly, having it as a table makes it trivially modable.
I would rather say it depends. The biggest factor regarding performance of a lookup table for such an application will probably be how often the lookup table actually ends up being used in practice. ^^

In an ideal world with infinite amount of fast-accessible cache being able to pre-calculate as much as possible and only inserting dynamic values on the fly where needed and using lookup tables for everything else would surely beat doing most slower math functions on the fly.

But in practice you have to put slower math functions in comparison to how many cache misses you would get from using a lookup table instead... because cache space is limited. And what is held in cache usually depends on how often it is used; with the least recently used stuff being replaced.


However that is from a hypothetical point of view.
Can't say how much of a performance impact that has for Factorio in this particular case; that is probably what profiling is for. It probably largely depends on how many beacons are being used in a factory which definitely is different for every player and at each stage of the game. But I would assume towards endgame the more beacons that are being used the more it pays off to have it as a lookup table. ^^
But that said I also agree that the big advantage is that the lookup table is mod-friendlier. ^^

pleegwat
Filter Inserter
Filter Inserter
Posts: 275
Joined: Fri May 19, 2017 7:31 pm
Contact:

Re: Friday Facts #409 - Diminishing beacons

Post by pleegwat »

MeduSalem wrote: ↑
Mon May 13, 2024 10:55 am
Nidan wrote: ↑
Mon May 13, 2024 7:11 am
dominis wrote: ↑
Mon May 13, 2024 1:00 am
Is a 1/sqrt(n) lookup table faster than doing the computation directly? Maybe if Lua I guess.
Yes. Only the most simple functions will break even or be faster than a predictable memory load. But more importantly, having it as a table makes it trivially modable.
I would rather say it depends. The biggest factor regarding performance of a lookup table for such an application will probably be how often the lookup table actually ends up being used in practice. ^^

In an ideal world with infinite amount of fast-accessible cache being able to pre-calculate as much as possible and only inserting dynamic values on the fly where needed and using lookup tables for everything else would surely beat doing most slower math functions on the fly.

But in practice you have to put slower math functions in comparison to how many cache misses you would get from using a lookup table instead... because cache space is limited. And what is held in cache usually depends on how often it is used; with the least recently used stuff being replaced.


However that is from a hypothetical point of view.
Can't say how much of a performance impact that has for Factorio in this particular case; that is probably what profiling is for. It probably largely depends on how many beacons are being used in a factory which definitely is different for every player and at each stage of the game. But I would assume towards endgame the more beacons that are being used the more it pays off to have it as a lookup table. ^^
But that said I also agree that the big advantage is that the lookup table is mod-friendlier. ^^
My bet: A square root in C code would likely be faster than a lookup table in C++ code. But the lookup table will be way faster than any callout to LUA, even if the lua function was only returning a constant.

Pinga
Inserter
Inserter
Posts: 42
Joined: Fri Oct 27, 2017 3:59 pm
Contact:

Re: Friday Facts #409 - Diminishing beacons

Post by Pinga »

The beacon FFF mentioned that
using beacons seems restrictive on build variety and tends to feel monotonous and uninteresting
and it showed a picture labeled "8 Beacon build" as an example of this boring and uninteresting setup that feels mandatory at some point. Which I agree wholeheartedly.

A few FFFs later:

Last FFF (#416 Fluids) showed several pictures of 8 beacon as "Endgame setups".

I'm confused. It seems that, even with diminishing, adding the maximum amount of beacons in the smallest space is still the optimal way to play, as demonstrated by you. So help me understand, how exactly will lategame setups in Space Age be any different?

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

Re: Friday Facts #409 - Diminishing beacons

Post by mrvn »

Do I read this right that placing a speed module inside a single beacon has 3 times the effect than placing it in the assembler itself? So in effect one should not place any (speed, efficiency) modules inside assemblers until 8 beacons have been used because that has less of an effect.

Shouldn't the diminishing returns be per module instead of per beacon? And more specifically per module type. So placing a speed and efficiency module into a beacon has the same full effect for both. But placing a second speed module would have a diminishing return.

And with the calculation being done per module this would mean the effect of modules inside assemblers and inside beacons can be combined. This would have several effects:

1) Placing a module inside an assembler or beacon has the same effect, beacons don't suddenly triple the effect of a module.
2) A beacon has less additional effect if the assembler already has a module of the same type.
3) Calculating effects is simpler as one sums up all modules (per type) and then looks into the effect table. Easier to remember that e.g. 5 speed modules will double the speed, 20 will quadruple or something like that.
4) Varying beacon density makes more sense story wise. In the FFF the same beacon effects assemblers differently depending on other beacons. I guess that could be explained by some form of interference. Going per module instead of per beacon the effect isn't dependent on the beacon sending the effect but depends on the assembler recieving (+ local modules). So it's not a matter of the signal transmission breaking down with multiple beacons but simply he ability of the assembler to make the effect happen.

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

Re: Friday Facts #409 - Diminishing beacons

Post by mrvn »

pleegwat wrote: ↑
Mon May 13, 2024 4:48 pm
MeduSalem wrote: ↑
Mon May 13, 2024 10:55 am
Nidan wrote: ↑
Mon May 13, 2024 7:11 am
dominis wrote: ↑
Mon May 13, 2024 1:00 am
Is a 1/sqrt(n) lookup table faster than doing the computation directly? Maybe if Lua I guess.
Yes. Only the most simple functions will break even or be faster than a predictable memory load. But more importantly, having it as a table makes it trivially modable.
I would rather say it depends. The biggest factor regarding performance of a lookup table for such an application will probably be how often the lookup table actually ends up being used in practice. ^^

In an ideal world with infinite amount of fast-accessible cache being able to pre-calculate as much as possible and only inserting dynamic values on the fly where needed and using lookup tables for everything else would surely beat doing most slower math functions on the fly.

But in practice you have to put slower math functions in comparison to how many cache misses you would get from using a lookup table instead... because cache space is limited. And what is held in cache usually depends on how often it is used; with the least recently used stuff being replaced.


However that is from a hypothetical point of view.
Can't say how much of a performance impact that has for Factorio in this particular case; that is probably what profiling is for. It probably largely depends on how many beacons are being used in a factory which definitely is different for every player and at each stage of the game. But I would assume towards endgame the more beacons that are being used the more it pays off to have it as a lookup table. ^^
But that said I also agree that the big advantage is that the lookup table is mod-friendlier. ^^
My bet: A square root in C code would likely be faster than a lookup table in C++ code. But the lookup table will be way faster than any callout to LUA, even if the lua function was only returning a constant.
Note: A square root in C++ code would likely also be faster than a lookup table in C code. Seriously, past the frontend C and C++ are basically identical. They use the same code generators in the compilers and such trivial functions will not have any abstraction layers added by C++ compared to C.

My guess why they use a lookup table is modding. It's trivial to define a table in LUA and transfer that to memory. I'm assuming this is done in data.lua so only ever once. The code then simply looks up the value not caring where it came from. Spinning up the lua instance every time the effect of some module needs to be calculated would be insane. Just switching to LUA once per tick is a serious burden on the game and the reason mods should avoid running every tick.

One alternative to a simple table would be to use memoization. Meaning you call the LUA function the first time some set of values occurs and remember the result. The next time the same values appear you use the remembered value. But then on every use you first have to check if the result already exists in memory. Given a large enough sample base you also just end up with the full table memorized.

That is unless the values would be (number of speed modules, number of productivity modules, number of efficiency modules). With the 3 module counts separate the argument space would be huge and any game would probably only use a few combinations. But would there be much point in having module effects depend on the exact number of each module. Should mods be able to e.g. make speed modules reduce the effect of productivity modules? As in haste makes waste.

Note: you can probably get the same effect by having speed modules carry a -10% productivity effect.

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2318
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Friday Facts #409 - Diminishing beacons

Post by boskid »

I decided to use table because of modding: it makes it trivial because i do not care how complex are the expressions or if they are pre computed by someone in excel or in lua. Those lookups are so rare i could use anything else but given that it would have to be defined in data stage and evaluated at runtime, it would have to be a noise expression and i do not like those for case of known table of coefficients. Also noise expression would take more memory (even if its in range of 2KB) than a simple lookup table even if table has 4x as many coefficients given than any reasonable use case.

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

Re: Friday Facts #409 - Diminishing beacons

Post by mrvn »

boskid wrote: ↑
Wed Sep 04, 2024 7:24 am
I decided to use table because of modding: it makes it trivial because i do not care how complex are the expressions or if they are pre computed by someone in excel or in lua. Those lookups are so rare i could use anything else but given that it would have to be defined in data stage and evaluated at runtime, it would have to be a noise expression and i do not like those for case of known table of coefficients. Also noise expression would take more memory (even if its in range of 2KB) than a simple lookup table even if table has 4x as many coefficients given than any reasonable use case.
*pout* But I want my beacon with 1000000 speed modules. That table will be huge and the noise function just a sqrt(). :lol:

Nidan
Filter Inserter
Filter Inserter
Posts: 252
Joined: Sat Nov 21, 2015 1:40 am
Contact:

Re: Friday Facts #409 - Diminishing beacons

Post by Nidan »

mrvn wrote: ↑
Wed Sep 04, 2024 11:07 pm
*pout* But I want my beacon with 1000000 speed modules. That table will be huge and the noise function just a sqrt(). :lol:
What counts is the number of beacons, not the number of modules inside these beacons.

----------

Which value gets used if you manage to put more beacons around an assembler than there are entries in the table? The last defined one, zero or something else?

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2318
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Friday Facts #409 - Diminishing beacons

Post by boskid »

Last one. Knowing this if you want 0 to be used instead, just add extra 0 at the end of table.

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

Re: Friday Facts #409 - Diminishing beacons

Post by mrvn »

boskid wrote: ↑
Thu Sep 05, 2024 3:31 am
Last one. Knowing this if you want 0 to be used instead, just add extra 0 at the end of table.
That would make it a beacon overload scenario, right? Any chance of getting a warning icon displayed over the factory then?

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2318
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Friday Facts #409 - Diminishing beacons

Post by boskid »

mrvn wrote: ↑
Fri Sep 06, 2024 9:26 pm
That would make it a beacon overload scenario, right? Any chance of getting a warning icon displayed over the factory then?
No, that would be an equivalent of beacons being ignored so the effect receiver would work at its base speed.

Post Reply

Return to β€œNews”