Author Topic: Etch Mk II(F1)(abyaly)-15.03.2008  (Read 3691 times)

Offline abyaly

  • Bot Destroyer
  • ***
  • Posts: 363
    • View Profile
Etch Mk II(F1)(abyaly)-15.03.2008
« on: March 15, 2008, 09:57:30 PM »
Code: [Select]
'Etch Mk II
'Dirty F1 tie fighter by abyaly
'For version 2.43.1d
'March 15, 2008

def id 6395
def status 53
def tstatus 54
def ally 1
def veggie 2
def enemy 3
def rrr 942

def speed 10

'****************************Birth init**************************
cond
*.robage 0 =
start
  .dnalen .memloc store
  .dnalen .tmemloc store
  100 rnd .rrr store
stop
'****************************************************************

'*******************Const****************************************
cond
start
'Unfix myself
  0 .fixpos *.fixed sgn mult store
'Identify myself
  .id dup *.out5 sub sgn abs .out5 mult store
'arrange my eyes
  -140 dup *.eye1dir sub sgn abs .eye1dir mult store
  -105 dup *.eye2dir sub sgn abs .eye2dir mult store
  -70  dup *.eye3dir sub sgn abs .eye3dir mult store
  -35  dup *.eye4dir sub sgn abs .eye4dir mult store
  35   dup *.eye6dir sub sgn abs .eye6dir mult store
  70   dup *.eye7dir sub sgn abs .eye7dir mult store
  105  dup *.eye8dir sub sgn abs .eye8dir mult store
  140  dup *.eye9dir sub sgn abs .eye9dir mult store
  -30  dup *.eye1width sub sgn abs .eye1width mult store
  -25  dup *.eye2width sub sgn abs .eye2width mult store
  -15  dup *.eye3width sub sgn abs .eye3width mult store
  5    dup *.eye4width sub sgn abs .eye4width mult store
  45   dup *.eye5width sub sgn abs .eye5width mult store
  125  dup *.eye6width sub sgn abs .eye6width mult store
  285  dup *.eye7width sub sgn abs .eye7width mult store
  605  dup *.eye8width sub sgn abs .eye8width mult store
  1221 dup *.eye9width sub sgn abs .eye9width mult store
  .deltie *.tienum sgn mult inc
stop
'****************************************************************

'************************Eye focus manager***********************
cond
  *.eye1 0 >
  *.eye2 0 > or
  *.eye3 0 > or
  *.eye4 0 > or
  *.eye5 0 > or
  *.eye6 0 > or
  *.eye7 0 > or
  *.eye8 0 > or
  *.eye9 0 > or
start
'Focus using the narrowest eye that sees something
  *.eye1 *.eye2 *.eye3 *.eye4
  *.eye5 *.eye6 *.eye7 *.eye8 *.eye9
  floor floor floor floor
  floor floor floor floor
  50 store
  -4 *50 *.eye1 sub sgn abs -- - .focuseye mult store
  -3 *50 *.eye2 sub sgn abs -- - .focuseye mult store
  -2 *50 *.eye3 sub sgn abs -- - .focuseye mult store
  -1 *50 *.eye4 sub sgn abs -- - .focuseye mult store
  0  *50 *.eye5 sub sgn abs -- - .focuseye mult store
  1  *50 *.eye6 sub sgn abs -- - .focuseye mult store
  2  *50 *.eye7 sub sgn abs -- - .focuseye mult store
  3  *50 *.eye8 sub sgn abs -- - .focuseye mult store
  4  *50 *.eye9 sub sgn abs -- - .focuseye mult store
stop
'****************************************************************

'****************************Tie manager*************************
cond
  *.numties 0 >
start
'We will need this later :D
  *.tiepres .tienum store
  *.tiepres .readtie store
stop
'****************************************************************

'****************************Target ID***************************
cond
'I see something..   what is it?
  *.eyef 0 >
start
'Oh, you. Hi again, I guess.
  .ally
    *.in5 .id sub sgn abs -- -
    *.refage sgn -- - add sgn mult
    *.memval *.dnalen sub sgn abs -- - mult
  .status store

'Its a veggie! Let's eat it!
  .veggie .status
    *.status .ally sub sgn abs mult
    *.refshoot sgn -- - mult
    *.refaimsx sgn -- - mult
    *.refkills sgn -- - mult
    *.refeye sgn -- - mult
    *.refup sgn -- - mult
    *.memval 13 sub sgn abs -- - mult
  store

'You're not my race and you're not food.. you must be trying to kill me!
  .enemy .status
    *.status .ally sub sgn abs mult
    *.status .veggie sub sgn abs mult
  store
stop
cond
'I'm attached to something..   what is it?
  *.tienum 0 >
start
'Oh, you. Hi again, I guess.
  .ally
    *.tmemval *.dnalen sub sgn abs -- -
    *.trefage sgn -- - add sgn mult
  .tstatus store

'Its a veggie! Let's eat it!
  .veggie .tstatus
    *.tstatus .ally sub sgn abs mult
    *.trefshoot sgn -- - mult
    *.trefaimsx sgn -- - mult
    *.trefkills sgn -- - mult
    *.trefeye sgn -- - mult
    *.trefup sgn -- - mult
    *.tmemval 13 sub sgn abs -- - mult
  store

'You're not my race and you're not food.. you must be trying to kill me!
  .enemy .tstatus
    *.tstatus .ally sub sgn abs mult
    *.tstatus .veggie sub sgn abs mult
  store
stop
'****************************************************************

'**************************Untie allies**************************
cond
  *.numties 0 >
  *.tstatus .ally =
start
  *.tiepres .deltie store
stop
'****************************************************************

'****************************Seeking*****************************
cond
  *.eye1 0 =
  *.eye2 0 =
  *.eye3 0 =
  *.eye4 0 =
  *.eye5 0 =
  *.eye6 0 =
  *.eye7 0 =
  *.eye8 0 =
  *.eye9 0 =
start
'We clearly aren't looking hard enough
  .speed .up store
stop
'****************************************************************

'*******************Aim in direction of movement*****************
cond
  *.velup 0 !=
  *.veldx 0 !=
  *.eyef 0 =
  *.numties 0 =
  *.status .ally = or
start
'theta = arctan (veldx / velup). (math ftw)
  *.veldx 628 mult *.velup div *.veldx *.velup div dup mult 8824 mult 31416 add 10000 div
  div - *.velup sgn sqr -- - 628 mult add *.aim add .setaim store
stop
cond
  *.velup 0 =
  *.veldx 0 !=
  *.eyef 0 =
  *.numties 0 =
  *.status .ally = or
start
'divide by zero (eek!)
  *.velsx sgn 314 mult *.aim add .setaim store
stop
'****************************************************************

'***********************Target non-allies************************
cond
  *.eyef 0 >
  *.status .ally !=
start
'"children, scooch closer"
  *.refvelup 250 *.eye3 sub add *.velup abs - floor .up store
  *.refveldx .dx store  *.refveldx .dx store
  *.refxpos *.refypos angle .setaim store
stop

'****************************************************************

'************************Avoid allies****************************
cond
  *.eyef 0 >
  *.status .ally =
start
'root 2 = 14142 10000 div
'Yo. How's it going? Good? Me too. See ya.
  *.tiepres .deltie store
  *.refveldx sgn abs -- - *.refveldx add sgn .speed mult - 14142 mult 20000 div  .dx store
  .speed 14142 mult 20000 div .up store
stop

'****************************************************************

'***********************EAT YOUR VEGGIES!!***********************
cond
  *.eyef 0 >
  *.status .veggie =
  *.numties 0 =
start
  *.memval .tie store
stop
cond
  *.eyef 0 >
  *.status .veggie =
start
  .tieloc *.robage *.rrr add 2 mod 0 sub sgn abs -- - mult
  .tienum *.robage *.rrr add 2 mod 1 sub sgn abs -- - mult add
  .shoot store

   -1 *.robage *.rrr add 2 mod 0 sub sgn abs -- - mult
   1  *.robage *.rrr add 2 mod 1 sub sgn abs -- - mult add
  .shootval store
stop
cond
  *.numties 0 >
  *.tstatus .veggie =
start
  .tieval .tieloc store
   30000 .tieval store

stop
'****************************************************************

'*********This section is dedicated to killin'*******************
'This section is also a pain to comment,
'but I'm sure you can figure it out if you're interested
cond
  *.eyef 0 >
  *.numties 0 =
  *.status .enemy =
start
  1000 rnd .tie store
  .shootval  *.robage *.rrr add 4 mod 0 sub sgn abs -- - mult
  .strpoison *.robage *.rrr add 4 mod 1 sub sgn abs -- - mult add
  .strvenom  *.robage *.rrr add 4 mod 2 sub sgn abs -- - mult add
  .fixpos    *.robage *.rrr add 4 mod 3 sub sgn abs -- - mult add
  .shoot store
  32000 .shootval store
stop
cond
  *.eyef 0 >
  *.numties 0 >
  *.status .enemy =
  *.trefbody 50 >
start
  .tieloc *.robage *.rrr add 2 mod 0 sub sgn abs -- - mult
  .tienum *.robage *.rrr add 2 mod 1 sub sgn abs -- - mult add
  .shoot store
  -1 *.robage *.rrr add 2 mod 0 sub sgn abs -- - mult
  1  *.robage *.rrr add 2 mod 1 sub sgn abs -- - mult add
  .shootval store
stop
cond
  *.eyef 0 >
  *.numties 0 >
  *.status .enemy =
  *.trefbody 50 <=
start
  .shootval  *.robage *.rrr add 4 mod 0 sub sgn abs -- - mult
  .strbody   *.robage *.rrr add 4 mod 1 sub sgn abs -- - mult add
  .strpoison *.robage *.rrr add 4 mod 2 sub sgn abs -- - mult add
  .strvenom  *.robage *.rrr add 4 mod 3 sub sgn abs -- - mult add
  .shoot store
  32000 .shootval store
stop
cond
  *.numties 0 >
  *.tstatus .enemy =
  *.trefbody 50 >
start
  .strbody *.robage *.rrr add 2 mod 0 sub sgn abs -- - mult
  .tieval  *.robage *.rrr add 2 mod 1 sub sgn abs -- - mult add
  .tieloc store
  32000 .tieval store
stop
cond
  *.numties 0 >
  *.status .enemy =
  *.trefbody 50 <=
start
  .shootval  *.robage *.rrr add 4 mod 2 sub sgn abs -- - mult
  .fdbody    *.robage *.rrr add 4 mod 3 sub sgn abs -- - mult add
  .strpoison *.robage *.rrr add 4 mod 0 sub sgn abs -- - mult add
  .strvenom  *.robage *.rrr add 4 mod 1 sub sgn abs -- - mult add
  .tieloc store
  32000 .tieval store
stop
'****************************************************************

'**************************Waste & body**************************
cond
  *.waste 400 >
start
  -4 .shoot store
  *.waste .shootval store
stop
cond
  *.body 2 >=
start
  *.body .fdbody store
stop
'****************************************************************

'*****************************Repro******************************
cond
  *.nrg *.body 10 mult add 600 >
start
'Face the direction opposite to velocity
  *.veldx 628 mult *.velup div *.veldx *.velup div dup mult 8824 mult 31416 add 10000 div
  div - *.velup sgn sqr -- 628 mult add *.aim add .setaim store
'Accelerate with current velocity
  80 *.velscalar sub 0 floor .dn store
  50 .repro store
stop
'****************************************************************
Etch is back and working in current vers!
A few tactics have changed due to version trauma and new opportunities.
Reams the current F1 table in addition to pacifist and multiply4.
No close fights, contenders are welcome to take notes
Lancre operated on the feudal system, which was to say, everyone feuded all
the time and handed on the fight to their descendants.
        -- (Terry Pratchett, Carpe Jugulum)

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Etch Mk II(F1)(abyaly)-15.03.2008
« Reply #1 on: March 16, 2008, 06:18:22 PM »
Damn, was working on a bot that used the same way to eat up alge... but yours is better :'(
I have a cool way to drain larger bots even if they try to break the ties... but it's no use against etch.
It still doesn't even beat Pacifist yet, had a strat for it, but I don't think it'll help against this new Etch...
I have a cool first spread though, not sure if it's better, but it looks cool
Not going to release it till it's done... but I'm not sure I can beat this thing, gonna be working on my thesis. I have one idea but if I can't get it to work without spending too much time on it think I'll make a scraped version of it... it won't beat pacifist and this bot, but I want to show off the other neat bits in it.
I'm not actualy sure it's using the same way to feed on alge, but it looks like it, it also looks like yours has it's range for shots set up better, I think mine is waitig too long before firing memmory shots. I haven't checked the code but it eats the alge so fast I'm asuming it's the same trick... just tie and push 1000 into it's tieval and fire -1 into .tieloc with mem shots or venom... (I hope noone nerfs it, it's the best way for small bots to feed)
I'm hoping you're using tielen to determine shotrange, so I can steal your tweeked values >D
If you're using an eye value I probably have a different eyewidth...
Either way it's nice to have somthing I can work on beating, other than my own bots
Could have come at a beter time though, but once I'm done with my thesis I suspect I may be back to spend the time needed to beat whatever has come along (If I can).

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Etch Mk II(F1)(abyaly)-15.03.2008
« Reply #2 on: March 16, 2008, 06:45:54 PM »
Hmmm, we're also using the same way to kill off small bots... I already guessed you where working on that idea from your post earlyer... but I thought I had a working defence for it in my new bot... maybe we're not doing the same thing... or maybe my method doesn't work as well as I thought...

Was using something like this :

cond
*.numties 0 >
*.trefval *.trefkey !=
start
1000 .strbody store
-1000 .fdbody store
stop

So you're either doing something different or the gene is worthless... maybe the slight increase in size just prevented my test bot from detecting a small bot...
Sux... realy thought I had a good defence, I can't think of another way to prevent this except being larger... but I had such fun watching bots try to hit pacifist for ages with no luck... :-/
I'm hoping there's a lot of neat stuff in this thing that will help me understand ties better though. Still got a lot of stuff I'm uncertain about concerning code execution and ties, who gets to go first, how fast refvars and tmemval are updated and stuff like that.

Offline abyaly

  • Bot Destroyer
  • ***
  • Posts: 363
    • View Profile
Etch Mk II(F1)(abyaly)-15.03.2008
« Reply #3 on: March 16, 2008, 07:42:59 PM »
Etch does not kill small bots through .fdbody, if that's what you're wondering. Although it was effective when I tried it&mdash;I didn't use it here because I suspect that "feature" won't last for many versions.

Also, etch doesn't check for distance. It just fires away wastefully if it sees an enemy. I tend not to optimize things too much

I tried to make it readable, but if anything's unclear feel free to ask.
« Last Edit: March 16, 2008, 07:45:49 PM by abyaly »
Lancre operated on the feudal system, which was to say, everyone feuded all
the time and handed on the fight to their descendants.
        -- (Terry Pratchett, Carpe Jugulum)

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Etch Mk II(F1)(abyaly)-15.03.2008
« Reply #4 on: March 17, 2008, 03:43:16 AM »
From first clance it looks very nice and broken down and both usefull and slightly entertaining coments
If I have any problems understanding it I'll let you know.
Now I just need to find the time to study it closely. I can see that -- does in fact work, I was just forgetting to seperate it with a space... so I'm learning something already

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Etch Mk II(F1)(abyaly)-15.03.2008
« Reply #5 on: March 17, 2008, 09:31:18 AM »
Ok looks like you're using lots of different triks through the ties... and I can't do what I had in mind fast enough... and countering those tricks will probably take some thinking and testing... and even if I found a weakness you'd just fix it with an update.... so...
I'm posting a messy version of what I was working on (Cleaned out the worst big comments and foul language in there but it's still messy and had unused defines and generaly looks realy bad).
Calling it TieFighters till I can think of a better name.
It doesn't beat Etch II and Pacifist, but it it beats all the other bots, and has a cool way of killing of bots (Uses ties only to kill any kind of larger slower oponent, also works on bots that break al ties like Excalibur)
It was suposed to be SG'fied and use different hibernation levels and stuff... but I doubt lower code excution costs would help against this thing... it might make it capable of beating Pacifist though...
I don't think I can beat Etch any time soon, so I'm posting what I have so I can focus on my thesis, and I think I'll be back when I'm done to have another go at Etch II...
You have the worst timing ever, I sit around for months waiting for some competition and then you release this right as I run out of spare time...  

Anyways you win this time.... but I'll be back !