From news-rocq.inria.fr!jussieu.fr!fu-berlin.de!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!newsfeed.internetmci.com!194.87.0.28!demos!news1.spb.su!newsfeed1.funet.fi!128.214.205.17.MISMATCH!news.helsinki.fi!karhu.Helsinki.FI!jpihlaja Mon May 4 11:39:25 1998 Article: 8947 of rec.games.corewar Path: news-rocq.inria.fr!jussieu.fr!fu-berlin.de!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!newsfeed.internetmci.com!194.87.0.28!demos!news1.spb.su!newsfeed1.funet.fi!128.214.205.17.MISMATCH!news.helsinki.fi!karhu.Helsinki.FI!jpihlaja From: M Joonas Pihlaja Newsgroups: rec.games.corewar Subject: Another beginner warrior Date: Sun, 3 May 1998 20:30:09 +0300 Organization: University of Helsinki Lines: 416 Message-ID: NNTP-Posting-Host: karhu.helsinki.fi Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Sender: jpihlaja@karhu.Helsinki.FI Sorry about waiting so long to publish this. It was ready last week, but I had some unforeseeable problems. I really don't have a good excuse for the delay. This is my warrior meld as it is on the -b hill. It switches Clisson, Seven Eleven, an Alladin-like stone, and, __meld (a P-Clear derivative). I'll account some of my experiences building this warrior below. I had mainly tried to get aquainted with the different warrior types before trying my hand at P-space and found out that I'll never be a paper man. Working with papers is like working with black magic... All comments, questions, and suggestions are very welcome. ---- In a p-spacer, one strategy is to use very specialised components with low tie rates so that your warrior will switch in the appropriate component against you opponent. Of course, you have to have something which kills your opponent well, otherwise you're toast. * Components I started out by testing a few different warriors on the hill and found out that HSA did extremely well. Right, I'll use HSA then. "That's the papers taken care of" I thinks. As far as I could tell there were quite a few Tornado type pattern bombers on the hill as well. This is where reading (although not always understanding) lots and lots and lots of code and posts comes in. I remembered Clisson-Lite. This is a bomb dodger/clear sort of thing switched with a backup paper/imp. Clisson scores 170/30/0 against Tornado! Even against Torch-t18 it scores around 100/70/30, even though Torch uses a 'non-optimal' pattern. Hmm.. yes, I'll use Clisson. That's incendiary bombers and other such taken care of. What about those scanners? HSA is big but fast and thus gets some wins against oher scanners but not enough. Well, Alladin just came out and CW65 has been out for some time. I guess it's OK to use one of those. At this point overkill mode was switched on. Clisson isn't really well suited to handle dat-bombing stones or stone/imps. I needed something that could holds it's own against them. Preferably something that would grind out a few wins against those imps. My first thought was to use anti-imp paper. It doesn't care about how optimal the stone's step is, and might kick a few imps too. As I mentioned before I'm not too good with papers, so I... I don't seem to have a good excuse here. Anyway, I opted against it. I did find Paul Klines (he's one of my favourites) P-Clear that does well against Impfinity but not so well against some other imp/stones. I started working with P-Clear and came up with __meld. This is the only component that I consider my own, so you'll forgive me if I spend some time on it. P-Clear is a pair of d-clears spaced about 4000 words apart with a redundant slow backward clear. The clears do two passes around the core before one of the clears overwrites itself. I thought that having two clears that work independently of each other (gating different locations) before one exterminates itself was vulnerable against imps. That thought is silly, since the stone (in stone/imps) hogs most of the process queue and the imps takes a *long* time to reach the gate. Anyway, that's what I thought, so I decided that the pair of clears would use the *same* gate and run one clear. But now we have a problem. The clears only do a half pass through core before the other gets exterminated. Also, since they are well separated, the odds of both clears being dat bombed early in the round was not low. So I decided to place the clears side by side. Against pattern dat bombers this works well. I always considered oneshots to be vulnerable to stones since the scanner being bombed is fatal. Enter CW66 with Alladin's Cave which solves this problem nicely by running the clear and scan in parallel. So that's what I did. I added a jmz scanner which runs in parallel with the clear. The '3-imp point' scanning is a great idea. It colours the core nicely and tries to avoid triggering by imps. Starting to look a lot like the clear from Alladin. A lot of my code seems to end up looking like somebody else's code :( I have a few theories about this... This component holds it's own against stone imps and does pretty well against a few oneshots. It still loses to Gigolo and Krajnovic's Metal series. The former has too heavy imps. About the later I don't know for sure, but I suspect a Carbonite style stone. The name __meld is a bit silly, I know, but it's the working name. I can't call it 'Stone/Imp Killer', since it hardly lives up to that name. 'Stone/Imp Resistance Force' is well.. you know ;) Between friends it prefers to be called just "meld". * The brain. I was short on space by now and needed a small brain to do the job so I chose to go with P^2b. It's similar to P^2 in that it is a table based switcher. It takes advantages of the similarities between state transitions for each warrior by using templates of state transitions. This can reduce your brain size drastically. I use a switch on three losses with draws counting as wins similar to Alladin. For each component I have three states corresponding to three, two and 'one losses to switch' respectively. Each state is associated with a state transition template and the appropriate component entry point. The template specifies the _change_ in state for the cases of win, tie, and loss. An illustration of the state changes for the first component. ___________________ |_________ | _V_ _|_ _|_ | 0 |====>| 1 |====>| 2 |==...==> [note] ~~~ ~~~ ~~~ key: --> win/draw ==> loss note: state 2 goes to the state corresponding to '1 loss to switch' of the next component (state 5). For multiple components with similar switching schemes the savings in space can be substantial. The drawback is that the brain is one cycle slower than P^2. Also, for complex switching schemes P^2b may require too many different templates to be of any use. Following Alladin, this strategy is reluctant to switch warriors. This was needed to keep __meld in place when fighting stone/imps, since draws are common. I was worried thought that HSA may be a bit _too_ strong of a component for a strategy like this. Since HSA is only there to kill papers, an anti-paper low tieing scanner should do better than HSA. This is the reason for replacing HSA with Seven Eleven. * Final remarks Only two out of four components boot. Seven Eleven and Clisson are too expensive to boot which makes the warrior very vulnerable to Qscans. It is bloated and sluggish, but against non-Qscans quite robust (I hope). I seem to have messed up Seven Eleven though, so resistance to papers is not too good. Qscans and imps seem to be missing from the -b hill. Correct me if I'm wrong here. I suggest reading lots of old posts and all the code you can get your hands on. The Olde Tyemers(tm) have an advantage here as they have done exactly that. It's our responsibility as newbies to catch up to them :) Harquebus is a -94 hill version of meld. During tuning (that which never ends) I had to drop the stone, Clisson, and Seven Eleven as they were bloating my code. I replaced Seven Eleven with a Mini-HSA and spaced out the components a bit. Happy redcoding, Martti Joonas Pihlaja ------------------- ;redcode-b verbose ;name meld ;author M. J. Pihlaja ;strategy P-warrior ;strategy ;strategy switching Clisson, SevenEleven, a stone, and some ;strategy stone/imp resistance based on P-clear. ;strategy ;kill meld ;assert CORESIZE==8000 ;***** HSA/SevenEleven ;***** ; ; tPtr equ (tWipe-4) tWipe mov tSpl ,tPtr ,>tPtr jmn.f tWipe ,>tPtr ; first check at x tScan sub.x #-11 ,tPtr ; increment and look sne.f *tPtr ,@tPtr sub.x *pScan ,@tScan ; increment and look jmn.f tSelf ,@tPtr jmz.f tScan ,*tPtr pScan mov.x @tScan ,@tScan ; swap pointers for attack tSelf slt.b @tScan ,#tEnd+4-tPtr ; self-check djn tWipe ,@tScan ; go to attack x-1 djn *pScan ,#17 ; after 17 self-scans jmp *pScan ,}tWipe ; switch to dat-wiping datzero dat 0,0 tSpl spl #0,{0 dat 0,{0 tEnd equ (tSpl+2) ; place tPtr and start him running tPtrIns dat 100 , 4100-4 ; widely-spaced pointers HSA mov tPtrIns , tPtr jmp tScan+1 ;***** Clisson UltraLite ;***** ; ; slower scanning and no 'internal silent carpet check' ; ; Gem of the Ocean seems to have a completely different version of Clisson ; with a smaller killer ; q1 spl #0,<-10 ; this is the bomber-killer mov qb, __meld -> Clisson -> stone ; ; with stone starting, hsa defaulting on 0 brainwash ; ; PSTATE equ 1 STATES equ (statesend-state) think ldp.a #0 , in load ldp.a #PSTATE , state add.ba *state , in in add.ba 0 , state mod.a #STATES , state store stp.a state , load mov.i #0 , -1 state jmp }0 , TW1 spl #_hsa , TW2 spl #_hsa , TW3 spl #_mld , TW1 spl #_mld , TW2 spl #_mld , TW3 spl #_cli , TW1 spl #_cli , TW2 spl #_cli , TW3 spl #_stn , TW1 init spl #_stn , TW2 spl #_stn , TW3 statesend spl #0 , init-state ; transition templates TW1 equ (tw1-in) TW2 equ (tw2-in) TW3 equ (tw3-in) tw1 spl #0 ,1 ; loss spl #0 ,0 ; win spl #0 ,0 ; tie tw2 spl #0 ,1 spl #0 ,-1 spl #0 ,-1 tw3 spl #0 ,3 spl #0 ,-2 spl #0 ,-2 _cli equ Clisson _hsa equ HSA _stn equ Stone_boot _mld equ __meld_boot ;***** Stone ;***** ; ; Alladin-like stone picked up from CW 65 ; Stone_boot mov Stone+2 , ppair psrc jmp @ppair , Pair+10 pscan mul.x #scan+4 , #__meld_boot+_SDIST+4 ppair div.f #0 , #__meld_boot+_PDIST+10 __mld_STEP equ 13 ; relative to paGate in core __mld_FIRST equ (-_PDIST+scan+8-__meld_boot) paGate equ (Pair-5) gateins dat #0 , #__mld_FIRST ; the clears Pair sclr1 spl #0 , >Pair-paGate+10 mov dclr , >paGate mov dclr , >paGate djn.f -2 , >paGate sclr2 spl #0 , >Pair-paGate+10 mov dclr , >paGate mov dclr , >paGate djn.f -2 , >paGate dat >5335 , >Pair-paGate+11 dclr dat >5335 , >Pair-paGate+11 ; the scanner scPair equ (scan+_PDIST-_SDIST) scan add #__mld_STEP*2667-2,paGate-Pair+scPair jmz.f -1 , @paGate-Pair+scPair spl scPair ,