Author Topic: Stupid question  (Read 4162 times)

Offline HazD

  • Bot Neophyte
  • *
  • Posts: 17
    • View Profile
Stupid question
« on: April 13, 2006, 12:30:12 PM »
Can someone give me code for recognising enemies mine don't seem to work. please?
Being an EPOD is fun!  
(Eccentric Person Of Doom)  

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Stupid question
« Reply #1 on: April 13, 2006, 12:46:55 PM »
The simplest and classical solution is to use the refvars.
 
 A conspec would have
 
 *.myeye *.refeye =
 
 While an enemy would have
 
 *.myeye *.refeye !=
 
 Other methods are briefly considered on The WIki.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Stupid question
« Reply #2 on: April 13, 2006, 01:03:49 PM »
What have you tried using so far?
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Elite

  • Bot Overlord
  • ****
  • Posts: 532
    • View Profile
Stupid question
« Reply #3 on: April 13, 2006, 01:51:55 PM »
Do you have the code for your bot so far? If you do showing us would help

As Num said, *.refeye/*.myeye conspec recognition is the most popular (and very secure)

Here's a shooting gene with *.refeye/*.myeye conspec recognition:

cond
*.eye5 40 >
*.refeye *.myeye !=
start
-1 .shoot store
stop

It will cause your bot to -1 shoot at bots that don't match its *.myeye

*******

Num's Ymir uses *.memloc/*.memval conspec recognition

So you add this gene to the start of your bot:

(BTW, you can use any other number in place of 123, and you can use any free memory location in place of 52)

cond
*.robage 0 =
start
123 52 store
52 .memloc store
stop

And then check *.memval

cond
*.eye5 40 >
*.memval 123 !=
start
-1 .shoot store
stop
« Last Edit: April 13, 2006, 01:52:21 PM by Elite »

Offline HazD

  • Bot Neophyte
  • *
  • Posts: 17
    • View Profile
Stupid question
« Reply #4 on: April 14, 2006, 06:17:15 AM »
OK, this is my first experiment with bots and stuff learnt from the wiki and based on animal minimalis.
Code: [Select]
def venomcounter 51

cond
 *.robage 0 =
start
 .shoot .ploc store
 .mkshell .vloc store
 -32000 .venval store
stop

cond
*.eye5 0 >
*.myeye *.refeye =
start
*.refveldx .dx store
*.refvelup .up store
stop

cond
*.eye5 50 >
*.refeye *.myeye =
start
-6 .shoot store
stop


cond
*.waste 40 >
start
.backshot inc
-4 .shoot store
*.waste .shootval store
stop

cond
 *.venomcounter 19 >
start
 50 .shootval store
 -3 .shoot store
 0 .venomcounter store
stop

cond
*.eye5 0 =
*.refeye *.myeye = or
start
314 rnd .aimdx store
stop


cond
 *.poison 500 <
start
 50 .strpoison store
stop

cond
 *.venom 500 <
start
 50 .strvenom store
stop

cond
 *.nrg 20000 >
start
 10 .repro store
stop
end
Being an EPOD is fun!  
(Eccentric Person Of Doom)  

Offline Elite

  • Bot Overlord
  • ****
  • Posts: 532
    • View Profile
Stupid question
« Reply #5 on: April 14, 2006, 06:29:29 AM »
Which version are you using HazD?

Here's the corrected version. I've added an antibirthtie gene at the beginning, coding to make the venom work, corrected conspec recognition, and some prey-tracking routines, and some minor stuff

Your conspec routine for enemies should be *.refeye *.myeye != rather than *.refeye *.myeye =

' HazD's Bot

def venomcounter 51

' Birthtie begone!

cond
*.robage 2 <
start
.tie *.robage -1 mult 1 add mult inc
.deltie inc
stop

cond
*.robage 0 =
start
.shoot .ploc store
.mkshell .vloc store
-32000 .venval store
stop

cond
*.eye5 0 >
*.eye5 50 <
*.myeye *.refeye !=
start
*.refveldx .dx store
*.refvelup 50 add .up store
stop

cond
*.eye5 50 >
*.refeye *.myeye !=
start
-6 .shoot store
*.refveldx .dx store
*.refvelup .up store
stop

' Got shell? Use venom to remove it

cond
*.eye5 30 >
*.refshell 0 >
*.refeye *.myeye !=
start
.venomcounter inc
stop

cond
*.waste 40 >
start
.backshot inc
-4 .shoot store
*.waste .shootval store
stop

cond
*.venomcounter 19 >
start
50 .shootval store
-3 .shoot store
0 .venomcounter store
stop

cond
*.eye5 0 =
*.refeye *.myeye = or
start
314 rnd .aimdx store
stop

cond
*.poison 500 <
start
50 .strpoison store
stop

cond
*.venom 500 <
start
50 .strvenom store
stop

cond
*.nrg 4000 >
start
40 .repro store
stop

end
« Last Edit: April 14, 2006, 06:36:24 AM by Elite »

Offline HazD

  • Bot Neophyte
  • *
  • Posts: 17
    • View Profile
Stupid question
« Reply #6 on: April 14, 2006, 06:43:54 AM »
I am using version 2.41.0 and thanks for correcting my first bot type thing.  
Being an EPOD is fun!  
(Eccentric Person Of Doom)