-
Notifications
You must be signed in to change notification settings - Fork 73
Implement catching strategy in safari for RSE #477
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
Closed
ThibaultLassiaz
wants to merge
1,670
commits into
40Cakes:main
from
ThibaultLassiaz:implement-catching-safari-rse
Closed
Implement catching strategy in safari for RSE #477
ThibaultLassiaz
wants to merge
1,670
commits into
40Cakes:main
from
ThibaultLassiaz:implement-catching-safari-rse
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ach-listener-fire-red Fire Red : Fix TrainerApproachListener
…red-eu-languages Fire Red : Support SGR for EU languages
…bols-mapping Support empty symbol mapping
…er strategy in Wiki (40Cakes#470) Repel works by using the level of the first **non-fainted, non-egg** Pokémon in the player's party. But both Rock Smash and Roamer Reset modes just checked the first party slot. So if the first Pokémon in the party was fainted, it would erroneously still use that for the repel level check. Also, I have updated Rock Smash's Wiki page to advise users to use a Pokémon with the Vital Spirit or Pressure abilities as their first party member, as that gives another +35% boost to encounter rates. This possibility was found by **14flash** on the Discord server and verified through benchmarking.
* Migrate symbol mapping from JSON to YML * Support Daycare mode for JP Fire Red * Refacto symbol reading to work with YML hex
…d-mapping Rearranged Fire Red symbol mapping file & support battle functions
…er-addr Fix zero pointers not overriding default value
This might be a terrible idea. But questions on how to do this have popped up a couple of times, so...
* Support battling modes for FR JP * Update docs for battling modes
7415953
to
1cb420d
Compare
This comment was marked as resolved.
This comment was marked as resolved.
…ner_mode_lfgr_german Support game corner mode on Leaf Green GR
Fix berry blender player offset on R/S
* Test and add support for Sapphire EN & GR modes * Support battling modes for Sapphire EU * Support Puzzle Solver for Sapphire EU * Support Roamer resets for Sapphire EU * Support Rock Smash for Sapphire EU * Support Starters mode for Sapphire EU * Support SGR, SRR for Sapphire EU * Fix map for Sapphire JP * Support Daycare Sapphire JP * Support Berry Blender for Sapphire JP * Support Puzzle Solver for Sapphire JP * Support Feebas for Sapphire JP * Support battling modes for Sapphire JP * Support Starters for Sapphire JP * Support remaining modes for Sapphire JP
* Add files via upload * Add files via upload * Add Wiki entry for EV train mode Add Wiki entry for EV train mode * Update WIKI Update WIKI * Updated to enable surfing --------- Co-authored-by: Tino <[email protected]>
This extracts the bulk of the code shared between EV Train and Level Grind modes: The lookup which Pokémon Centre is closest to a chosen training spot. Having that function might be useful for other modes or features in the future, so separating it out seems sensible. Also, it avoids having two identical data lists (current map vs. potential nearest PCs) so there's no risk of someone updating one but not the other anymore.
…s#605) This adds a check to the EV Train mode to make it stop and switch to manual once the target EVs have been reached. Until now, it would just keep spinning and rejecting every battle. That made it a bit hard to figure out when the mode was actually done. Also, it now checks the land encounter tables for the current map and verifies that at least one of the encounters will yield EVs that are useful towards the target.
The EV train mode shows a table with the lead Pokémon's EVs and their targets after each battle, but this was a bit hard to read since these messages fly by so quickly. I've added some colour-coding (green for targets that have been reached, yellow for in-progress targets, regular font colour for EVs that are not being trained.)
This updates the EV Train mode's battle strategy so it always tries to run away if the lead Pokémon cannot battle. That should avoid adding unwanted EVs to other party members if the user forgot to update their `battle.yml`.
EV Train: Improve battle strategy to never rotate lead, remove dead code, add colours to target table
…kéblocks (40Cakes#607) When using a Pokéblock in R/S, after our block-throwing function has completed the game is already back in the action selection screen. This means that the battle handler will never break out of that `while` loop (which is only meant to run for a single turn) and keeps providing the `decide_turn_in_safari_zone()` function with the battle state that has been generated before the Pokéblock has been thrown. This fix just forces the battle handler to break out of the loop.
This adds pathfinding support for traversing Muddy Slopes upwards using a Mach Bike. Also, fixes two issues: (1) When using the Acro Bike, the bot would sometimes try to access rails from the side due to a logic bug that skipped collision checking. (2) If the bicycle wasn't registered to the `Select` button, using the `mount_bicycle()` utility would hang because it waits for the Start Menu to reappear after using the item. But that does not happen with bicycles.
) There is a brief moment after a battle commenced and before the battle handler callbacks are enabled, where all the conditions for 'we are no longer in a battle' are met. That led to `on_battle_ended()` to be called at the start of a battle (as well as at the end.) This fix just adds another check that the battle has actually started properly before considering to report the battle as done.
1cb420d
to
b2b0a8c
Compare
ThibaultLassiaz
commented
Jan 8, 2025
7145589
to
a20f3e0
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Need to implement re-entering when |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR add support for auto catching in RSE and support for Safari mode in RSE
How flee system works
There's a grade from 0 to 20 for the flee chance, which 0 is 0% and 20 equals 100%.
On the start of a fight the Pokémon flee chance is 3 (15%).
So we can NEVER avoid that flee chance of 15% at the end of the first turn, whatever we do.
Flee chance variation depending on the Pokéblock thrown :
Throwing a liked Pokeblock will get him to -2 (3 - 5). But if the value is negative the game will put the cursor to 1 (5% flee chance). And once it's at 1 it can NEVER go lower.
BUT, if we stat at 3 and we throw a neutral Pokéblock (not liked/disliked) then it can go to zero, and our Pokémon flee chance is now reduce to 0%.
Since we don't read the Pokémon nature to mimic a real user behavior we will follow this pattern :
If the Pokémon's catch rate is higher than 200, throw Safari Balls. Otherwise, we throw the lowest feel Pokéblock (aka a random one).
2a) If the Pokémon is enthralled (escape factor = 0), throw Safari Balls.
2b) If the Pokémon is curious (escape factor = 1), throw Safari Balls.
If we don't have any Pokeblock in our case, just throw balls
Just like FR/LG, if you're using catching modes such as
spin
,fishing
orsweet scent
, the bot will auto catch shinies if yourauto_catch
config is set to true, but will stop if your safari ball counter is less than 15.Safari mode
Safari mode works the same as Safari mode in FR/LG, I just reduced the number of run from 50 to 30.
As we can only have 40 Pokéblocks in our Pokeblock case, and we can use 1-2 Pokéblocks (or 0 depending on the encounter), 30 runs will guarantee that we almost never run out of Pokéblocks when hunting.
Warning
Rock smash mode for Shuckle or geodude (route not implemented) is not supported on safari mode. For Shuckle people will still have to use Rock Smash mode for now, that works on Emerald for every languages.
Safari Mode is supported in all languages for RSE :
Notes
I updated the master sets with Safari mode test states
Checklist
--line-length 120
argument