[HN Gopher] Porting Zelda Classic to the web
       ___________________________________________________________________
        
       Porting Zelda Classic to the web
        
       Author : MrAwesomeSauce
       Score  : 250 points
       Date   : 2022-05-03 17:29 UTC (5 hours ago)
        
 (HTM) web link (hoten.cc)
 (TXT) w3m dump (hoten.cc)
        
       | HanClinto wrote:
       | Thank you! I had never heard of Zelda Classic before, but I'm
       | also not much of a Windows gamer. Porting it to WASM indeed lets
       | me play this when I wouldn't otherwise -- thank you! Awesome
       | work!!
        
       | birdyrooster wrote:
       | Doesn't load, but its the thought that counts
        
       | swayvil wrote:
       | I assume there will be a world-editor and multiplayer
        
       | 1970-01-01 wrote:
       | This is as awesome as it is illegal :)
       | 
       | God speed to OP.
       | 
       | https://torrentfreak.com/images/storman-judgment.pdf
       | 
       | https://www.documentcloud.org/documents/4615448-Nintendo-Lov...
        
         | throwmeariver1 wrote:
         | I don't believe you read the article there... he ported zquest
         | an engine remake which you can play with your original ie. self
         | ripped Zelda rom.
        
           | 1970-01-01 wrote:
           | "I ported Zelda Classic to the web. You can play it _here_
           | -grab a gamepad if you have one!"
        
             | crtasm wrote:
             | Yep, I thought they'd just include some user made
             | quests/content to showcase the web port but it defaults to
             | loading a replica of NES Zelda.
        
               | hoten wrote:
               | I'm wondering if it could be prudent to at least make the
               | default quest be one of the custom quests. And maybe
               | remove the remakes of the original games (1st, 2nd, and
               | BS Zelda).
               | 
               | For the classic quests that remake original games, they
               | are made in the ZQuest engine so I'm not distributing any
               | ROMs. However, there are some videogame music files which
               | may be ripped from the ROMs (not sure on their
               | origination). And the graphics are obviously taken from
               | the games too.
               | 
               | Although, pretty much every quest uses some sort of
               | copyrighted material (these are fan games after all). Not
               | sure if any of this falls under fair-use.
        
           | [deleted]
        
       | zamadatix wrote:
       | TIL about Zelda Classic which has apparently been around a long
       | time https://www.zeldaclassic.com/development-history/
       | 
       | Very cool port, I like that it tries to integrate it into the
       | browser features instead of calling it a day after compiling. The
       | lack of D-pad support is a bit jarring considering gamepads are
       | supported but it was still very playable.
        
       | joe__f wrote:
       | Oh this is super exciting! I used to be on the dev team for ZC as
       | Joe123 back when I was a teenager, I mostly worked on the
       | scripting language. I left the community about 10 years ago and I
       | haven't seen anything about it since then. It'll be great to have
       | a play on this sometime
        
       | als0 wrote:
       | This is an awesome explanation about how to port a real (and
       | tricky) native project to WASM/Emscripten. Sadly, the game itself
       | seems to crash in Safari after walking around for a bit.
        
         | simion314 wrote:
         | >the game itself seems to crash in Safari after walking around
         | for a bit.
         | 
         | Apple users need to ask Apple to use a tiny bit of their
         | fortune to make it possible for developers to test Safari and
         | Safari Beta on their preferred OS/device, otherwise small
         | projects can't support it.
        
           | als0 wrote:
           | I wholeheartedly agree
        
       | gwbas1c wrote:
       | Awesome!
       | 
       | One very minor suggestion: Can you tell me what keys to use (in
       | the UI)?
       | 
       | I figured out the arrow keys, but I just don't know what keys map
       | to A & B.
        
         | axutio wrote:
         | It seems like Z, X, A, and S are mapped to A, B, L, and R
         | respectively! There's some other information as well in the
         | about panel in the top left.
        
       | MasterScrat wrote:
       | It reminds me: a decade ago, I had the idea of porting Baldur's
       | Gate 2 to the web: http://lumakey.net/labs/battleground/demo1/
       | 
       | I initially played with EMSCRIPTEN as well, starting from GemRB,
       | an open-source reimplementation of the engine. But that was
       | boring, as I wasn't really getting any sense of how things were
       | working under the hood.
       | 
       | So I started reverse-engineering the various file formats (a
       | website called IESDP had most things figured out already) and
       | converting them to PNG, JSON and other web formats. At that point
       | I only knew PHP which made it a pain to work with binary data.
       | Then, I started rebuilding the game from scratch: pathfinding,
       | streaming huge maps using small tiles, animations...
       | 
       | 10 years later, there's still that one single room and single
       | character that were implemented, but it was still fun times.
        
         | hoten wrote:
         | That was literally how I first approached this problem of
         | getting Zelda Classic quests to work in the browser. I had
         | initially failed to port it with Emscripten, so I reverse
         | engineered the quest binary format and started painstakingly
         | recreating the engine in JavaScript [1].
         | 
         | I got pretty far but there would have been years and years of
         | tweaks to get it just right, so I gave up.
         | 
         | [1] https://hoten.cc/quest-maker/play/
        
       | anthk wrote:
       | On sprites, the Fanwor project has some which are lookalike to
       | the ones of the Zelda for the NES.
       | 
       | https://git.tuxfamily.org/fanwor/fanwor.git
        
       | marginalia_nu wrote:
       | I remember about 20 years ago there was a (IIRC) Java Applet-
       | based multiplayer clone of Zelda: A Link to the Past that was
       | sort of a forerunner the to MMORPGs we see today. It changed
       | names to Graal Online because of the lawyers.
       | 
       | Thinking back to it, it was really ahead of its time, not only
       | because it was massively multiplayer, but it had a great level
       | editor and was doing user-created content in the late '90s.
       | 
       | --edit--
       | 
       | Oldest I could find on the wayback machine is from 1999, but
       | that's a later version that was a standalone exe.
       | http://web.archive.org/web/19991012175711/http://graalonline...
       | 
       | --edit 2--
       | 
       | Here's a nice writeup: https://graal.in/t/graal-zelda-online-
       | historical-thread/1420...
        
         | electriclizard wrote:
         | I played Graal for 10+ years, mostly on Valikorlia, but I
         | tossed around Era and Maloria too; I started some time between
         | 2002 and 2005.
         | 
         | But I didn't realize its main website had been taken down, as I
         | was literally on it a few months ago. Did it die completely? I
         | am no longer able to login with the client.
         | 
         | That's too bad. It really was ahead of its time
         | technologically; it's where my programming life got started and
         | I was intimately familiar with graalscript and GS2.
        
         | Arrath wrote:
         | >Here's a nice writeup: link
         | 
         | OP of the writeup: "Goatse" Ah that takes me back.
        
           | marginalia_nu wrote:
           | Our generation's Herodetus will be some random account named
           | xXxPoopFeast420xXx
        
             | na85 wrote:
             | Yeah and historians will pore over the annals of
             | /u/PM_ME_UR_BUTT
        
         | Esther432q wrote:
        
         | rzzzt wrote:
         | I had Graal on a shovelware CD, but back then we didn't have
         | Internet access at home. I could start the client and walk
         | around on some of the maps that were included, occasionally
         | interacting with scripted characters, but mostly just picking
         | up jars and throwing them around. I didn't know any of the back
         | story and no documentation was on the disc, so it turned out to
         | be quite boring after a while :)
         | 
         | Also when you went to sleep in a bed, your body disappeared and
         | only your head remained visible, floating above the pillow. I
         | found it pretty funny for some reason.
         | 
         | Edit: this was the Java version's homepage:
         | http://web.archive.org/web/19990423103617/http://www.cyberjo...
        
         | xwdv wrote:
         | I remember Graal, but where I really sank time in was Era, a
         | modern day mod of Graal. It was so cool, like if Zelda and GTA
         | had a baby. You could get an assortment of weapons, join gangs,
         | get in violent shootouts, I even remember getting blown at a
         | beach house by someone playing a hooker. I think they
         | eventually introduced cars or something. For a middle school
         | kid it was super cool, even though the city was kind of small
         | there was tons of role playing opportunity and emergent
         | gameplay.
         | 
         | Although I'd probably get bored of such a game these days, I'd
         | probably have a lot of fun building it out and watching a
         | community grow from playing it.
         | 
         | I sometimes wondered about the developers who built this game.
         | Maybe they were the age I am now when they wrote it. Is it _my
         | turn_ now to build a game like this for some new younger
         | generation? A circle of life? Eh, I don't know, I feel like
         | kids these days just don't play these kind of games anymore on
         | a PC.
        
           | the_lonely_road wrote:
           | Unfortunately most of the families in my circle that are not
           | in tech don't own computers anymore. They literally just
           | turned the PC off one day and then a few years later
           | unplugged it and put it in a closet to collect dust, with
           | zero chance of ever purchasing another thousand dollar
           | replacement. Their toddlers are amazing at driving
           | tablets/phones though. Who is going to crack the SmartPhone
           | native WoW 2.0?
        
         | micheljansen wrote:
         | Amazingly I had never heard of this! A link to the past was one
         | of the first (and only) first party games I owned on the SNES
         | and I played it until it almost fell apart. A multiplayer
         | version would have been amazing!
        
         | airstrike wrote:
         | Sounds like that story is worth a submission of its own!
        
           | marginalia_nu wrote:
           | There's probably enough material to write a whole article
           | about it. I just thought it was funny how history repeats
           | itself.
        
             | w-ll wrote:
             | There were MUDs and Roguelikes way back. I personally
             | consider Ultima Online is the genesis of modern MMO's
        
               | marginalia_nu wrote:
               | UO is actually roughly the same generation as Graal.
               | There were several of these fairly creative stabs at the
               | problem before WoW came along and really defined what a
               | MMO is.
               | 
               | I think in many way Neverwinter Nights' persistent worlds
               | is another noteworthy entry. They weren't massively
               | multiplayer, but I think more like a cross between
               | Baldur's Gate and a MUD.
        
               | w-ll wrote:
               | UO had a persistent world. It even had real estate, and
               | later fully customizable houses. And the custom server
               | scene had some really crazy stuff as well.
        
               | kbenson wrote:
               | > WoW came along and really defined what a MMO is.
               | 
               | I wouldn't call WoW the first that defined it, or even
               | the first wildly successful one that did. I never played
               | any of them, but EverQuest was huge back in the day. If
               | we are willing to lower the bar of success, there's
               | predecessors to EverQuest as well.
               | 
               | Then again, maybe there's something very different than
               | WoW and EverQuest that I'm not aware of? They seemed
               | pretty similar from the outside.
        
               | marginalia_nu wrote:
               | I don't think WoW did anything particularly new, what it
               | did was completely suck the air out of the room with its
               | runaway success (which also ended up turning a lot of its
               | competition into ghost towns).
               | 
               | Before WoW, there were a lot of different multiplayer
               | games. After WoW, there was almost only WoW and WoW-
               | clones (often down to mimicking the art style).
        
               | mattw2121 wrote:
               | Yes, let's not forget Legends of Kesmai and its
               | predecessor Island of Kesmai.
        
               | harph wrote:
               | I did some scripts for a NWN RP persistent world back
               | when I was a teenager. Great memories
        
               | evandale wrote:
               | I don't think WoW was anywhere close to the first MMO.
               | RuneScape came before it and Tibia came before that.
        
               | outworlder wrote:
               | Ultima Online was actually ahead of its time in many
               | aspects (it sort of still is).
               | 
               | The concept of 'shards' which many MMO games embraced
               | (sometimes not even supporting as many players). Only Eve
               | Online really rejected the idea.
               | 
               | The in-game 'economy', by having player craftable items,
               | done in a way that IMHO was way better than what WoW came
               | up with. It wasn't restricted to crafting. Mages could
               | charge for portals, ditto for healers. There was robbery
               | - you could either demand money or pickpocket people.
               | 
               | Law enforcement was limited to cities and had to be
               | called.
               | 
               | Housing! That was actually in world, not another
               | instance. There was actually a real state market. And
               | scouting for empty spots was a viable 'profession', even
               | if informal.
               | 
               | Full PVP - in fact, I'd say that the non-PVP servers
               | actually caused its demise.
               | 
               | One concept that was not embraced by later MMO games was
               | 'no levels'. Only had skills and attributes. And items
               | were not a big deal. Sure, you could yield a very rare
               | magical sword, but are you really going to risk losing
               | it? Most people would fight with cheap weapons and armor
               | and only take out the special stuff in limited
               | circumstances.
               | 
               | I could go on.
               | 
               | I think there's a modern 'Ultima' game that could be
               | birthed from what Origin came up with decades ago.
        
               | hoten wrote:
               | Funny you should mention UO. I've been working forever to
               | recreate the UO experience (it's called Gridia, you can
               | find links to it on my website). Not too far from being
               | ready, but still a lot of work to be done. Now that I've
               | wrapped up this Zelda Classic project I'll return my
               | focus to Gridia soon.
        
         | Mizza wrote:
         | I have been tinkering on something similar - I had no idea this
         | already existed, and so long ago. Absolutely amazing.
        
         | anyfoo wrote:
         | Sorry, nobody likes to be reminded, but by now that was around
         | 25 years ago, not 20! (I got a little confused when reading
         | because around 2002 the landscape was very different already.)
        
           | marginalia_nu wrote:
           | Well, 20-25 is perhaps a good compromise. It had its glory
           | days around 2000-2001 I think.
        
         | chriswright1664 wrote:
         | I'm Chris Wright, mentioned in the 2nd link. I had the original
         | idea, as the article says I commissioned Stefan to write it for
         | me as I had next to no coding skills back then (apart from HTML
         | and PHP). I ran a fairly successful SNES emulation site (I knew
         | the teams behind Snes9x and Zsnes well) and was looking for a
         | gimmick to boost traffic. Stefan took things off in his own
         | direction with the Graal makeover (we never actually got
         | threatened by Nintendo legal) and we lost touch. There was a
         | house in the game that was 'mine' and credited me with the
         | idea.
         | 
         | Half related fun fact: I was also behind the very first leak of
         | the SNES Starfox 2 ROM onto the web. One of the devs, which I
         | prob shouldn't name (though I think it is common knowledge now)
         | was a fan of the site. He got in touch and we did an exclusive
         | interview and ROM release.
        
           | electriclizard wrote:
           | Hey man. Graal was an intimate part of my life growing up. I
           | had thousands of hours logged on Valikorlia and a few hundred
           | on other playerworlds. It was a good idea. It's where I first
           | started programming; graalscript was my first language.
           | 
           | It's sad to see it go. I really wish we could have a game
           | experience that had the community graal did. There's not much
           | with that level of involvement for players anymore; it's all
           | now downstream of ivory towers and extremely restricted.
        
           | and0 wrote:
           | Seconding graal being hugely formative for me, and I still
           | think of it often.
           | 
           | It was my first real social experience online, and inspired
           | in part the hobby projects that led me into software as a
           | career. Thanks so much :)
        
       | causality0 wrote:
       | Considering how DMCA-happy Nintendo is I'm surprised this is till
       | up.
        
         | evouga wrote:
         | I was the main developer and webmaster of Zelda Classic for
         | several years in the mid-2000s. Nintendo knew about us because
         | disgruntled users reported us in retaliation for forum drama,
         | but they never came after us. Probably because we were never
         | prominent enough for them you care, but we liked to imagine we
         | were protected by someone high up at Nintendo.
        
       | kin wrote:
       | I'm ashamed I haven't heard of Zelda Classic. As a Nintendo
       | fanboy (my github handle is kintendo), I thank you!
       | 
       | Also thank you for this work! When WASM was first announced this
       | is the kind of project that I envisioned we'd see more of.
       | Instead, everything has been mobile-centric and app-centric but
       | you give me hope.
        
         | CyborgCabbage wrote:
         | There is also https://www.neilb.net/n64wasm/ , but you have to
         | bring your own rom.
        
       | popmatrix wrote:
       | Very neat to see this isn't just a re-implementation but provides
       | some modernization by providing extra menus, and persistent
       | storage. Great work. Helps make me feel a little less bad to
       | download multiple MBs for what would otherwise be a small
       | emulator + 64KB ROM :) edit: typo
        
         | BoorishBears wrote:
         | I don't know if you're familiar with Zelda Classic, but it
         | wouldn't be comparable to the 64KB ROM either way
         | 
         | Zelda Classic is a very open ended game engine that happens to
         | have Zelda 1 assets baked in
         | 
         | I recall people making entire Metroidvanias with it
        
         | hoten wrote:
         | Yeah, I thought it was really important to make it a usable as
         | possible. Quest makers can just share a link directly to their
         | quest, and they can get people playing their stuff with zero
         | effort. No driver issues, no downloading and trusting random
         | executables.
        
       | ilaksh wrote:
       | Is there any work to unbundle web assembly applications from the
       | browser? And further, break apart the monolithic web platform API
       | bundle into something like device drivers?
       | 
       | Because let's say you just wanted a 2d game engine using SDL
       | without shaders and using the mouse. Why do we need to drag the
       | entire browser with 1000 APIs and features into it?
       | 
       | Just add something like a framebuffer and mouse input to web
       | assembly. Distribute via IPFS or something.
        
         | hoten wrote:
         | Well, you need some sort of underlying platform to run
         | primitives on. Wasm just isn't enough, and isn't meant to be.
         | 
         | But yes, Wasm is not just for the browser, you can run it in
         | Node. Or a custom runtime: https://wasmer.io/
        
       | bilekas wrote:
       | This is amazing work.. And infact this is the first "Chrome APP"
       | I have allowed to be installed!
       | 
       | >WebGL does not support that, so the entire shader needed to be
       | redesigned
       | 
       | I'm blown away how WebGL has come along. But then theres people
       | like this. Great job!
        
       | kbenson wrote:
       | Wow, the link[1] to the custom games ("Quests") made using the
       | engine shows a lot of things that look fun to play.
       | 
       | 1: https://www.purezc.net/index.php?page=quests&sort=rating
        
       | lelandfe wrote:
       | The site's theme makes code unreadable when the OS color scheme
       | is Light: https://i.imgur.com/2Sduvye.png
       | 
       | This is happening because the CSS uses `prefers-color-scheme`
       | media queries - you can't use those and _also_ have a site theme
       | switcher.
        
         | teach wrote:
         | I guess you and I are the only ones who use a light theme? I
         | _wish_ my eyes were still good enough to read text clearly on a
         | dark theme....
        
         | [deleted]
        
         | hoten wrote:
         | Sorry about that, I'll have to figure out how to wrangle that
         | dependency's CSS.
        
       | tadbit wrote:
       | This reminds me of The Mana World
       | 
       | https://www.themanaworld.org/
       | 
       | An MMORPG based on the game Secret of Mana, started around
       | 2003-2004.
        
       | xahrepap wrote:
       | Zelda Classic holds a special place in my heart.
       | 
       | My older brother downloaded it thinking it was just a Zelda 1
       | clone. I discovered it had a quest editor. And it was a very
       | magical moment for me.
       | 
       | I spent hundreds of hours never completing any of my projects. It
       | was the first online community I ever joined and actively
       | participated in.
       | 
       | Eventually I yearned for for power and discovered Dark Basic. Now
       | I'm a software dev.
       | 
       | Zelda Classic was a major spark in my life. And it's a really
       | cool piece of software. 100% original code, (obviously the
       | default assets are lifted... from another project). It's got to
       | be a 20 year old project at this point.
        
         | 0x20cowboy wrote:
         | Similar story, just a, ahem, few years earlier
         | https://en.wikipedia.org/wiki/Adventure_Construction_Set
         | commodore64 ftw.
         | 
         | Good times.
        
         | BoorishBears wrote:
         | I followed a very similar path: never getting very far in many
         | many different projects I started with it as a kid, but having
         | it serve as a motivator to work with other tools like Dark
         | Basic, GameMaker, RPG Maker, etc.
         | 
         | Almost as instrumental as my dad's Ti 83 Plus in my eventual
         | career path
        
           | xahrepap wrote:
           | GameMaker and RPG Maker just never quite stuck with me the
           | way Zelda Classic did. But my kids are getting to that age
           | where they want to "make games". So I'm hoping something like
           | that would be fun for them.
           | 
           | I remember getting the Ti83+ in High School and trying to
           | make a Snake game. I followed a tutorial, and I barely knew
           | what I was doing. But man, was it fun!
        
         | k__ wrote:
         | Haha, cool!
         | 
         | My developer career also started with gaming.
         | 
         | The StarCraft map/script editor was my entry drug.
        
           | vlunkr wrote:
           | I didn't do actual scripting there, but through the gui you
           | could set up events to happen on various triggers. That
           | really sparked something in me.
        
             | k__ wrote:
             | yes, same for me.
        
           | markus_zhang wrote:
           | Back then I spent a hell lot of time trying to figure out how
           | Blizzard managed to order corsairs to cast spells on certain
           | area. Years later figured out there was an internal
           | functionality not exposed to outsiders.
        
       ___________________________________________________________________
       (page generated 2022-05-03 23:00 UTC)