Comments/Ratings for a Single Item
You should add a parameter maxPromote=0 ; then it doesn't matter what the zone depth and promoChoice are, as they would never be looked at. Your Pawns promote per morph instructions.
OK, I have the pawn promotions fixed on both diagrams.
I'll start looking at the other two things (probably royal promotions) later today.
Thanks for the help!
I guess you would need something like:
if == k #victim: set p search pr $space; add k #p; endif;
at the end of the Post-Move 1 section, to take care of black's Prince promoting to King when white captures the black King.
[Edit] This did not work; apparently the search operator cannot operate on a system variable like $space. So you have to copy that first:
if == k #victim: set brd $space; set p search pr #brd; add k #p; endif;
When I do get into the heavy editing: Do you think it'd matter whether the #victim test or the Helepolis test is done first?
In the code it would probably be easier to do the Helepolis move before the succession test, because the succession then can also take care of the case where the Helepolis did overrun the King. If you encounter a King in thr process of removing the locust victims you could set victim to k, so that the succession code is later triggered. Unfortunately you have to prepare for the case that K and Q can be captured on the same move, and you cannot set victim to K and Q at the same time. This could be solved by making a copy of victim (set v2 #victim;), and use that for testing the Queen succession; the Helepolis code can then set victim to K and v2 to Q when it encounters any of those, without spoiling succession of the other.
I presume that the capitalized counterpart would go into the Post-Move 2 section, and both would also need the q/pc (Q/PC) conversion as well.
I presume that the capitalized counterpart would go into the Post-Move 2 section, and both would also need the q/pc (Q/PC) conversion as well.
Correct, but note that I was still doing an edit of my earlier posting that crossed your latest message.
BTW, 'buldozer move' is not a standard term, it is just what came to mind when I saw this kind of move. 'Juggernaut move' also excellently covers it.
OK, fine, then. Now Post-Move 1 is:
gosub HandleMove false;
if == k #victim:
set brd $space;
set p search pr #brd;
add k #p;
endif;
if == q #victim:
set brd $space;
set p search pc #brd;
add q #p;
endif;
if == q #vic2:
set brd $space;
set p search pr #brd;
add k #p;
endif;
While Post-Move 2 is:
gosub HandleMove true;
if == K #victim:
set brd $space;
set p search PR #brd;
add K #p;
endif;
if == Q #victim:
set brd $space;
set p search PC #brd;
add Q #p;
endif;
if == Q #vic2:
set brd $space;
set p search PC #brd;
add Q #p;
endif;
If I got that part right (I felt that vic2 was a better mnemonic than v2
; in any event, I feel like I misread something), all that's left to worry about right now is the really hard part: the Helepolis.
I still had the Helepolis on the old RcamfRidaufmRsb(caf)14R move code when I built the initial GAME code; I hope I don't need to fix that and regenerate the code when I turn to that part (though it's probably not a huge problem if I do). If there's a simpler way to go about it, I'll take it!
Then I can start poking around with Inkscape, Paint, and/or GIMP to see if anything decent comes out, in between developing text.
Actually, I had a little time before going on to something else, so I fiddled around and found better pics already in the array for the Prince, Princess, and Chancellor (these are already updated both here and in the GCP), and tentatively generated pieces for:
- Berserker
- Bowman
If these are deemed good, then I can see what I can figure out for the Soldier (the current Soldier can become the new Sergeant) and the Spy.
Addendum: Well, they at least appear to be working OK on the Interactive Diagram.
You should make sure vic2 has a value; that of victim is set in the HandleMove code. Immediately after that you can copy it to vic2 by
set vic2 #victim
There then is no need to use #victim for succession of the Queen; it would do exactly the same as the code that used #vic2.
That reminds me of a flaw in the code; Prince, Princess need not be present. (And certainly would not be the second time, when you attempt it twice!) The search command would then return an invalid location, which would probably crash the following add command. So the add should only be executed if search found the piece, by replacing it with
if #p: add k #p; endif;
The Helepolis moves are described in the Pre-Game section like this (but very many more):
4 99 -1 0 2 99 -1 0 2 99 -1 0 2 99 -1 0 3 5 99 1 0 2 99 1 0 2 99 1 0 2 99 1 0 2 99 1 0 3 where the number in the first 'column' indicates the number of legs, and the last number the allowed occupancy of the final square of each leg. The 2 there means it has to end in a capture, but since the generic code can handle only one such leg (and here they would run up to 14), you would have to replace the 2 everywhere by 16 (which means that it should end on the mount of a hop). The 3 in the final leg you can leave (it means capture or move to empty).
So now I have the Post-Move 1 looking like:
gosub HandleMove false;
set vic2 #victim;
if == k #victim:
set brd $space;
set p search pr #brd;
if #p:
add k #p;
endif;
endif;
if == q #vic2:
set brd $space;
set p search pc #brd;
if #p:
add q #p;
endif;
endif;
And Post-Move 2:
gosub HandleMove true;
set vic2 #victim;
if == K #victim:
set brd $space;
set p search PR #brd;
if #p:
add K #p;
endif;
endif;
if == Q #vic2:
set brd $space;
set p search PC #brd;
if #p:
add Q #p;
endif;
endif;
I'll get on that Helepolis move in a wee bit....
Nice, but the Berserker needs thicker outline.
Berserker
Off-topic fun fact: my name appears three times in the announcement of this year's Physics Nobel prize (reference 18, 23 & 36). Nobel laureate Pierre Agostini was a close colleague of mine, and I spent a year in Paris in his group as a post-doc.
Yeah, I did notice that. It's not quite up to asking Fergus to add it to the official set, but it'll do for now (and I'll probably fix that outline before all is done).
And congratulations on the Nobel thing. :)
OK, I got all of those 2
's converted into 16
's.
I assume I don't need to worry about the ones that end in 4198464
, and that the Post-Move codes that I posted earlier are OK.
I think (unless my brain is glitching something) all that's left is getting the code in to clear out the juggernaut's path, and mark whether the victims include the King and/or Queen.
After that, it's mostly just text and graphics (the latter consisting of redoing the Berserker with 2-pixel lines, and trying to figure out a Soldier and a Spy that don't look pathetic.)
Testing some more icons:
- Berserker (take 2)
- Soldier
- Spy
I may want to workshop the Spy a little, but on the whole I think they look satisfactory.
I adjusted the ID to include the graphics below, and I think it looks good.
The moves with mode 4198464
are not juggernaut moves. After converting that number to hexadecimal (401040) I can see that they are marked as initial moves.
I think (unless my brain is glitching something) all that's left is getting the code in to clear out the juggernaut's path, and mark whether the victims include the King and/or Queen.
Sort of. The 2 -> 16 replacment changed the c mode of these legs to p mode. But that would allow enemy as well as friendly hopping, and this is not what you want; firendly pieces in the path should not be destroyed or jumped over. This would have been achieved by (cafu)14R, not (paf)14R, using the capture+unload kludge. So I am afraid we realy should have needed to replace by 4194306 instead of 16. Which is hexadecimal for 400002, the 2 standing for capture, and the 400000 for 'but unload on the next leg'. Sorry about that.
For clearing the Helepolis juggernaut path you can use something like this:
if == H #mover: set p path #ori #desti; set k count #p; do while #k: dec k; set sqr elem #k #p; set v space #sqr; if isupper #v: break; endif; empty #sqr; if == k #v: set victim k; elsif == q #v; set vic2 q; endif; loop; endif;
The conditional break is needed to prevent removal of the friendly piece when the initial moves hops over one; the way the table now defines the Helepolis other moves can only have hopped over a number of enemies
OK, I'll work on replacing all of those 16
's with 4194306
, and then insert that code. But there's a possible snag: the Helepolis's juggernaut move should be stopped by the presence of a friendly piece. Is this accounted for there?
Edit: Never mind the question. Upon re-reading, I see that it's accounted for.
OK, so currently Post-Move 1:
gosub HandleMove false;
set vic2 #victim;
if == H #mover:
set p path #ori #desti;
set k count #p;
do while #k:
dec k;
set sqr elem #k #p;
set v space #sqr;
if isupper #v:
break;
endif;
empty #sqr;
if == K #v:
set victim K;
elsif == Q #v;
set vic2 Q;
endif;
loop;
endif;
if == k #victim:
set brd $space;
set p search pr #brd;
if #p:
add k #p;
endif;
endif;
if == q #vic2:
set brd $space;
set p search pc #brd;
if #p:
add q #p;
endif;
endif;
And Post-Move 2:
gosub HandleMove true;
set vic2 #victim;
if == h #mover:
set p path #ori #desti;
set k count #p;
do while #k:
dec k;
set sqr elem #k #p;
set v space #sqr;
if isupper #v:
break;
endif;
empty #sqr;
if == k #v:
set victim k;
elsif == q #v;
set vic2 q;
endif;
loop;
endif;
if == K #victim:
set brd $space;
set p search PR #brd;
if #p:
add K #p;
endif;
endif;
if == Q #vic2:
set brd $space;
set p search PC #brd;
if #p:
add Q #p;
endif;
endif;
Hopefully I have all of the capitalizations and instruction order correct.
I do think I have something screwy in the Pre-Game, though; when I press the Run button, I get a text list of legal moves for White, one per line, before the board. The Pre-Game looks like this:
include /membergraphics/MSgame-code-generation/betza.txt;
set legdefs
(I'll skip the move definitions for now)
def P cond #0 1 0;
def p cond #0 22 0;
def N cond #0 43 0;
def n cond #0 43 0;
def B cond #0 144 0;
def b cond #0 144 0;
def R cond #0 165 0;
def r cond #0 165 0;
def Q cond #0 186 0;
def q cond #0 186 0;
def PC cond #0 227 0;
def pc cond #0 227 0;
def C cond #0 288 0;
def c cond #0 288 0;
def F cond #0 349 0;
def f cond #0 349 0;
def NR cond #0 470 0;
def nr cond #0 470 0;
def PR cond #0 511 0;
def pr cond #0 511 0;
def SL cond #0 572 0;
def sl cond #0 603 0;
def W cond #0 634 0;
def w cond #0 634 0;
def BR cond #0 931 0;
def br cond #0 931 0;
def A cond #0 1700 0;
def a cond #0 1700 0;
def BO cond #0 1793 0;
def bo cond #0 1793 0;
def L cond #0 2338 0;
def l cond #0 2338 0;
def H cond #0 2419 0;
def h cond #0 3997 0;
def GN cond #0 5575 0;
def gn cond #0 5575 0;
def SG cond #0 5616 0;
def sg cond #0 5616 0;
def SP cond #0 5642 0;
def sp cond #0 5642 0;
def K cond #0 5703 0;
def k cond #0 5703 0;
set wroyal (Pr K);
set broyal (pr k);
set morphers (P p SL sl SG sg);
set morphs assoc
P ((All N))
p ((All n))
SL ((All H))
sl ((All h))
SG ((All L))
sg ((All l))
;
set extinction 1; // must capture all royals to win
set promotables (P p Sl sl Sg sg); // pieces that can promote
set supply array; // in infinite supply
set promotab ( // allowed choices per rank
(n l h)
0
0
0
0
0
0
0
0
0
0
0
0
0
0
(N L H)
);
// Additional Pre-Game code (only needed with non-standard piece set):
set mypieces assoc
P "wpawn.png" p "bpawn.png"
N "wknight.png" n "bknight.png"
B "wbishop.png" b "bbishop.png"
R "wrook.png" r "brook.png"
Q "wqueen.png" q "bqueen.png"
PC "wfalcon.png" pc "bfalcon.png"
C "wchancellor1.png" c "bchancellor1.png"
F "wbird.png" f "bbird.png"
NR "wnightrider.png" nr "bnightrider.png"
PR "wduke.png" pr "bduke.png"
SL "wchampion.png" sl "bchampion.png"
W "wmoon.png" w "bmoon.png"
BR "wman.png" br "bman.png"
A "warcher.png" a "barcher.png"
BO "wcannon.png" bo "bcannon.png"
L "wlance.png" l "blance.png"
H "wbenthero.png" h "bbenthero.png"
GN "wgeneral.png" gn "bgeneral.png"
SG "wsergeant.png" sg "bsergeant.png"
SP "wthief.png" sp "bthief.png"
K "wking.png" k "bking.png";
setsystem dir "/graphics.dir/alfaeriePNG/";
setsystem pieces #mypieces;
Once this is sorted, I can start in on the text, and probably working with you and/or Fergus on getting the graphics icons I created for this game into the preset.
when I press the Run button, I get a text list of legal moves for White, one per line, before the board.
Ah, sorry about that. I had been debugging the other day, and had accidentally left in one of the print statements I had added for that purpose in the betza.txt file. In the mode where I tested it ('Move' from the menu) this output does not show up at the start of the game, but only after the GAME code crashes (which after debugging it did not do anymore). So I had not noticed this. I removed that print statement now.
You forgot to capitalize K and Q in the h part.
I don't think the 'promotables' belong in the Pre-Game code. This would indicate which pieces promote with the choice that is specified in the promotab (which is N, H or L on last rank). But you don't want any choice; you just want them to promote automatically as specified in the morphers/morphs arrays. Did the Play-Test Applet generate that 'set promotables' line? And was that while you had maxPromote=0 in the ID?
Run button: Ah, OK, so it wasn't my fault this time. That's a relief.
Capitalizing K & Q: I capitalized them in the Pre-Move 1, instead of the Pre-Move 2. I'm not sure whether I need to capitalize the K other than in the "if" section; I left it lower-case, because it looks like the k in the preceding lines is a variable..
Promotables: Should I just remove the promotables, supply, and promotab parts then? (And yes, that was while I had maxPromote=0.)
Yes, you can remove all of those, since I now made the default of promotables the empty array. If no piece can ever be found in promotables, it would not use supply or promotab.
You are right; in dec k and set k ... k is a variable.
But you capitalized the wrong ones: when the white Helepolis moves, you have to test for capture of black K and Q, or vice versa.
I had the wrong ones capitalized before; this is that section now in Post-Move 2:
if == h #mover:
set p path #ori #desti;
set k count #p;
do while #k:
dec k;
set sqr elem #k #p;
set v space #sqr;
if isupper #v:
break;
endif;
empty #sqr;
if == K #v:
set victim K;
elsif == Q #v;
set vic2 Q;
endif;
loop;
endif;
In Post-Move 1, the h at the top is capitalized, and the K and Q at the bottom are not.
If that's correct, then all that's really left (except for the text part, which I'm pretty sure I have a handle on) is getting the four piece graphics I made for this game (for Berserker, Bowman, Soldier, and Spy) to appear in the GCP as they do in the ID. For that, unless I'm misunderstanding something, I can just upload the existing graphics for the Alfaerie set that are used in this to /membergraphics/MSvanguardchess/
(where the new ones are already located) and change setsystem dir "/graphics.dir/alfaeriePNG/"
to look there.
I've edited in the text portion (as well as fixed some of the text on this page), so if the Post-Move sections are OK, all that's left is getting the graphics to match those used in the Interactive Diagram.
I just realized that the Berserker, being merely a renaming of the Japanese Lion from Chu Shogi, is another piece here that can make more than one capture per turn. Argh....
Two captures per turn is OK, as long as one of those is the normal replacement capture. The restriction is on the number of locust captures; there can only be one of those. This because the GAME code in the betza.txt include file represents a move as 3 squares plus one piece type to drop; the 3rd square specifies where to drop it, and if the dropped type is an empty square the piece that was sitting on it would be locust captured.
25 comments displayed
Permalink to the exact comments currently displayed.
Yeah, the ID has a lot of screwy stuff, and needs a good bit of fixing. Whatever has Pawns morphing to Queens should be edited out. (Should that line be just "promoChoice=" with nothing?)
I'll see what happens when I convert the ID with the new applet before I go about doing a lot of editing.
When I do get into the heavy editing: Do you think it'd matter whether the #victim test or the Helepolis test is done first?
(Personally, I like to call that a "juggernaut capture," but I can switch to "bulldozer capture" if that's an established term.)
Oh, and my apologies for not including the link. (D'oh! once again!)