Moves that don't move Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Desired Features for Zillions of Games » Moves that don't move « Previous Next »

Author Message
Dan Troyka (Dtroyka)
Posted on Friday, February 02, 2001 - 8:11 pm:   

Zillions will let you "move" a piece to its starting space under certain circumstances. In game play a green bubble appears behind the piece and you simply click and release to execute the move. You can use a null move to change a piece attribute, flip the piece, change its type, or remove it from the board by self-capture. Provided you do something with the moving piece that Zillions recognizes as a move, such as change an attribute, you can also use the null move to flip, capture, or change the type of other pieces on the board. The null-moving piece, in short, can act like a button.

For some reason, however, Zillions disables a number of functions when the moving piece doesn't actually change position. As far as I can tell, it is impossible to cascade when the initial piece doesn't move, and the add-partial command is read simply as an "add" for all set-attribute, set-flag, change-type or flip commands, which severely limits the use of a piece as a button. I can't think of any good reason for this and would ask that when a move is defined so that the moving piece doesn't actually move (the piece is just clicked and released), these features work. This would allow a player to select a button that turns some feature on, and then make a move. It would also allow a player to toggle a piece attribute in a partial move, thereby enabling a special subsequent move in that turn.

As a specific example, I have been working on a game in which a moving piece can make a series of partial moves that ends when a neutral piece is pulled. As initially coded the player was prompted on nearly every partial move as to whether to pull or not to pull, which was very annoying. I tried to code it so that the player could make partial non-pulling moves and then click the piece when it was in a position to pull, thereby turning on a pulling attribute. No matter what I tried, however, clicking the piece ended the turn despite the add-partial (although the pulling attribute would be turned on).

Any thoughts on a workaround, by the way, would be appreciated. For now I have coded the game so that a neutral piece is pulled when the moving piece approaches it then pulls away. This works well enough but it is not a very satisfying solution.
Jeff Mallett (Jeffm)
Posted on Wednesday, August 13, 2003 - 7:03 pm:   

I know this is an old one, but if you have a ZRF where add-partial doesn't work, please send it to me and I can examine it. As far as I know add-partial should work here.

As far as cascading when no piece is moved, this doesn't make sense to me. The point of using cascade is that you can move multiple pieces.
David J Bush (Twixter)
Posted on Wednesday, August 13, 2003 - 8:18 pm:   

FYI I used cascade in Twixt to add links to a peg when a peg is placed. In other words a piece drop triggers a cascade of other drops (which is not quite the same as piece moves.) I don't know if this pertains to what Mr. Troyka is talking about, though.
Dan Troyka (Dtroyka)
Posted on Wednesday, August 13, 2003 - 9:16 pm:   

It'll probably make more sense to give concrete examples. Take the game Zonesh. Now suppose I wanted to add a special rule that any piece, optionally, could explode on its destination square and blow up all neighboring pieces. I might try to code this by allowing a player who wants to detonate a piece to first click and release that piece, thereby changing the attribute explosive to true, then use add-partial to force on that same turn an additional (exploding) move that actually moves the piece to a different position. As far as I know this cannot be done in Zillions.

Here's how I would try to do it:

insert (option "pass partial" false) in the game block

insert (attribute explosive false) in the piece definition

replace the zo macro with:

(define zo

((set-attribute explosive true) add-partial)

((set-flag explosive explosive)
$1 (verify not-friend?)
(if (flag? explosive)
capture (capture n) (capture s) (capture e) (capture w))
add)
)

When I do this the add-partial is ignored. If you click and release a piece, the attribute explosive is set to true, the move ends, the opponent moves, and only then can the explosive move be made. In short, the add-partial is treated exactly as an add and the piece is not given an additional move.

In my original post I was referring to the game Hobbes, in which I wanted to allow a player to click a monarch to turn on its ability to pull a neighboring soldier. This was not possible because clicking the piece to change its pulling attribute always terminated the move, making a subsequent pull on the same turn impossible.

Regarding cascade, suppose I want to have a button called launch that, when selected, uses cascade to cause a rocket situated elsewhere on the board to move across the board. I have also been unable to do this.

If I were to try this with Zonesh, I might designate the piece in a1 as the launch button and the piece in c1 as the rocket. The goal is to define the piece on a1 so that clicking and releasing it -- without moving it -- causes the piece on c1 to move across the board to c5. I might try replacing the zo macro with:

(define zo

($1 (verify not-friend?) add)

((verify (and (position? a1) (not-empty? c1)))
to c1 cascade c5 add)
)

