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

[Feature Request] Lottery RNG for DPPt/HGSS #114

Open
greenDarkness opened this issue Jul 28, 2020 · 9 comments
Open

[Feature Request] Lottery RNG for DPPt/HGSS #114

greenDarkness opened this issue Jul 28, 2020 · 9 comments

Comments

@greenDarkness
Copy link
Collaborator

For HGSS the beginning lottery number can be obtained by taking the 16 bit High from the 4th frame of a seed, and then converting it from hex to decimal.
image

For DPPt the beginning lottery number can be obtained by taking the 16 bit High from the 2nd frame of a seed, and then converting it from hex to decimal.
image

Would it be possible to search through the 16 bit High of the 2nd or the 4th frame of a seed to see if the number produced matched a possible TID?

@Admiral-Fish
Copy link
Owner

Could you link where you found this, unless you discovered it through testing. I assume it uses the initial seed that is also used to create the TID/SID.

@greenDarkness
Copy link
Collaborator Author

greenDarkness commented Jul 29, 2020

Deece/Bruceman from Discord was who I got the info from; apparently this is common knowledge in the speedrunning community, because there is actually a tool called RaikouSearcher by mkdasher that lets you look for Cyndaquil/Raikou spreads that has a seed which can win the masterball from your OT or Kenya the Spearow. The tool is a little awkward to use due to the speed running jargon, and it doesn't work for Platinum- these are the primary reasons why I suggested the addition to PokeFinder.
And I also believe that is the case, but I'm not certain. I'm gonna try to do some testing later.
https://www.speedrun.com/pkmnhgss/resources
image

@Admiral-Fish
Copy link
Owner

Been a while since I have looked at this. Did you have some kind of vision for what the GUI would look like?

I am not entirely opposed to adding this, I just don't think I know enough to see what the end goal would look like.

@greenDarkness
Copy link
Collaborator Author

Goal for this project:
Create a GUI that uses a provided TID and checks it against a range of seeds using Advance 1 or Advance 3 for DPPt and HGSS respectively.

My vision of the GUI is as follows:
Under Gen 4 tools there would be an additional option called "Lottery".
When "Lottery" is clicked a similar window to "Gen 4 TID/SID" would be produced- except it one only have 1 search field instead of 3.
For the title you could just list it as "Seed Finder", and the below that it would have fields for DPPt/HGSS, TID, Year, Min Delay, Max Delay, and perhaps even the infinite search. After searching the user would be provided with a list of seeds containing numbers that match the provided TID on Advance 1/3.

@aluminiumAKA
Copy link

I am very much looking forward to adding this feature. It is very useful when I do RTA. Please.

@GimmyTomas
Copy link

GimmyTomas commented Feb 23, 2022

I have details on how the Lottery RNG advances after the first day (example: https://youtu.be/bivayAXdpS0), however I still don't understand how and when seemingly "old" (like ≥months, or so) savefiles seem to re-seed the Lottery RNG at some point. Don't know if you want to add this stuff too.

@HappyLappy1
Copy link

This is known: creating a "group" will set the group seed (that controls lottery) to the current MT state. Joining a group copies the seed of the current group leader to yours. Basically, never join or create a group, and it's based on the seed at save initialization. Also, a modified LCRNG (same mult, add of 0x3039) is used on day 2+ group seed states as a sort of mask for the final lottery number.

@GimmyTomas
Copy link

I am aware of groups, but I am pretty sure that the reseeding happened in savefiles which never joined or created one. I don't have an example right now, but I will post here if I find one.

The phenomenon is visibile on emulator too (DesMuMe with a lua script to check the LID), by the way, under conditions which I haven't fully understood, but seemed to do with changing date enough times.

@HappyLappy1
Copy link

Interesting. I have further questions about this, please reach out to me on discord (happylappy#5231) about this. Definitely want to get a better understanding of this, since it jeopardizes the effectiveness of my group seed SID finding tool.

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

No branches or pull requests

5 participants