| Author |
Message |
Thomas Dy (Alpha8888_2)
| | Posted on Sunday, March 14, 2004 - 7:33 am: | |
is it possible to hide the pieces of the enemy? i.e. the enemy has a pawn and a queen, you dont know which is which but you know their positions. also, is it possible to have a ranking system as in queen beats pawn and pawn cannot beat queen. since you dont know what the enemy is if you attack the queen with the pawn the pawn should die. is this possible? if anybody can help, thank you very much. both ideas are to be implemented in a game. |
Andreas Kaufmann (Andreas)
| | Posted on Monday, March 15, 2004 - 2:17 am: | |
Yes, these both things are possible. Please look at Battle.zrf (Stratego implementation for Zillions). The only restriction is that you can hide pieces only from the human player. |
Thomas Dy (Alpha8888_2)
| | Posted on Wednesday, March 17, 2004 - 1:08 am: | |
Thanks. I'm almost finished. Two last questions, how do you set the win-condition so if a certain piece is in a certain zone you win? Also, how is it possible so that you cannot win by the means above if enemy pieces are beside you? |
Thomas Dy (Alpha8888_2)
| | Posted on Wednesday, March 17, 2004 - 1:12 am: | |
By the way, I also used parts of your code in my game. The games are somewhat related anyway. Thanks again for helping |
Andreas Kaufmann (Andreas)
| | Posted on Wednesday, March 17, 2004 - 1:48 am: | |
You probably need to use combination of "absolute-config" and "relative-config". Please check ZRF language manual for keyword "goal". It has a lot of examples, may be you will find one which fits to your game. |
Thomas Dy (Alpha8888_2)
| | Posted on Wednesday, March 17, 2004 - 3:55 am: | |
I think i may have solved the problem, in theory anyway. I haven't tested it yet. Not once. I still have to make the graphics. Thanks anyway. |
Ken Franklin (Kenz)
| | Posted on Wednesday, March 17, 2004 - 7:44 am: | |
Winning condition (exact pieces at positions): also see Chaverse and/or (much larger example, Missing Link). My examples used extensively spelled out absolute-configs rather than relative-configs. |
Thomas Dy (Alpha8888_2)
| | Posted on Wednesday, March 17, 2004 - 9:18 pm: | |
I solved the win condition problem by promoting the piece if it reaches the zone. Then the win condition is if there is one piece if the "promoted piece" Most of the bugs have been solved but one thing stumps me. The flag should not capture anything but flags and can be captured. Now, its the opposite. Please look at the move logic: (define flag-move ($1 (if (in-zone? win-zone) (if (and (empty? e) (empty? w)) (add nflag))) (if empty? add else (if enemy? (if (Five-Star?) add else (if (Four-Star?) add else (if (Three-Star?) add else (if (Two-Star?) add else (if (One-Star?) add else (if (Colonel?) add else (if (LtColonel?) add else (if (Major?) add else (if (Captain?) add else (if (FirstLieutenant?) add else (if (SecondLieutenant?) add else (if (Sergeant?) add else (if (Private?) add else (if (Flag?) add else (add Flag) This doesn't work, what happens is the enemy flag captures anything and cannot be captured. By the way if I use capture it doesn't work but I prefer capture since it doesn't reveal the piece to me. |
Sean Duggan (Dream)
| | Posted on Wednesday, March 17, 2004 - 9:36 pm: | |
Well, I can't answer for the other pieces not being able to capture it, but with the adds for all of the pieces, yes, it will capture all of them. Maybe instead: (if enemy? (if not (or (Five-Star?) (Four-Star?) (Three-Star?) (Two-Star?) (One-Star?) (Colonel?) (LtColonel?)(Major?)(Captain?)(FirstLieutenant?)(SecondLieutenant?) (Sergeant?)(Private?)) add) That way, if the piece is not one of the above, you add. |
Sean Duggan (Dream)
| | Posted on Wednesday, March 17, 2004 - 9:38 pm: | |
{slaps his forehead} Or... (define flag-move ($1 (if (in-zone? win-zone) (if (and (empty? e) (empty? w)) (add nflag))) (if (or empty? (and (Flag?) enemy?)) add) ) ) |
Thomas Dy (Alpha8888_2)
| | Posted on Wednesday, March 17, 2004 - 9:50 pm: | |
Thanks. I'll try it but what about other pieces not being able to capture those lower in ranking? i.e. five-star cannot capture four-star. the move logic is somewhat the same. (define five-star-move ($1 (if empty? add else (if enemy? (if (Five-Star?) capture add else (add Five-Star) ))))) (define four-star-move ($1 (if empty? add else (if enemy? (if (Five-Star?) add else (if (Four-Star?) capture add else (add Four-Star) )))))) What if I invert everything i.e. if it has a lower rank I'll place an add after it and for higher just none. I'm still confused with the add thing. I'll post a draft version on my site if I have time. |
Sean Duggan (Dream)
| | Posted on Wednesday, March 17, 2004 - 11:23 pm: | |
(nods) Basically, my two answers show two different ways of doing it, either by defining what a piece can't capture or by what it can. use whichever one makes more sense or makes your code more concise. In general, you don't have to specify what kind of piece to add unless you're changing piece type. "(add Four-Star)" does the same thing as "add" if the piece moving _is_ a Four-Star. |
Thomas Dy (Alpha8888_2)
| | Posted on Thursday, March 18, 2004 - 6:40 am: | |
Yes!! I finally finished the game. Graphics are poor though, but still acceptable. :D By the way, this is the first game I ever programmed for Zillions. :D |
Keith Carter (Keithc)
| | Posted on Thursday, March 18, 2004 - 8:55 am: | |
I can help you if you would like to make some changes to the graphics. Take a look at A-Maze, Cannon, or some of my games as samples. |
Thomas Dy (Alpha8888_2)
| | Posted on Thursday, March 18, 2004 - 9:07 pm: | |
sure. I'd surely appreciate it. By the way what graphics editor do you use? Can you recommend anything that is free? |
Keith Carter (Keithc)
| | Posted on Thursday, March 18, 2004 - 9:48 pm: | |
I use Photoshop. I have never looked into freeware graphics editors. I will ask around. |
Thomas Dy (Alpha8888_2)
| | Posted on Saturday, March 20, 2004 - 6:49 am: | |
I finally finished putting together my site. Its still incomplete though. I uploaded the Zillions file there so you can see it. Its at http://www.geocities.com/alpha8888_2 |
Thomas Dy (Alpha8888_2)
| | Posted on Saturday, March 20, 2004 - 7:28 am: | |
Oh yeah, is it possible to set the piece-set of the player to a default? i.e. red uses this one blue uses that one. This would greatly reduce the amount of code and would enable net-play. notation as piece would be for all sides though, but that's a small price to pay right? |
Thomas Dy (Alpha8888_2)
| | Posted on Sunday, March 21, 2004 - 3:15 am: | |
I've got an entirely weird idea that should work but doesn't. I've just learned that macros cant be called by $1 or other arguments. Is it possible to let them be called? Everytime I do it it says unrecognized symbol "flag-move" or something like that. But if I write the macro each and everytime, it works. BTW, the macro is (define moveQ (moves (move-type normal-move) ($1-move n) ($1-move s) ($1-move e) ($1-move w) ) removing -move still results in the same problem. |
Andreas Kaufmann (Andreas)
| | Posted on Monday, March 22, 2004 - 3:45 pm: | |
For net-play the following could work (also I never tried it). You create two different piece image set. In the first one red pieces are visible, but blue ones are hidden. In the second set, vice versa, red pieces are hidden, blue are visible. Then when playing over net, red player uses the first piece set, the blue player the second one. Another possibilty is two have two versions of the game, with identical ZRF's but different images. One version is for player who plays red, another for player who plays blue. |
Thomas Dy (Alpha8888_2)
| | Posted on Monday, March 22, 2004 - 8:11 pm: | |
That is exactly what I did. However, both of them must close their move boxes and status bars so play will be fair. There should also be some way for them to know whether one of them is cheating. i.e. switching piece sets every so often. I'm going to post the updated zrf and graphics soon. |