Koi-Koi (Hanafuda)
Pages: 1 2
Rick Murray (539) 13850 posts |
Back in 2012 I started work on a RISC OS implementation of an east Asian game known as “Koi-Koi” (Japan) or “Stop-Go” (Korea, I think?). It uses a deck of cards (smaller and thicker than western cards) arranged as 12 “months” of 4 cards. Then, I completely forgot about it. Which wasn’t a surprise as I was working night shift at the time and I need to refer to my blog to remember anything from then. I happened to come across the bits of the game that I had created recently, and decided to “celebrate” RISC OS’s full “open source” by making a decision. The decision would be very simple – the game will work by November, or I’ll delete all of the files and forget about it. My finger hovered over the delete option, because, there was a lot of work to do. But, you know me, there’s only so many DVDs I can watch… so I dragged the files into Zap, cranked up Eagle 80s (playing “China In Your Hand”, my favourite song of the decade, an omen?), and set about the long slog to getting this going. Here are the results. The game has a lot of stuff still to do (it doesn’t support auto-win cases, and you always play first, for example), but it will start inviting you to play: It’s a reduced size JPEG to be forum friendly. The real playing area is larger. The point of the game is to match the flower cards (Hanafuda is Japanese for “flower cards”) by month to form winning combinations called “yaku”. From this, I can see Iris (third card on the bottom – that’s my “hand”) matches the upper right card on the table. The fourth card in my hand is a chrysanthemum which matches the second card on the top row. And the fifth card is a peony which matches the third card on the top row. The blue ribbons are worth ‘more’ than the red ribbon (three blue is a yaku). The cards the ribbons match with are plain flowers, so either one will suffice. Here’s a little later on in the game: I finally play the blue ribbon peony. You can see the third card on the upper row of the table is highlighted in yellow with a little version of the ribbon card on top. This means it has been “captured” (and once my turn is over will be sent to the part on the right). The topmost card on the stack has been turned over (because gameplay is a card from my hand and a card off the stack). It is highlighted blue as it is the card in play, and you can see three cards highlighted in red – this means they match the card in play. Since three cards are on the table, if I play that pampas grass card, I’ll claim the entire month. Game play keeps on like this until a yaku is formed or you run out of cards in your hand. If you run out of cards, the game is a draw. If a yaku is formed, you have two choices. You can either decide to stop the game (in which case any points you have are yours), or you can Koi-Koi which means to carry on. When somebody wins, the status window will pop up: The part at the top says how many games played and who won. You see that insane score won by the computer? That’s because we had a brilliant game and kept on koi-koing. In the end, the computer brought things to a close on its final card and showed me an unbelievable score. All that stuff down below is a record of what sorts of yaku were formed. You will probably find this useful as an introduction to the game, an explanation of all the yaku, and a walk-through of a game: https://www.heyrick.co.uk/blog/index.php?diary=20110729 Then once you’ve digested that, you can try the alpha-test version of the Koi-Koi game for RISC OS:
(this is all being served off my Pi, don’t expect miraculous speed! ☺) Please post here how you get on. And note that even though the computer player is utterly braindead, it’s still a reasonable opponent! God help me if I give it some intelligence. Skynet anyone? ;-) |
Steve Pampling (1551) 8172 posts |
Not complaining that images aren’t there but:
Nope.
Nope.
Nope. |
GavinWraith (26) 1563 posts |
I used to have a little box of hanafuda cards – lovely. They disappeared years ago in the clutter of my children’s childhood. |
Rick Murray (539) 13850 posts |
Steve – just switched to 3G and wandered around outside to get a signal (too flippin’ cold!) and the images showed up for me. http://heyrick.ddns.net/files/koikoi1.jpeg Were you using a work computer or something that might block ddns? Gavin – download the game, you can play with virtual cards. ;-) |
Andrew Conroy (370) 740 posts |
The images worked fine for me too. |
Steve Pampling (1551) 8172 posts |
Nesh.
No, but if I were I’d have a short discussion with the network manager1 about how I could access any specific item. As it happens coming back to this thread just now, the images all appear. 1 Short conversation with a full meeting of minds. |
patric aristide (434) 418 posts |
Looks interesting, thanks Rick! Love card games, Mahjong style puzzles and of course Sokoban (always sucked at shooters and everything else requiring hand-eye-coordination). |
Willard Goosey (5119) 257 posts |
The game description makes my head hurt… but actually playing it is pretty easy… If only because the computer highlights the legal choices. :-) It’s certainly a pretty card game! |
Colin Ferris (399) 1818 posts |
Very nice – what about sending Rick some bully beef :-) An ‘Auto’ mode – ie comp vs comp (done slowly to get a idea how it goes) |
Rick Murray (539) 13850 posts |
Ditto. I have Resident Evil Codename Veronica for my PS2 and even with a walkthrough, I’ve yet to make it beyond the graveyard. For those unfamiliar with the game, that’s literally the second place you go after the opening that exists in order to allow you to find a gun…
It’s not that hard with practice. It’s basically a set of “match this with this”. Okay, it’s Japanese so it’s weird and complicated and several of the Animals aren’t, but asides from that it’s “match this with this (and this and this and maybe this but not this)”. ;-) My advice – get the Sakê Cup and either the Full Moon or the Sakura Curtain. It’s the simplest (two card) yaku and it’s worth more than a single point.
As Willard says, the legal choices are highlighted. So simply play it and note what works and what the computer opponent does (even though it isn’t by any means smart). I have moved the pictures to my main website, so no waiting for my Pi to serve stuff (hi Steve!), and I have also created an update adding more features:
|
Steve Pampling (1551) 8172 posts |
I’m glad you mentioned that, it caused me to think about slowness on forum pages loads, which I suspect could in some instances be related to the fetch from a third party site. A number of people here use gravatar and response times from that setup are variable. So, slow forum response isn’t all local. |
Rick Murray (539) 13850 posts |
It’s 2018. Any browser worth its salt ought to be capable of showing the forum content as it arrives, reflowing with images when they arrive. That said, there is something a little odd with the setup of this forum as my mobile browser prefers to show nothing at all until everything has been received (as opposed to drawing the textual content, then reflowing with images – just exactly at the moment you’re about to tap on something leading you to tap on something else…). |
Willard Goosey (5119) 257 posts |
Yay new version, will try after work. |
Rick Murray (539) 13850 posts |
New version! :-) In a nutshell:
Home server is off, will be out and warnings of thunderstorms. If you didn’t get the update, don’t worry – I’ve just finished several more improvements I’ll upload to heyrick this evening. ;-)
|
Willard Goosey (5119) 257 posts |
1109 looked good and played good… |
Rick Murray (539) 13850 posts |
Thanks Willard. Here’s a new one (v0.02) with even more improved computer player. ;-) |
Willard Goosey (5119) 257 posts |
The link to koikoi20181110.zip returns, and I quote: cute anime chick at least… :-) |
Rick Murray (539) 13850 posts |
Oops, link should be fixed now… |
Willard Goosey (5119) 257 posts |
Got it! Thanks! |
Rick Murray (539) 13850 posts |
Version 0.03 is now on !Store. The differences are:
|
Willard Goosey (5119) 257 posts |
0.03 works fine for me! |
Willard Goosey (5119) 257 posts |
I could swear it was working earlier, but 0.04 SIGSEGV’s when the computer player wins a game(*), at address 8fb4 in arbitrator_donethat (*)computer chooses “stop”. RO 5.24, armv7 pi2, armv8 pi3 |
Rick Murray (539) 13850 posts |
A few years later… I have uploaded a shinier fixed version of Koi-Koi. Here’s what’s been done:
Oh, and guys, if things screw up, don’t be afraid to shoot me an email. I don’t bite! Anyway, nice working version (that I exercised all morning) is now on PlingStore. |
Colin Ferris (399) 1818 posts |
A pity progs couldn’t be downloaded from the plingstore – from like a mobile phone. |
Rick Murray (539) 13850 posts |
It’s something I’ve wondered about given there’s a website that could act as a useful online catalogue, as well as a way for apps to access their metadata (like available version, etc)… …but I’d imagine it could be complicated 1 to handle this with non-free apps. 1 Complicated defined as “too much effort for too little overall benefit”. |
Pages: 1 2