Author Topic: P. Delicious  (Read 3863 times)

Offline goffrie

  • Bot Builder
  • **
  • Posts: 65
    • View Profile
P. Delicious
« on: February 12, 2008, 09:53:27 PM »
Yep, it's my first bot, but it's gone through tons of changes and I think it's pretty good
It should be suitable for F2.

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
Code: [Select]
' P. Delicious
' Based (somewhat) on "Animal Minimalis"
' Now with extra ____!

' 360 degree vision, shamelessly stolen from 'Beholder'
cond
 *.robage 0 =
start
 420 .eye1dir store
 315 .eye2dir store
 210 .eye3dir store
 105 .eye4dir store
 -105 .eye6dir store
 -210 .eye7dir store
 -315 .eye8dir store
 -420 .eye9dir store
 105 .eye1width store
 105 .eye2width store
 105 .eye3width store
 105 .eye4width store
 105 .eye5width store
 105 .eye6width store
 105 .eye7width store
 105 .eye8width store
 105 .eye9width store
 .shoot .ploc store
 .body .memloc store
stop

' Birth initialization
cond
 *971 0 >
 *.robage 0 =
start
 .tie inc
 *.maxvel 4 div *.vel sub .dn store
stop

' Otherwise
cond
 *971 0 =
 *.robage 0 =
start
 971 inc
stop

' Food Finder
cond
 *.eyef 0 >
 *.refeye *.myeye !=
 *.refaimdx *.myaimdx != or
start
 *.refveldx *.body mult 1000 div .dx store
 *.refvelup *.body mult 1000 div 30 add .up store
 *.refxpos *.refypos angle *.refveldx 2 mult sub .setaim store
 0 .focuseye store
stop

' Eat Food for Nonhostile
cond
 *.eye5 30 >
 *.refeye *.myeye !=
 *.refaimdx *.myaimdx != or
 *.waste 500 <
 *.refshoot 0 =
 *.focuseye 0 =
start
 4 .shootval store
 -1 .shoot store
 *.refvelup *.body mult 1000 div .up store
stop

' Eat Food for Hostile
cond
 *.eye5 40 >
 *.refeye *.myeye !=
 *.refaimdx *.myaimdx != or
 *.waste 500 <
 *.refshoot 0 !=
 *.focuseye 0 =
start
 8 .memval 400 sub sgn 1 add 2 div 8 mult add .shootval store
 -6 .shoot store
 *.refvelup *.body mult 1000 div .up store
stop

' Shoot Waste
cond
 *.eye5 25 >
 *.refeye *.myeye !=
 *.refaimdx *.myaimdx != or
 *.waste 500 >=
 *.focuseye 0 =
start
 -4 .shoot store
 *.waste .shootval store
 *.refvelup *.body mult 1000 div .up store
stop

' Reproduce
cond
 *.nrg 5000 >
 *.body 1000 >
 *50 10 <
 *.poison 20000 >= or
 *.eye5 20 <
 *.totalmyspecies 150 <
start
 10 .repro store
 50 inc
stop

' Roam
cond
 *.eyef 0 =
 *.refeye *.myeye =
 *.refaimdx *.myaimdx = and or
start
 3 .up store
 4 .aimdx 1 *.aimdx sgn abs sub mult store
stop

' Begin eXtreme inefficiency.
' Any help here in making it more efficient would be appreciated, but it works for now
' "othar" is an intentional misspelling, dont ask

' Detect othars
cond
 *.eyef 0 =
 *.refeye *.myeye =
 *.refaimdx *.myaimdx = and or
 *.focuseye -4 =
start
 4 .focuseye *.eye9 sgn mult store
 3 .focuseye *.eye8 sgn mult store
 2 .focuseye *.eye7 sgn mult store
 1 .focuseye *.eye6 sgn mult store
 0 .focuseye *.eye5 sgn mult store
 -1 .focuseye *.eye4 sgn mult store
 -2 .focuseye *.eye3 sgn mult store
 -3 .focuseye *.eye2 sgn mult store
stop

' Detect othars
cond
 *.eyef 0 =
 *.refeye *.myeye =
 *.refaimdx *.myaimdx = and or
 *.focuseye -3 =
start
 -4 .focuseye *.eye1 sgn mult store
 4 .focuseye *.eye9 sgn mult store
 3 .focuseye *.eye8 sgn mult store
 2 .focuseye *.eye7 sgn mult store
 1 .focuseye *.eye6 sgn mult store
 0 .focuseye *.eye5 sgn mult store
 -1 .focuseye *.eye4 sgn mult store
 -2 .focuseye *.eye3 sgn mult store
stop

