Skip to content
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

VGC support -- remembering an opponent's team #522

Open
caymansimpson opened this issue Apr 3, 2024 · 6 comments
Open

VGC support -- remembering an opponent's team #522

caymansimpson opened this issue Apr 3, 2024 · 6 comments
Labels
bug Something isn't working enhancement New feature or request question Further information is requested

Comments

@caymansimpson
Copy link
Contributor

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?

@hsahovic
Copy link
Owner

hsahovic commented Apr 4, 2024

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.

@hsahovic hsahovic added bug Something isn't working enhancement New feature or request question Further information is requested labels Apr 4, 2024
@caymansimpson
Copy link
Contributor Author

caymansimpson commented Apr 6, 2024

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:

  1. The 4 pokemon you send out is stored in "team"
  2. Teampreview opponent mons are stored in "opponent_team"

So two clarifications for you that would help me move forward:

  1. 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!
  2. Do you have a preference for what the other variables are named? e.g. team/opponent_team to represent the 4 mons picked, and teampreview_team/opponent_teampreview_team to represent the possibilities (eg all 6 mons)

@hsahovic
Copy link
Owner

hsahovic commented Apr 8, 2024

Ok - I'll get back to you on this one; I need to take a look at what exactly is currently happening.

@caymansimpson
Copy link
Contributor Author

Are you still working on this? If not, if you have opinions on what the naming conventions are, I can implement.

@hsahovic
Copy link
Owner

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.

@caymansimpson
Copy link
Contributor Author

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:

  1. We update battle.team to only return teams that are returned from teampreview. I think in this case, it would also be great to have a battle.teampreview_team for all 6 of the player's mons as well (à la battle.teampreview_opponent_team), since this information will be helpful for the AI to learn how to "trick" opponents by bluffing potential mons in back
  2. We have a separate field like battle.sent_team that tells us which pokemon we send to battle
  3. We don't do anything at all, and just have AIs store/recall this information outside of poke_env

Wdyt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants