manny405 / sapai

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

Knockout phase should happen before "after attack hurt/faint triggers" #74

Open jimkaal opened 2 years ago

jimkaal commented 2 years ago

https://www.reddit.com/r/superautopets/comments/u06kr7/not_sure_if_rhino_good_or_he_just_got_way_too_far/

Below test gets stuck in a loop, but with debugging you can see that it spawns a chick way before rhino can trigger his knock out ability on the other roosters.

    def test_rhino(self):
        t0 = Team(["rhino"])
        t1 = Team(["rooster","rooster","rooster","rooster","rooster"])
        b = Battle(t0, t1)
        r = b.battle()
        # print(b.battle_history)
        self.assertEqual(r, 0)

Not sure what is causing the loop yet, but it might be fixed by re-ordering the knock out phase.