I am trying to write a program for the Witch

evert823

I am trying to write a program that can handle the Witch. Since I haven't heard of any other person taking this up. And as for existing engines, the Witch will be quite specific and it won't be easy to add this piece to existing code, that only deals with more or less normal pieces.

At this moment:
- It has no nice UI at all, no whatsoever board
- It has XML import and export routines and that's what I use while testing
- Imported XML is validated thoroughly
- It's supposed to handle all Witch rules, all normal FIDE rules (50 moves, repetition, castling, en passant etc etc), and various board sizes
- Creating list of all valid moves from a given position --> implemented and tested
- Executing the move on the board --> implemented and tested (sounds simple but this was the hardest thing so far)

- I have drafted the algorithm/pseudo code to evaluate a position, calculate from that position, detect Mate and Stalemate, and come up with the preferred move

My first target is that this program can find forced mate sequences, so I can draft a mate in 2 and it will solve it.

Long term target is of course: play a proper game, and have a proper visual board with dragging pieces etc etc

The draft that is now written and tested is here:

http://www.scrybqj.com/downloads/csharp/

amusingmouse

It will be hard...

amusingmouse

good luck!

evert823

I'm afraid this has my priority over modding other games, except my own games of course.

musketeerchess2017
evert823 wrote:

I am trying to write a program that can handle the Witch. Since I haven't heard of any other person taking this up. And as for existing engines, the Witch will be quite specific and it won't be easy to add this piece to existing code, that only deals with more or less normal pieces.

At this moment:
- It has no nice UI at all, no whatsoever board
- It has XML import and export routines and that's what I use while testing
- Imported XML is validated thoroughly
- It's supposed to handle all Witch rules, all normal FIDE rules (50 moves, repetition, castling, en passant etc etc), and various board sizes
- Creating list of all valid moves from a given position --> implemented and tested
- Executing the move on the board --> implemented and tested (sounds simple but this was the hardest thing so far)

- I have drafted the algorithm/pseudo code to evaluate a position, calculate from that position, detect Mate and Stalemate, and come up with the preferred move

My first target is that this program can find forced mate sequences, so I can draft a mate in 2 and it will solve it.

Long term target is of course: play a proper game, and have a proper visual board with dragging pieces etc etc

The draft that is now written and tested is here:

http://www.scrybqj.com/downloads/csharp/

 

Hi

are you the programmer of nebiyu or are you using it and customising it?

evert823

I've never heard of nebiyu before.

musketeerchess2017
evert823 wrote:

I've never heard of nebiyu before.

It’s part of the package in your download link that’s why i was asking.

evert823
musketeerchess2017 wrote:
evert823 wrote:

I've never heard of nebiyu before.

It’s part of the package in your download link that’s why i was asking.

It should download one zip file with the components of a Visual Studio 2019 C# project for a simple Windows Forms application. I don't see the nebiyu anywhere, perhaps you were confused with another link???

evert823

I did to one more evening of programming, and now I have a result:

 

This is mate in 3 plies (mate in 2):

1. Qxe7+ Kxe7

2. Wf3#

The program found it. happy.png

To find the first move it took a bit less than 20 seconds meh.png

The link in the OP now points to this version of the code that gave me this result.

evert823

The above also includes some very (very!!!) basic evaluation of material advantage, and draw by insufficient material.

deeper_thinking

Wow

evert823

I have implemented substantial improvements, and some half an hour before posting this I updated the files behind the link in the OP. The improvements are: more compact code, and a really very big step towards better performance. W.r.t. performance: a 4 plies deep calculation of an avarage Bulldog chess position will take some 5 minutes.

evert823
rychessmaster1 wrote:

does the program know that RvW is drawn

No not yet. These kind of observations are work in progres.

Legendary_Basilisk
evert823 wrote:

I am trying to write a program that can handle the Witch. Since I haven't heard of any other person taking this up. And as for existing engines, the Witch will be quite specific and it won't be easy to add this piece to existing code, that only deals with more or less normal pieces.

At this moment:
- It has no nice UI at all, no whatsoever board
- It has XML import and export routines and that's what I use while testing
- Imported XML is validated thoroughly
- It's supposed to handle all Witch rules, all normal FIDE rules (50 moves, repetition, castling, en passant etc etc), and various board sizes
- Creating list of all valid moves from a given position --> implemented and tested
- Executing the move on the board --> implemented and tested (sounds simple but this was the hardest thing so far)

- I have drafted the algorithm/pseudo code to evaluate a position, calculate from that position, detect Mate and Stalemate, and come up with the preferred move

My first target is that this program can find forced mate sequences, so I can draft a mate in 2 and it will solve it.

Long term target is of course: play a proper game, and have a proper visual board with dragging pieces etc etc

The draft that is now written and tested is here:

http://www.scrybqj.com/downloads/csharp/

 

To make a chess engine that can play bulldog chess, you should make a variant of stockfish that can play bulldog chess, you won't have to make the pruning function and the evaluation function from scratch. 

evert823
Legendary_Basilisk wrote:
evert823 wrote:

I am trying to write a program that can handle the Witch. Since I haven't heard of any other person taking this up. And as for existing engines, the Witch will be quite specific and it won't be easy to add this piece to existing code, that only deals with more or less normal pieces.

At this moment:
- It has no nice UI at all, no whatsoever board
- It has XML import and export routines and that's what I use while testing
- Imported XML is validated thoroughly
- It's supposed to handle all Witch rules, all normal FIDE rules (50 moves, repetition, castling, en passant etc etc), and various board sizes
- Creating list of all valid moves from a given position --> implemented and tested
- Executing the move on the board --> implemented and tested (sounds simple but this was the hardest thing so far)

- I have drafted the algorithm/pseudo code to evaluate a position, calculate from that position, detect Mate and Stalemate, and come up with the preferred move

My first target is that this program can find forced mate sequences, so I can draft a mate in 2 and it will solve it.

Long term target is of course: play a proper game, and have a proper visual board with dragging pieces etc etc

The draft that is now written and tested is here:

http://www.scrybqj.com/downloads/csharp/

 

To make a chess engine that can play bulldog chess, you should make a variant of stockfish that can play bulldog chess, you won't have to make the pruning function and the evaluation function from scratch. 

Yes that's how this can be approached. Advice taken.

evert823

A small step.

Convert a won position to an actual win is a bit tricky. Because the winning plan must be represented as a higher score for the moves that fit in the winning plan. The progress must be reflected in the score for a position.

Now I have a routine that covers this for the situation that I have to chase a lone opponent's King. It was a matter of giving a higher score for coming closer to the opponent's King, and the opponent's King coming closer to a preferred corner.

 

It's been tricky, but now TheWeirdEngine successfully chases the King into a corner and mates.

 

evert823

White to move.

I don't master K+N+B vs K.
In this position, Fritz says mate in 8. That's mate in 15 plies.
I gave it to TheWeirdEngine with 7 plies. It doesn't see the mate yet but just does corner chasing.

Countermoves done by Fritz.

Kb4 Ka2
Nd3 Kb1
Kb3 Ka1
Kc2 and tells me that it sees mate in 4
... Ka2
Bc1 Ka1
Bb2+ Ka2
Nc1#

PerpetuallyPinned

How much time are you giving the engine?

evert823

In the above position, to calculate 7 plies and find Kb4 took one minute and 40 seconds

PerpetuallyPinned

I'd try giving it more time.

How long to find mate in 7?