From news-rocq.inria.fr!jussieu.fr!math.ohio-state.edu!howland.reston.ans.net!newsfeed.internetmci.com!in2.uu.net!spcuna!news.stormking.com!ff95@dial.pipex.com Mon Dec 4 11:52:17 1995 Article: 3203 of rec.games.corewar Path: news-rocq.inria.fr!jussieu.fr!math.ohio-state.edu!howland.reston.ans.net!newsfeed.internetmci.com!in2.uu.net!spcuna!news.stormking.com!ff95@dial.pipex.com From: Robert Macrae Newsgroups: rec.games.corewar Subject: Last Laugh Date: 3 Dec 1995 16:57:54 -0500 Organization: Storm King Ind. Inc. Lines: 279 Sender: server@news.stormking.com Distribution: world Message-ID: Reply-To: ff95@dial.pipex.com NNTP-Posting-Host: valhalla.stormking.com Mime-Version: 1.0 Originator: corewar-l@stormking.com Hey, Last Laugh worked! Round 7 provided a completely novel challenge, where several of the norma= l rules of the game are suspended. Since between rounds, the only variabl= e is the p-space state of the warriors, it is VITAL to avoid brainwash = yourself but inflict it on your opponent. To defend yourself, you need = to be small. To brainwash your opponent, you need to be a vampire (I cons= idered modifying a coreclear to brainwash, but could not see anything ele= gant). So... first design a pit, then design ways to suck your victim = into it. trap mov 5, 0, #1 ; Stores 0 through P-Space (?) jmp trap This pit combines a suicidal core-clear with a brainwash. It is not terri= bly efficient in general corewars terms -- slow splitting, and partial = single-pass clear -- but if I catch a single-process opponent in it, I = should eventually brainwash and then then kill him. The MOV instruction = conducts the coreclear, starting just before my warrior (wherever it is).= The SPL splits too slowly to beat a silk unless I hit one of the first = generation, but then I don't expect to find many silks around given 5-1-0= the scoring system. I can't be certain to clear all P-space before the = pit overwrites itself, but I guess this risk is one of the smaller ones = I'm running... vamp mov bite, @bite ; Minimal vampire add split, bite jmp -2, >-20 bite jmp trap, 0 ; Fang The vampire is as slim as I can make it. A 3-word loop with no coreclear,= and no SPL because: 1) Larger means easier to hit, 2) the pit has a partial coreclear, and I don't expect many silks, and 3) If I die to a DAT bomb I die happy -- no brainwash. I'd prefer not to launch the fang as well, to slim the profile, but I fou= nd that this fattened the launch. Since I don't expect many scanners (too= much chaff in the 500-cell warriors) and I do expect some quickbombers, = slimming the launch takes priority. This vampire is pretty 'low-tech', with only a 0.33c bomb rate and a weak= gate, but for this round this doesn't matter. To crush an opponent I onl= y need to win twice in a row, AND THEN I WILL WIN EVERY SUBSEQUENT ROUND.= After the first win, I have brainwashed the opponent. After the second, = I have beaten the brainwashed version, and from then on _nothing_ changes= so I beat it again, and again, and... So how do we maximise the chance of getting those two key wins before our= opponent does the same to us? The only variable is where we choose to = launch the code. If we won, we naturally don't change anything. Otherwise= , try somewhere new. For best results, try to launch to a location which = is substantially separated from the last both in core terms _and_ in term= s of the bombing pattern. The constants chosen (1364 for bombing step, = 3240 for separation of launch locations) result in a mod-4 bomber which = is nudged about 2/5 way round core each time it doesn't win, and about = 2/7 way round its own bombing pattern. [I have to nudge mod-4 so that the= fangs don't mess up the pit]. If I did not win the last round it was bec= ause I did not bite before I was hit, so the new position may let me bite= sooner and/or be hit later. In principle you could nudge the first bite = and launch positions by different amounts, but this takes longer. The final addition to this strategy was a quickvamp -- an inline-coded = vampire with 1c. Given the number of mistakes I made talking about quicks= cans I'm rather nervous about this, but... :) I, and I suspect most players, where terrified of quickbombers. Since we = occupy a fixed position, an inline bomber with hardcoded attacks may kill= us every time. I looked at bombers like MOV {A, B which will disrupt = at 2c. If your launch takes 15 cycles and has 18 vulnerable instructions,= like mine, you have roughly a (18/2) / (500/(15*2)) =3D 54% chance of = losing to this crude strategy! Of course, life is not easy for the quickb= omber either. After it has spent 15 cycles bombing it has to launch its = own fallback warrior too -- to cover the 46% of the time it has failed = to hit. I suspect most players feared this strategy, but I wonder how many actual= ly tried to use it? Almost as an afterthought, I added a quickvamp sectio= n which launches 15 fangs through my opponents' area. I don't know how = much this contributed to the overall effectiveness, though having several= 100-0-0 victories suggests it helped a lot. The final element is the boot code. This has to be short. boot ldp _BOOT, #0 ; Calculate boot offset result ldp _RESULT, #0 jmn.b quickv, result ; If I lost, drop quickvamp. launch seq.b result, #1 ; If I won, don't nudge vampire. nudge add.ab #MSTEP, boot mov.ba boot, store store stp #0, _BOOT ; complete book-keeping. sub.ba boot, vamp+1 ; Correct pointer to step sub.ba boot, bite ; Correct fang mov bite, 1 ; (of course, who'd scan? Bow tie?) nop 1,<1 nop 1,}1 ; and I don't have a djn trail... nop 1,{1 nop 1,@1 nop 1,*1 rof vamp mov bite, @bite ; Minimal vampire add split-boot+vamp+4, bite jmp -2, >-20 bite jmp trap-boot+vamp+4, 0 ; Fang ; Have to launch fang, sadly, to permute bombing... ; Separate by a multiple of 4... Total is 44. nop 1,>1 nop 1,<1 for 6 nop 1,1 nop 1,>1 nop 1,<1 nop 1,}1 nop 1,{1 nop 1,@1 nop 1,*1 rof trap mov 5, 0, #1 ; Stores 0 through P-Space jmp trap, 4 ; Will be over-written... for 4 dat <2667, 0 ; Coreclear rof ; Separate by a multiple of 4... Total is 36. nop 1,>1 for 5 nop 1,1 ; 7 is unlikely scan separation... nop 1,>1 ; Dec if QV gets lucky? nop 1,<1 nop 1,}1 nop 1,{1 nop 1,@1 nop 1,*1 rof boot ldp _BOOT, #0 ; Calculate boot offset result ldp _RESULT, #0 jmn.b quickv, result ; If I lost, drop quickvamp. launch seq.b result, #1 ; If I won, don't nudge vampire. nudge add.ab #MSTEP, boot mov.ba boot, store store stp #0, _BOOT ; complete book-keeping. sub.ba boot, vamp+1 ; Correct pointer to step sub.ba boot, bite ; Correct fang mov bite, 1 nop 1,<1 nop 1,}1 nop 1,{1 nop 1,@1 nop 1,*1 rof end boot Regards, Robert Macrae