Analysis on the Relative Influence of Daily Luck and buff Luck in The Legend of Starvalley
What is the difference between lucky buff and daily luck in recent times? I had some arguments with my bar friends. Although I use wiki directly to describe luck, wiki does not explain how this data came from. So I'm going to read the source code directly.
Firstly, the lucky model proposed by wiki is introduced.
Simply put, luck is divided into daily luck and buff luck, and each **uff is a random number in [-0. 1, 0. 1]. For some events, both * * * affect the probability of occurrence, and for some events, one of them affects. But Wikipedia says:
An increase of 0.0 1 in daily luck usually means that the possibility of random events increases by about 1%.
A luck gain of+1 means that the probability of a random event is about 1%. Any luck buff is handled separately from daily luck, so the effects of these two kinds of luck will not be automatically the same; The types of events affected by lucky buffs and the degree of influence may be different.
This has several meanings:
For most events, we can apply a simple model:
The first level, every 0.0 1 lucky day, will increase the probability of random events by one 1%.
In the second layer, every 1 buff is lucky, which will increase the probability of random events by one 1%.
The third time, two kinds of luck don't cover each other.
The fourth layer, for the events affected by luck, the influence degree of daily luck and buff luck may be different; On the one hand, it conforms to the meaning of the first layer and the second layer, on the other hand, some events may have additional coefficients to adjust the two lucky influences.
For the events with the influence of additional coefficient adjustment, this post will make a rough analysis of these special cases at the end. The purpose of this post is to prove that the impact ratio of the two is indeed 1 to 100 under non-special circumstances.
Go to github, I'll search the source code directly. You can also decompile with reflector, but I'm too much trouble.
There are probably more than 100 files that I haven't released. I've read about fifty or sixty files that may contain luck keywords. A long document cannot move tens of thousands of lines. After watching me for more than an hour, I feel dizzy.
The first is the most critical evidence.
See the Game 1.cs file, which is updated five days earlier than the version of 1.5.4, so the timeliness can be guaranteed.
In line 8243 of this document, we can see how the daily luck is calculated.
This function can be simplified as min (0. 1, (double) random (- 100,101000).
That is to say, take the smaller value between 0. 1 and (double)random(- 100,101)1000.
(double) indicates that the type of random(- 100, 10 1)/ 1000 is a double-precision floating-point number.
Random(- 100,10/) means to randomly generate a number between-100 and10/.
Except that 1000 is equivalent to randomly selecting a number between -0. 1 and 0.1kloc-0/. At this point, the value of the previous min function can be displayed. Once this number is greater than 0. 10 1, take the smaller of 0. 1 and this number, that is, 0. 1.
In other words, this line actually means that the daily luck is a double-precision floating-point number between -0. 1 and 0. 1, which is exactly the same as the definition on wiki.
See the GameLocation.cs file below, which is also the latest.
See line 1 1606 of this document.
ChanceModfier is a function that quantifies the luck probability of an event. From this function, we can analyze the relative influence of daily luck and buff luck.
ChanceModifier will have some extra items for different functions. This function is about mining and experience, so there will be one more mining level in the expression.
Here ChanceModifer = lucky every day /2.0+buff lucky * 0.001+C.
C is a constant that we don't care about.
Buff luck is always a positive integer, so this effect is one thousandth.
So what is the scope of daily luck? -0. 1 to 0. 1
I can understand the difference here. Meng Xin asked about iridium luck. My understanding of iridium luck (daily luck) is opportunity cost, which means that the distance from the worst to the best luck is due to luck (buff luck is always positive, so there is no such ambiguity). From this point of view, every 0. 1 luck does have 0.05 luck, but this is only the positive half axis; I think the distance between the most unfortunate and the luckiest is called the luckiest, so this value needs to be multiplied by 2, because the origin becomes -0. 1, that is, the probability of each lucky influence every day is 0. 1.
So one is 1 to 0. 1 and the other is 1 to 0.001; The ratio of relative influence is indeed 1 ratio 100.
However, if the luckiest is understood as the distance from the middle luck to the best luck or the distance from the middle to the least belief, then the ratio of influence is 1 50. Personally, I have reservations about this definition, because it is obviously not the length of the largest subinterval that can be found in this interval. For asymmetric intervals, it is counterintuitive to me. But I also think that this definition has merit and is a reasonable explanation; After all, the so-called ridge peak is only an artificial definition. I study computer, and the definition of computer domain number, interval and concept does have preconceived elements.
Although wiki and I have chosen the same definition, this definition does have ambiguity, and even this value is sometimes not 50 or 100.
See line 4 17 of event.cs, which is also the latest.
This line has an item loss rate, which should refer to the probability of item loss after death.
Item loss rate = 0.25-buff lucky * 0.05- lucky every day.
You can see that the relative impact ratio here is 20.
I'm not sure if this refers to a probability, whether it refers to the independence of each item or the independence of all items, or a basic probability but the items interact with each other.
But what is certain is that in any case, if the loss probability of each item is zero, then nothing will be lost.
This will lead to an interesting conclusion. If the daily luck is iridium, Venus or absolutely neutral, then as long as you eat a lollipop (+5buff is luck), the probability of losing items will be greater than or equal to 0. Interested students can try, of course, there is no guarantee that this probability will change when another file is adjusted or called.
Ps: Absolute neutrality is different from neutrality. Absolute neutrality means that the daily luck is exactly 0. Neutrality means that daily luck is a non-zero number between -0.02 and 0.02.
Sometimes this ratio is even smaller, but it is already a marginal special case.
The MineShaft.cs file in the Locations folder is 236 1.
According to the context, it should be behind the layer 130 of the desert mine (or it may be the layer 10, depending on whether the first layer of the desert mine is a mine).
There is a parameter for doubling gems. This parameter is 0.0 1+ daily luck/10+ lucky buff/ 100.
The relative influence rate of the two is as high as 1 to 10, so it is easy to get a misunderstanding here. If lucky buff is so effective, is it effective to superimpose lucky buff for these relatively high proportion of events? Not necessarily, this validity is only relative to each **uff. If the coefficient of multiplication of the two is small, then the influence caused by the two is small. Take this as an example. The lucky buff of iridium+10 still has a poor probability of 12%.