Ultima

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
hgm
Posts: 28391
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Ultima

Post by hgm »

Evert wrote:By the way, my experience with null move in something like KRK is that the engine completely fails to deliver mate. I think that's to be expected though, since zugzwang is important for driving the lone king to the edge of the board.
This was my experience too. But Bob reported that Crafty had no problem winning KRK with null move on. So it seems to depend on the details of the Piece-Square Tables.

Btw, how are you doing with BigSjaak? I hope you have not given up on that. It would be very nice to have an other 10x10 (and I suppose then also 10x8) capable engine. I will most certainly do another "Battle of the Goths" general 10x8 championship later this year. We already have enough new engines to make it worth it.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Ultima

Post by Evert »

hgm wrote: This was my experience too. But Bob reported that Crafty had no problem winning KRK with null move on. So it seems to depend on the details of the Piece-Square Tables.
Maybe... but I don't see how white is going to make progress in this position if black just keeps null-moving:
[d]8/8/3k4/4R3/3K4/8/8/8 b - -
Btw, how are you doing with BigSjaak? I hope you have not given up on that.
No, not at all. Progress has just been very slow over the past week or so. I'll try to get it to a state where it works properly (with or without the special rules needed for Grand Chess) before the end of the week. Next week though I'll be at a conference, so I probably won't get much work done on it.
It would be very nice to have an other 10x10 (and I suppose then also 10x8) capable engine. I will most certainly do another "Battle of the Goths" general 10x8 championship later this year. We already have enough new engines to make it worth it.
It should be able to do all rectangular boards that have 128 squares or less, so including 10x10, 10x8, 10x12 and 12x10. Unfortunately I won't be able to extend that to make it play Tamerlane unless I make a major change to the way I keep track of promotion possibilities for each piece. As it is I'd have to make each pawn its own piece type, which doesn't fit in 16 different piece types maximum...
PK
Posts: 908
Joined: Mon Jan 15, 2007 11:23 am
Location: Warsza

Re: Ultima

Post by PK »

BTW I'm afraid I'm afraid I won't manage to get Oberon working on big boards in time for Grand Chess, especially after I started using it as a tool for... learning object oriented programming. Nice for catching bugs, but not for coding fast, especially with little time in my hands.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Ultima

Post by Evert »

Evert wrote:Maybe... but I don't see how white is going to make progress in this position if black just keeps null-moving:
[d]8/8/3k4/4R3/3K4/8/8/8 b - -
Ok, badly worded there: if black always null-moves (except in check) it's easy. But if he sometimes does and sometimes doesn't, it's another story.

But, it probably does make a difference whether to code outright prunes a node when the null move fails high or whether it just reduces the search depth.
User avatar
hgm
Posts: 28391
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Ultima

Post by hgm »

But even with null-move on, you cannot null move in the PV. So in an N-ply search, there must be at least one line of N-ply without null moves. Now if that sequence contains good black moves, but poor white moves, so that it makes no progress, it becomes very difficult to find improvements. Any better white move can be refuted by black null moves, which slow down progress (and shorten the line).

But if you tend to pick moves that make progress to extend the PV in the next iteration, you will eventually arrive at the mate. It just becomes impossible for white to improve on the first move he picks.
Daniel Shawul
Posts: 4186
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: Ultima

Post by Daniel Shawul »

Yesterday's test was wrong as you can see in the PGN , I used D and G :oops: But I tested again and it works. Six more variants are added. Taking each pieces of Ultima on a 10x8 board and replacing the A and C of capablanca chess with those, you get Withdrawer chess, Immobilizer chess etc..
Three more pieces Advancer, pushmepullyus, and grass hoper are added too.

Allow king capture is the default now.

And also one serious problem contributing to tree explosions is removed. For root move ordering and easy move selection , I did a minimax qsearch with full window. This apperently is too much for Ultima search which can have big qsearch. I changed that to simple eval() and it reached depth = 10 quickly but the previous one didn't manage to finish qsearch. This is the power of alpha-beta comapred to minimax !

After the above two changes , I stopped getting tree explosions.
New version : http://sites.google.com/site/dshawul/Ne ... edirects=0

The Alien version will always allow king captures from now on. Attacks() is a waste of code, and also very slow. It makes even the orthodox chess 2x slower.

There is a chameleon chess but it seems I have to update the move generation of chameleon everytime I add a new piece. Can you think of a way to generalize the move generation of this piece ?
I have added many other fairy pieces that can be used to generate many games. But the chameleon can't imitate them, it can only do the ultima pieces.
User avatar
hgm
Posts: 28391
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Ultima

Post by hgm »

