\

Xs of Y – roguelike that names itself every run. Written in 4kLoC

204 points - last Sunday at 3:32 AM

Source
  • seabass-labrax

    last Wednesday at 8:02 PM

    I killed myself with a flaming spear and the game said this:

    > FATAL ERROR: [program exited] "cannot subtract nil and let-go.lang.Int", :data {:trace ("game-loop (<unknown>)" "game-loop (<unknown>)" "update-world (<unknown>)" "run-until-player-turn (<unknown>)" "creature-turn (<unknown>)" "update-ai-state (<unknown>)" "distance (<unknown>)")}}

    A fatal error indeed!

      • jdiff

        last Wednesday at 11:12 PM

        I got killed by a fire imp and crashed the same way.

        • Fnoord

          yesterday at 3:18 PM

          Oops... Suddenly, the dungeon collapses

          • marcingas

            last Wednesday at 8:07 PM

            Love it :D

        • marcingas

          last Wednesday at 5:44 PM

          Author here! Thanks for posting! This game is written in a Clojure-like programming language I've made. So this is a (B)rogue-like in a Clojure-like :)

          What I think is interesting is that this game computes the entire world state each tick and does so efficiently thanks to persistent data structures.

          To anyone who dared to fire it up: thank you for playing, I'm curious what you think!

            • allknowingfrog

              last Wednesday at 10:10 PM

              I did a quick run on the web version. I was able to sneak attack everything on the first two levels, which felt like a bug, but I'm honestly not sure.

              When I found a spear, I kind of expected to be able to throw it, but I didn't find a throw option anywhere. I think that makes the short sword better in every case, but maybe I missed something.

              Overall, I love the execution. Quality retro fun with a really nice interface.

                • marcingas

                  last Wednesday at 10:25 PM

                  This totally is a bug. Was this recently? I thought I fixed this in WASM version.

                    • allknowingfrog

                      yesterday at 2:26 PM

                      Yeah, this was yesterday in the web version. I only did the one run, and only for a couple of levels, so I don't think I can give you any help reproducing it.

              • jackpirate

                last Wednesday at 6:10 PM

                The name let-go of your programming language is awesome!

                  • marcingas

                    last Wednesday at 6:13 PM

                    Thanks! Please check it out and leave me a star if you like it :)

                • onlyrealcuzzo

                  last Wednesday at 8:47 PM

                  This is awesome!

                  I'm interested in building something similar, any tips besides looking at what you've done and Brogue?

                    • marcingas

                      last Wednesday at 10:07 PM

                      I'd say don't immediately go into making an ECS and don't sweat about perf too much. You can totally do this in any programming language. This is a good talk about roguelike software design in general: https://www.youtube.com/watch?v=JxI3Eu5DPwE

                      Tbh the whole channel is a gold mine of inspiration. Also check: https://discord.gg/bgd2GrhR

                  • biosubterranean

                    last Wednesday at 7:14 PM

                    Little buggy (dying from things not on the screen), but I love the dwarf fortress esque vibes

                      • Oakwhisper

                        last Wednesday at 7:32 PM

                        There was a commit a few minutes ago that fixed the instakills for me

                          • marcingas

                            last Wednesday at 7:36 PM

                            This was caused by a stdlib bug in the language, I bypassed it :D

                    • dgb23

                      yesterday at 11:25 AM

                      I don't think you have specified that "," is used to pick up stuff in the bar below the log.

                        • fhn

                          today at 5:53 AM

                          it's not. pickup is auto

                      • last Wednesday at 8:01 PM

                        • cmrdporcupine

                          last Wednesday at 11:24 PM

                          My 15 year old's (who is a roguelike fanatic) first comment was: there's no diagonal movement?

                          "The visuals are interesting.... oh I died."

                            • marcingas

                              last Wednesday at 11:57 PM

                              I don't have a numpad so it did not occur to me to add diagonals :D

                              Good feedback though, I'll add it. Thanks to your 15 year old!

                                • fhn

                                  today at 5:55 AM

                                  definitely need this. Enemies can attack you diagonally but you can't attack back

                                  • jdiff

                                    yesterday at 12:48 AM

                                    most roguelikes also add (IIRC looking at my phone keyboard and reverse engineering muscle memory) yubn for diagonals.

                        • hales

                          yesterday at 4:51 AM

                          Been having fun today trying to work this game out.

                          Questions:

                          1. How do I learn the magic/rune system? I can inscribe them on weapons & armour. Some are verbs and some are adjectives. I am yet to see obvious effects (edit: except for 'arc'), so I wonder if they always do things or often do nothing unless specific combinations are used (like subject-verb-object requirements of a sentence or certain weapon/armour+spell combo validity)?

                          2. What does "magic" mean when I try to inscribe more than one rune on a thing? Does this mean one rune is free but multiple require magic and are detrimental if you have none?

                          3. How do I interpret the weapon stats? Eg "Current: 3-5 -> 2-4"

                          Notes:

                          1. The game is much easier if I set my gamma up (xgamma -gamma 1.5). Most of the levels are very dark (10% of RGB values dark) so I easily miss items and routes to check otherwise.

                          2. There are a lot more keybinds than shown onscreen. 'x' to autoexplore, 'r' for a runes page I'm trying to work out. Shift+Z to autorest/heal. '>' will fasttravel you to the stairs down if you have already found them. Shift+direction will autowalk.

                          3. Don't press 'q'. There is no confirmatin prompt. There are no saves. Aieee :D

                            • marcingas

                              yesterday at 12:11 PM

                              Thank you for playing!

                              1/2. There are no docs, in fact, the system is not really fleshed out yet. The core idea is that these runes really stand for lispy threading macro that gets evaluated by the game engine. So for instance `(magic-> fire)` sets the default target (enemy you hit, coordinates you shoot with the bow etc.) of action on fire, `(magic-> (area 2) fire)` is the same but here, the area rune expands the target into a circular zone. `(magic-> (damage 2) self (heal 2))` would damage the target, reset the target to yourself and heal you. The entire world state is chained through these expressions so it should enable some insane spells to be made: travel back in time, swap minds with a door, modify creatures ai etc.

                              Try looking at the runic weapons you find, they show the spell syntax in the inventory.

                              3. These are damage ranges.

                              re gamma, key binds and q: thanks for the feedback, I'll look into improving these.

                              • fhn

                                today at 5:56 AM

                                damn, so that's what all those runes are for? I could have been so much stronger!

                            • cheald

                              last Wednesday at 9:54 PM

                              "Applied theology with inadequate safety margins" might just be my favorite difficulty description ever.

                              • Jeremy1026

                                last Wednesday at 5:42 PM

                                Gets stuck in a redirect loop with the message:

                                > Interactive input unavailable (no cross-origin isolation).

                                > Deploy coi-serviceworker-js alongside this file.

                                in Safari on 26.4

                                  • feirlane

                                    yesterday at 12:02 PM

                                    Same in Firefox for Android 151.0b4

                                • MeshHideaki

                                  yesterday at 10:25 PM

                                  Computing the entire world state every tick with persistent data structures is a really interesting design choice. Makes the whole system feel unusually coherent for a roguelike.

                                  • fhn

                                    yesterday at 1:21 AM

                                    let's not have q=quit. most rouge games have q=quaff. I mean if people want to quit, they can just refresh or close the tab. At the very least, ask.

                                      • marcingas

                                        yesterday at 11:25 AM

                                        Good point! Thanks.

                                        • Pay08

                                          yesterday at 11:04 AM

                                          And how would you quit the terminal version?

                                            • IX-103

                                              yesterday at 11:36 AM

                                              Control-C is the usual for that.

                                      • ssalka

                                        yesterday at 3:09 AM

                                        Not sure how you feel about including sound, but I feel like there needs to be a warning sound that plays when you're low HP, like in Pokemon. I keep dying because I don't realize I'm at low health

                                          • marcingas

                                            yesterday at 8:28 AM

                                            Interesting idea... maybe it could send terminal bell or tint the screen red at low health?

                                              • ssalka

                                                yesterday at 9:07 PM

                                                honestly any indicator would help <3 love the game! I keep coming back to it haha

                                        • Parcival

                                          last Wednesday at 4:45 PM

                                          Pretty fun! I keep getting instantly killed by things though and I'm not sure why, possibly a bug.

                                            • andai

                                              last Wednesday at 4:47 PM

                                              I see you haven't played Noita!

                                                • marcingas

                                                  last Wednesday at 5:55 PM

                                                  Noita was another inspiartion when making this - the inverted power curve is real! Start squishy, become a god, die anyway.

                                                    • zardo

                                                      last Wednesday at 7:27 PM

                                                      A wand related accident has to be the number one cause of a Noita run ending.

                                                  • ticulatedspline

                                                    last Wednesday at 8:17 PM

                                                    I feel this comment. Seriously though, damage reflection was one of the many insanely annoying things about that game.

                                                    • CyberShadow

                                                      last Wednesday at 6:18 PM

                                                      No, I think I'm seeing the same bug. Time seems to sometimes subjectively freeze:

                                                          ─── Messages ───                                                                                                                                                                                                              
                                                            Old man shuts the gate behind you. You hear him mutter "every time, I swear..."                                                                                                                                              
                                                            You must retrieve the Amulet of Lost Semicolons.                                                                                                                                                                             
                                                            You kill the rat! (sneak attack!)                                                                                                                                                                                            
                                                            The rat squeals and dies!                                                                                                                                                                                                    
                                                            You wait. (x10)                                                                                                                                 ᛜ                                                                            
                                                          ᚢ You kill the rat! (sneak attack!)                                                             ᛉ                                                                                                                              
                                                            The rat squeals and dies!                                                                                                                                                                                                    
                                                            You hear muttering.                                                  ᛋ                                                                                                                                                       
                                                            You hear muttering.                                                                                                                                                                                                          
                                                            You hear muttering.                                                                                                                                                                                                          
                                                            You hear a distant creak.                                                                                                                       ᛖ                                                     ᛃ                      
                                                            The runestone crumbles as you touch it. You learn: ᛟ means "ice"!                                               ᛚ                                                                                                            
                                                            You hear a distant creak.                                                                                                                                                                                                    
                                                            The goblin misses you. (x3)                                                                                                                                                                                                  
                                                            The goblin hits you for 4.                                                                                                                                                                                                   
                                                            The goblin hits you for 3.                                                                                                           ᛏ                                                                                       
                                                            The goblin hits you for 4.                                                                                                                                                                                                   
                                                            The goblin hits you for 3.                                                                                                                                                                                                   
                                                            The goblin misses you.                                                                                                 ᛚ                                                                                                     
                                                            The goblin hits you for 4.                                                                                                                                                                                                   
                                                            The goblin hits you for 2.                                                                                                                                                                                                   
                                                            The goblin hits you for 4.                                                                                                                                                                                                   
                                                            The goblin misses you.                                                                                                                                                                                                       
                                                            The goblin hits you for 2.                                                                                                                                                                                                   
                                                            The goblin misses you. (x2)                                                                                                                                                                                                  
                                                            The goblin hits you for 2.                                                                                                                                                                                                   
                                                            The goblin kills you!                                                                                                                                                                                                        
                                                            You die...
                                                      
                                                      Note how there were no user action messages during the time the goblin was attacking.

                                                        • marcingas

                                                          last Wednesday at 6:24 PM

                                                          Definitely a bug. I'll look into this at some point. Please note that this is not a finished game by any means. If anyone asked I'd call it a tech demo at this point :)

                                                            • CyberShadow

                                                              last Wednesday at 7:03 PM

                                                              Seems to be that the sort function accepts a ternary predicate but then passes it to an implementation accepting a boolean one?

                                                                • marcingas

                                                                  last Wednesday at 7:37 PM

                                                                  Yeah that was it, the let-go stdlib changed.

                                                          • dpkp

                                                            last Wednesday at 7:28 PM

                                                            I see the same but only in browser / wasm. Also notice that the mobs dont move in browser mode. Local via lg in console works great though.

                                                            • fhn

                                                              last Wednesday at 6:21 PM

                                                              yeah. something is wrong. You don't even get to fight back.

                                                              • marcingas

                                                                last Wednesday at 7:25 PM

                                                                I think I fixed it!

                                                        • devindotcom

                                                          last Wednesday at 5:26 PM

                                                          that's actually a beloved feature of "true" roguelikes

                                                      • bean469

                                                        yesterday at 10:18 AM

                                                        Nice, an actual roguelike (as in, like Rogue)

                                                        • gchamonlive

                                                          last Wednesday at 4:31 PM

                                                          Reminds me a lot of NetHack, good times

                                                          • imdsm

                                                            yesterday at 11:10 AM

                                                            This brings back ADOM memories from ages past. Thank you for that.

                                                            • pgt

                                                              last Wednesday at 6:28 PM

                                                              Not a Rogue-like specialist, it's hard – I haven't made it out of level 1 yet.

                                                                • fhn

                                                                  yesterday at 1:22 AM

                                                                  I just got to lvl2 only because goblins aren't insta-killing me

                                                              • sandoze

                                                                last Wednesday at 4:20 PM

                                                                No credit for the art direction and inspiration? Brogue?

                                                                Or did I miss the attribution?

                                                                * Edit: I’m not looking for the downvotes or to stir things up. I’m simply calling out that this is a small niche community we notice these things, we’re very free with our code, and copy is a compliment, but so is attribution.

                                                                The author wasn’t so much inspired the by Brogue style, but copied it directly down to the animations and ASCII.

                                                                  • bayarearefugee

                                                                    last Wednesday at 4:25 PM

                                                                    > No credit for the art direction and inspiration? Brogue?

                                                                    In the age of LLMs the "author" might not even know where the art direction and inspiration came from!

                                                                      • marcingas

                                                                        last Wednesday at 5:47 PM

                                                                        I know, this is intentional :)

                                                                        I took things I like from Brogue and added my own spin on it.

                                                                    • marcingas

                                                                      last Wednesday at 5:46 PM

                                                                      yeah, this is a Brogue-like. I love Brogue and have been inspired by it. XsofY is not an exact clone but I've studied Brogue C source heavily when making this.

                                                                      I'll link to Brogue in the README :)

                                                                        • sandoze

                                                                          last Wednesday at 5:52 PM

                                                                          Amazing and great work!

                                                                      • somewhatgoated

                                                                        last Wednesday at 4:23 PM

                                                                        Calling it rogue-like is basically attribution since Brogue is just the follow-up to Rogue which invented the genre

                                                                          • sandoze

                                                                            last Wednesday at 4:32 PM

                                                                            I’ll be sure to keep that in mind with my next plumber platformer

                                                                              • somewhatgoated

                                                                                last Wednesday at 6:11 PM

                                                                                No one calls them plumber platformer though…

                                                                                If you call it “Mario-like” then I would say most people would understand where the inspiration comes from.

                                                                            • fsckboy

                                                                              yesterday at 3:30 AM

                                                                              most people would name hack (1984) or the fork nethack (1987) as the successor to rogue (1980). brogue (2018) i never heard of till now but probably i aged out by then (aged out of spending many mindless i.e. repetitive hours of fun)

                                                                                • Widdershin

                                                                                  yesterday at 4:39 AM

                                                                                  Brogue was released in 2009 for what it’s worth.

                                                                                    • fsckboy

                                                                                      yesterday at 7:57 PM

                                                                                      thanks, since i had never heard of it i had to look it up but I guess I misread it, wikipedia says the project was started in 2009, latest version in 2018. I noticed the difference in word between "project started" and "released", i'm growing numb-er, and jumped to a terribly erroneous conclusion. I have been killed by a rattlesnake.

                                                                          • deathanatos

                                                                            last Wednesday at 5:47 PM

                                                                            While I can see perhaps a claim of "inspiration", when I put Brogue & this side-by-side, while artistically there is similarity, I wouldn't say "copied".

                                                                            Brouge isn't the only rouge-like with LoS mechanics.

                                                                              • marcingas

                                                                                last Wednesday at 5:57 PM

                                                                                Brogue is insanely well balanced and ingeniously designed. XsofY is a mere tribute ;)

                                                                                • protocolture

                                                                                  yesterday at 1:47 AM

                                                                                  Sounds like its close to red.

                                                                              • SubiculumCode

                                                                                last Wednesday at 11:56 PM

                                                                                I'm a little confused. There were some differences, but this stuff is straight out angband/moria lineage stuff. https://angband.readthedocs.io/en/latest/version.html#previo...

                                                                                  • jdiff

                                                                                    yesterday at 12:51 AM

                                                                                    the lighting effects are very brogue and like nothing I've seen in angband, which is very very barebones ASCII by comparison. brogue-likes push into ANSI art territory with their abuse of terminal formatting.

                                                                                      • SubiculumCode

                                                                                        yesterday at 1:37 AM

                                                                                        Some of the many variants did expand on the ASCII graphics a bit, but yeah, I see what you mean.

                                                                                • last Wednesday at 9:54 PM

                                                                                  • BeetleB

                                                                                    last Wednesday at 4:28 PM

                                                                                    Wouldn't the credit go to ... rogue?

                                                                              • Razengan

                                                                                last Wednesday at 4:25 PM

                                                                                Noun of Noun

                                                                                • bennettpompi1

                                                                                  last Wednesday at 4:23 PM

                                                                                  fun project!

                                                                                  • otikik

                                                                                    last Wednesday at 4:58 PM

                                                                                    Found it a bit annoying having to press 'i' at the start in order to equip the dagger and armor that were on my backpack, but well done.

                                                                                      • fhn

                                                                                        last Wednesday at 6:20 PM

                                                                                        yep. should be equipped from the start.

                                                                                        • marcingas

                                                                                          last Wednesday at 6:26 PM

                                                                                          Agree, will patch this.

                                                                                          • marcingas

                                                                                            last Wednesday at 7:34 PM

                                                                                            fixed

                                                                                        • butz

                                                                                          last Wednesday at 6:42 PM

                                                                                          [dead]

                                                                                          • hope2

                                                                                            last Wednesday at 9:22 PM

                                                                                            [dead]

                                                                                            • binary0010

                                                                                              last Wednesday at 6:49 PM

                                                                                              Isn't this the kind of thing you can essentially fully offload to Claude code these days? Don't really get the point of these tiny primarily llm generated game clones tbh.

                                                                                                • marcingas

                                                                                                  last Wednesday at 6:57 PM

                                                                                                  I see your point but I like to think it's not as sloppy as you'd expect. This one is written in a programming language I've been making since 2021 and it's not a direct Brogue clone despite its looks.

                                                                                                  • postalrat

                                                                                                    last Wednesday at 9:13 PM

                                                                                                    Consider them prototypes. Like the games submitted to game jams.

                                                                                                      • marcingas

                                                                                                        last Wednesday at 9:25 PM

                                                                                                        I wouldn't even dare posting this to a game jam... or HN at this point but someone posted it for me, welp.

                                                                                                          • postalrat

                                                                                                            yesterday at 3:40 AM

                                                                                                            I guess it depends whats more important, getting the game in your head out where others can try it, or the process of building the game itself.

                                                                                                    • frakt0x90

                                                                                                      last Wednesday at 6:55 PM

                                                                                                      Is this a troll comment? I don't see where the author used AI to generate the code and if you don't see the point of experimenting with technology, you're on the wrong website.

                                                                                                        • binary0010

                                                                                                          last Wednesday at 7:42 PM

                                                                                                          You really don't see where the author uses ai? Pretty much everywhere, all the docs, the overview of the project, a LOT of the code is obviously primarily ai written, etc.

                                                                                                            • sandoze

                                                                                                              last Wednesday at 7:58 PM

                                                                                                              So the author used the latest and greatest development tech to create a unique little demo in their custom language. I'm unsure your point. You know what I don't use to program with anymore? Punch cards and Borland C++. The industry has evolved for better or worse.

                                                                                                                • binary0010

                                                                                                                  last Wednesday at 8:47 PM

                                                                                                                  What are you going on about?

                                                                                                                  No idea what you think you are arguing. Are you in the wrong thread?

                                                                                                                  I said I don't get why people keep posting essentially vibe coded game clones... I get bored checking out GitHub projects on HN that are doing absolutely nothing new and are essentially baby projects made by Claude on a weekend, and terribly architected to boot. Cluttering the feed.

                                                                                                              • marcingas

                                                                                                                last Wednesday at 8:02 PM

                                                                                                                FWIW it's a good fuzz test for the interpreter ;)

                                                                                                        • Andy_Donner

                                                                                                          yesterday at 8:07 AM

                                                                                                          [dead]