text
stringlengths
0
1.99k
website and get a credential file + compile mod they add to their emulated
SD card, or their real SD card if they use custom firmware on a switch, and
a custom server would treat them both the same.
Custom servers also have to convince the official client it is legitimate.
All GetUser requests that refer to the current user have to send the same
PID as the user's device ID. But we've already established Ryujinx sends the
same constant for everyone. So to prevent a crash that PID has to be swapped
with `0xcafe`. Another example is GetEndlessModePlayInfo (method 115). This
method is constantly called while in a playthrough of the endless gamemode,
and it is expected to return up to date info about all active endless runs.
Included is all the courses that have been cleared. So calls to
StartEndlessModeCourse, DominateEndlessModeCourse (completing),
PassEndlessModeCourse (skipping), SuspendEndlessMode (exiting) and
FinishEndlessMode (game over) need to record the new status of the endless
run or the client will behave strangely. Number of coins, remaining lives
and other variables must also be kept up-to-date.
Another problem is that the official client only sends a fixed set of
requests. All the server has to work with is what is sent by the client
whenever it wants to send it. Some information we'd like to track, like
replays of every run, isn't sent by the client. StartEndlessModeCourse
(method 110), for example, is the only way the custom server knows if you've
died in a course during an endless playthrough. The same course can only be
started again if the player dies or starts over, which is a death in-game.
Once we have a custom server we can begin playing with the client as a form
of modding. A popular challenge in SMM2 is IronBROS: completing 50 levels in
endless normal (a difficulty) without dying. Can we enforce the no-death
requirement on the server? What we found is we couldn't, the server has no
power to end an endless attempt. Courses are largely completed offline and
stats on the completion sent to the server afterwards, so variables like
number of deaths is tracked clientside. But with a clientside mod, which we
already have to redirect requests to our custom server, we can add our own
functionality.
Something I tried and found success with was a webassembly binary,
uploadable on our website, that would be associated with a level. The
clientside mod would hook a function into a function called at course start
that would download this webassembly and execute it, with a similar hook to
revert the changes. With this courses could have custom mods, like changing
gravity or a different player scale.
Once we own the server we can also begin to see what information is sent by
the official client but locked away forever on the official servers with no
way to query. We knew about the Ninji replay because the official client
queries it to represent it in-game. We also know how to parse it [37]. This
replay stores the position of the player during the run every 4 frames and
in what animation state they were in, so it only exists to play that run
back. There had always been theories of another replay: input replays.
Those replays were likely analyzed to ban players hacking during a run, like
setting the coordinates of the player to the flagpole at the beginning of
the run. We confirmed this did happen: when uploading a course and when
getting a world record on an online course. PreparePostRelationObject
(method 132) is responsible for handling a number of binary blobs posted to
the server, like the thumbnails of uploaded courses and ninji replays, but
enum value 5 (upload) and 6 (wr) correspond to these hypothesized input
replays. And this method is always called shortly before PostPlayResult
(method 96), which is responsible for updating statistics about a course
when a player completes it or dies. After some work I found it was truly an
input replay, just like a Tool Assisted Speedrun, that Nintendo could play
back themselves with a debug client to verify runs [38].
With time this custom server, called OpenCourseWorld [39], became a haven
for creators of "troll" courses, or courses with exploits. With our blanket
policy of no course deletions, our server is now an effective archive for
courses that still want to played by players but do not want to risk the
closing of the feed.
--< 7. A New Era in SMM2
The public API, and the technical research following it, has changed how
players engage with this game left behind by Nintendo. Streamers use course
viewers, primarily one developed by Wizulus [40], to vet what users send
and to skip tiring "little timmy" levels in endless mode. A search engine
for courses, one of those removed features from SMM1, has been created by
regularly topping off a local archive of courses collected from
SearchCoursesLatest and GetCourses, enabling players to find whatever the
in-game filter makes needlessly tedious to find [41]. Teams of players who
had labored by hand searching for particular kinds of levels no longer need
to do so, like the 0% team [42], who used the scrape to get an up to date
list of uncleared levels and boost the team forwards.
Now the game is in a data oriented future. Not hindered by the strict rules
of the feed from Nintendo, players have the freedom to choose new ways to
play. A custom client has entirely transformed this scene.
--< 8. A Bitter Reminder
So what is there to do when the hardware operating the public API, by which
everything else mentioned operates, gets banned? Then our reliance on this
fragile feed, and my loyalty to this kind of work, gets tested.
I know what it feels like because it's happened twice. The first time was
immediately after the scrape in 2022, likely due to test requests I made to
implement new methods. The second time was 2025, as the result of large
scale DAuth changes from system version 20.0.0. Both times I had to buy new
hardware, with the implicit reminder that it was another potential sacrifice
to keep this experience going for all of the players of my favorite game.