No move is generated for the launch button with this macro. If you change the destination square to a5 (by putting a5 before "to c1" in the last line), the macro works with the button on a1 moving to a5, and the rocket on c1 cascading to c5. But as long as the selected piece does not change positions no move will be generated. This is true regardless of whether flip, change-type, change-owner, or capture is used in the move.

In both cases nothing is gained by not giving functionality to the command -- add-partial or cascade -- when the selected piece does not change position. I'd just like to be able to toggle attributes on and off in a partial move sequence, and to create buttons that trigger remote moves. Workarounds of some sort are usually available but enabling these features would be more convenient.
Jeff Mallett (Jeffm)
Posted on Thursday, August 14, 2003 - 3:31 am:   

Thank you for the examples. These are really two separate issues. I will explain what is going on...

1) Exploding

Zillions does understand that the in-place move is a partial move. However, after a partial move you get to continue moving (actually generating moves for) the same piece, and Zillions doesn't know which that piece is. For figuring this out, it uses the piece that moved (assuming it hasn't also been captured) or the piece that was dropped. Since neither happened, it assumes the partial move can't be continued.

I can modify Zillions so that in moves without drops/movements, it can figure out what that piece should be (similar to how the UI figures out which piece to click.) This seems reasonable. In your case the choice for the piece is obvious, but in other cases the choice may be fairly arbitrary if, for example, a move sets piece attributes for several pieces on the board. (Zillions goes by the moves only and does not keep track of which pieces generated them in the first place.)

2) Rocket

>No move is generated for the launch button

Actually the cascade is being generated correctly, and you can make the move by clicking on the c1 position. The move consists of a move from a1->a1 and the move from c1->c5. a1->a1 is a no-op though (optimized out), so c1->c5 is the only meaningful part of the move. Zillions looks at the c1->c5 move and figures that the best user interface for this is for the user to click on c1.

There are basically two ways to look at how the UI is done for moves. Your way would allow one to click on something (a button) to make something else happen somewhere else. Zillions' way allows a piece to generate moves -- normal-looking moves -- for other pieces. I chose this way to avoid inevitable game problems where it would hard for the game-player to figure out how to make his moves. I can see value in both approaches, but I fear any behavioral changes in this area would break some existing games.

Cheers,
Jeff
Dan Troyka (Dtroyka)
Posted on Thursday, August 14, 2003 - 10:43 am:   

Thanks for the information. I guess what I have in mind is that if a piece is selected and released without a change of position, causing some effect (change-type, set-attribute, etc.) for that piece or elsewhere on the board, the move is treated as a move to the current position. I.e., if the piece on a1 is selected and released it is treated as a move from a1 to a1, so that add-partial works from that position exactly as it would if the piece had actually moved there from another position. I would add the same request for dropped pieces. I have no idea if this is feasible but just throw it out for what it's worth.

The cascade logic makes sense and it seems that the create command allows an easy solution in most of the situations I previously encountered.
Ingrid Lael (Ingridlael)
Posted on Wednesday, January 18, 2006 - 7:45 am:   

Hi there, I know this thread is pretty much closed at the moment, but I thought it was woth the shot anyway (having seen Mr Mallet himself reply in here).

I'm trying to code a move wich implies not moving the piece in question, but every piece around it (king-wise) one square away (kind of a repeller piece). I tried a couple of combinations of add, add-partial, move types/priorities and cascade, to no avail.


Whst should I do? (I'm really confused right now)


Thanks for any insight you can share, and thanks for your time.


Cheers...
...Ingrid.
Karl Scherer (Karl)
Posted on Saturday, January 21, 2006 - 5:39 am:   

You asked the same question at another place.
As I suggested, there, drop a piece onto your pusher and move any other piece with capture/create such as:

to
mark
n
capture
(if (piece? pieceA) (create pieceA n) (flip n) else
...
(if (piece? pieceB) (create pieceB n) (flip n)
))

back
s
...;and so on for all directions
add

Zillions is not very good at doing many things at the same time (drops and moves in one go), but there is usually a way to implement what one wants.

Cheers, Karl
Karl Scherer (Karl)
Posted on Saturday, January 21, 2006 - 5:43 am:   

P.S.
Of course you can also have a ?Helper do the moves
in between the player's moves, but this can lead to problems with win-conditions and with the AI.
I use this approach a lot because in my solitair games it does not matter.

...and welcome to the group of Zillions programmers!

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: