Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  AI Contest : Chess  (Read 9081 times)
0 Members and 1 Guest are viewing this topic.
Offline saucymeatman
« Posted 2013-12-05 21:22:37 »

How cool would it be if we built chess AI's around a central chess framework (Board data, and such) and then had them compete? Yea, I know its like that movie "ComputerChess" but I still think it would be fun.

Chess is a great game and I think it would be a real challenge to build a good chess AI that could beat other chess AI's.

This would be a contest because your AI would be competing with the other contestants AI's. Yes I am suggesting a contest.
Offline Opiop
« Reply #1 - Posted 2013-12-05 21:27:41 »

So... Why is this in the contest board? Are you suggesting a new contest for creating AI for chess?
Offline ags1

JGO Kernel

Medals: 367
Projects: 7

Make code not war!

« Reply #2 - Posted 2013-12-05 21:34:41 »

I've got a Java chess app lying around with three AIs implemented - dumb, dumber and dumbest :-) The game was called Tiny Chess because it was meant to be tiny - maybe I will enter it in the 4K competition.

If I recall correctly I modeled the board and the rules, so that for any board position I could get all possible moves.

The AIs then simply rank the moves according to various systems.

DUMBEST simply picks a move at random - it is officially the worst chess player in the world. You can play worse deliberately of course.

DUMBER is actually quite clever and can beat me. It loops through all its possible moves and scores the board: you get points for every move available to your pieces in the new position, you lose points for every possible move your enemy has, you get points for every piece you defend and every enemy piece you threaten (and vice-versa for the enemy). Then DUMBER simply takes the highest scoring move.

DUMB is exactly the same but looks two moves ahead and tries to instead of picking the move based on highest scoring position, it plays the next enemy move and scores its own move by the enemy's score - I don't know if it was an improvement, it was just too slow.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline saucymeatman
« Reply #3 - Posted 2013-12-06 01:53:40 »

Thats pretty cool. For the DUMB or DUMBER you should have it increase the score also if the move to be made is a center controlling move.

Opiop, I edited the post to make myself more clear, but the answer is yes I'm suggesting a contest.
Offline HeroesGraveDev

JGO Kernel

Medals: 382
Projects: 11
Exp: 4 years

┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻

« Reply #4 - Posted 2013-12-06 03:29:20 »

I don't have the time to make an AI myself (maybe tomorrow), but I can share what I think is the general idea.

1. Opening moves. Obviously working out all the possible combinations of even the first 2 moves won't do you any good, so have a strategy defined to use all the time (or pick randomly from multiple).

2. General play. This is the main challenge. My idea here would be to take the value of each piece (1 = Pawn, 3 = Knight/Bishop, 5=Rook, 9=Queen, 1000=King), and then brute force all the possible (valid, but that should go without saying) outcomes for the next 2 moves. Add numbers for the value of each piece you take, and subtract for each piece you lose. Make sure to average the opponents moves so you end up with a result close to halfway between best and worse case scenarios. Also add/subtract points for putting/getting in check. Then take the best outcomes, and compare how many moves the opponent has. The less moves available to them, the better. Then you can pick randomly from the available options, and do the first move of that sequence.

3. Finishing moves. When you have taken out most of the opponents pieces, the previous techniques won't work. II'm not entirely sure how to do this part, but you can figure this out your own way.

The reason above for having the king at such a value is to sway the AI away from moves that have any chance whatsoever of leading to checkmate (unless of course there is also a chance of putting the other player in checkmate).

I think this system is a good place to start, but would need lots of tweaking to have a chance in a proper game.

Offline Agro
« Reply #5 - Posted 2013-12-06 03:35:24 »

I'd probably just write a rating algorithm for all possible moves. It would probably factor in things like what pieces you're getting closer to, if its opening up "better" moves, if it captures a piece(should also take in what piece it captures), whether you can/will get taken afterwards, if it guards another piece etc.

would be cool if you guys also did some machine learning stuff :O

you need to organize a team to write the base for the chess app tho, i would be interested in helping, i got a free 7th period at school Cheesy

Offline HeroesGraveDev

JGO Kernel

Medals: 382
Projects: 11
Exp: 4 years

┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻

« Reply #6 - Posted 2013-12-06 03:48:00 »

The base chess app should be a server so you can link up a bot and a bot, a bot and a human, or a human and human depending on the client. It would also require minimal effort if we also programmed a basic client.

I've already started working on something, and might be able to get it running in the next few hours.

EDIT: Nope, not going to get it done today. Someone else should do it instead. I'm too lazy.

Offline Agro
« Reply #7 - Posted 2013-12-06 06:24:54 »

well, scratch networking for now. Just write a Chess game with an API that'll let you make moves, analyze board etc. then make a plugin system that allows people to load AI, networking comes later.

Offline delt0r

JGO Wizard

Medals: 143
Exp: 18 years

Computers can do that?

« Reply #8 - Posted 2013-12-06 12:22:07 »

There are already quite a few such AI plugin frameworks out there for chess. Perhaps not in java, but the interfaces don't prevent java AFAIK. AI in chess is more or less a done deal with a min/max tree pruning being the way to do it.

I think it is perhaps less interesting that some other games like Go, or Stratego.

I have no special talents. I am only passionately curious.--Albert Einstein
Offline Damocles
« Reply #9 - Posted 2013-12-06 12:37:11 »

I have made a simple minimax depthsearch Chess AI a while ago.
It did not handle all rules yet (like Castling), but was in a playable state.
(the cutoff heuristic was simply the value of pieces on the board, like 100 for the queen and 10 for a pawn)

For a competition, you just need to define an interface to talk to
-reset board
-assigned color
-move from - move to
-special actions like turning pawn, checkmate etc.

then each ai gets a runcommand and the recent parameters.

could also define a maximum time allowed to process for each AI to keep it fair
Pages: [1]
  ignore  |  Print  

EgonOlsen (76 views)
2018-06-10 19:43:48

EgonOlsen (56 views)
2018-06-10 19:43:44

EgonOlsen (76 views)
2018-06-10 19:43:20

DesertCoockie (256 views)
2018-05-13 18:23:11

nelsongames (156 views)
2018-04-24 18:15:36

nelsongames (155 views)
2018-04-24 18:14:32

ivj94 (896 views)
2018-03-24 14:47:39

ivj94 (157 views)
2018-03-24 14:46:31

ivj94 (809 views)
2018-03-24 14:43:53

Solater (173 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!