Gomoku on VIC?

Discussion, Reviews & High-scores

Moderator: Moderators

Iltanen
Vic 20 Devotee
Posts: 200
Joined: Tue Jul 17, 2007 6:08 pm

Gomoku on VIC?

Post by Iltanen »

Has anyone made a really playable gomoku game on VIC? And I don't mean a 3x3 game like Vic-tac-toe
I'm trying to make a whole screen gomoku game. Could that be possible? I've found some old fomoku games by my dad and his friends - they are fairly good players but incredibly slow and my program is even slower. Is there any chance to get it working?
Sargon II was made and it's a lot more complicated game than gomoku..
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

I thought it was more or less the same as noughts and crosses? There was a listing in Zap Pow Boom, Symphony for a Melancholy Computer by Tim Hartnell and Mark Ramshaw, but I suppose that one is not very good either.
Anders Carlsson

Image Image Image Image Image
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Update: I scanned in that particular listing yesterday night, and after fixing a bunch of OCR typos, I got it working mostly as expected. However the computer plays terribly, putting stones most randomly across the board no matter if I play on the easiest or hardest level. Perhaps I still have some typo in the listing or it has always played like crap. In any case, it can not be recommended.

Gomoku is described here:
http://en.wikipedia.org/wiki/Gomoku

Apart from the rules that you may never make a move that opens two unblocked rows of three stones, never make a move that opens two rows of four stones and the Gomoku+ rule that the winning row of five stones may not be blocked in either end, it looks very much like Noughts and Crosses.

There is also Renju, related to Gomoku. If someone can clarify whether these board games are different in implementation, someone might consider implement one. Until then, you should be able to find several decent N&C games instead of Gomoku.
Anders Carlsson

Image Image Image Image Image
Iltanen
Vic 20 Devotee
Posts: 200
Joined: Tue Jul 17, 2007 6:08 pm

Post by Iltanen »

Yes, Noughts & Crosses is the same game. That is the title of my game also, I wrote about gomoku here because I thought the name Noughts & Crosses isn't used that much in english. Also using the name Gomoku makes it clear that it's not 3x3.

So, are there any good Noughts & Crosses games on the vic? The only one I've seen is the Vic-Tac-Toe, a 3x3 so it isn't much fun. I'd like to see a full screen game or close to that, which provides some challenge.
Last edited by Iltanen on Tue Jun 24, 2008 12:52 am, edited 1 time in total.
nippur72
de Lagash
Posts: 574
Joined: Thu Sep 07, 2006 8:35 am

Post by nippur72 »

can you post the .prg files? I would like to peek at them. Perhaps I will write my own implementation of gomoku, it's a nice game.
Iltanen
Vic 20 Devotee
Posts: 200
Joined: Tue Jul 17, 2007 6:08 pm

Post by Iltanen »

Me? I could post a .prg of one of the old versions, but I'll have to type them in Vice first (or do I ?). I can't get all the keys to work in Vice... are they all supported? Maybe the finnish keyboard layout is disturbing it?
nippur72
de Lagash
Posts: 574
Joined: Thu Sep 07, 2006 8:35 am

Post by nippur72 »

While the forum was down I' wrote some routines for a machine language based Gomoku that I want to implement.

The board will be something like 14x14 or 15x15. Vic will play as second-move player so to put human player in advantage.
Iltanen
Vic 20 Devotee
Posts: 200
Joined: Tue Jul 17, 2007 6:08 pm

Post by Iltanen »

Great, I'd love to see a working gomoku on vic! I'll try to improve mine too, but it's hard because I'm not very good with machine language.. Is there a good free introduction available? The Reference guide doesn't help me enough, and I can't understand complicated ML programs
nippur72
de Lagash
Posts: 574
Joined: Thu Sep 07, 2006 8:35 am

Work in progress

Post by nippur72 »

I'm progressing on Gomoku...

I've been hardly hindered by the game strategy... I rewrote the "thinking engine" several times and now it seems to work, but it's rather slow. I suppose it's what you pay when you apply brute force in your algorythms!

Computer takes about 5-10 seconds on each move. I would like to improve it, so has anyone a good strategy to suggest?

Mine simply is:

1) simulate eavery possible move, counting the resulting combinations
2) choose the one that has lowest opponent combinations and highest computer combinations

Unfortunately, step #1 involves scanning the whole board for each move, with quadratically increasing complexity.

Image
Iltanen
Vic 20 Devotee
Posts: 200
Joined: Tue Jul 17, 2007 6:08 pm

Post by Iltanen »

I's consider 5-10 seconds very fast for a VIC.. It's on a 14x14 board?
nippur72
de Lagash
Posts: 574
Joined: Thu Sep 07, 2006 8:35 am

Post by nippur72 »

Iltanen wrote:It's on a 14x14 board?
it's 13x13 but I can change it increasing or reducing it (and it doesn't have to be square). The upper limit is fixed by the elapsed time that increases quadratically. A full screen version would be unplayable. That's why I'm looking for a better game strategy.
User avatar
orion70
VICtalian
Posts: 4343
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Post by orion70 »

nippur72 wrote:A full screen version would be unplayable.
...or playable on a warped VICE emu :wink: .
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

If you need routines to check for rows of three or four in each direction from a given starting point, I wrote some for my Othello game that I partly reused for Jewels. I think I even reused them in Re-Connectris. I don't know if they are faster though, as you probably can abort every search from an empty square.

Supposedly you can take advantage of the last placed "stone", that you usually only need to scan around it for openings. It is not entirely true though. I'd bet some quality research on the Internet may lead you to interesting discussions and algorithms for an AI in the Noughts & Crosses and Gomoku games.
Anders Carlsson

Image Image Image Image Image
nippur72
de Lagash
Posts: 574
Joined: Thu Sep 07, 2006 8:35 am

Post by nippur72 »

OK, now I have it full-screen and real-time, but playing strategy is not very striking. Computer beats me most of the times but it takes too long cause it stays on the defensive (it looks so).

My new playing engine uses the video ram so that in every free cell the score for the cell is calculated. Since free-cells are white, they are not visible during calculations.

Image
Richard James
Vic 20 Devotee
Posts: 269
Joined: Mon Feb 04, 2008 6:06 am

Post by Richard James »

I've been reading a book called "Beyond AI" and in it the author mentions the difference between leading Chess programs and Go programs. The Chess programs can beat a world master but the Go programs can only beat amateur players. I believe that following the path of computing the next move like in chess is way too computationally intense for the Vic. The author of the book says that human Go players can see patterns on the board but the computer always has had a problem with seeing patterns.

So if you can get the program to beat someone you are doing very well indeed. If the program is hard to beat you have written something brilliant.

I think I would start looking for some sort of winning patterns. I can't play Go I always get beaten (even by the PC) so I don't know what these patterns look like.
Change is inevitable except from a vending machine.
Post Reply