-
Notifications
You must be signed in to change notification settings - Fork 43
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
Implement Game Sync #8
Comments
what's news ? and for fixing the Matchmaking of gen5 random matchups ? |
I need lots of free time to do game Sync. Random matchup is an altwfc issue. Send them your packets. https://github.com/polaris-/dwc_network_server_emulator/issues/162 |
Random bump; @mm201 how is the stage of the framework as a whole? |
It'll be done when it's ready. |
What are you planning to do with the whole dream world/ global link stuff then i know you won't replicate it but what are you going to use the gamesync for and what will happen to all the other functions of gamesync will you work with other's to create a way to grow berries and maybe get dream world event pokemon or something like that and do you have any plans for the other global link stuff |
any news ? |
Well ofc not. If there was any news, it'd have been posted 😉 |
How can i help with this ? (im not dev ,dont have any captured packages) |
Could you write up what you do know about the Game Sync protocol? The lay writeups focus on the Dream World (not unreasonable, but unhelpful for our purposes) and I'd be interested to know what uses it can be put to. |
First, the game checks the account status. If it's able to put a pokemon to bed, it first downloads a banlist, then lets you pick a pokemon, then puts it to bed. The put-to-bed request actually uploads the entire savefile to the server. Another possible account status is that the pokemon is dreaming or that it's able to wake up. If you wake it up, the server sends a payload which contains any pokemon or items you brought back with you. Communications happen over https. It's not a gamestats server. There should be other stuff in this payload I haven't had a chance to look at yet, such as trainer's pokemon who visited you and stuff for BW2 join avenue. The neatest thing is that the entire savefile is sent, so this can be used for stuff like bulk IV checking. You should also be able to inject pokemon, which will then appear in the forest to be caught with dream balls, or items. I can't give you detailed specifics, since I haven't figured them out yet and plan on figuring them out by actually implementing it. What I can provide is @polaris- 's toy Game Sync implementation which contains some valuable research he did. |
Wow, that's a lot more exploitable than what I was expecting. Thanks! |
How is the project going? |
Split NAS's DLS1 code
Yo, incase you need any help, I've been doing some research relating to Game Sync. I've built a simple Python server to run GS but that's besides the point. Currently I've found that when a Pokemon isn't currently sleeping in that save, returning anything relating to waking up a Pokemon will tell you that "Game Sync needs to recharge" |
Alright, more research, the form data (I think?) when you respond with |
@zurgeg I hear you're doing some good research! Can I contact you on Discord? |
Yeah, but I prefer GitHub issues for this kinda thing ;) |
@mm201 I figured out some likely key info on
I believe that |
0x1ed is Arceus's Nat Dex number which is ... interesting. It looks pretty clearly like a null-terminated list of up to 10 whatsits involving Pokémon. Possibly the list of Pokémon to send to the Entree? 8 bytes would give us 4 shorts for species, 2 moves, and maybe some additional flags like gender? But I'm not sure why it would care whether the Pokémon is a Unova native or not. 0x289 seems like a more reasonable number to test. |
Odd, afaik Arceus isn't the last guy in the natdex (at least in gen 5). Additionally, PKHeX says that Entree pokemon can only have 1 move? Maybe the additional flags are actually replacing the PID? I know Entree pokemon don't have a PID. |
Heyo, someone else who would be interested in helping out (but not sure how to) here! Took a look at everything mentioned in here so far, as well as the gist shared, and wanted to share my thoughts on it. Please note that I have never played PDW or used the Global Link extensively while it was around, so I might be completely wrong here. Assuming that the gist was based off of the first set of gen V games (this would somewhat explain why the second loop uses the index of the first BW2 exclusive item), it would make sense for the game to check for any non-Unova Pokémon, as they aren't part of the regional dex. My guess is that the game performs an additional check on non-Unova Pokémon to see whether or not the player has obtained the national dex mode in-game, and if not, makes the Pokémon invisible in the Entree Forest (this is also an option in PKHeX) until they do. As for the data itself, my guess is that it's laid out like this:
The DW Pokémon have a set gender, as well as a guaranteed HA (if the Pokémon has one) and cannot be shiny from what I've read, so for these elements, a (partial) personality value would need to be created on the server's side before the transfer occurs (probably within the DW game when the Pokémon was encountered). Hope any of this helps! |
Ah. Perfect! I used up my GS energy yesterday so I should be able to give this a test. I'll edit this once I do. |
Does the problem originate from the Pokémon data parsing specifically, or can it be any of the other sections as well? And is what is described in the gist all that is sent, or is there more data (namely PGL stuff) that is sent in the same response? Supposedly there should be more data that the system receives once a Pokémon wakes up, but I can't find any mention of anything unrelated to the DW apart from the battle competition. Also, would it be possible to share some snippets of the disassembled code that parses the response, or does that go against any rules/guidelines (not familiar with the legal side of these things)? I don't have any experience in the field reverse-engineering, but would like to take a look at it if possible. |
Good question! I haven't taken a look in a debugger since I can't get it to work under melonDS, but I will once I get back to you |
FYI, the answer to why it would care is that there are only a couple Unova pokemon with overworld sprites (Virizon, Reshiram, Zekrom, just to name a few). We also figured out that it comes out to 2-bytes species, 2-bytes move, 1-byte gender, and then some other things we haven't figured out. |
Well, that helped quite a bit given you were actually right about the first 2 values. What a coincidence that a random guess would've gotten us this far! |
Alright, so I made a purely random guess about |
I was mistaken. I coded a basic SAKE server (bounces back a simple XML upon a download request) and now we are connecting to |
Is there a way for me to get involved with this project as far as testing the sending and receiving of save data or anything to do with testing? |
We haven't quite gotten anything up and running for a production ready build, but maybe soon! |
Hi! |
Not really. We don't actually have anything set up for front-end stuff, so basically all that you can do is download a bunch of Blaziken ;) |
@Cowboyjunkie If you're feeling adventurous, you could drop some replay responses into Other than that, just have a bit of patience while I finish up GenIV and move onto this. |
Busted Entralink was an issue with the save I was using fyi. But attempting to load in ----- (or really anything with no overworld sprite) would probably crash. |
Any updates in the past few months? |
Has there been any cool & notable progress that I missed out on? I'm currently at the point where I am able to tuck in and wake up a Pokémon, as well as catch downloaded Pokémon in the Entralink/Dream World. (Although the provided data is far from complete.) I'm currently not very experienced when it comes to reverse engineering DS games (couldn't for the life of me figure out how to debug them in realtime..), but I'd love to share any of my findings with you, should you find them interesting! |
Ooh! We would definitely love to know how savedata.download works. Currently, we're stuck on Pokemon data. All it gives us is a Blaziken, and I've been stuck trying to bruteforce due to GS's cool down. If you need help with RT Debugging, use No$GBA. |
Ahh, I figured out why it wasn't working. I forgot to catch my Blazikens I've been |
You wouldn't mind opening your own repo for this, would you? I'm curious about replicating the same thing on my own computer. |
I would be delighted to take a pull request that gets Game Sync working! If you want to talk more, you should hop on Discord. There should be a current link on https://pkmnclassic.net/ |
atm, DSLink has repos for it. https://github.com/NDSLink/dream-server |
@kuroppoi do you happen to know if this is in big endian or little? I'm p sure that DS uses little but just checking before I use my GS energy for today :P |
Little endian |
Alright, I published all of my findings in a separate repository, so feel free to do with that what you will. |
@polaris- already did some amazing work reverse engineering this; I should be able to do the rest myself.
Note that I have no plans of replicating the original dream world, since that would be a major violation of copyright.
The text was updated successfully, but these errors were encountered: