You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed in the fandom page that Borehole will give 1-3 alien alloys for the first visit with some probability. Are the chances of getting either 1, 2 or 3 alien alloys intended to be equal? If yes, the code does not seem to confirm to that.
To elaborate, loot calculation is handled by the following code in events.js:927 var num = Math.floor(Math.random() * (loot.max - loot.min)) + loot.min; Math.random() returns x, a float, where 0 <= x < 1
Since loot.max = 3 and loot.min = 1 for boreholes, we get Math.floor(y) where 0 <= y < 2.
So, num will always be either 1 or 2.
This applies to loot calculation in the entire game.
IMHO, the correct implementation should have been
var num = Math.floor(Math.random() * (loot.max + 1 - loot.min)) + loot.min;
And I could be completely wrong and the game is designed to give only 1-2 alien alloy on the undiscovered visits. :)
The text was updated successfully, but these errors were encountered:
arnablegend
changed the title
Random chance for alien alloys
Equal probabilities for alien alloys in borehole?
Aug 24, 2024
arnablegend
changed the title
Equal probabilities for alien alloys in borehole?
Bug in alien alloy calculation in borehole
Aug 25, 2024
I noticed in the fandom page that
Borehole
will give 1-3 alien alloys for the first visit with some probability. Are the chances of getting either 1, 2 or 3 alien alloys intended to be equal? If yes, the code does not seem to confirm to that.To elaborate, loot calculation is handled by the following code in
events.js:927
var num = Math.floor(Math.random() * (loot.max - loot.min)) + loot.min;
Math.random()
returns x, a float, where0 <= x < 1
Since
loot.max = 3
andloot.min = 1
for boreholes, we getMath.floor(y)
where0 <= y < 2
.So, num will always be either 1 or 2.
This applies to loot calculation in the entire game.
IMHO, the correct implementation should have been
And I could be completely wrong and the game is designed to give only 1-2 alien alloy on the undiscovered visits. :)
The text was updated successfully, but these errors were encountered: