Jump to content
BNE Jeff

Commodore 64 Awari

Recommended Posts

I picked up a bunch of commodore 64 disks at the VCF East event 3 weeks ago and while going through them, I found this curious game that was published by an Australian computer club and decided to emulate it.   It’s an American version of the African game Mancala.

Feel free to give it a shot and let me know if you run into any issues or have any suggestions.  A detailed description of the game rules is in the .asm, but here’s the gist:

Each player has 6 “houses” and each house starts with 4 seeds in it.  Between the houses, on the ends, are the score pits.  The left one is the computer’s and the right one is yours.  Your houses are the bottom houses with the numbers 1 through 6 below them.

Use the joystick to choose a house by number and press the fire button to remove all of the seeds.  They then get distributed counter–clockwise one by one, in each of your houses, then your score pit, then the opposing houses, until you run out of seeds in hand.

If you did have enough seeds to put one in your score pit, then you get that one point.  However, you can score more points, potentially, if the last seed distributed is in one of your empty houses.  If you do that, the seed will be put in your score pit, and also, you will gain all of the seeds in your opponent’s house that is directly across from that pit.

Alternatively, if the last seed distributed is in your score pit, you get a free turn- as many times as you can do that.

[attachment=638409:2019-05-26 (3).png]

In the above example, if the computer played the house with 10 seeds in it, it would gain four points, distributing the seeds counter-clockwise- one each in its leftmost house, its score pit (1 point), all six of the human players houses, (opponents score pit gets skipped over), then its two right-most houses.  The last seed being in one of its own houses, goes into its score pit since that was a house with zero in it (1 point), the opposite side seeds are also collected from the human (2 points).

If it is the human's move, playing house 1 would put one seed in house 2, causing it to be put into its score pit, along with the 10 seeds in the opposing player's house.  If the human played house 5 or 6, then he would get 1 point and another turn.  In fact the human could make 4 moves in one turn here for 14 points- picking houses 6, 5,6, then 1. 

Next, I’ll add some higher skill levels and flair, but for right now the computer is at skill level zero- super easy to beat.  You win when the opposing player is out of seeds, or you accumulate a majority of the 48 seeds in your own score pit (more than 24) When one player wins, the game simply restarts (for now), so keep track of where you are so you know who won.

Thanks for checking it out!

Edited by BNE Jeff

Share this post


Link to post
Share on other sites

Here's an update.  Instead of just immediately starting a new game when one person wins (and losing the results of the last game), the game now stays at the final result and waits for you to hit reset. (F3, Reset)

 

Also, I fixed one of the rules I didn't realize I had implemented wrong.  Whenever you land on one of your own zeros, your seed goes into your score along with the opposing seeds.  But if there are no seeds across from that house, your seed does not go in either..  I had it going in any time you hit a zero- making the later part of the game play a little weird.

 

I also added level 1 logic for the computer player but that is not working yet so he's still pretty easy to beat.

Share this post


Link to post
Share on other sites

Cool..  I did not know that.  Reading it, I see there are a few more rules I might want to implement.  One, if you run out of pieces, you don't necessarily lose.  Two, you win when the opponent runs out of pieces, not when one player gets more than half the seeds.  Three, the winner collects all of the opponents seeds.  I suppose if your gambling this matters.

 

I wonder what they mean by "Exhaustive analysis of move sequences" I can see going up to all of the computer's possible moves, then all of the human's possible counter-moves.  But beyond that, it would seem extremely complicated, and of less value since the game wouldn't go in a known direction after those two moves.

Share this post


Link to post
Share on other sites

Any challenges writing the game?  Fancy technical features you impressed yourself with?

 

No sarcasm here.  This looks like there's a lot below the surface and I don't have the assembly skills to immediately appreciate it :)

Share this post


Link to post
Share on other sites

Well..  the challenge I set for myself here was to stay away from graphics, focus on game logic, stick to the plan, finish a fully functional game.  So, three weeks to write a complete, functional game is a milestone for me. 

 

I'm a little impressed with the seed distribution.. I think its pretty lean in the way the RAM is arranged, and how the code passes out the seeds, skips the opponent score pit, wraps to the other side, detects where the last seed lands and either gives another turn for landing in the score pit, or if on the player's own empty pit, grabs that seed as well as the opponent's seeds after checking if there are any.  I also think the Commodore 64 theme came out pretty well.  And, since 2600 doesn't have a keyboard to select a house, I think the cursor idea covered nicely.

 

On the other hand..  The computer player is pretty brainless.  I wrote a subroutine this week that runs through all possible moves and counter-moves that I'm going to try to add this weekend.

Share this post


Link to post
Share on other sites

The computer is a decent player now.  There's still more to add but it has beaten me a few times:

[attachment=639862:2019-06-02.png]

Note, if the computer lands in it own score pit and gets additional turns, It immediately takes them and it goes by too fast for you to see.

Edited by BNE Jeff

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...