\

Pokemon Emerald Ported to WebAssembly (100k FPS)

152 points - today at 11:12 AM

Source
  • hawkice

    today at 1:23 PM

    Confirming that saving genuinely works. Interesting stuff. Wonder if we can get trades working too.

      • tripplyons

        today at 2:20 PM

        Yeah, I made sure saving worked correctly

        • ceroxylon

          today at 3:40 PM

          First thing I checked as well! I've been Poke-sniped, there goes a few hours.

      • ianm218

        today at 5:40 PM

        What are considered the best games in WASM? I recently got into playing around with WASM - it would've been great if this technology was prevalent during the Flash games era

          • prinny_

            today at 6:12 PM

            WASM is not for games specifically, it's for anything that needs native performance but also needs to run on the web.

        • weird-eye-issue

          today at 1:46 PM

          I did a Pokémon Crystal playthrough several months ago, still great games!

          I used an emulator on my laptop with increased speed so it made everything like walking and combat way faster which was really nice and I probably would have given up if it wasn't for that

            • nosioptar

              today at 5:49 PM

              I use the cheat engine in zsnes to get rid of the grinding in final fantasy games.

              I find it improves the game when I don't have to spend a bunch of time leveling up or earning gold for equipment.

          • Navaie

            today at 5:37 PM

            Crashed when using a potion vs May :(

            • Luc

              today at 1:21 PM

              https://github.com/tripplyons/pokeemerald-wasm/

                • fc417fc802

                  today at 1:43 PM

                  How long until this is DMCA'd? How has the project it's based on stuck around for so long? Do I perhaps misunderstand what this is? https://github.com/pret/pokeemerald

                    • orlp

                      today at 5:40 PM

                      Copyright being as long as it is is a theft of our culture. I (and many of our generation) grew up with Pokemon, it's a common experience for many of us. A classic of our culture. Except we're not allowed to use it, remix it, build our own versions, etc. We still do, of course, but it's all illegal.

                      It didn't used to be this way.

                      I think 20-30 years of copyright should be plenty to extract whatever profits you deserve from the fruits of your labor. Anything beyond that is just holding culture hostage for the benefit of a few. It doesn't serve society in any meaningful way.

                      • mathgeek

                        today at 1:50 PM

                        It's a port of a disassembly that requires you to provide your own ROM. The legality of such things is a tangled web that anyone producing them needs to navigate very, very carefully.

                          • yw3410

                            today at 2:11 PM

                            Interesting; but the GitHub project linked seems to have the original animations from the ROM.

                              • mathgeek

                                today at 2:20 PM

                                It's mostly argued around or against the application of fair use. I suggest consulting a lawyer if you're truly interested, as it quickly gets into legalese around what constitutes ownership, distribution, etc. Throw in a lack of extensive case law and you quickly get into opinions rather than legal bases.

                                • derefr

                                  today at 4:59 PM

                                  I get the sense that these disassembly/decompilation projects believe that some types of IP-laden asset data can be shipped embedded into the project — not necessarily "legally", but in that they'll likely get away with doing so indefinitely — as long as:

                                  1. those assets are stored in proprietary formats that only the game code itself understands, and

                                  2. no tool exists in the project to extract the assets from these proprietary formats into open formats, unless that tool itself exists only in source-code form in the codebase, and requires the ROM as an input to compile it (even if in the case of such a tool, the ROM is doing nothing but serving as a "key" to unlock compilation.)

                                  Basically, if you have to prove you have your own copy of the IP in order to make their embedded copy of the IP "legible", then it's very hard to construct an evidence-based DMCA takedown order that actually makes any coherent point about the project "distributing" said IP.

                                  That being said, shipping assets like this at all, even if you "can get away with it", is ultimately just a kind of laziness / shortcut-taking. They do it because there's either no clear/simple/obvious way to automatically extract the given asset data from the ROM (e.g. because the relevant data is split up into various data planes + metadata bits that are stored "exploded" all over the ROM), so they just did it once by hand, committing the results; or because there's no clear/simple/obvious way to store the extracted asset data such that a regular compiler/assembler natively understands how to embed it into the binary in the particular form it was found in the original ROM. (Remember, re-assembling/compiling to the original ROM is always the test these projects use to ensure their disassembly/decompilation is preserving semantics. So they need to replicate every weird layout quirk the original dev tooling imposed upon the original ROM. And sometimes the original dev tooling included special-purpose domain-specific asset-codegen tools that aren't part of regular compiler toolchains.)

                                  What these projects should actually be doing, is taking on the schlep: writing the extract tooling anyway, even if it's just "copy these bytes from here and these bytes from there, and spit them out as hex in an .asm file with this header"; and/or writing matching asset-codegen tooling to the tooling that likely existed in the platform SDK, to run before compile/assemble time, converting the extracted ROM asset files into a form (probably a bunch of little assembly files) that will land in the right places when linked back together to form the original ROM.

                                  And, to be clear, they mostly do do this! These projects are very good at doing this!

                                  But sometimes — especially on a larger project with many contributors — one or two things like this aren't audited properly, and fall through the cracks. Or they start out as temporary "bootstrap" approaches made during a private phase of development to get things working + compiling to a correct image; and then not all of those get cleaned up before the repo gets made public.

                              • Lplololopo

                                today at 4:42 PM

                                How is this a port which requires you to provide my own ROM?

                                  • giancarlostoro

                                    today at 5:23 PM

                                    Its not requiring you to provide your own ROM so this demo very sell could get DMCAd but Nintendo layers are surprisingly asleep.

                            • oompydoompy74

                              today at 3:23 PM

                              I’m of the opinion that projects like this should start hosting Forgejo instances in countries with favorable laws and just mirroring to Github for exposure.

                    • wild_pointer

                      today at 4:45 PM

                      There should be 2 options for speed, regular and sped up. Then there should be a key to speed the game up. When I was a kid, it was the space key for GBA. You could have the normal game and skip the boring parts fast.

                      • firefax

                        today at 2:50 PM

                        Why Emerald -- is classic already done?

                        If anyone has emulator suggestions, I recently attempted a playthrough and found that midway through my copy of red, the game was corrupted? Oddest thing -- hadn't reading the point where you do the "Missingno trick" near cinnebar.

                        Anyways, I suspect the save got corrupted somehow but it made me swear off emulation and try a physical copy. (Which had the battery I replaced fail... it's been a comedy of errors).

                          • jeremyloy_wt

                            today at 4:08 PM

                            Emerald is well regarded as the best of Generation 3, which is the final of the traditional 2D games and can trade with Fire Red/Leaf Green (remakes of the classic)

                            So you have available all of the original Pokémon

                            • tripplyons

                              today at 4:27 PM

                              I chose Pokemon Emerald because it is my favorite of the games that have been disassembled!

                              • giancarlostoro

                                today at 5:25 PM

                                Maybe the internal battery died. I honestly recommend you look at GBC style handhelds or if you like the GBA style, Anbernic made one that looks insanely close to a GBA.

                                There also a craze of DS style emulators popping up. They all give you comfort knowing that your saves will be fine forever if you back them up, even if the device dies.

                                • patrickcorrigan

                                  today at 2:59 PM

                                  Try https://afterplay.io it’s cross platform, saves every 20 seconds and keeps your last 50 saves which you can recover from if anything goes wrong

                              • gobdovan

                                today at 1:45 PM

                                Any way to get sound?

                                  • tripplyons

                                    today at 1:55 PM

                                    I have not added that yet, but it would probably be quite easy to throw a few prompts to Codex to do so.

                                • oceansky

                                  today at 1:44 PM

                                  Next step: 100% browser javascript pokémon emerald.

                                    • vorticalbox

                                      today at 5:23 PM

                                      New LLM benchmark?

                                  • dmitrygr

                                    today at 1:10 PM

                                    Ok. So what’s interesting here, presumably, is that this isn’t a wasm GBA emulator (which also exist and work). This is the game itself compiled to wasm. Even though no official source code was ever published, there was a community based decompilation.

                                      • tripplyons

                                        today at 1:55 PM

                                        Yes, it a recompilation of a community decompilation!

                                    • danielrmay

                                      today at 2:46 PM

                                      Super neat. I'd love to see what it would be like to play with more modern &intuitive touch controls instead of just the D-pad and A/B.

                                      • eigenspace

                                        today at 12:28 PM

                                        Very cool. Too bad this doesnt seem to work as a PWA, or am I jusr missing the button on Android Firefox?

                                          • ameliaquining

                                            today at 1:54 PM

                                            You could send a PR. It's reasonably straightforward to add a manifest to make the app installable (https://developer.mozilla.org/en-US/docs/Web/Progressive_web...), and to use Workbox to make it work offline since it's fully static (https://developer.chrome.com/docs/workbox).

                                            The one caveat is that a PWA needs an icon but the project doesn't currently have one, so you'd have to design, find, or LLM-generate one.

                                            • parasti

                                              today at 1:38 PM

                                              You have to use "Add to home" menu item on Firefox for Android. But this web app doesn't seem to be a PWA.

                                          • deadbabe

                                            today at 4:41 PM

                                            What kind of mods and new features could be added?

                                            • Innittech

                                              today at 3:03 PM

                                              29 FPS for me, what hardware are you using to get a hundred thousand FPS?

                                                • _vertigo

                                                  today at 3:27 PM

                                                  iPhone 13. Did you change the slider at the bottom?

                                                    • Innittech

                                                      today at 4:40 PM

                                                      Yeah, just found that. Now I'm getting 3000+FPS on my ancient Thinkpad T520.

                                              • itsthecourier

                                                today at 1:34 PM

                                                some weeks ago I made a Gameboy emulator from zero in rust and then exported it to wasm

                                                https://holy-lake-f6df.sdreyesg.workers.dev/

                                                took me 3 hours with Opus. Opus knew the whole ISA, clock, bus quirks, etc. from their training without any external docs

                                                  • mathgeek

                                                    today at 1:53 PM

                                                    Likely because all of the external docs were already in its training set.

                                                    • tripplyons

                                                      today at 1:56 PM

                                                      Yes, this project was made in around 15 hours of Codex.

                                                  • zuzululu

                                                    today at 4:37 PM

                                                    Nintendo lawyers intensifi

                                                    • today at 2:02 PM