Jump to content
  • entries
    53
  • comments
    536
  • views
    68,404

4-in-a-Row Homebrew


Guest

727 views

.I have been working on a board game in which players drop pieces into an upright 7x6 board. The first to get four of a kind horizontally, vertically, or diagonally is the winner. Milton Bradley markets a similar game under the name Connect Four.The first picture is an actual screenshot of a single row, and the next part is a mockup of what the final kernel should look like. Making one row was the most difficult part, and repeating it will of course be simple. With any luck, I will be able to make this into a 1K game by September 30. The kernel at first glance seemed to be a lot easier than my Go kernel, but as usual it was more difficult than I expected. I tried out a bunch of designs before arriving at the one shown above.The middle of the pieces are a transposed playfield with some carefully timed background color changes at the edges of the board. The top and bottom are P0 on the left, P1 on the right, and BL in the middle. Of course, the middle columns are missiles. For a while I thought I would be able to set the playfield the score display colors, COLUP0 and COLUP1, but it turned out to be too difficult to control the color of the missiles. If it had worked I would have been able to use basically one routine to color the entire row of pieces. However, two routines is not bad.The individual pieces are colored with STX for blue, STY for red, or STA for the background color. Like my Go kernel, a short sequence of code will be placed in RAM so that the colors of each stone can be changed.I also did some 4-in-a-Row AI in C++. Since there are at most 7 possible moves at each play, the AI will be relatively simple. It is an ideal choice for my first homebrew board game.Once I get 4-in-a-Row working it will be possible to use this same kernel for several other games, including Ataxx.

5 Comments


Recommended Comments

Hi Zach!

 

This looks pretty good! If I'd ever need a kernel for a board game I knew whom I'd ask :)

 

Greetings,

Manuel

Link to comment

Today I figured out how to implement my original design for the kernel. This design has evenly spaced squares, and the grid can be any color. :)

 

I had posted a mockup in this thread, and the actual kernel is very close to what I had planned. As I said it is very easy to adapt the code to an 8x8 board as well.

 

Before I explain how it works, I'll see if anyone wants to try to figure it out. At least half the fun of Atari programming is trying to figure out what the machine can do, and how do to it. :)

 

7x1_jul09.png

 

8x1_jul09.png

Link to comment

Hi there!

 

Hm... I think I have a good idea how this works...

 

A bit like Roberts 13-char trick, no? :)

 

Greetings,

Manuel

Link to comment
Hi there!

 

Hm... I think I have a good idea how this works...

 

A bit like Roberts 13-char trick, no? :)

 

Greetings,

Manuel

 

Wow! I hadn't noticed Robert's 13 char display before. Robert, if you're reading this, I applaud you. I didn't even realize that resetting the ball took effect immediately. I thought the multi-sprite trick only worked for objects that could be repeated with NUSIZx. That information will be useful for future kernel designs.

 

There is some similarity to Robert's kernel in that I use masking. Here is how the 8 stone kernel works. PF is set to |0111|01110111|01110111| and is repeated on the right side. At the beginning of the line COLUPF is gray and is then reset to the color of each stone. COLUBK is set to black, and each gap in the PF is covered with a gray mask. The ball is on the far left, followed by six player sprites set to 11100111. So far this creates six masks to round off the stones, and six columns. The remaining three masks are done with missiles. M1 is 8 clocks wide and M0 is on top at 2 clocks wide. There are just enough cycles in between all the STx COLUPF's to reset M0 to black. At the end, COLUBK is set to gray to close off the last gap.

 

To round off the stones, asimple change is made to priority. At the upper and lower parts, the sprites are in front. In the middle PF is in front.

 

I'll keep adding updates as I make progress. :)

Link to comment

Progress report on Four-Play

 

The kernel displays a full 7x7 board, and you can select a column with your joystick and drop your piece in. Currently I am working on game logic, specifically how to recognize a winning string of four pieces. Once that is done, a two player version will not be far away.

 

The code as is easily fits into 1K, but it doesn't have game logic or AI yet. I give myself a 50/50 chance that I will be able to fit it all into 1K in time for the 2005 minigame contest.

Link to comment
Guest
Add a comment...

×   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...