poke-env icon indicating copy to clipboard operation
poke-env copied to clipboard

Is there a way to determine slot conditions within a battle?

Open LostGeorge opened this issue 4 years ago • 4 comments

I am trying to get an RL agent to learn specific team setups, one of which is similar to the gen8ou example you all provide, containing a Sylveon that has Wish. When looking through the code, I can see that the wish move of the Sylveon has the slot_condition "Wish" that characterizes the HP restoration at the end of the next turn. But in that next turn, I'd like my state embedding to be able to determine that there is a pending wish, and I cannot seem to find anywhere in the code that allows me to access the current slot conditions.

I might be missing something obvious, but am wondering if maybe the code just doesn't support this. Thanks.

LostGeorge avatar Dec 01 '21 17:12 LostGeorge

Hey @LostGeorge,

Thanks for opening this issue. I'll look into it.

hsahovic avatar Dec 03 '21 00:12 hsahovic

That's a very good catch. Showdown doesn't send any specific kind of message related to these, and they are currently ignored by poke-env. However, we can infer the list of moves to store as activating a slot_condition from the moves dataset. Would a move_id -> (turn, mon that activated it) dict work for your use case?

Edit: or maybe a Move -> (turn, mon) mapping?

hsahovic avatar Dec 03 '21 01:12 hsahovic

So would this mapping be stored in the battle? That would definitely work for my case.

LostGeorge avatar Dec 03 '21 03:12 LostGeorge

Yes, it would. I'll add it to my todo list; I'll take a look at it over the weekend. Depending on how much work is required, it might be released then or later this month.

hsahovic avatar Dec 03 '21 18:12 hsahovic