AI strange behaviour Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Designing Games for Zillions » AI strange behaviour « Previous Next »

Author Message
Artur Damezzi (Netto)
Posted on Wednesday, January 01, 2003 - 1:18 pm:   

I created a piece to simulate an Archer, by capturing enemy pieces from a distance, using the shogi prisioner-check procedure when coming to the square where the enemy is. After the procedure I still added a capture statement, which (I can't understand why, since the prisioner check should be enough) helped the AI in some circonstances. But still sometimes I notice that zillions sacrifices a piece without any noticeable reason placing it in front of the archer, as if it hadn't recognized the danger.
Since the prisioner check procedure changes the piece owner, zillions should recognize the danger in any situation, I suppose. And, in fact, in almost all cases it recognizes it clearly, but still in some cases...


This same flaw can be seen with a piece I created that freezes all adjacent pieces. I used a verify statement at the begining of each piece's move generation that will return false if that piece is adjacent to the specified piece.
Still so the AI seems sometimes to fall in the trap and throw his piece adjacent to the freezing piece as if it hadn't noticed it would be freezed.

I would be grateful to have any help on this.

Thanks
Jeff Mallett (Jeffm)
Posted on Wednesday, January 01, 2003 - 2:13 pm:   

I can understand the behavior in the freezing game. There's no Zillions concept of freezing, so the only way it could know that it's getting itself forever into a bad situation would be for it to analyze the move code and derive some sort of "higher-level understanding" of the logic. All it can see in the look-ahead is that one of its pieces has little mobility in the short term, which is pretty minor and may be made up for by the mobility of other pieces and other factors. If you want to give Zillions more of a chance to avoid getting frozen, an alternate strategy might be to change-type into a "frozen knight", "frozen bishop", etc. These pieces would have no movement, so Zillions would recognize they are weak.

For the rare cases where Zillions doesn't recognize danger from an Archer, I'd have to see the game as well as an example of the strange move in order to determine what's going on. It could be a bug, but almost always when I look into these sorts of things it ends up being the result of either (A) a deep calculation, where it's avoiding some other dangers that aren't obvious, or (B) a different valuation of the pieces than the player expects.
Artur Damezzi (Netto)
Posted on Thursday, January 02, 2003 - 12:17 pm:   

For the freezing I didn't express myself well. The piece is freezed only while adjacent to the freezing piece. But in that case I can't be sure that the AI wasn't counting with it. But in the case of the archer here goes an example: once zillions droped two pieces in front of it to protect a more valuable piece. After capturing the two pieces it offered me he decided to move away the piece he was trying to protect. He could have done that at first, since the only thing that changed in the board configuration were the reserve pieces (pieces to drop) he transfered me.

The code for the archer (which I don't have here at the moment) is something like:

(if enemy?

(prisioner-check) ; taken from shogi -
;changes piece's owner and places it in reserve

capture
;which I thought unnecessary, but seems to improve AI

add
)

Having the code at hand I will send it to you.

Thank you,

Netto

Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: