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

feat(matchmake-extension): Add documentation for Super Smash Bros 4 #35

Merged
merged 3 commits into from
Jan 6, 2025

Conversation

DaniElectra
Copy link
Member

@DaniElectra DaniElectra commented Jan 3, 2025

Resolves #XXX

Changes:

Contains the structures and method requests and responses that I was able to locate inside the code by crossreferencing functions with the retail version of Minecraft, and with help of the type_info tables.

Important notes

Since the functions for extracting and adding signed or unsigned values are indistinguishable from each other, it has been assumed for every value to be unsigned. Keep in mind that this may not be the case, and further research is needed!

There are various instances where it is unknown whether a List<u8> or a Buffer should be used. In those cases a List<u8> is assumed, but this may not be correct.

The fields details are mostly unknown. Only some of them have been filled based on guesses from the method names. The PID is equivalent in code to a Uint32, so there may also be instances of unknown fields which are a Uint32 where a PID is used.

Contains the structures and method requests and responses that I was
able to locate inside the code by crossreferencing functions with the
retail version of Minecraft, and with help of the type_info tables.

Since the functions for extracting and adding signed or unsigned values
are indistinguishable from each other, it has been assumed for every
value to be unsigned. Keep in mind that this may not be the case, and
further research is needed!

There are various instances where it is unknown whether a List<u8> or a
Buffer should be used. In those cases a List<u8> is assumed, but this
may not be correct.

The fields details are mostly unknown. Only some of them have been
filled based on guesses from the method names. The PID is equivalent in
code to a Uint32, so there may also be instances of unknown fields which
are a Uint32 where a PID is used.
@jonbarrow
Copy link
Member

It might be worth adding a "thoughts/notes/whatever" column to the tables here so we can document some things as guesses. We can make some pretty good guesses, and they're probably true (or close enough), but we can't be 100% sure right now

@DaniElectra
Copy link
Member Author

I added a Notes column for all our guesses. I also couldn't resist and looked on the missing function from DataStore GetSharedDataMeta

@jonbarrow
Copy link
Member

I wonder if it's worth looking into the Ranking protocol changes too? SMB4 has custom patches there as well https://nintendo-wiki.pretendo.network/docs/nex/protocols/ranking/super-smash-bros-4

@DaniElectra
Copy link
Member Author

I did check Ranking too, but I couldn't find any references in the code of the functions that would use those methods. Do we know if they are even used?

@jonbarrow
Copy link
Member

@SuperMarioDaBom Have you seen the Ranking methods in any dumps? I know you've been looking at Smash lately

@SuperMarioDaBom
Copy link
Member

I have not been looking for it in network dumps, so I'm not sure. I'll take a look the next time I can.

My expectation would be that there's a bit of Ranking for things such as the GSP, World Report, and Conquests (although Conquests seem to heavily use BOSS so it might not have anything on the NEX side.

Still heavy in the research phase, will update if I find anything new to share.

@jonbarrow
Copy link
Member

jonbarrow commented Jan 6, 2025

Well this sucks, I actually can't find any dumps of Smash that captured GSP. I just poked around a bit in the Discord channel and found nothing for GSP or Power relating to Smash 4 GSP

GSP definitely sounds like it uses Ranking, though. I can't believe we didn't get a single dump of that?

I poked around some For Glory dumps people sent and didn't see any Ranking calls, though

@SuperMarioDaBom
Copy link
Member

Actually, you know what, it could be DataStore. Every time the game disconnects from the server, it makes a request to SendPlayReport. World Play Report is also contained in there. Maybe they switched away from Ranking to that late in development?

@DaniElectra
Copy link
Member Author

DaniElectra commented Jan 6, 2025

Actually, you know what, it could be DataStore. Every time the game disconnects from the server, it makes a request to SendPlayReport. World Play Report is also contained in there. Maybe they switched away from Ranking to that late in development?

That could be the case. I know the Wii Sports Club leaderboard was stored in a DataStore MetaBinary, so I would not discard it

@jonbarrow
Copy link
Member

If they're storing GSP in DataStore I'm killing somebody. According to https://www.ssbwiki.com/Global_Smash_Power GSP uses Elo rankings, which lines up with stuff like matchmaking levels. But this doesn't super line up with how DataStore is used

Unless they went the Super Mario Maker route and create a "maker" ("smasher?" In this case? I guess?) "profile" object just to store stats on using object ratings

In Super Mario Maker this makes a lot more sense imo since you have a ton of stats directly related to your user profile that need to be tracked, so creating a "profile" object and storing stats as ratings makes sense there. But for Smash...? I can see them doing it, but it would be cursed (not that that's stopped N before ig)

@jonbarrow
Copy link
Member

I eat my words, I just checked a dump and one of the first things it does is call DataStoreSmash4::GetFightingPowerChartAll, which returns a List of DataStoreFightingPowerChart objects. These objects contain a List of DataStoreFightingPowerScore objects, which have only 2 fields: score and rank

This sounds like GSP

Thanks Nintendo

@SuperMarioDaBom
Copy link
Member

That is indeed GSP.

I can probably treat it like ranking in the game server, so nbd.

@jonbarrow
Copy link
Member

Good enough for me then. Looks like this stuff is unused. If we decide to document it later, can be in a different PR

@jonbarrow jonbarrow merged commit b89d70a into PretendoNetwork:master Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants