VGC support -- remembering an opponent's team
Right now, once you enter a battle out of teampreview, there is no way to restore information about what possible mons an opponent had and what could be in back. Having a function in Battle object that remembers the opponent's teampreview team would be helpful! Any thoughts on the naming?
In theory, this should already be implemented. Have you checked that this is not the case in the current release?
If it is indeed missing, I think this should just be stored in opponent_team.
Just confirmed that this is not how this works. If I print out the following in the first turn of VGC (gen9vgc2024regg):
print("My team: \t" + str(battle.team))
print("Oppponent team:\t" + str(battle.opponent_team)) # only what we know
I get:
My team: {'p1: Furret': furret (pokemon object) [Active: False, Status: None], 'p1: Incineroar': incineroar (pokemon object) [Active: False, Status: None], 'p1: Raging Bolt': ragingbolt (pokemon object) [Active: True, Status: None], 'p1: Dragonite': dragonite (pokemon object) [Active: True, Status: None], 'p1: Entei': entei (pokemon object) [Active: False, Status: None], 'p1: Tornadus': tornadus (pokemon object) [Active: False, Status: None]}
Oppponent team: {'p2: Raging Bolt': ragingbolt (pokemon object) [Active: True, Status: None], 'p2: Ogerpon': ogerponhearthflame (pokemon object) [Active: True, Status: None]}
From your comment in Issue #521, it seems you'd rather have the behavior being:
- The 4 pokemon you send out is stored in "team"
- Teampreview opponent mons are stored in "opponent_team"
So two clarifications for you that would help me move forward:
- They seem maybe inconsistent? Like I would expect them to either both represent teampreview teams or what we know of teams sent in battle. Just want to confirm the behavior you'd prefer!
- Do you have a preference for what the other variables are named? e.g.
team/opponent_teamto represent the 4 mons picked, andteampreview_team/opponent_teampreview_teamto represent the possibilities (eg all 6 mons)
Ok - I'll get back to you on this one; I need to take a look at what exactly is currently happening.
Are you still working on this? If not, if you have opinions on what the naming conventions are, I can implement.
In theory, this should already be implemented. Have you checked that this is not the case in the current release? If it is indeed missing, I think this should just be stored in
opponent_team.
I now understand why I thought this was already implemented: there is a private _teampreview_opponent_team property doing exactly what you want.
It is not officially maintained yet, but you can use it. I'll add official support for it in the next release.
The addition of battle.teampreview_opponent_team as a property of battle would be great! The only thing I think is missing is storing the information of the team that we chose to send to battle. Right now, the battle.team attribute holds all 6 mons, but in VGC, only the four we choose matter. When AI will embed the state of the battle, we should be able to know which of the four mons we chose. So there are three options, I think:
- We update
battle.teamto only return teams that are returned from teampreview. I think in this case, it would also be great to have abattle.teampreview_teamfor all 6 of the player's mons as well (à labattle.teampreview_opponent_team), since this information will be helpful for the AI to learn how to "trick" opponents by bluffing potential mons in back - We have a separate field like
battle.sent_teamthat tells us which pokemon we send to battle - We don't do anything at all, and just have AIs store/recall this information outside of poke_env
Wdyt?
This is now supported in poke-env