9 ms·
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 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 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.
- strix_varius 4y agoGreat level design!
- deleted 4y ago[deleted]
- petersonh 4y agoVery cool! Love the simplicity of the characters, but smooth animations.
- lioeters 4y agoSo 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.
- peanut_worm 4y agoWow this is really cool. It controls extremely well on a gamepad. This might make me try out game development. Well done!
- daneel_w 4y agoGreat work on such a small footprint, but there's nothing Metroidvania about it. It's just a regular "jump 'n' run" platformer.
- rogerclark 4y agoAfter 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.
- janmarsal 4y agoIf 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.
- shadowfoxx 4y agoI wouldn't say it was a negative comment but I also wouldn't say the comment's assessment was correct. "Nothing Metroidvania about it" is plainly false. "Typical run and jump platformer"... wouldn't agree there, either. This is closer to Metroid or Castlevania than say, Donkey Kong or Super Mario. Even the atmosphere. It had - dark themes, 'creepy, dungeon' music, Skeletons, Spike traps, Spiders, and the Map screen we've seen since SOTN. Lastly, you can start a comment however you like that doesn't make the comment that way. I could say, "Great work! For a worthless pile of garbage like yourself" and I don't think anyone could argue that because I started off my saying, 'Great work' that the comment was positive, maybe that it was supportive! (But again, I don't think the comment was negative, no matter how much I disagree with it)
- daneel_w 4y agoNo negative intention. It's just an observation.
- j_leboulanger 4y agoNot working on Safari
- arikgalactic 4y agoOnly tested in Chrome + Edge + Firefox. I'll look in to Safari and report back!
- kemayo 4y agoIt 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 https://imgur.com/a/1PNTW7E
- hombre_fatal 4y agoYeah, here's the place I got "teleported" to: https://i.imgur.com/rI5rPiX.png https://i.imgur.com/rI5rPiX.png
- aidenn0 4y agoAs a comparison, a zstd compressed copy of the US Metroid ROM comes out at 59781 bytes. Castlevania comes out at 71237 bytes.
- peanut_worm 4y agoJS is an interpreted language that isn't really a fair comparison
- beagle3 4y agoIt actually is a fine comparison. At ~140 chars on a browser, JS can do this: https://www.dwitter.net/d/26107 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 https://www.dwitter.net/top/year top section to get more example of "demos that fit in a twit".
- peanut_worm 4y agoSo 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 4y agoWhile 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.
- beagle3 4y agoMy point is that code density is code density regardless of underlying CPU, programming language, and libraries - up to a constant (bounded above by size of an emulator and said libraries). That’s actually very rigorously defined for those who care - and has a lot of implication. The rabbit hole starts with “algorithmic complexity” also known as “Kolmogorov complexity”. The constants matter. It may be harder to get an impressive dwitter style output from bare NES or C64, but there a 32, 64, 128 and 256 byte demo “micro scene” for c64 and DOS that pumps out very impressive stuff for the size - some that would even be impressive on dwitter. Most NES code is tight (due to constraints). Most JS code is not (there are essentially no constraints) but that’s not inherent, as is shown with demos and proven by kolmogorov solomonoff and chaitin.
- yesimahuman 4y agoVery smooth animations. Impressive work. Are we about to see a bunch of serious web/JS games coming (with Vampire Survivors paving the way?)
- Maphistow 4y agoCrosscode was amazing and is a pure JS/canvas game. I dunno I've fiddled a bit with some engines, but the tooling/docs are pretty lackluster compared to unity/godot
- aroman 4y agothe main challenges facing web games are: 1. hard to monetize 2. lack of mature tooling (Unreal dropped Web support, Unity pretty much has just 1 FTE maintaining WebGL support, and Godot is still catching up) 3. mobile UX sucks (try playing a game in Safari on iOS) not to say it isn't possible to make really cool games on the web. and some have been quite successful recently, like FNF. but it's a verrrrry tiny slice of the overall games market, and has been shrinking over time since the death of flash and the rise of mobile
- lxe 4y agoHight quality stuff, especially the animations.
- jbverschoor 4y agoThat was fun :) spent 38minutes.. 571 bones left, 8 dead Too many buttons IMO for a keyboard
- nonethewiser 4y agoI found j,k,l and n very comfortable (layout 2). I don't really play video games either.
- arikgalactic 4y agoHuge thanks to the itch.io community for recommending this second layout. Glad you found it comfortable.
- nextaccountic 4y agoThe character controls and animation feel satisfying
- mod 4y agoAgree, movement was really nice. On controller would be slightly better.
- lifthrasiir 4y agoSee also https://js13kgames.com/entries/2022 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.
- hypertexthero 4y agoLovely work, especially the feeling of the controls and smooth movement! And I like how the main character looks like a fox!
- hollowturtle 4y agoDamn it doesn't even use WebGL context, just plain canvas 2d drawing api, congrats to the dev, great job
- nonethewiser 4y agoIs this something that web assembly could actually do well?
- iainmerrick 4y agoWhat would you want it to do differently from the JavaScript here?
- johnfn 4y agoIf 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 4y agoBut seriously, why is that?
- deleted 4y ago[deleted]
- solumunus 4y agoI assume the code is 13kb but loads external assets like image/audio.
- filleduchaos 4y agoThat is not permitted in JS13K, no.
- arikgalactic 4y ago1. The WebAudio api requires user interaction to allow playing audio. The main menu saying "press any key" is intended to trigger that. 2. One WebAudio is ready to use, I build all the sound effects procedurally. There's 13 SFX and 3.5 minutes of music that need to be generated! This takes about 5-6 seconds total to churn through all the math used to build the audio buffers.
- jordemort 4y agoI'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 4y agoand to move horizontally a bit too
- sgarman 4y agoIn my limited testing I wasn't able to get much more distance vertically. I did try to abuse it to sequence break but wasn't successful. There was an early part to the left where if I could get it to work reminded me of a popular sequence break in hollow knight. Maybe an homage?
- bil7 4y agocool as FUCK!!! this is awesome!! bones: 499 time: 59.15 deaths: 7 took a few short breaks
- bil7 4y agobest speedrun: 8:46, 3 deaths
- gkTyM2B8V7R5qF8 4y ago- Actually 180KB (src/ only; 344K for everything except .git) - As served it requires 950KB, which compress down to 396KB???
- chrismorgan 4y agoBroken in Firefox under Linux, “TypeError: navigator.getGamepads is not a function”.
- thristian 4y agoIt's working for me on Firefox Nightly, but I do have a gamepad.
- chrismorgan 4y agoHmm… seems like I had dom.gamepad.enabled set to false, which is not the default value. I don’t recall ever touching it. ¯\_(ツ)_/¯
- karpovv-boris 4y agoLove this Ori!
- RulerOf 4y agoImpressive technically, with very smooth and intuitive movement. I would prefer to see a key legend that I have to close. "Figure shit out yourself" when I've got a hundred keys to choose from is... not good. Gameplay was frustrating. I kept taking damage from stupid things like spikes but never found energy pickups. After I made my fourth or fifth movement mistake and took significant penalties for it each time (bones scatter when dying but upon my return they were not there to pick up), I did not want to continue playing.
- worthless-trash 4y agoI give some counter feedback from someone with some platform experience. The keys were obvious from the start, the right hand swipe was one of the first keys i accidentally mashed. The logic was simple, consistent and worked as expected. The dash and swipe mechanisms were untuitive and clear. I'm willing to commit more to 'hard things', but this really wasn't even in the 'hard category', my definition of hard begins at games like the soulsborne series. The penalties were obvious, dont jump on spikey things, dont get hit by enemies. I loved it and wanted to continue playing.
- djmips 4y agoNice I like it! Good work.
- skellyclock 4y agoFell out the bottom of the map There doesn't seem to be a way to kill yourself and go back to a checkpoint
- sergiusignacius 4y agoReally fun and smooth!
- gamescodedogs 4y agoHuge respect for keeping the Demoscene culture alive!
- wgx 4y agoFrom the same competition: this game "Dante" appears to be 3D (or at least pseudo-3D), and has a first person mode too. In 13Kb... mind blowing. https://js13kgames.com/entries/dante https://js13kgames.com/entries/dante
- flykespice 4y agovery good