Bug? Zillions passes when it shouldn'... Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Designing Games for Zillions » Bug? Zillions passes when it shouldn't « Previous Next »

Author Message
Ronald Hale-Evans (Rwhe)
Posted on Sunday, December 31, 2000 - 12:23 pm:   

I just wrote my first ZRF file, for a game I call Dough. Players take turns moving a piece as far as it can go in one direction on a 4x4 board. You win when you get 4 in a row (except diagonally), or when you create a compact square with your 4 pieces, or when your opponent corners you.

Zillions plays a pretty good game, but it cheats! Even though I have declared (pass-turn false), Zillions passes about 20% of the time! Same with (pass-turn forced).

Can anyone reproduce this? I am running Zillions under Wine, a Linux Windows emulator, version 20001202, with no actual Windows DLLs. Could that be the problem? It runs just about everything else OK.

Here's my ZRF file. Thanks, and happy New Year to all!

Ron Hale-Evans

*****

;; Dough

;; The only possible move: slide your piece all the way
;; till it bumps an enemy piece or the edge of the board
(define slide (while (empty? $1) $1) )

(game
(title "Dough")

(opening-sound "Audio\Register.wav")
(win-sound "Audio\Congrats.wav")
(loss-sound "Audio\YouLose.wav")
(move-sound "Audio\Slide.wav")
(click-sound "Audio\Click.wav")
(release-sound "Audio\CoinDrop.wav")

(description "Voted Best Game of the Year... NOT!")
(players Heads Tails)
(turn-order Heads Tails)
(pass-turn false)


(board
(image "images\TicTacToe\TTT4x4.bmp")
(grid
(start-rectangle 0 0 100 100) ; A1 position
(dimensions ;4x4
("A/B/C/D" (0 100)) ; rows
("1/2/3/4" (100 0)) ; columns
)
(directions (n -1 0) (e 0 1) (s 1 0) (w 0 -1)
(ne -1 1) (nw -1 -1) (se 1 1) (sw 1 -1))))

(board-setup
(Heads
(Coin D1 C2 B3 A4))
(Tails
(Coin A1 B2 C3 D4)))


(piece
(image Heads "images\Coins\heads.bmp"
Tails "images\Coins\tails.bmp")
(help "Coin: slides all the way in any one direction")
(name Coin)
(moves
((slide n) add)
((slide e) add)
((slide s) add)
((slide w) add)
((slide ne) add)
((slide nw) add)
((slide se) add)
((slide sw) add)
))


;; Your win conditions
(win-condition (Heads Tails)
(or

;; Your pieces are four in a row
(relative-config Coin n Coin n Coin n Coin)
(relative-config Coin s Coin s Coin s Coin)
(relative-config Coin e Coin e Coin e Coin)
(relative-config Coin w Coin w Coin w Coin)
;; Your pieces are adjacent and form a square
(relative-config Coin n Coin e Coin s Coin)
;; Your piece is cornered
(and (absolute-config Coin (A1)) (absolute-config (opponent Coin) (A2 B1 B2)))
(and (absolute-config Coin (A4)) (absolute-config (opponent Coin) (A3 B3 B4)))
(and (absolute-config Coin (D1)) (absolute-config (opponent Coin) (C1 C2 D2)))
(and (absolute-config Coin (D4)) (absolute-config (opponent Coin) (C3 C4 D3)))
)))
Dan Troyka (Dtroyka)
Posted on Sunday, December 31, 2000 - 4:54 pm:   

Try adding a verify empty? to the slide macro so it reads:

(define slide $1 (verify empty?) (while (empty? $1) $1) )

It appears that the current macro permits a null move for the AI -- it adds even when there are no empty spaces in the given direction -- which is interpreted as a pass.

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: