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.

DarkBASIC Discussion / DBC Chess program. I need some advice

Author
Message
Phil the Dill
20
Years of Service
User Offline
Joined: 29th May 2006
Location:
Posted: 31st May 2006 04:06
Could anyone who has written a chess program before in DBC give me some advice and also tell me the problems they had while making it? I would just like to know what to avoid and etc... and how to make certain parts of the program. I know the basic ideas of all the functions required like the evaluation, move generation, search functions etc but would just like some guidance as to how to allocate the generated moves in an array for example.

Thanks to anyone who replies
Dark Eternity
21
Years of Service
User Offline
Joined: 10th Jul 2004
Location: Vana Diel
Posted: 31st May 2006 12:32
problem I had was designing the engine, it needs a hell of a lot of work... but keep at it and once the start is done everything fits into place...

I am DarkEternity (DE for short) OWNER OF ANIRE!!!
We are looking for a coder, modelers etc
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 31st May 2006 13:29
When I attempted this, I used a long string with a delimiter, and X Y alpha coordinates.

So something like:

0 1 2 3 4 5 6 7
A
B
C
D
E
F
G
H

So moving piece G0 to E0, like a pawn moving forward two - might look like this:

G0E0:

Which would be stored in a string.

All the possible moves would be stored, then using a buffer board, you set it to your current board layout, and perform each move in the string, delimited by :. The next most likely move from the opponent would be added, then the next player move added onto that.

Say for instance the opponent copies the player:

G0E0: Becomes G0E0:B0D0

So a 256 byte string would store 28 moves, perfectly fine for a DB chess game.

After performing both moves, the AI is back with that current move thread and can calulate the next player move.

You'd start with a list of possible moves, then for all those, add the opponent move, and that list then exponentially grows, using that original list as a seed, you end up with a big array full of moves, all starting from these possible moves, most of them referencing the same move but with different movement variations.

When you calculate each buffer move, you can update a seperate score array for each player - so each move keeps it's final score, and you select the best scoring move when your finished your analysis.

Aegrescit medendo
Phil the Dill
20
Years of Service
User Offline
Joined: 29th May 2006
Location:
Posted: 1st Jun 2006 11:26
Thanks for replying so soon.

I've started writing my chess program and it sofar has approx. 800 lines of code. I decided not to use your idea of storing the moves as string entries because it seemed to me as memory wastage if you need 40 bits to store each move. Instead I saved it into an array with 3 parts for the from square, destination square and the move type. (btw I labelled the squares on the board 0 to 63). I believe this would make move generation easier because all you have to do say for a pawn move, is check if the current square value+8 is free etc... Also, it allows you to store more moves, (easily at least) because there are some chess positions with over 200 possible moves.

Could anyone suggest any imrovements on this method or problems?

thanks
Phil
waffle
23
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 5th Jun 2006 06:44
for extra fun, check out my chess program on my website
[href]www.archonrpg.com[/href]
it has source code, and can be multiplayer.
There is no AI for it because I just wanted to test some
multiplayer stuff.

The code is for DBPro. I don't like releasing full source material,
but if you email me, I give you a link to the full source.
Phil the Dill
20
Years of Service
User Offline
Joined: 29th May 2006
Location:
Posted: 7th Jun 2006 04:13
Thank you but I actually need help on the computer AI at the moment. I also do not plan on making my chess program multiplayer (as in different computers, but maybe on the same computer) until I have absolutely everything else finished which will take a long long long time! Besides I have DBC and I doubt there will be the same multiplayer commands... Thank you for the offer though.
Phil the Dill
20
Years of Service
User Offline
Joined: 29th May 2006
Location:
Posted: 7th Jun 2006 04:17
I tried to download it anyway except it gave me an error message when I tried to run it, something like some dll files that couldn't be found.
Phil the Dill
20
Years of Service
User Offline
Joined: 29th May 2006
Location:
Posted: 10th Jun 2006 06:00
Could everyone check out my other post called "Help on a function (DBC)" or so and read it (newbies corner), and possibly answer my question?
Phil the Dill
20
Years of Service
User Offline
Joined: 29th May 2006
Location:
Posted: 15th Jun 2006 02:22
DB (not pro) help please on a function... is real name of topic

Login to post a reply

Server time is: 2026-07-07 02:18:49
Your offset time is: 2026-07-07 02:18:49