Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
blather
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: United States
Posted: 9th May 2003 09:30
does anybody have a basic, and I do mean stripped down, no frills no spill chess game written in DB?
"N. foolish talk esp. in great quantity"
Webster's
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 9th May 2003 11:13
I could tailor the board and peices quite easily in 3d but u would have to work on the ai and control methods.

indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 9th May 2003 11:43
here is a real simple example of a chess board

Cras
23
Years of Service
User Offline
Joined: 15th Oct 2002
Location: United Kingdom
Posted: 9th May 2003 14:56
chess would be really hard to make. the ai would have to react to your every move.
andrew11
23
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 9th May 2003 15:41 Edited at: 9th May 2003 15:52
Oh don't take my project!

Go to my website to see screenshots of the chess game i'm working on. Click on "3D Chess" at the bottom.

I have been working on it for about a month. I'm already done with control and the pieces. The hardest part is the computer AI.

http://www.geocities.com/andrew11m

"All programmers are playwrites and all computers are lousy actors" -Anon
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 9th May 2003 15:45
Chess is complicated, I mean nightmarishly complicated, but not as complicated as most people think.

I started a chess game, and had very basic single move AI working, but it's the thinking moves ahead part that's the killer.

The principle is easy to get to grips with though. Each piece has a value, depending on how many spaces each piece can move to depending on each legal position on the board. Therefor, a Bishop could move diagonally any number of squares, so it's a higher value than a knight. Now - the cool thing is you can very easily calculate a score for each player at any time, by simply totalling each pieces score. So, you would calculate each score, then step through each piece that is under threat, and remove it's score from the totals. This is when it gets complex, you would have to store all the possible moves for each piece and the score they result in. It would be easy to get to the stage I'm at because the AI simply selects the move with the highest score result. The real AI would require you to calculate many moves ahead, including guessing the opponents move. That's how it works, it calculates everything, looking for a really high scoring move - which could be 10 moves down the line.

If you imagine the AI as a massive tree - the trunk would be the board before moving, then the first move would be the branches, then each calculated move after that would be twigs, and they grow expodentially into thousands of combinations. The data organising is immense, but that's the difficult part, chess is really just a massive maths and logic puzzle. When I organised my data, I used strings to signify the move data, and sorta grow each string. So the first branch would be something like "A2-A4", moving the leftmost pawn forward 2 places. Now with all these branch moves - I used a dummy board to calculate the scores, so each move is calculated, then stepping through the branches and adding the most obvious opponent move (using the score), you add twigs for each possible move. I just added a new data string, with the moves in it, so "A2-A4" becomes "A2-A4|B7-B5", then "A2-A4|B7-B5|A1-A3", but each new move data is an individual record with a score.

Hope this is of some help.


Van-B
blather
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: United States
Posted: 11th May 2003 09:20 Edited at: 11th May 2003 09:24
WHOAH! now I don't think I am going to go off and create DeepBlue, Mans last threat in the chess world so don't worry andrew11. Thoguh I doo have some questions about your' board. Do you think it is a little tight? Can you rotate the camera for a better view, not just the overhead? Checkout the source indi left here.

[indi] Thanks for the script and the offer for the 3ds but I am only starting with something more basic. 2D and bitmaps or maybe some animated sprites. Right now I am only in the pen and paper stage, reall its in Visio for the diagramming.

[Van B ] A little deep but I unnderstand some of what you are saying. Having played chess alot the AI would be a challange. I coppied your' notes to word for use later. The scoreing and move data storre is very intresting. Mostly I and friends never played for points but win/loose/draw.

Thanks for the input guys.

"N. foolish talk esp. in great quantity"
Webster's
andrew11
23
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 11th May 2003 18:22 Edited at: 11th May 2003 18:24
Yeah, I'm working on the scale of the pieces to get it just right, but you can rotate the camera around and change where it is pointing. Also, in the top-left corner is a view of the board from the top. I saw indi's source and I don't really like that camera motion. Mines a bit different. I have alot left to do!

"All programmers are playwrites and all computers are lousy actors" -Anon
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 11th May 2003 19:11
Quote: "Oh don't take my project!"


It happens to us all

You are the th person to view this signature.
Programmers don't die, they just Gosub without return....
ChrisS
23
Years of Service
User Offline
Joined: 24th Apr 2003
Location:
Posted: 13th May 2003 19:36
David/Andrew

If you are both working on a chess program why not make then net playable and then have them play each other

All you would have to do is agree on the data structure to pass moves etc.

Could be quite fun to watch

andrew11
23
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 13th May 2003 23:14
THat is one of the future features. See my site. I have already planned everything, data structure, AI. All I have to do now is program it. Easier said than done!

"All programmers are playwrites and all computers are lousy actors" -Anon
Chessplayer
23
Years of Service
User Offline
Joined: 22nd Dec 2002
Location:
Posted: 16th May 2003 02:08
Cool! Are any of you serious chess players? (I am!)

This is still Chessplaer! I just decided to spell my handle correctly!
soap_shoes
23
Years of Service
User Offline
Joined: 22nd Dec 2002
Location: United States
Posted: 21st Jun 2003 07:09
when i was in school (no i didnt drop out, its summer) i was in a chess club. it was really fun and we went to tournaments and stuff.

andrew 11, be sure to make your game online so i can school ppl.

lol
max

Do not give up for the beginning
is always the hardest...........
Mentor
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 21st Jun 2003 11:35
I wrote a simple chess player years ago for the Electron, a simple way to do the AI is to make the computer go through all the possible moves for one side and store the results with a score system, most important part of chess (IMO) is to retain control of the center of the board, so pieces that cover the center get higher scores than the same piece protecting the edge, you save the lists of possible moves and take the best 100 by sorting the scores, then you try the other side responding to the best 100 moves and store their results, then use the best 100 for the reply to that, then you calculate the scores for the reply to that, and then go down the chain of moves and add all the scores, then move the piece on the first level that gives the highest scoreing result, not deep blue level, but works pretty well, then you just need to add some endgames to allow the program to finish, since simple programs like that go round in circles when they get to endgames (3 ply is too weak to find it`s own endgames)

Mentor.

betpet
23
Years of Service
User Offline
Joined: 16th Jan 2003
Location: United Kingdom
Posted: 23rd Jun 2003 19:54
As someone who wrote a chess program in C for his final year project at Uni, I can safely tell you that the basics are easy. The AI is nightmarishly hard unless you read up on it.

The best thing I can recommend is to have a scoring system. When you start parsing the moves tree, you can store the initial move in an array and the highest score next to it. You only have 16 pieces at most so for each piece, store the score of each best move in an array of size 16, and as you parse, update the pieces' score. Naturally, the highest score would be the best move.

Now, the real problem is coming up with the AI for the scoring system. As of around Febrary 1999, I hadn't found a single paper about analysing positions in chess. There may bo one now but I don't know who by or what its called. I'd talk to a good chess player about their ability to analyse positions.

FYI, I could only get it to go 2 moves ahead in time for the deadlines.

Login to post a reply

Server time is: 2026-07-06 06:43:04
Your offset time is: 2026-07-06 06:43:04