manny405 / sapai

Super auto pets engine built with reinforment learning training in mind
MIT License
67 stars 21 forks source link

What determines pet ability priority in event of an attack tie? #89

Open jolpica opened 2 years ago

jolpica commented 2 years ago

It is stated that pet priority is determined by health in the event of a tie.

In a versus battle against myself, running these mosquitos over and over always lead to the right-hand mosquito going first

Not sure if this is versus exclusive, or effects arena mode the same, but it seems that health does not prioritise pets at all. Also seems that on attack ties, the outcome is not random as something (maybe player data?) always favours one team over the other. Screenshot_4

Should the health tie-break be removed? (and possibly the random tie-break)?

manny405 commented 2 years ago

You are correct. This was done very early and is obviously not how the game operates.

The health tie-break should be removed and a random tie-break needs to be added. With this change, random-state updating will need to be included so battles can continue to be seeded for a deterministic outcome.

For example: https://github.com/manny405/sapai/blob/8709b8f40ee939c0eb86865b0bcf5328adc6f231/tests/test_effect_queue.py#L226-L246