View Issue Details

IDProjectCategoryView StatusLast Update
0000751Infinitode 2[All Projects] Infinitode 2public2021-05-28 12:57
ReporterAnonymous Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionopen 
PlatformMobileOSAndroidOS VersionAny
Product Version 
Target VersionFixed in Version 
Summary0000751: Base stat generation skips line
Description

when a base generates stat lines, there is a possibility that it will generate less lines than it is supposed to, under specific conditions (see below), and thus in some cases reduces the tier of the base. this only involves bases that generates a "projectile speed" stat line.

Below from EyeBallin':

n3 is the total sum of all probabilities of every single line type. If n3 was scaled down to 1, then each line type's probability would be equal to the percentage chance of them being chosen.
nextInt is the max possible amount of lines for a base - for 70% rarity, it's 7 or 8 (50/50 chance)
array.get(n4).a is the individual chance of a given line. .b is the code that adds it to the base, and .c is whether this line has been chosen already.
Now, let's assume a hypothetical of there being 5 different possible lines, each with a chance of 10. That would mean a total chance of 50, so n3 would be 50.
That would therefore make nextInt2 = random.nextInt(50) = any integer between 0 and 49 inclusive
Say this base had a chance to make 2 lines. First line, random.nextInt(50) just happens to produce 49, the max value.
The inner while loop would keep going until array.get(n4).a + n5 >= 49. We know that array.get(n4).a will always be 10, because all of the 5 different potential lines have a chance of 10.
Ergo, this while loop will keep on going until the very last potential line, where n5 is equal to 40 (thanks to adding the +10 from the other previous 4 lines: 10 x 4 = 40).
10 + 40 is in fact >= 49, so the last of the different lines is added to the base.
Time to add the second line!
By sheer chance, nextInt2 has become equal to 49 again! Very low odds on that happening, but it happened.
So the inner while loop does its thing again until it once again has n5 = 40, as that is the minimum value n5 must be in order to add a new line, and the maximum n5 can be in our hypothetical scenario.
But alas! That puts us at the last line again! We've already added that line before, and array.get(n4).c = true!
So the while loop skips over that line, and... there's no more lines to add. So it just gives up.
Projectile Speed is in fact the last line in the array of all possible lines, so that backs up my analysis
Tl;Dr: The base generation code tried to give the base Projectile Speed twice, but has no failsafe for when it's trying to add a stat that already exists if that stat is the last in the list. A very rare occurrence, but still possible nonetheless

Steps To Reproduce

see above

Additional Information

see above

TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2020-04-22 10:23 Anonymous New Issue
2021-05-28 12:57 administrator Status new => closed