From news-rocq.inria.fr!univ-lyon1.fr!jussieu.fr!math.ohio-state.edu!howland.reston.ans.net!agate!soda.berkeley.edu!mconst Sun May 8 15:52:37 1994 Article: 760 of rec.games.corewar Path: news-rocq.inria.fr!univ-lyon1.fr!jussieu.fr!math.ohio-state.edu!howland.reston.ans.net!agate!soda.berkeley.edu!mconst From: mconst@soda.berkeley.edu (Michael Constant) Newsgroups: rec.games.corewar Subject: Pyramid v2.0 Date: 7 May 1994 03:20:08 GMT Organization: Society for the Prevention of Cruelty to Vegetables, UC Berkeley Lines: 178 Message-ID: <2qf1d8$1s4@agate.berkeley.edu> NNTP-Posting-Host: soda.berkeley.edu Yes! Pyramid v2.0 has been in first place on the Pizza '94 hill for a while now, with a strong 10-point lead above second (Torch). So, it's time to post the source. Pyramid is a standard vampire with a quick-vamp attached. (I just *love* quick-scanners.) Why, you may ask, do I use a standard vampire when I could use a non-standard one like Request which is not vulnerable to anti- vamps? Well, it's because of the quick-scan. All modern anti-vamps are either packaged with, or incorporated into, some sort of paper. (The reason for this is that the anti-vamp will destroy either the pit or the fangsource (depending on the type of anti-vamp) but this will usually leave the vampire intact -- acting as a stone. The purpose of the paper is to beat that stone.) However, Pyramid will find paper (and any attached anti-vamps) with the quick-scan before even starting the regular vampire bombing, so the poor anti-vamp won't have any fangs to look at before it is bombed. So, I can use a regular vampire (and thus gain a little efficiency) without fear of anti-vamp programs. In fact, P.Kline recently submitted a combo including an anti-vamp to KotH, and Pyramid beat it 81/11/9. Pyramid also beats Deck of Many Things, though not quite as spectacularly (53/43/4). Note that Pyramid v3.0 (which I submitted and then killed because it scored lower than v2.0) is more advanced, and will defeat some of the programs which can beat Pyramid v2.0. It's not on the hill now... but don't think it's safe to submit some anti-vamp that beats Pyramid v2.0, I just may dig out v3.0 again... :-) The quick-scanning routing is rather nicely written, IMHO. You can adjust its behaviour by varying the numbers in the "quick-scan parameters" box. Yes, they do make a big difference. The reason: contrary to popular belief, the main problem with writing a quick-scanner is not *finding* the enemy (which we can do in 39 cycles, guaranteed) but *bombing* the enemy once we have found him. This is not as easy as it looks. We are not writing a cmp-scanner which has a lot of time to bomb (and a limited area to cover). We need to (theoretically) cover 100 instructions in front of and behind the point where we find an enemy program. Unfortunately, this would take on the order of 300 cycles (with reasonable coverage). Remember, we are trying to hit a program as it's bootstrapping. If possible we should hit it within 20 cycles or so after the quick-scan -- some programs are even too fast for that. So, I found (through trial and error against lots of different programs) that a pretty-close-to-optimal quick-scanner bombing pattern comes from the numbers shown here. Of course, different sets of numbers work better against different types of programs. The numbers here were chosen to beat imps especially, but they work pretty well against just about everything :-) See the diagrams at the end of the program for an explanation of what each of the constants controls. Pyramid v2.0 (slightly modified) is also on the big hill, and also in first place (although just *barely* ahead of Demand-55440 -- this makes sense because Demand-55440 and Pyramid are actually quite similar). A question for the general public: is it rude to put a high-scoring program on both hills when there is very little modification involved? Should I restrict Pyramid (and my programs in general) to only one hill, or should I submit any program (that's easy enough to translate) to both? Anyway, the imp infestation on the big hill should be coming to an end soon... :-) Here is how Pyramid does against the big hill's imps: Variation G-1: 60/33/7 Variation L-1: 64/29/7 Splash 1: 71/16/13 Lucky 13: 50/35/15 BigImps: 60/29/11 Sissy: 66/25/9 Imperfection: 63/11/26 I have not included the source for the big-hill Pyramid because it's just too similar to the small version, so it would be rather a waste of bandwidth. However, I would be happy to mail it to anyone who wants it. Enjoy! ;redcode-94 ;name Pyramid v2.0 ;author Michael Constant ;strategy quick-vamp -> vampire ;macro ; ----------------- Quick-Scan Parameters -------------------- OVERLAP1 equ 30 OVERLAP2 equ 0 BIGSTEP equ 100 OFFSET equ 150 BOMBDIR equ 1 ; 1 is forward, -1 is backward SPACE equ 6 ; must be even ; ------------------------------------------------------------ STEP equ 3364 first mov wimp, wimp+22 spl wimp+22 jmp split wimp jmp 0, <-30 look qscan for 38 cmp.x (first+OFFSET+(qscan*BIGSTEP)), (first+(CORESIZE/2)+OFFSET+(qscan*BIGSTEP)) mov.ab #(-BOMBDIR*OVERLAP1)+(first+OFFSET+(qscan*BIGSTEP))-found, @found rof found jmz.b first, #0 mkfang sub.ba found, qfang add.b found, qfang mov.i qfang, @qfang sub.f subber, qfang djn.b -2, #(((BIGSTEP+(OVERLAP1+OVERLAP2))/SPACE)*2)+1 jmp first qfang jmp pit+(qfang-found), #found-qfang subber dat