8 ms·
Show HN: I made a Mahjong browser game
- Exuma 6y agoWhat song is that?
- jessym 6y agoThe first song in the playlist is called "Out and About" by David Renda: https://www.fesliyanstudios.com/royalty-free-music/download/out-and-about/359 https://www.fesliyanstudios.com/royalty-free-music/download/...
- Anon1096 6y agoNote: this is Mahjong Solitaire. I went in expecting either riichi or Chinese mahjong based on the title.
- Nbox9 6y agoI’m not sure I’d describe the multiplayer mahjong games as “relaxing”. Riichi specifically gets into really intense situations.
- baby 6y agoWow! Didn’t know Japanese played majhong too! What are the differences?
- deleted 6y ago[deleted]
- naniwaduni 6y agoThe most distinctive feature of the popular Japanese mahjong variants (as opposed to other mahjong gambling games) is probably the own-discard furiten rule: players can't win off others' discards if any tile they previous discard during that hand would complete their hand. (This is distinct from and in addition to more common "sacred discard" restriction against winning off a discard after letting another winning tile pass during the same round.) To facilitate keeping track of this, in Japanese mahjong separate discard piles are kept for each player through the entire hand. (The other distinct feature is the riichi yaku, which essentially lets a player (discretionarily) raise their stake and declare that the won't change their wait to increase the potential score of the hand on completion. This is pretty distortionary since it's by far the most common yaku at about twice as frequent as tanyao. It is the reason "riichi mahjong" is a common name for the most popular family of Japanese mahjong variants. It's pretty distinctive. I rate it as less distinctive mainly because, when everyone at the table knows what they're doing, it mostly only affects gameplay around the edges, whereas the own-discard furiten rule has wide-reaching implications for "defensive" play.) Aside from that, there's the usual mess typical of regional scoring variation.
- slevir 6y agoI would add that one other important distinction, though I don't know how unique, is that you can't win off a hand which doesn't have any yaku. This partly explains the popularity of riichi, as it's okay to have riichi only.
- Nbox9 6y agoIf you have a good wait, and you have a closed hand, there’s very little incentive not to riichi.
- Peteris 6y agoDitto.
- jessym 6y agoYes you're right, I wish I knew how to edit the post title to include the word "Solitaire" to avoid confusion.
- Quekid5 6y agoVery nice -- well done. Must break away now lest I be trapped for the next two days. :)
- cheschire 6y agoIt was relaxing until there were no more moves. Then I jumped a little in my seat at the noise.
- jessym 6y agoThat's a good point - I guess that sound effect doesn't go so well with the rest of the atmosphere.
- JKCalhoun 6y agoI would also suggest letting the user stew for 10 seconds or so before declaring "No More Moves".
- skrebbel 6y agoAnd maybe not make it a modal, but a little message above the board that the user might not initially notice. (btw great work, I really enjoyed it!) (did you do the art yourself?)
- jessym 6y agoMost of the tile art was taken from a GitHub repository [1], and most of the background assets (trees, clouds) were taken from a website called Freepik [2] where I have a paid subscription. I just added some color and assembled everything into a single composition :) [1]: https://github.com/FluffyStuff/riichi-mahjong-tiles https://github.com/FluffyStuff/riichi-mahjong-tiles [2]: https://www.freepik.com https://www.freepik.com
- jhart99 6y agoNostalgia overload. I love it. My only suggestion, I seem to trigger the drag when clicking for some reason. It happened to me quite often, maybe there should be a minimum distance before going into drag mode?
- sshb 6y agoSimilar vibe: https://apps.apple.com/us/app/shenzhen-solitaire/id1206037778 https://apps.apple.com/us/app/shenzhen-solitaire/id120603777...
- whywhywhywhy 6y agoWorth mentioning where this is from, SHENZHEN I/O [1], very fun and cosy programming puzzle game. Really beautiful UI and sound design. [1] https://store.steampowered.com/app/504210/SHENZHEN_IO/ https://store.steampowered.com/app/504210/SHENZHEN_IO/
- yoyoyoyoyoyo 6y agoawesome. nice job. helped reduce anxiety
- 29athrowaway 6y agoThis game, usually known to us as mahjong, is the solitaire version of mahjong. But the game known as mahjong is a 4 player game where these tiles are like cards. It's similar to poker in a way, and really fun to play. Usually very fast paced too. There are mahjong tables that automatically shuffle and sort the tiles, creating "hands" for all 4 players (I am not too familiar with mahjong terminology).
- supernova87a 6y agoAgree, it's actually a little confusing to call this mahjong. It really has very little to do with the actual game that is called that name. This is just "match the tiles" with some complicated tiles.
- chris_st 6y agoNice! That was a fun game back in the day. Interesting way of dealing with a narrower browser window, where the tiles "stack" instead of squeezing the images. Works pretty well, but it was nice to see them "click" into place once I widened my window.
- Yhippa 6y agoI was thinking about this game the other day! Thanks for making this. I used to play this all the time when I was a kid: https://www.youtube.com/watch?v=mk7QMxOgYTI https://www.youtube.com/watch?v=mk7QMxOgYTI.
- whywhywhywhy 6y agoVery nice, just a small suggestion you could add sounds just when you click your mouse and when you select/deselect a tile.
- jessym 6y agoGood idea!
- prakhar897 6y agoHey, Nice Game! One suggestion - Can you add an indicator so that people will know to scroll down for rules and stuff. I figured this out really late and by then, I had already googled all the rules.
- josepmdc 6y agoYes, the same happened to me. Maybe an extra button where the music and hint buttons are that says how to play or something like that.
- wolfgke 6y ago> Can you add an indicator so that people will know to scroll down for rules and stuff. It's called a "scrollbar" and shown in the browser.
- capableweb 6y agoYou're right, there is something called a "scrollbar", but many people don't see it because they are using macOS which for some reason hides the scrollbars by default. Also phones/touchpads don't see scrollbars I think.
- xodice 6y agomacOS does indeed show the scrollbar at all times when a input device other than a touchpad is attached. My desktop Mac never hides the scrollbar, as it uses a normal mouse, however when I was using a Magic Trackpad the scrollbar would indeed hide unless I was actively scrolling. Odd behavior.
- dylan604 6y agoThere's actually a system preference that shows/hides the scrollbar. System Preferences > General > Show scroll bars • Automatically based on mouse or trackpad • When scrolling • Always (because I remember when smart phones didn't exist) I keep mine at option 3 because I'm a dinosaur
- pvinis 6y agoI love it.
- matsemann 6y agoNice! Some feedback, maybe not specifically for your implementation, I think these are the reasons I've never gotten that into Mahjong even though I really like these kind of games. - Some of the bricks are too similar for me. Red symbol with a smaller black symbol above. As those symbols are meaningless to me, I'm unable to pattern match quickly. (It's probably the standard look, but having variations would be nice) - I have trouble with the depth perception, it's not extreme enough for me to intuitively know if a brick is available or not. If anything, fading those blocked just a tad would be very helpful to see it at a glance. What I find enjoyable when playing puzzle games is to "turn off my brain" and just do it on intuition/pattern matching/experience. I feel I'm unable to do this here, it takes a lot of cognitive effort to search for the bricks, instead of actually solving the logic of the game. Which to me often makes Mahjong more of a hassle than other type of games. - Whats the flower pot for?
- notagoodidea 6y agoConcerning the brick with the red symbol and the black symbols. The black symbols are the characters for 1 to 9. The red character means "ten thousands". The flower pot seems to mark your progress. The flower grows by stage when you have been connected a certain number of bricks. I agree that the depth perception is not optimal.
- jessym 6y agoThanks a lot for the great feedback! - I'm considering creating a Western variation of the tile set where the black characters (Chinese for 1 - 9) are replaced by 1, 2, ... 9, which might help a bit with the pattern matching (you might get used to the Chinese characters after a while, though!) - 100% agree, the depth perception could be better - the flower pot is a progress marker
- ksaj 6y agoThe game is pattern matching, so if you make a western version, make it a non-default option. FWIW you could make shapes, or famous buildings, etc., but I have only ever seen the proper tiles in use before. I don't even remember which Chinese numbers are which, and I have no idea the characters for which directions are which, either. But it doesn't matter as long as you can remember the shape and colour. I definitely prefer the "authentic" look. Besides, eventually you come up with nicknames for remembering what you're searching for: there's a stickman, a house, a mustache, the underlined th, the letter x, the letter k, etc... Depth perception caught me a few times because certain tile positions overlap at the same angle. I don't know how hard/easy it is to do, but one of the best versions I saw added a bit of a shadow as if the light was coming from the rear right side to make those more clear. That way it makes the tiers more obvious while still looking natural. Anyway, your game is pretty much spot on, and plays as quick/smoothly as a desktop app, so that's a good thing. Once in a while the <ding> gets delayed, but that might be my far-too-many open tabs interfering. I like the flower-meter. Nice subtlety. Some people might want a timer. It would be a nice addition as an option, but not default. "Relaxing" goes out the window if there's a timer, and I tend to lollygag and carry on conversations while playing games like this.
- ekvintroj 6y agoThis is really nice!
- josepmdc 6y agoMay I ask for the music? Do you happen to have a playlist? I really like it. And great game it looks really neat and it's relaxing.
- pandemic_region 6y agoNice, well done! Is it always the case that the plant tiles match even though it's not exactly the same plant ?
- Xevi 6y agoI was stuck for a long time until I gave in and clicked the hint button, only to find out that different plants could be combined. I think all of them can, since I paired up several during the game.
- jessym 6y agoYes that's correct - there are 4 unique flower tiles which can all be matched with one another
- hypersundays 6y agoHi, great job. I always knew how to play multiplayer mahjong (incredibly underrated family/friends activity) but not solitaire mahjong. Now I know cuz of your game!
- pixelpoet 6y agoThis was really enjoyable, thank you.
- chordalkeyboard 6y agoWell done! I enjoyed playing your game and thank you for making and sharing it.
- bfung 6y agoGood job technically overall. Some player feedback: It seems to be using more than a standard mahjong set? I saw 3 pairs of eight dots in a game. Other confusing part are the one bamboo tiles where they’re all different art — took awhile to figure out they ‘matched’ Fun times!
- InitialLastName 6y agoAfter playing a bit, this is definitely not using a consistent set. Additionally, if you shuffle, it doesn't give you the same tiles as you had before, which is a little disconcerting (and isn't really a shuffle, as it doesn't retain the information about which tiles you had more than one pair of remaining). Lastly, having CTRL-Z work to undo would be helpful.
- tartoran 6y agoThis is nice, I played a few games and the game played well except for a few bugs, namely some tiles remain blank after they’re uncovered - in Safari on IOs
- eslav 6y agoVery nice implementation. Enjoyable play Flower and tree tripped me up (not identical as other tiles) Would be nice if less delay after second tap (on matching tile)
- varjag 6y agoReally nicely done.
- hermitcrab 6y agoNice work. BTW It wasn't clear to me (until I clicked 'hint') that you can match different flower tiles.
- chadlavi 6y agoI don't think that's specific to this implementation
- hnick 6y agoFirst try! I remember playing this sort of game years ago, maybe on Solaris? Very fun thank you. One thing that might help unfamiliar players is a list of all tiles in the deck(?). I assume better players know how many there are of each which means it is safe to remove some easier ones when there can't be any more. It could update in real time as an option to show what's left, but probably best not to by default.
- xixixao 6y agoI remember playing this as a kid on my grandad’s Win 95 PC. Well done :)
- fatbird 6y agoThis is great and I wish I saw more like this. I've been picking away at Spider Solitaire so I can tell my parents to stop downloading dodgy apps and just go to my URL. Tiny jewels like this without obligation or advertising is about the last part of the original spirit of the Internet left.
- chad3814 6y agoI made a version of Mahjong Solitaire for Yahoo! Games back in the early aughties. I was stuck in figuring out how to make each board solvable. I asked Udi Manber, and he obviously in hind sight, was like, "why don't you just place them in pairs to set up?"
- jessym 6y agoRelatable! My first version of the tile generation placed every tile randomly, which meant I always got stuck, haha. Setting the board up in pairs is indeed what solved the issue.
- baby 6y agoPlayed a lot of it today! I’ve known this game forever but still don’t understand the exact rule. Also, it didn’t work well offline (I was on a boat most of the time so I had trouble restarting new games)
- josh_carterPDX 6y agoLove this. I used to play this as a kid. Love the different patterns. Thanks for creating this. Bookmarked!
- astura 6y agoVery nice! Are all hands solvable?
- jessym 6y agoThere's always at least 1 "path" to solving a newly generated game, but if you deviate from this path by matching tiles differently, you might end up getting stuck (where you can shuffle the remaining tiles) or even in an impossible situation (where the final two tiles are stacked on top of each other).
- chadlavi 6y agoThis is really nice, just wasted a few hours on a Sunday afternoon pleasantly.
- duffpkg 6y agoI like it but it does not seem to compute when a board has become impossible until all moves are exhausted. The point of impossibility can happen long before that.
- SamBam 6y agoPossibly a stupid question: is it possible not to win this? Is it just for the purposes of relaxing, or is there a strategy? I played one hand, and it needed to shuffle towards the end because there were no legal moves, and then I won. Can every hand be won without a shuffle?
- jader201 6y agoJust like many solitaire games, you can definitely lose in Mahjong Solitaire. Since there are four tiles (two pairs) of each tile set, you can play in such a way that you’re deadlocked because of a previous choice. Imagine, for example, there are two matching tiles with one stacked on top of the other. If you already removed the other two matches for that same tile set, then you’re stuck, since the only way to remove the top one is to match it with another match — but you can’t get to the only remaining matching tile since it’s covered by that tile.
- jader201 6y agoConversely — and to answer your second question — yes, all boards are solvable (unlike many other solitaire games that can have unsolvable setups).
- SamBam 6y agoI guess my question was whether "shuffle" was a legitimate part of the game, or if it means "you've lost, try again." When the tiles are shuffled, the situation you describe gets undone, no? So I'm guessing that means you've basically lost, but in this implementation it doesn't make that clear (at least to me), so I just carried on and figured I won.
- jader201 6y agoYeah, I nothing that’s just a way to allow you to finish when you get stuck. In most games I’ve played (and I’ve played many different ones on iPhone, computer, and consoles), I don’t think I’ve seen that. Usually once you’re stuck, they’ll let you know and you have to start a new game. I have, however, often seen them allow you to replay the same setup to try and beat it again. Many also allow undo (sometimes limited, sometimes unlimited) to reverse your moves to get out of being stuck.
- flemhans 6y agoIt captures my mouse cursor in a weird way, having real slow acceleration compared to when I move it outside the browser window. I didn't even know that was possible, and also it's annoying me that it's possible. Maybe it's the "Pointer Lock" JavaScript API?
- conductr 6y agoGreat game. Haven't played in a very long time and enjoyed this. This applies to most Mahjong Solitaire implementations but my only feedback is how I always imagine if I had to physically shuffle and tile the board up to play and how there's no way all tiles would have the same orientation. Meaning, yes left&right would be the long sides but a seven dot might be 3 over 4 or 4 over 3. Having the same orientation makes the game much easier.
- melicerte 6y agoWell done. Quick question: when there is no more move left, does that mean that I lost (and the shuffle is there in order to be less frustrating) or is the shuffle part of the game's original rules? Yup I'm totally Mahjong solitaire newbie :)
- deleted 6y ago[deleted]
- usr1106 6y agoLooks nice. (On my secondary phone which runs a somewhat older Firefox it gets an "unexpected" error whenever trying to build the Butterfly, works fine all the way through the Turtle.) Have you considered open sourcing that? I tend to avoid closed source software as much as I can. Of course Javascript is not really closed source, but I have better things to do than looking at packed source.
- ysfah 6y agoWow, this is awesome. Thanks for creating this.