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

[Enhancement] Simple tera usage #178

Open
wtfseanscool opened this issue Oct 18, 2023 · 2 comments
Open

[Enhancement] Simple tera usage #178

wtfseanscool opened this issue Oct 18, 2023 · 2 comments

Comments

@wtfseanscool
Copy link
Contributor

Can we get something simple like:

  • if we can tera
  • and we predict the enemy will use a super-effective move against us
  • and our tera type would negate that
  • and we have a move worth using over switching (modify the eval func to account for possibly tera switch?)
    then use tera?

Seems like it should be simple enough, but I can't figure out exactly where we would place this code, since it needs access to a lot of different information. I was thinking get_payoff_matrix made sense since it has user_options + opp_options, but tera isnt known as a user option so it seems the only way atm to add it without modifying a few of the classes is in format_message, which doesn't really work.

Unrelated, but some potential bugs:
I did run into an issue where amoongus continually used a poison move against an opponents steel type, dont have logs, so maybe it was predicting a switch every turn, and also blissey using seismic toss continuously vs someone who tera'd into ghost (maybe it didnt know they terad?).

Anyways, great project.

@pmariglia
Copy link
Owner

On terastallization in general:

I started a branch where tera+move was considered for each of the available moves. I lost motivation for that because:

  • the bot can only see 2 - 3 turns ahead, so the long-term effects of using tera and the opportunity cost aren't seen well enough
  • the search becomes even slower, as now instead of (normally) 4 moves, there are 8 moves to consider as each move would also need to be considered along with terastallizing (for both sides).

On your particular desire:

It might be possible.

Every time the PokemonShowdown server asks for a request, there is a can_terastallize flag that gets set on the active Pokemon. You can access this in the battle-bot's find_best_move function with self.user.active.can_terastallize.

Whatever logic you want to apply can be done so here, but you will need to change the format_decision function as well.

Unfortunately, my motivation to work on further terastallization mechanics is not very high - it is a very complex mechanic with long-term consequences that cannot realistically be considered with a low depth search bot such as this project

Unrelated potential bugs

As always, it is impossible to say without logs - it could be a bug, or it could be the bot working as intended but being really bad. Would need full logs to see the exact state(s) being considered to know for sure.

@nikqo
Copy link

nikqo commented Jan 26, 2024

On terastallization in general:

I started a branch where tera+move was considered for each of the available moves. I lost motivation for that because:

* the bot can only see 2 - 3 turns ahead, so the long-term effects of using tera and the opportunity cost aren't seen well enough

* the search becomes even slower, as now instead of (normally) 4 moves, there are 8 moves to consider as each move would also need to be considered along with terastallizing (for both sides).

On your particular desire:

It might be possible.

Every time the PokemonShowdown server asks for a request, there is a can_terastallize flag that gets set on the active Pokemon. You can access this in the battle-bot's find_best_move function with self.user.active.can_terastallize.

Whatever logic you want to apply can be done so here, but you will need to change the format_decision function as well.

Unfortunately, my motivation to work on further terastallization mechanics is not very high - it is a very complex mechanic with long-term consequences that cannot realistically be considered with a low depth search bot such as this project

Unrelated potential bugs

As always, it is impossible to say without logs - it could be a bug, or it could be the bot working as intended but being really bad. Would need full logs to see the exact state(s) being considered to know for sure.

might be possible to just add best usage, something like

opponent has 4 pokemon weak to water
my volcarona has the water tera type with tera blast, good usage

or

3 of my pokemon are weak to steel, so i'll terastalize one of them to remove the weakness since the opponent has a lot of steel types/suspected steel moves

either way i created a fork im gonna see if i can do anything like that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants