| Author |
Message |
John Nickerson (Mokalus)
| | Posted on Wednesday, December 25, 2002 - 5:47 pm: | |
I'm re-implementing a game I wrote a while ago that somehow got lost, and it involves "roadblock" neutral pieces that can be captured but not passed. Once they're captured, they are able to be dropped anywhere on the board. At least, that's the theory. Despite turning on "recycle-captures", Zillions seems to be destroying the captured pieces. Is there something else I need to do? I've tested everything else by placing a few roadblocks off-board in the board setup, and when I do, those ones can be dropped without any problems. Help? |
Dan Troyka (Dtroyka)
| | Posted on Saturday, December 28, 2002 - 12:37 pm: | |
Recycle-captures returns the piece to the off-board store of its owner, neutral in this case. I'm not aware of any easy way to flip a captured piece to the capturer's side so that it goes into the capturer's store. (Allowing this would be a good addition to the "recycle captures" option.) Change-owner and flip do not work on a captured piece. All the work-arounds I know of are pretty complicated. Here's one idea that might work in ZoG 2.0: Have two off-board dummy squares, x1 and x2. Define a zone "dummy-zone" that consists of x1 for White, and x2 for black. Start the game with a White block (exactly equivalent to the neutral block but owned by White) on x1 and a Black block on x2. Use "off 0" in the board set-up to give these pieces an off-board store. Whenever White captures a neutral block, include (capture x1) before add so that the friendly block on x1 is captured. It should go to White's off-board store so that White can drop it in a later round. For the code to work for either White or Black, it would need to look something like: (if (piece? Block) (if (in-zone? dummy-zone x1) (capture x1) else (capture x2))) The dummy squares will have to be replenished as part of every move. When White moves, before the add include a test of whether Black's dummy-zone (x2) is empty. If it is, use (create Black Block x2). This code could look like: (if (in-zone? dummy-zone x1) (if (empty? x2) (create Black Block x2) else (if (empty? x1) (create White Block x1)))) I haven't tested any of this code so it's probably buggy. |
John Nickerson (Mokalus)
| | Posted on Wednesday, January 01, 2003 - 7:34 pm: | |
Actually, a player doesn't need to own the pieces once they're dropped, so each player just has a (PlayerX Neutral) in the turn-order. As it turns out, the problem here was that there was no off-board store for Neutral pieces. The fix, as given to me, is to include (Neutral (Block off 0)) in the board definition, to create the store space. |
Karl Scherer (Karl)
| | Posted on Saturday, January 18, 2003 - 4:12 pm: | |
Hey , Jeff Mallet! The above propblem and solution, namely defining (...(Block off 0)) to create recycle space, is something that could be added to the help text, isn't it ?? If it is in there, please ignore my note. Cheers, Karl |
Fergus Duniho (Fduniho)
| | Posted on Saturday, January 18, 2003 - 5:01 pm: | |
This can be done without adding an extra turn in the turn order. When you move a neutral piece, it does not have to be handled as a move of a neutral piece. Pieces can be moved by other pieces. For example, in the game Philosopher's Chess, there is a neutral piece that can be moved by either side. In my ZRF for this game, the movement of this piece is handled as a King's move. As described in the move code, the King moves to where the neutral piece is, moves it to another space, then moves itself back to its own space. Yet when someone plays the ZRF, the fact that this is a King's move is invisible to the player. The move is actually done by picking up the neutral piece. Here is what is probably the most efficient way to handle Block drops. Place each Block a player captures into a separate area for each player. Have the King move to the beginning of its side's area, find the first Block, and drop it. Then have the King move back to its own space. I know this is doable, because I once implemented an early version of Interdependent Chess in which each player could drop pieces belonging to the other side. Since the players didn't own the pieces they could drop, I implemented all drops through King moves. |
Jeff Mallett (Jeffm)
| | Posted on Saturday, May 10, 2003 - 12:46 am: | |
I've changed this in version 2.0.1 so recycled pieces can be dropped even if no piece of that type originally appeared in the store (i.e. was initialized in board-setup using "off"). Thanks. |
|