Skip to content
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

Togepi Egg from Water Labyrinth can be Method 4 #4404

Open
notblisy opened this issue Dec 17, 2024 · 2 comments
Open

Togepi Egg from Water Labyrinth can be Method 4 #4404

notblisy opened this issue Dec 17, 2024 · 2 comments
Labels

Comments

@notblisy
Copy link

notblisy commented Dec 17, 2024

Describe the problem
Currently PKHeX Marks the Togepi you can receive from the gentleman in the Water Labyrinth as illegal if you get a Method 4 one. However, it is possible to get Method 1 and Method 4 PID Types on it.

To Reproduce
The conditions I used were specific on retail hardware (DS) to ensure I'd get Method 4 with a near 100% guarantee, but it works on mGBA as well.

I had 5 Hariyama in my party with a PID of 5999999B and received the egg on Initial Seed 52D2 frame 40544. (32 bit seed 388A2E32, and a Togepi with a PID 59999995). Provided in the zip is the Togepi I received along with the Hariyama I used.

Method 4 Togepi Squad.zip

Expected behavior
This Togepi specifically is able to be Method 4 because of the way its script works.

https://github.com/pret/pokefirered/blob/2a3e92e10f8353e167874d1d2f6b311560a2a80d/data/maps/FiveIsland_WaterLabyrinth/scripts.inc#L30

The "getpartysize" script command checks the party size by seeing if the species of a Pokemon in a given party slot is "0". By having extreme values for my parties PID, we are able to effect both how long the PID % 24 takes, and the value of said PID % 24, which affects the efficiency of the switch case used to identify substructures.

In short, making these things take a long time allow us to shift when the game is likely to blank to almost guarantee we hit a method 4 togepi.

Screenshots
I've attached screenshots of my PKHeX showing it's illegal. And here is the link to my stream where I verify I hit Method 4. https://youtu.be/c8Qk9QjNvIc?t=15194

M4Togepi1
m4togepi2
m4togepi3

Additional context
I streamed myself doing this entirely on retail, mostly without glitching(I used the clone glitch to get 5 Hariyamas so I only ha
d to manip it once. And I used ACE to change my trainers SID to make the Togepi Shiny. I obviously used RNG Manipulation to guarantee the PIDs I needed.

Despite that, the reason I did this was not to push buttons about some edge case, but because a user in my discord was going through their childhood Fire Red save, and this Togetic flagged illegal for them. So my friend Shao and I did a bit of a deep dive to see if they were lying, or it was possible, since I think the rarity of a non Box RS Mon being able to be method 4 is interesting. I'll also link screenshots of that happening.

Noahtogetic
Noah2

It's worth noting that it's also likely possible to hit Method 1 and Method 4 using similar techniques on the PCNY Wish Eggs (which were thought to be locked to Method 2). But this is just using the scripts that are available to the public, and I'm not sure if those are actual leaked event scripts.

@notblisy notblisy added the bug label Dec 17, 2024
@kwsch
Copy link
Owner

kwsch commented Dec 18, 2024

But this is just using the scripts that are available to the public, and I'm not sure if those are actual leaked event scripts.

Pretty sure those are the real ones.

// Wondercard gifts call the same give egg script as the Hot Springs Wynaut, but the game has a vblank interrupt between PID and IVs (potentially because the script does not lock when starting).
// Removing the vblank interrupt via ROM patch results in the scripts yielding a Method 1 PID/IV, so hopefully it's consistent enough to assume all are just Method 2 and no splits.

Another example of someone obtaining Togepi w/ Method 4:
https://projectpokemon.org/home/forums/topic/57375-pkhex-new-update-legality-errors-contribution-page/page/21/#comment-285162

@kwsch
Copy link
Owner

kwsch commented Dec 18, 2024

For additional context, Gen3 statics have their PID Type matching logic as below:

public bool IsCompatible(PIDType type, PKM pk)
{
var version = pk.Version;
if (version is GameVersion.E)
return type is PIDType.Method_1;
if (version is GameVersion.FR or GameVersion.LG)
return Roaming ? IsRoamerPIDIV(type, pk) : type is PIDType.Method_1;
// RS, roamer glitch && RSBox s/w emulation => method 4 available
return Roaming ? IsRoamerPIDIV(type, pk) : type is (PIDType.Method_1 or PIDType.Method_4);
}

Since RS Box's emulation is "legal", it results in the laggy-Method4 spreads being possible.

Is there a rough/specific PID threshold to compare to for this Togepi encounter? Or is the only requirement having 5 high PIDs? Since Method 4 is ABC-E, I don't think it's able to be slowed further to yield Method 2 for this encounter.

In the context of Wish gifts, should be straightforward to check via single-party zero PID (and get a low PID gift?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants