From news-rocq.inria.fr!univ-lyon1.fr!jussieu.fr!oleane!tank.news.pipex.net!pipex!in2.uu.net!news2.new-york.net!news.stormking.com!bezzi@iol.it Tue Aug 29 17:51:29 1995 Article: 2140 of rec.games.corewar Path: news-rocq.inria.fr!univ-lyon1.fr!jussieu.fr!oleane!tank.news.pipex.net!pipex!in2.uu.net!news2.new-york.net!news.stormking.com!bezzi@iol.it From: bezzi@iol.it (Beppe Bezzi) Newsgroups: rec.games.corewar Subject: Know your enemy - Tornado Date: 28 Aug 1995 07:02:07 -0400 Organization: Storm King Ind. Inc. Lines: 310 Sender: server@news.stormking.com Distribution: world Message-ID: <199508281134.MAA00399@iol-mail.iol.it> Reply-To: bezzi@iol.it NNTP-Posting-Host: valhalla.stormking.com Originator: corewar-l@stormking.com After some trials I got to make one of my p-warrior function fairly well, I still have some little problem to fix (more about this later), but I'm satisfied of the results of Know your enemy enough to publish it. Know uses a very simple strategy, that proved good against most part of old (non p) warriors (at least in the limits i knew in advance) It is composed of two separate fighting parts, Marcia Trionfale and Tornado (more on it later) and tests each part against the enemy for some round, noting the results. Then it compares the results and uses the best strategy to finish the fight. Simple and effective even if it will be soon beaten by future adaptive warriors. The main problems I incurred are: A: When fighting replicators i score but 90 points because Tornado is *very* weak against them and Marcia, left fighting, scores 90 ties. B: I cannot contrast others adaptive warriors, if Tornado scores better than Marcia in the test rounds the adaptive warrior, soon or after, pits a paper against it, eating the poor in a single gulp. C: I scored a funny 4/94/2 against myself (I think it's the hill's worst record in corewar hystory) because happened one made the long fight with Tornado and the other with Marcia. Results: Porch swing 56/40/4 \ Whitershins 59/35/6 \ Thanks Tornado Agony II 53/38/9 / Miss Underst.. 49/35/16/ Copyright 36/55/9 Thermite 40/44/16 Catches ofter my boot Timescape 0/15/85 Test (Kline) 60/35/5 Is it Whitershins with non working p-stuff?;-) People 15/76/9 As foreseen Torch 51/30/19 Circle of F. 32/48/20 Marcia did the main fight Marcia T. 2/14/84 juliet storm 29/11/60 HeremScimitar 55/19/26 Die hard 0/9/91 Know (later) 16/4/80 Blue Funk 3 35/16/49 Rude Wind 0/13/86 Illusion 94 47/49/4 PC 9 3/4/93 Know (myself) 4/94/2 8-((( Overall 128.66 (changing the against myself in a 90 pts result will add 4, better more reversing it :-) Now the code. Sorry for the mess in the hill result presentation; any comment line beginning with ;strategy cause the daemon to report it in the warrior presentation. ;redcode-94 ;name Know your enemy ;author Beppe Bezzi ;strategy test single parts against for some rounds ;strategy choose best one to finish the fight ;strategy Starring: Marcia Trionfale (full size), Tornado 1.2 ;strategy 0.1 smaller strategic part, extended test time ;strategy 0.2 faster boot - 0.3 slight change in strategy ;strategy 0.4 fixed, i hope, a little bug ;kill Know ;assert CORESIZE == 8000 _RESULT equ #0 ;last round result _COUNTER equ #a ;round counter _STRAT equ #b ;-strategy to test _win0 equ #c ;score strategy 0 Marcia _win1 equ #c+1 ;score strategy 1 TornadoT. _BEST equ #d ;best strategy ;_win0 and _win1 need to be consecutive locations ;a,b,c,d can be everywhere in p-space ;I don't want you know where *I* am ;-) prove equ 9 ;n. of test to choose best endtst equ prove*2+1 ;end of test rounds org pensa ;---- Marcia part 1 A0 equ 3488 A1 equ 1860 A2 equ 3740 silk spl @0, }A0 ;split mov.i }-1, >-1 ;copy mov.i bomb, {123 ;bombing silk2 spl @0, }A1 ;split mov.i }-1, >-1 ;copy mov.i bomb, >1001 ;bombing mov.i bomb, }2042 ;A-indirect bombing mov.i {silk2, A2 ;jmp new copy bomb dat.f >2667, >5334 ;anti-imp bomb ;---Tornado step equ 52 count equ 665 away equ xxx ;something beetween 1500 and 2500 ;better not to tell my home address ;-) bootgt mov incr, away+60 mov bombd, away+30 boot mov clr, away+7 mov {boot, fast boot / -1 = 7999 cnt ldp _COUNTER,#0 ;increment a round counter add #1, -1 ;cnt contiene n. rounds break; stp1 stp.b -2, _COUNTER mov bomba, stp1 ;erase stp instructions sne.b cnt, #endtst ;round = 2*prove+1 ? jmp selwin ;yes select winning strategy ; ---- strategy testing and update str ldp _STRAT ,#0 ;load strategy ;0=Marcia 1=Tornado add.ba str, agg ;update strategy agg ldp _win0, #0 ;load results strategy jmz loss, res ;a zero indicates a loss in the last round djn tie, res win add.ab #2, agg ;3 points for win tie add.ab #1, agg ;1 points for tie loss ;str.b strategy - agg.b score update add.b str, stp5 ;pointer to strategy mov.ba agg, stp5 ;new result ;break stp5 stp #0, _win0 ;store result strategy rndcnt mov bomba, stp5 ;erase stp instructions sne cnt, #prove ;test each strat for prove rounds jmp change ;prove round then change str seq cnt, #prove*2 jmp select ;select next strategy selwin ;choose best strategy and save it ; score0 ldp _win0, #0 score1 ldp _win1, #0 slt.b score0, score1 jmp best0 ; jmp best1 ;s1 > s2 ;break best1 stp #1, _BEST mov.ab -1, best jmp gowin ;break best0 stp #0, _BEST mov.ab -1, best ; gowin ;best.b = winning strategy add.ba best, sel01 jmp sel0 change ;change strategy for next round ;break stp4 stp #1, _STRAT mov bomba, stp4 ;erase stp instructions ; select ldp _STRAT, #0 add.ba select, sel01 ; sel0 mov bomba, best0 mov bomba, best1 mov bomba, first mov bomba, stp1 sel01 jmp 2 jmp Marcia ;redundancy added some points against ;djn stream using warriors jmp Marcia jmp Tornado ;break first stp #-1, _BEST ;not yet a winning strategy mov bomba, stp4 ;erase stp instructions mov bomba, first jmp Marcia Marcia spl 1, <300 ;\ mov -1, 0 ;-\ generate 10 mov -1, 0 ;-/ consecutive processes spl 1, <400 ;/ spl silk, <1000 silka spl @0, }3620 ;split mov.i }-1, >-1 ;copy mov.i bomba, }113 ;bombing silk2a spl @0, }1270 ;split mov.i }-1, >-1 ;copy mov.i bomba, >1001 ;bombing mov.i bomba, }2042 ;A-indirect bombing mov.i {silk2a,-350 ;jmp new copy bomba dat.f >2667, >5334 ;anti-imp bomb end Final note to the code. I had to use some lines to erase stp instruction because in the big redcode mess caused by fights beetween Marcia and others replicators I happened to execute them, changing my best strategy location with devastating, for me, results (Timescape beated me 0/92/8) ----- Tornado. Tornado is a fast bomber, using its first bomb as a pointer for the last I achieved a bombing speed of 60% c, three bombs in a five instruction loop. I think it's the maximal speed possible for a pure bomber using a single add instruction in its loop. Randy in his discussion of simple warriors wrote >Some time back Paul presented an idea about faster warriors. I think >it was a 0.6c hard stone and a faster jmz or jmn scanner. I haven't >seen a warrior use these yet, I don't think. I'm guessing there is a >problem of protecting oneself with either of these ideas. That stone >looks great, but how will it handle paper, set up a core clear, or >keep from self destructing. I think Tornado is an attempt at this, >but it hasn't gone to high up the hill yet. I don't know this article, I took the inspiration of Tornado looking at the use Paul made of indirect addressing in Whitershins Thrice, at first I made Copyright notice (soon I'll publish code and story) a 50% c bomber that was a rediscovery of HeremScimitar, then I realized Tornado reaching 60%. Let's rewiew the main part of the code. ;bomb falls here start mov bombd, *stone mov bombd, @stone stone mov *(2*step)+1, *(3*step)+1 add incr+50, stone jump djn.b start, #665 bombs spl #step, #1 clr mov start-1, }start-5 ;bomb falls here incr dat 3*step, 3*step bombd dat #step, #1 incr and bombd are away from main code Of the three problems Randy speaks about I solved but the last two, handling paper is still my pain, even using bombs in stead of bombd, and it's one of the reasons Tornado never climbed high the hill. The other reason is that Tornado is 7 lines long (all vulnerable target), while a stone like Blue Fumk is but 4 (and disabled only by a hit in 2 of them) so the bombing speed/size ratio is at my disadvantage. I drop near 2000 bombs in 3330 cycles, in the meantime a ~30% c stone drops near 1000. I have a 2000*2/8000 = 50% chance to kill the stone while the stone has a 1000*7/8000 = 87.5% chance to kill me. Hard times indeed. I tried using a mod 5 pattern setting a 2 pass core clear, and I tried too, not very hard because I soon started playing with p-space, adding a djn stream and hitting the jump instruction to start the clear; results are not yet good, but I still believe in this guy. The version included in Know your enemy is optimized to kill scanners, in particular those using forward c-c, having not to worry about paper and stones, and, in doing this, performs better than any four lines stone I tried. I use it as a specialized weapon against a specific target. I have been too long so I greet you all. -Beppe