It depends a bit on how you generate captures in the first place. For reguar Chess pieces that capture by replacement, I guess you could simply throw a capture test on all opponent pieces to check if the piece can capture the Chameleon, and if it can, the Chameleon should be able to capture it back. (It is a but a matter of taste how you would make an asymmetric piece like a Shogi General perceive the Chameleon; I ussume the logical thing would be as the same type of General, but of opposite color.)

Btw, I get the impression that the value of the Chameleon is not fixed. It depends on what the opponent has.
Daniel Shawul
Posts: 4186
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: Ultima

Post by Daniel Shawul »

Yes but that has two problems. One I have to generate moves for the opponent making the move generator two times slower and even more when there is a leaper.
If the chameleon jumps over the longleaper first, it will have many possiblilities to capture along the way. If that test is done for each landing square, it could be 5x slower f.i

For example in the diagram below the white chameleon captures all the black pieces. N = long leaper, B = chameleon and R = coordinator
[d]

The value of chameleon should definately be higher in the opening. It should lower when immobilizer, long leaper are gone...
It is good that a chameleon don't do anything to another chameleon, otherwise it is infinite loop ;)
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Ultima

Post by Evert »

hgm wrote:It depends a bit on how you generate captures in the first place. For reguar Chess pieces that capture by replacement, I guess you could simply throw a capture test on all opponent pieces to check if the piece can capture the Chameleon, and if it can, the Chameleon should be able to capture it back.
Here's how I think I would do it with Sjaak.
Get a list of all enemy piece types. For each piece type from the list, generate captures on enemy pieces of that type from the location of the Chamaeleon. Repeat until all piece types have been examined.
This is all fairly simple using bitboards, maybe a bit more cumbersome if you need to be board scans. The main advantage of this method is that things will speed up a bit as pieces disappear from the board.
(It is a but a matter of taste how you would make an asymmetric piece like a Shogi General perceive the Chameleon; I ussume the logical thing would be as the same type of General, but of opposite color.)
That would be a problem for Sjaak, which doesn't deal very well with asymmetric pieces (they need to be defined as different piece types for black). I agree that would be the sensible way to do it though.
User avatar
hgm
Posts: 28391
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Ultima

Post by hgm »

Daniel Shawul wrote:Yes but that has two problems. One I have to generate moves for the opponent making the move generator two times slower and even more when there is a leaper.
If the chameleon jumps over the longleaper first, it will have many possiblilities to capture along the way. If that test is done for each landing square, it could be 5x slower f.i
Well, what I said applied to capture of regular chess pieces by Chameleon, not to capture of Ultima pieces. In fat all regular Chess piece types (that do replacement capture without side effects) could be considered one "piece family". Pieces that capture something by jumping over it would be another piece family, etc.

For each piece family you would have to do a different test to see if the Chameleon can capture it, which makes Ultima a hard game. But doing "Chamelon Chess" with FIDE + 2X on 10x8 already simplifies the Chameleon move generation a lot. You only have to do a 0x88 capture test for each piece. That is a lot less work than generating all moves of every piece. Chameleon moves to an empty square can never be captures, in such a game.

But if any members of other piece families are present, life is more complicated. Even moves to empty squares could have side effects. But fortunately, for many victim families the tests are simple. E.g. Withdrawer type will only be captured if there was a Withdrawer-stryle piece next to the Chameleon in the direction opposite of motion (and then only if the Chameleon moves in a direction that Withdrawer could move in). In that case all moves in that direction would share the same side effect, so you would have to do the test only once. Leaping capturers you just run into when generating moves along the ray. In Chess you would then count replacement cature a valid move when that happens, but here you would have to check if it is a Leaper-style victim, and if the square behind it is empty.

The most nasty are the Pincer and Coordinator-style captures. Those would indeed have to be tested for on every to-square. An alternative here might be 'retrograde' capture generation, starting from the victim. E.g. in the initial position of Ultima you have 8 Pincer Pawns, that each have 4 moves. That is already 32 Pincer moves, and the number rises when you break the closed rank of them, due to sideway moves. (Move 1 forward, and you get 9 extra...) It would be kind of expensive to test for all of these 32+ moves in 3 directions if something gets sandwiched. It could be cheaper to run through the opponent piece list (16 pieces), and check every piece for an opponent neighbor that could act as 'backer' for the sandwich (in 4 directions). Because usually there will be none, and that immediately rules out the piece can be captured this way. If there is a backer, and an empty square on the other side, you could try to generate all Picer moves to that empty square, from piece list Pincer section, 0x88 alignment test and ray scan. you could mark all squares where a Pincer would capture something (e.g. with a bit mask to indicate what it captures), and do normal generation of Pincer moves, testing the masks on the to-squares.