pmariglia / showdown

A Pokemon Showdown Battle Bot written in Python
GNU General Public License v3.0
241 stars 175 forks source link

[Enhancement] Simple tera usage #178

Open wtfseanscool opened 9 months ago

wtfseanscool commented 9 months ago

Can we get something simple like:

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 commented 9 months ago

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:

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 commented 5 months ago

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