' Detect othars
cond
 *.eyef 0 =
 *.refeye *.myeye =
 *.refaimdx *.myaimdx = and or
 *.focuseye -2 =
start
 -3 .focuseye *.eye2 sgn mult store
 -4 .focuseye *.eye1 sgn mult store
 4 .focuseye *.eye9 sgn mult store
 3 .focuseye *.eye8 sgn mult store
 2 .focuseye *.eye7 sgn mult store
 1 .focuseye *.eye6 sgn mult store
 0 .focuseye *.eye5 sgn mult store
 -1 .focuseye *.eye4 sgn mult store
stop

' Detect othars
cond
 *.eyef 0 =
 *.refeye *.myeye =
 *.refaimdx *.myaimdx = and or
 *.focuseye -1 =
start
 -2 .focuseye *.eye3 sgn mult store
 -3 .focuseye *.eye2 sgn mult store
 -4 .focuseye *.eye1 sgn mult store
 4 .focuseye *.eye9 sgn mult store
 3 .focuseye *.eye8 sgn mult store
 2 .focuseye *.eye7 sgn mult store
 1 .focuseye *.eye6 sgn mult store
 0 .focuseye *.eye5 sgn mult store
stop

' Detect othars
cond
 *.eyef 0 =
 *.refeye *.myeye =
 *.refaimdx *.myaimdx = and or
 *.focuseye 0 =
start
 -1 .focuseye *.eye4 sgn mult store
 -2 .focuseye *.eye3 sgn mult store
 -3 .focuseye *.eye2 sgn mult store
 -4 .focuseye *.eye1 sgn mult store
 4 .focuseye *.eye9 sgn mult store
 3 .focuseye *.eye8 sgn mult store
 2 .focuseye *.eye7 sgn mult store
 1 .focuseye *.eye6 sgn mult store
stop

' Detect othars
cond
 *.eyef 0 =
 *.refeye *.myeye =
 *.refaimdx *.myaimdx = and or
 *.focuseye 1 =
start
 0 .focuseye *.eye5 sgn mult store
 -1 .focuseye *.eye4 sgn mult store
 -2 .focuseye *.eye3 sgn mult store
 -3 .focuseye *.eye2 sgn mult store
 -4 .focuseye *.eye1 sgn mult store
 4 .focuseye *.eye9 sgn mult store
 3 .focuseye *.eye8 sgn mult store
 2 .focuseye *.eye7 sgn mult store
stop

' Detect othars
cond
 *.eyef 0 =
 *.refeye *.myeye =
 *.refaimdx *.myaimdx = and or
 *.focuseye 2 =
start
 1 .focuseye *.eye6 sgn mult store
 0 .focuseye *.eye5 sgn mult store
 -1 .focuseye *.eye4 sgn mult store
 -2 .focuseye *.eye3 sgn mult store
 -3 .focuseye *.eye2 sgn mult store
 -4 .focuseye *.eye1 sgn mult store
 4 .focuseye *.eye9 sgn mult store
 3 .focuseye *.eye8 sgn mult store
stop

' Detect othars
cond
 *.eyef 0 =
 *.refeye *.myeye =
 *.refaimdx *.myaimdx = and or
 *.focuseye 3 =
start
 2 .focuseye *.eye7 sgn mult store
 1 .focuseye *.eye6 sgn mult store
 0 .focuseye *.eye5 sgn mult store
 -1 .focuseye *.eye4 sgn mult store
 -2 .focuseye *.eye3 sgn mult store
 -3 .focuseye *.eye2 sgn mult store
 -4 .focuseye *.eye1 sgn mult store
 4 .focuseye *.eye9 sgn mult store
stop

' Detect othars
cond
 *.eyef 0 =
 *.refeye *.myeye =
 *.refaimdx *.myaimdx = and or
 *.focuseye 4 =
start
 3 .focuseye *.eye8 sgn mult store
 2 .focuseye *.eye7 sgn mult store
 1 .focuseye *.eye6 sgn mult store
 0 .focuseye *.eye5 sgn mult store
 -1 .focuseye *.eye4 sgn mult store
 -2 .focuseye *.eye3 sgn mult store
 -3 .focuseye *.eye2 sgn mult store
 -4 .focuseye *.eye1 sgn mult store
stop

' End eXtreme inefficiency

' Retaliate
cond
 *.shflav 0 !=
 *.shflav -2 !=
start
 1256 *.shang sub .aimshoot store
 628 .shootval store
 .aimdx .shoot store
 0 .shflav store
stop

' Store energy
cond
 *.nrg 10000 >
 *.poison 32000 =
 *.body 2000 < or
start
 1000 .strbody store
