-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix speed ties #4780
Fix speed ties #4780
Conversation
d8ba6f7
to
d96f4ed
Compare
The doubles test fails, and I think this is because each battler shouldn't have a 50-50 chance of being faster than another. As an example, if battler1's bit says it's faster than battler2 and slower than battler3, but battler2's bit says it's faster than batlter3 then we have 3 > 1 > 2 from the first and 2 > 3 from the second, and that's obviously inconsistent. I think the correct approach would be to generate a number 0..23 which corresponds to the number of permutations of 4 ( |
Pushed a fix for this, which is exactly as described in my message—I generate a number 0..23 and interpret that as the relative order of all four battlers. |
I've un-drafted this. I would like to make the doubles test faster, but I don't think it's possible to do in the test system as it exists rn. My idea is to replace the 24 |
Could 3 different fixed damage moves and a healing move work? |
Oh, that's clever! My gut feeling is that should work 🤔 |
Attackers I think this could work, but I didn't calculate all permutations. |
Any reason we can't merge this? This solves the issue. Also conflicts. I made a new function for ai speed calcs and removed the randomness during a tie but now that there is consistency across the board we should bring it back. Not the function but the speed tie check. I think having the separate function has other benefits. |
Oh, I was working on trying to set up a test that didn't have the massive array of turn orders. |
hm, I feel like we shouldn't hold up a merge because of this since it solves a crucial problem. |
Yea, the test can wait. |
@mrgriffin conflicts 👀 @tertu-m I'll merge it once mgriffin solves conflicts if that's okay |
Resolved! (Hopefully—I only ran the "Turn order" tests locally because it's bedtime 😅) |
For some reason |
I watched the replay and it's very weird—the Ditto uses Toxic on itself (that's probably a difference in the speed ties in the old and new code)... But as far as Toxic goes I would guess what's happening is that Ditto tries to go for Celebrate which would be the first move in its moveset... but the first move is now Toxic due to it transforming. |
Test setup: Turn Possible Outcomes
|
See #4772, this is Alex's suggestion of caching the speed tie-breaks at the start of the turn.