Bastard Othello

Discussion, Reviews & High-scores

Moderator: Moderators

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

Bastard Othello

Post by carlsson »

For a couple of weeks, a nagging thought has grown in the back of my brain: what would it be like to play Othello with the rule variation that you can only flip opponent's markers whenever you have fewer markers than him/her?

I don't follow the world of Othello/Reversi (is there any difference?) players so I don't know if this kind of game has any name. I know in the world of Chess there are dozens of variations, one more bizarre than the other.

Anyway, today I decided to spend five minutes with the problem. Since I already have a mostly playable version of Othello made for the MiniGame Compo 2002, I decided to hack in a conditional which will flip markers only if you have fewer on board than the opponent, not counting the marker you're just about to place. The exact rule set can be discussed, whether this marker should be counted or not and whether the cutoff should be less than or equal number of markers.

If anyone wants to play this slightly odd Othello game, you can download a Zip file which contains a PRG plus the source code. It is a bit beyond 1024 bytes now but in theory I could reallocate a lot of workspace to lower 1K. Anyway, I'd probably expand this into a bigger Othello game with joystick control and the option to choose game variation.

http://www.cbm.sfks.se/files/bothello.zip

Image

The screenshot is from the former (original) release but it looks the same. :-D

I'm not sure if this should be called a release, so I'll not post in that thread for now. Call it a test of concept or work in progress, although I find it unlikely I will work a lot on it within soon. I have a few more urgent VIC-20 game projects to take up, this was more for the sake of it.
Anders Carlsson

Image Image Image Image Image
Diddl
Vic 20 Afficionado
Posts: 425
Joined: Wed Jun 10, 2009 3:18 am

Post by Diddl »

nice! i don't know othello is implemented on VIC.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Actually there are a handful of Othello games for the VIC-20. Some may even have an advanced AI while my algorithm is a simple brute force one, looking to capture as many markers as possible with emphasis on the borders and corners.

I played this variant a bit last night and I'm positively surprised. It adds quite a bit of strategic element to the game, just like you would need strategy added to an already strategy board game. Whenever you are a few markers short, you can try to set up winning positions without taking the temporary lead. When you are in the lead, you just try to secure some of the more important locations.

The computer AI as mentioned uses brute force and is currently not tuned to the rule set which means the computer will try to capture a lot of markers but will be denied all but one. It can lead to rather interesting scenarios. One of the games I played last night, I had a big lead and in the end game the computer yet could not make any valid moves. It meant I got to place one marker at a time on the board until it was full.

For those who prefer the original rule set, I may just as well post the link to the original 2002 version:
http://www.cbm.sfks.se/files/othello.zip
Anders Carlsson

Image Image Image Image Image
wimoos
Vic 20 Afficionado
Posts: 348
Joined: Tue Apr 14, 2009 8:15 am
Website: http://wimbasic.webs.com
Location: Netherlands
Occupation: farmer

Post by wimoos »

I looked through this ML version of othello and the algo appears the same as from the Basic version. In each move it tries to capture as many pieces as possible. A random function is added to diffuse the game a little.
I have optimized the Basic version, so that it takes approx. 10 seconds to calculate the next move. The ML version is obviously quicker.

But taking as many pieces as possible in each move is not necessarily the best strategy. The position of the next piece should also be taken into account. So there is another Basic version that determines the next move based on its position on the board. This one is still easy to beat, though.

Do you have a real AI / brute force version for me to test ?
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Err.. yes, I translated the Basic algorithm. Can't remember any random element though. There are modifiers for borders and corners.

What you suggest is some look-ahead in the algorithm, evaluating the possible moves from the opponent. I never went that far, due to I think it would use a fair amount of memory. Please notice the original game was within 1K of code which was the compo limitation.

If you like, you're welcome to improve the algorithms. Most important for this game variation would be to capture as few or unimportant markers whenever the computer is in the lead, since there would not be any actual capture in that phase.
Anders Carlsson

Image Image Image Image Image
wimoos
Vic 20 Afficionado
Posts: 348
Joined: Tue Apr 14, 2009 8:15 am
Website: http://wimbasic.webs.com
Location: Netherlands
Occupation: farmer

Post by wimoos »

Can't remember any random element though.
When determining the best move there is a LDA 162 in your lines.
Post Reply