stop

' Restore energy
cond
 *.nrg 5000 <
 *.body 800 >=
start
 1000 .fdbody store
stop

' Emergency energy restore
cond
 *.nrg 2000 <
 *.pain 200 >=
start
 *.body 10 mult 10 sub .fdbody store
stop

' Create poison
cond
 *.nrg 15000 >
 *.body 2000 >=
 *.poison 32000 <
start
 5000 .mkpoison store
stop

' Unstick
cond
 *.fixed 0 >
start
 .fixpos dec
stop

' Antivirus
cond
 *.mkvirus 0 !=
start
 *.mkvirus .delgene store
stop

' Kill ties
cond
 *.numties 0 !=
start
 *.tiepres .deltie store
stop

end
« Last Edit: May 09, 2014, 11:21:00 AM by Botsareus »

Offline rsucoop

  • Bot Destroyer
  • ***
  • Posts: 166
    • View Profile
P. Delicious
« Reply #1 on: February 15, 2008, 01:49:17 PM »
You're antiviral gene causes the bot to delete genes at random for certain viruses. Some that copy any gene would be destructive to your bot. But it works very well for the simpler ones from the Violets. To make the eye system for focuseye one gene, use this

start
5 .focuseye *.eye1 sgn abs mult *.eye1id 1 sub abs mult store
6 .focuseye *.eye2 sgn abs mult *.eye2id 1 sub abs mult store
7 .focuseye *.eye3 sgn abs mult *.eye3id 1 sub abs mult store
8 .focuseye *.eye4 sgn abs mult *.eye4id 1 sub abs mult store
9 .focuseye *.eye5 sgn abs mult *.eye5id 1 sub abs mult store
1 .focuseye *.eye6 sgn abs mult *.eye6id 1 sub abs mult store
2 .focuseye *.eye7 sgn abs mult *.eye7id 1 sub abs mult store
3 .focuseye *.eye8 sgn abs mult *.eye8id 1 sub abs mult store
4 .focuseye *.eye9 sgn abs mult *.eye9id 1 sub abs mult store
stop

The focuseye check is pointless, because the original designer used a lot more genes to determine where everything was; this prevented the bot from going back and checking a spot with something it already knew. Try it out, works for me alot of the time even with mutations. But that large of a gene leaves room for things like eyewidth changes and so on. Not to sure how it has anything to do with Animal Minimalis, but it certainly is an interesting bot.

Offline goffrie

  • Bot Builder
  • **
  • Posts: 65
    • View Profile
P. Delicious
« Reply #2 on: February 16, 2008, 06:13:29 PM »
Thanks for the .focuseye gene.
Quote
Not to sure how it has anything to do with Animal Minimalis,
It was originally based on Animal Minimalis. It's just significantly changed  The comment should probably be removed.
Quote
You're antiviral gene causes the bot to delete genes at random for certain viruses. Some that copy any gene would be destructive to your bot. But it works very well for the simpler ones from the Violets.
True, the antivirus gene isn't great. However, I don't see a lot of viruses making viruses out of other genes...

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
P. Delicious
« Reply #3 on: February 16, 2008, 06:37:14 PM »
Lots of anti virus schemes would short circuit if a virus copied random genes.  That in itself might be a fun weapon.

Offline rsucoop

  • Bot Destroyer
  • ***
  • Posts: 166
    • View Profile
P. Delicious
« Reply #4 on: February 16, 2008, 08:40:41 PM »
Quote from: goffrie
Thanks for the .focuseye gene.
Quote
Not to sure how it has anything to do with Animal Minimalis,
It was originally based on Animal Minimalis. It's just significantly changed  The comment should probably be removed.
Quote
You're antiviral gene causes the bot to delete genes at random for certain viruses. Some that copy any gene would be destructive to your bot. But it works very well for the simpler ones from the Violets.
True, the antivirus gene isn't great. However, I don't see a lot of viruses making viruses out of other genes...

The best viruses I've encountered copied random genes for that reason, but they require at least 2 genes to fire the right virus.

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
P. Delicious
« Reply #5 on: February 26, 2008, 07:36:17 AM »
I have a virus in Pacifist (The second one), it hides it's presence while deleting all other genes, and only starts to spread itself whent here's one gene left.
If the oponent removes the gene nr saved in mkvirus it will delete the genes in between the virus and the antiviral gene (Deleting it's own antiviral gene in the end).
That way any delgene inhibiters would most likely get deleted by the antivirus gene
Problem is the virus is very long... but the primary purpose isn't realy to kill anyone though, I only made it lethal because otherwise it had a hibernating effect on oponents which just prolonged most league fights...