-
-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate pokemon/nicknames cause issues with available information #415
Comments
After testing a format with Team Preview enabled, I can confirm this issue occurs in formats with Team Preview enabled as well. |
Hi @entropiccode, Thanks for opening this issue. This problem is a known edge case for |
Sure thing. Attached are 3 different versions that demonstrate the various elements with different teams (duplicate Pokemon with no nicknames, duplicate Pokemon with nicknames, different Pokemon with a shared nickname). Creates two bots that will battle against each other. Scripts are designed to run against a locally hosted showdown server but configurable in a variable. I've also added some informational output that can be un-commented to see how the data updates on a turn by turn basis. Probably could be more minimal but I wanted to get something together quickly. |
Thanks @entropiccode ! I'll dive into it next weekend |
I looked into this a bit - it is a bit more work that I feel inclined to put for this feature at this stage. Unless you are interested in implementing this yourself (in which case I'd be happy to give you some pointers) or more interest in formats where this would be required arises, I won't implement this feature for now. |
To be quite honest this was more of a niche bug I discovered while I was testing static bot logic. It doesn't impact too much in most formats, although definitely something that should be improved long term. Issues like #411 are definitely more pressing. |
If an opposing team has two or more of the same species of Pokemon, the information available to a bot starts to become inaccurate.
Example::
I am battling my bot in a 1v1 battle, custom gen9 format with team preview disabled.
The bot is configured to print a number of details every turn, including the "battle.opponent_team" object, using this code:
My team consists of 2 Heliolisk and 1 Pelipper. The Heliolisk are different levels (75 and 100), genders, and one is shiny.
Bot team consists of 1 Mew.
At the start of the battle, I lead with the non-shiny, lower leveled Heliolisk. The opponent team output looks like this:
In the Pokemon Showdown client, my team is represented as a Heliolisk and two pokeballs.
On turn 1, I switch to Pelipper. As turn 2 begins, the opponent team output now looks like this:
In the client, my team is represented as a Heliolisk, a Pelipper, and a pokeball. So far everything lines up.
On turn 2, I switch from Pelipper into the higher level shiny Heliolisk and this is where the issue arises. The showdown client is displaying my team as a Heliolisk, a Pelipper, and a Heliolisk. The opponent team output, however, looks like this:
As a result other information returned is inaccurate. This can be seen further by modifying the code to return the pokemon's level, gender and shiny state as well, like so:
Repeating the above sequence leaves us with this series of outputs:
Turn 1:
Turn 2:
Turn 3:
As you can see, it simply overwrites existing data of the pokemon of the same species instead of treating it as a different member of the opposing team. This causes difficulty when trying to utilize data such as the opponent's ability.
When the pokemon are nicknamed with unique nicknames, the issue seems to go away:
However, if all pokemon on the team share a nickname the issue is even worse, as the first entry in the opponent_team dictionary will always be overwritten with the data of the active opponent Pokemon.
The text was updated successfully, but these errors were encountered: