[HN Gopher] Show HN: Mini Metroidvania in 13KB of JavaScript
       ___________________________________________________________________
        
       Show HN: Mini Metroidvania in 13KB of JavaScript
        
       As part of the annual JS13K games challenge, I've put together a
       pretty large (but small-in-code) Metroidvania game that fits in
       just 13KB of compressed Javascript.  The source is available here:
       https://github.com/arikwex/infernal-sigil  NOTE: the current head
       of the main branch is at 13.6KB due to quality of life patches. The
       legit 13KB version is tagged in github.  Useful hacks: - Using
       Roadroller (https://github.com/lifthrasiir/roadroller) for
       compression - Compressing the map data as grayscale PNG paired with
       some code generation. - Using procedural animation for all
       characters. - Replacing string enum with numeric enums for
       compression. - Built a small game engine for object lifecycle and
       rendering. - Single function to generate unique procedural songs
       for different regions.
        
       Author : arikgalactic
       Score  : 95 points
       Date   : 2022-09-13 18:25 UTC (4 hours ago)
        
 (HTM) web link (arineonshark.itch.io)
 (TXT) w3m dump (arineonshark.itch.io)
        
       | daneel_w wrote:
       | Great work on such a small footprint, but there's nothing
       | Metroidvania about it. It's just a regular "jump 'n' run"
       | platformer.
        
         | rogerclark wrote:
         | After playing it for 2 minutes there are clearly two kinds of
         | obstacles that could only be surmounted by some kind of
         | enhancement. And there's a Metroid-style grid map you can bring
         | up.
         | 
         | There's nothing useful about this kind of negative comment.
        
           | daneel_w wrote:
           | No negative intention. It's just an observation.
        
           | janmarsal wrote:
           | If the maker wants to advertise his little game as a
           | metroidvania and the first impression is that it seems like a
           | simple platformer then the metroidvanianess isn't obvious
           | enough and there's room for improvement. If you've made the
           | game yourself you can become blind to little things like this
           | and it's very useful that someone points it out.
           | 
           | "Negative comment" my ass. It literally starts with the words
           | "great work". That's a clearly a supportive comment.
        
         | Bigpet wrote:
         | The metroidvania inspirations are pretty clear, it's a large
         | map that you unlock gradually by finding abilities on the map.
         | Including some back-tracking.
         | 
         | What do you think is missing for it to be called a
         | metroidvania?
        
           | daneel_w wrote:
           | The graphics and scenery. It's 13 kilobytes of JavaScript
           | with no bitmapped graphics in it, I know, but if we settle
           | for (as an example) your two very broad strokes of running
           | back and forth and unlocking new areas then hundreds of old
           | NES and SNES games have suddenly become Metroidvania, despite
           | nobody ever branding them as Metroidvania.
           | 
           | I don't mean to come off as a retro-gaming connoisseur, but
           | there's a certain _feel and atmosphere_ to the Metroidvania
           | branding - it 's more than a sub-genre - and it shouldn't be
           | taken lightly.
        
             | kemayo wrote:
             | I'd say that, particularly in modern genre terms,
             | "Metroidvania" refers to a game involving gathering
             | abilities that unlock new areas, with either mandatory or
             | optional-for-bonuses backtracking to previously blocked
             | paths. (This is distinct from just flipping switches or
             | finding keys -- you have to find things that change your
             | character's moveset, and the new capabilities are what let
             | you pass through.)
             | 
             | Non-linearity and ability-acquisition are the only
             | essential elements. There's _often_ platforming, a certain
             | isolation-vibe, and a large single map, but those aren 't
             | mandatory to get the label.
        
             | Bigpet wrote:
             | Hm. I don't know if I'd consider atmosphere part of the
             | genre. But it's missing boss fights which are a pretty core
             | part of the genre I think.
             | 
             | Which other NES or SNES games take place on one continuous
             | map that you backtrack with new abilities to find a way to
             | progress?
             | 
             | Edit: that you wouldn't consider a metroidvania, I mean.
        
               | daneel_w wrote:
               | Zelda, Metal Gear, Wizardry, Faxanadu, Rygar, Ys,
               | Mother/Earth Bound. The list goes on and on. The element
               | of revisiting previous stages/locations to unlock
               | portions you couldn't access earlier on was a basic
               | ingredient of old adventure games.
        
               | hombre_fatal wrote:
               | Well, not so fast.
               | 
               | https://es.wikipedia.org/wiki/Rygar -- genre:
               | metroidvania
               | 
               | https://en.wikipedia.org/wiki/Faxanadu -- wiki categories
               | include metroidvania. style: "like castlevania".
               | 
               | The thing you're also missing is that a
               | {castle,metroid}vania is a 2D side-scroller, so Zelda,
               | Metal Gear, and friends are not.
               | 
               | This kind of "umm actually" stuff is boring.
        
       | yesimahuman wrote:
       | Very smooth animations. Impressive work. Are we about to see a
       | bunch of serious web/JS games coming (with Vampire Survivors
       | paving the way?)
        
       | hypertexthero wrote:
       | Lovely work, especially the feeling of the controls and smooth
       | movement! And I like how the main character looks like a fox!
        
       | jbverschoor wrote:
       | That was fun :) spent 38minutes.. 571 bones left, 8 dead
       | 
       | Too many buttons IMO for a keyboard
        
         | nonethewiser wrote:
         | I found j,k,l and n very comfortable (layout 2). I don't really
         | play video games either.
        
       | nonethewiser wrote:
       | Is this something that web assembly could actually do well?
        
       | mirkodrummer wrote:
       | Damn it doesn't even use WebGL context, just plain canvas 2d
       | drawing api, congrats to the dev, great job
        
       | johnfn wrote:
       | If it's really 13kb, how can there be a loading screen?!?
       | Checkmate!
       | 
       | In seriousness though, this is awesome! I love little
       | metroidvanias. :) And the interactions, like the jump and swipe,
       | feel remarkably satisfying. Great stuff.
        
         | nonethewiser wrote:
         | But seriously, why is that?
        
       | jordemort wrote:
       | I'd like more of this, it was very entertaining. The controls are
       | great.
       | 
       | Tip: You can use the regular attack to slow your descent when
       | falling.
        
         | nonethewiser wrote:
         | and to move horizontally a bit too
        
       | [deleted]
        
       | j_leboulanger wrote:
       | Not working on Safari
        
         | arikgalactic wrote:
         | Only tested in Chrome + Edge + Firefox. I'll look in to Safari
         | and report back!
        
           | kemayo wrote:
           | It semi-works. It launches, loads, says something about
           | wingspan and double jump, then immediately teleports you to a
           | location where you're stuck.
           | 
           | It's all very jumbled: https://imgur.com/a/1PNTW7E
        
             | hombre_fatal wrote:
             | Yeah, here's the place I got "teleported" to:
             | https://i.imgur.com/rI5rPiX.png
        
       | nextaccountic wrote:
       | The character controls and animation feel satisfying
        
       | lioeters wrote:
       | So smooth! Easy to get started, and fun to play. I'll enjoy
       | taking the time to explore the game world. The code is so
       | readable too, I'm learning from reading it.
        
       | lxe wrote:
       | Hight quality stuff, especially the animations.
        
       | aidenn0 wrote:
       | As a comparison, a zstd compressed copy of the US Metroid ROM
       | comes out at 59781 bytes. Castlevania comes out at 71237 bytes.
        
         | peanut_worm wrote:
         | JS is an interpreted language that isn't really a fair
         | comparison
        
           | beagle3 wrote:
           | It actually is a fine comparison. At ~140 chars on a browser,
           | JS can do this: https://www.dwitter.net/d/26107 . That's not
           | idiomatic JavaScript, but then, people had to work hard for
           | the old roms as well.
           | 
           | (I recommend browsing through the
           | https://www.dwitter.net/top/year top section to get more
           | example of "demos that fit in a twit".
        
             | peanut_worm wrote:
             | So since you can abuse eval() in a wacky way, that means JS
             | should be compared to compiled code? I don't understand
             | your point.
        
               | aidenn0 wrote:
               | While we are being pedantic I seriously doubt either
               | Metroid or Castlevania was _compiled_ , given that most
               | NES games were written in 6502[1] assembly.
               | 
               | 1: 6502-ish, it was a clone with the BCD instructions
               | disabled.
        
           | aidenn0 wrote:
           | The NES had a dedicated sprite engine, Javascript has a huge
           | standard library.
           | 
           | Of course it's apples-to-oranges, but surely we can make such
           | non-serious comparisons in a thread about a metroidvania game
           | written for a fun contest?
        
       | peanut_worm wrote:
       | Wow this is really cool. It controls extremely well on a gamepad.
       | This might make me try out game development. Well done!
        
       | bil7 wrote:
       | cool as FUCK!!! this is awesome!!
        
       | petersonh wrote:
       | Very cool! Love the simplicity of the characters, but smooth
       | animations.
        
       | lifthrasiir wrote:
       | See also https://js13kgames.com/entries/2022 for this year's
       | submissions. As always it's great to see so many people making
       | games in so small size.
        
       ___________________________________________________________________
       (page generated 2022-09-13 23:00 UTC)