Bug Reports v3 [READ ORIGINAL POST before posting]

Status
Not open for further replies.

Merritt

no comment
is a Tournament Directoris a Site Content Manageris a Member of Senior Staffis a Community Contributoris a Contributor to Smogonis a Top Dedicated Tournament Host
Head TD
https://replay.pokemonshowdown.com/gen1ou-922163873
RBY speed stats are weird Turn 16 my jynx is slower than lax and from turn 61 on my lax is slower than his paralyzed chansey. Or did we miss something?
Rest in Gen 1 only clears the status, not the stat drop until the Pokemon switches out, so both Jynx and Snorlax were acting at 1/4th speed still due to not having switched out after clearing their paralysis with Rest.
 
I've looked over and tested the code that generates random teams (in data/random-teams.js) and figured out why this happens, but I'm not sure exactly how it should be fixed. It's a combination of three things:
  • This is the main problem. Here's the distribution of Ice-types in tiers:
    Uber: Arceus-Ice, Kyurem-W
    OU: Kyurem-B
    UUBL: Ninetales-Alola, Weavile
    UU: Mamoswine
    RUBL: Kyurem
    RU: Cloyster
    NUBL: Vanilluxe
    NU: (megas or NFEs, which aren't in the team generation algorithm; Cryogonal dropped recently)
    PUBL: None
    PU: [a bunch]
    (PU): [a bunch]
    Ice-types are heavily concentrated in PU and (PU) tiers. Here's the code (lines 1766-1771, plus 1833) that limits a team to only so many Pokemon per tier:
    JavaScript:
    //Limit two Pokemon per tier
    if (!tierCount[tier]) {
        tierCount[tier] = 1;
    } else if (tierCount[tier] > 1) {
        continue;
    }
    JavaScript:
    tierCount[tier]++;
    It claims to limit to two Pokemon per tier, but actually limits to 1 since the appropriate entry in tierCount becomes 2 after a Pokemon gets accepted. Not sure if the comment or the code is wrong; if it's the code, just initialize the entry in tierCount to 0 instead of 1 to fix it:
    JavaScript:
    //Limit two Pokemon per tier
    if (!tierCount[tier]) {
        tierCount[tier] = 0;
    } else if (tierCount[tier] > 1) {
        continue;
    }
  • The random team generation, presumably designed for non-Monotype formats, tries to make sure alternate Formes show up about as often as regular Pokemon by randomly rejecting them. For example, the list of Pokemon has both Sandslash and Sandslash-Alola, so to keep Sandslashes from showing up twice as often as other Pokemon, it automatically rejects Sandslash and Sandslash-Alola half the time. The code that does this (lines 1742-1762):
    JavaScript:
    // Adjust rate for species with multiple formes
    switch (template.baseSpecies) {
    case 'Arceus': case 'Silvally':
        if (this.randomChance(17, 18)) continue;
        break;
    case 'Rotom':
        if (this.randomChance(5, 6)) continue;
        break;
    case 'Deoxys': case 'Gourgeist': case 'Oricorio':
        if (this.randomChance(3, 4)) continue;
        break;
    case 'Castform': case 'Kyurem': case 'Lycanroc': case 'Necrozma': case 'Wormadam':
        if (this.randomChance(2, 3)) continue;
        break;
    case 'Basculin': case 'Cherrim': case 'Floette': case 'Giratina': case 'Hoopa': case 'Landorus': case 'Meloetta': case 'Meowstic': case 'Shaymin': case 'Thundurus': case 'Tornadus':
        if (this.randomChance(1, 2)) continue;
        break;
    case 'Dugtrio': case 'Exeggutor': case 'Golem': case 'Greninja': case 'Marowak': case 'Muk': case 'Ninetales': case 'Persian': case 'Raichu': case 'Sandslash': case 'Zygarde':
        if (this.gen >= 7 && this.randomChance(1, 2)) continue;
        break;
    }
    This usually works fine, but you can get unlucky and have all Formes of a species get rejected. That's a problem when those are your only options. For mono-Ice, there's about a 28% chance that the generation randomly rejects Arceus-Ice and all three Kyurems, which are the only Ice-types in Uber, OU, and RUBL.
  • Keeping too many Pokemon on a team from having the same type combination is a good thing. The random team generation limits Monotype teams to two Pokemon with the same type combination. The problem is that Ice's only representation in NUBL, Vanilluxe, is mono-Ice. This means that if the team gets two mono-ice Pokemon (e.g. Cryogonal and Regice) before deciding about Vanilluxe, it'll reject Vanilluxe and thus NUBL. This system works; it's only a problem in combination with the first two things.
When you get unlucky on the second and third issues, the team generator locks itself out of all but 5 tiers to choose from. Since it can only pick one Pokemon from each tier, it can't make a full team of 6.

This can be fixed by fixing the code in the first spoiler so it works as it says it does, but I don't know if that's intended or not. It can also be fixed by adding special exceptions to the second two issues specifically for generating random mono-Ice teams. I'm not sure which one is right.

TL;DR Ice Monotype team generation can hit a bunch of edge cases which result in teams of 5 Pokemon, which can be fixed a few different ways. I don't think it's possible for any other type to have the same problem.
 
Ice Monotype team generation can hit a bunch of edge cases which result in teams of 5 Pokemon, which can be fixed a few different ways. I don't think it's possible for any other type to have the same problem.
Ah yes, these were exactly the same problems I was encountering trying to make past gen Monotype work on ROM. (Worst was Gen 3, where there are very few type combos available for some types at all, so two of each type combo is not enough.) In particular, I wound up rewriting the code that selects the alternate formes to pick each species with at least one valid forme randomly and then pick a random valid forme from that species.
 
Ah yes, these were exactly the same problems I was encountering trying to make past gen Monotype work on ROM. (Worst was Gen 3, where there are very few type combos available for some types at all, so two of each type combo is not enough.) In particular, I wound up rewriting the code that selects the alternate formes to pick each species with at least one valid forme randomly and then pick a random valid forme from that species.
I wrote code that does that, and it fixes the bug. It does make Pokemon with different Formes come up more often in Monotype; the most egregious case is Arceus, which used to show up in about 1% of teams but now is in about 18% of teams (across all types) and a whopping 43% of mono-Ice teams. I don't know if we want that either, and what to do about it if we don't.

Starting at line 1742:
JavaScript:
// Adjust rate for species with multiple formes
switch (template.baseSpecies) {
    case 'Arceus': case 'Silvally':
        if (this.randomChance(17, 18)) continue;
        break;
    case 'Rotom':
        if (this.randomChance(5, 6)) continue;
        break;
    case 'Deoxys': case 'Gourgeist': case 'Oricorio':
        if (this.randomChance(3, 4)) continue;
        break;
    case 'Castform': case 'Kyurem': case 'Lycanroc': case 'Necrozma': case 'Wormadam':
        if (this.randomChance(2, 3)) continue;
        break;
    case 'Basculin': case 'Cherrim': case 'Floette': case 'Giratina': case 'Hoopa': case 'Landorus': case 'Meloetta': case 'Meowstic': case 'Shaymin': case 'Thundurus': case 'Tornadus':
        if (this.randomChance(1, 2)) continue;
        break;
    case 'Dugtrio': case 'Exeggutor': case 'Golem': case 'Greninja': case 'Marowak': case 'Muk': case 'Ninetales': case 'Persian': case 'Raichu': case 'Sandslash': case 'Zygarde':
        if (this.gen >= 7 && this.randomChance(1, 2)) continue;
        break;
}
Inserted at line 1735:
JavaScript:
//Build list of Formes
/**@type {{[k: string]: number}} */
let formesSeen = {};
for (let i = 0; i < pokemonPool.length; i++) {
    let species = this.getTemplate(pokemonPool[i]).baseSpecies;
    if (formesSeen[species]) {
        formesSeen[species]++;
    } else {
        formesSeen[species] = 1;
    }
}
for (var species in formesSeen) {
    if (formesSeen.hasOwnProperty(species)) {
        formesSeen[species] = this.random(1,formesSeen[species]);
    }
}
Replacing the old code:
JavaScript:
// Adjust rate for species with multiple formes
formesSeen[template.baseSpecies]--;
if (formesSeen[template.baseSpecies] != 0) continue;
 
178824


My whimsicott fainted from a flame thrower while behind a substitute.
wasn't sure if it had something to do with the quick claw being used at the same time as my priority move.
 
Future Sight and Doom Desire have properly functioned as their types ever since gen 5.

Since that was a Custom Game, and thus devoid of any legality checks, there's no guarantee that the Shedinjas had Wonder Guard. They never took any other attacks in the entire battle that might have elicited that ability message, after all.
 
In DPP, sleep talk and outrage work in such a way that outrage, if selected, does not lock you in if selected by sleep talk. In a battle I have recently been locked into outrage the turn after sleep talk selected outrage when on that turn shed skin was activated after the sleep talked outrage. I am unsure if this is a glitch or intended.
 
My matchmaking is bugged. I only can face people with rank 1000-1050 in sm ou ladder.

Proves:

  1. FormatEloGXEGlicko-1WLTotal
    User: lto4mtfg
    [Gen 7] OU129072.3%1685 ± 7714115
    Reset W/L
    FormatEloGXEGlicko-1WLTotal
    User: lto4mtfg
    [Gen 7] OU130172.5%1687 ± 7515116
    Reset W/L
    FormatEloGXEGlicko-1WLTotal
    User: lto4mtfg
    [Gen 7] OU129870.7%1669 ± 7117219
    Reset W/L
    FormatEloGXEGlicko-1WLTotal
    User: lto4mtfg
    [Gen 7] OU134772.3%1684 ± 6622224
    Reset W/L
    FormatEloGXEGlicko-1WLTotal
    User: lto4mtfg
    [Gen 7] OU139074.5%1704 ± 6028230
    Reset W/L
    FormatEloGXEGlicko-1WLTotal
    User: lto4mtfg
    [Gen 7] OU139074.5%1704 ± 6028230
    Reset W/L
    FormatEloGXEGlicko-1WLTotal
    User: lto4mtfg
    [Gen 7] OU139874.8%1708 ± 5929231
    Reset W/L
    FormatEloGXEGlicko-1WLTotal
    User: lto4mtfg
    [Gen 7] OU140374.9%1709 ± 5930232
    Reset W/L

    This is normal when you are in 1900 and you face someone with 1700 points or something like that, but not in 1400 and def not at least 14 in a row.
 
A lot of my teams have been getting deleted recently on the desktop app, has this happened to anyone else? I just built four teams, played a game with one, and took a break. Came back and none of the teams were which is bizarre
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 1, Guests: 7)

Top