pk3DS icon indicating copy to clipboard operation
pk3DS copied to clipboard

GetRandomSpecies seems to return 3 of the same value when using oldSpecies = 0

Open mc6415 opened this issue 7 years ago • 4 comments

The GetRandomSpecies function in SpeciesRandomizer.cs seemingly returns the same value whenever the value passed into it is 0, this value is 265, I didn't have a lot of time to look into this unfortunately so I'm not sure what's causing this, I seem to have tracked it down to the GetNewSpecies function in the same file, an example of this is if you pass in 0 when randomizing the starting pokémon you end up getting 3 wurmples every time, this also means that currently when randomizing starters without checking Basic Starter Pokémon you end up with the first gen's starters being all Wurmple. this can be missed if doing it blind currently.

mc6415 avatar Aug 15 '18 01:08 mc6415

I've looked into it a bit further and the problem seems to come from IsSpeciesBSTBad() call on line 235 of SpeciesRandomizer.cs I added a boolean to skip this if it was from the starter randomisation and this seemed to solve the issue.

mc6415 avatar Aug 15 '18 02:08 mc6415

Probably shouldn't be inputting 0 for oldSpecies; looks like it's emitting Wurmple because it is the worst Gen3 species by BST -- that being the closest to entry 0 (which has a BST=0).

kwsch avatar Aug 15 '18 02:08 kwsch

Yeah I thought this might be the case I saw that as the loopctr increased the BST range increased so I'm guessing once it was enough to allow Wurmple with that being the worst it returned that each time.

mc6415 avatar Aug 15 '18 08:08 mc6415

Also to be clear I wasn't inputting the 0 value, the randomizer iterates through an array and starts by using the index value, hence it calling it using oldSpecies as 0.

mc6415 avatar Aug 15 '18 12:08 mc6415