Author Topic: Spiral (IB)(F2)(abyaly)-16.06.07  (Read 3485 times)

Offline abyaly

  • Bot Destroyer
  • ***
  • Posts: 363
    • View Profile
Spiral (IB)(F2)(abyaly)-16.06.07
« on: June 16, 2007, 10:27:03 AM »
Code: [Select]
'Spiral
'Interesting Behavior bot by abyaly
'They work together to find food
'For version 2.43
'June 16, 2007




def spiral -15
'This number controls how much sideways push the bot
'exerts when part of a group.

def size 50
'This number controls how much body each bot will maintain

def swarmnumber 20
'This number is the maximum number of
'degrees of seperation between the bot and food
'for which it will follow the ally it sees.
'They branch off more if the number is lower.
'With a negative number they will never try to split up

def swarmdensity 90
'This numbers controls how close each bot wants to be
'to allies it follows. With higher numbers they tend to
'get closer and act more excited.


def id 8654
def status 62
def ally 1
def food 2
def enemy 3

cond
*.robage 0 =
start
  .tie inc
  140 .eye5width store
  .id .out5 store
stop

cond
start
  *.body .size sub *.body ceil .fdbody store
  .size *.body sub *.nrg 1000 sub ceil .strbody store
  *.tiepres dup sgn abs .deltie mult store
  0 .fixpos *.fixed mult store
stop

cond
  *.eye5 0 >
start
  .ally
*.in5 .id sub sgn abs -- - mult
  .status store
  .food .status
*.status .ally sub sgn abs mult
*.refshoot sgn -- - mult
*.refaimsx sgn -- - mult
*.refshell sgn -- - mult
*.refslime sgn -- - mult
*.refvenom sgn -- - mult
*.refkills sgn -- - mult
*.refeye sgn -- - mult
*.refup sgn -- - mult
  store
  .enemy .status
*.status .ally sub sgn abs mult
*.status .food sub sgn abs mult
  store
stop

cond
  *.eye5 0 =
  *.in3 0 = or
  *.robage 2 >
start
  *.aim 317 sub .setaim store
  *.robage dup 2 mod add 4 mod 2 mult
  .up *.robage 2 mult 4 mod sgn 3 mult add store
stop

cond
  *.eye5 0 >
  *.status .ally =
  *.in3 0 !=
  *.robage 1 >
start
  *.in1 .out1 store
  *.in2 .out2 store
  *.in3 -- .out3 store
  *.in1 *.in2 angle .setaim store
  *.refvelup .swarmdensity *.eye5 sub add *.velup abs - floor .up store
  *.refveldx .spiral add .dx store
stop

cond
  *.eye5 0 >
  *.status .ally !=
  *.robage 1 >
start
  *.refxpos *.refypos angle .setaim store
  *.refvelup 80 *.eye5 sub add *.velup abs - floor .up store
  *.refveldx .dx store
stop

cond
  *.eye5 0 >
  *.status .food =
  *.robage 1 >
start
  *.refxpos .out1 store
  *.refypos .out2 store
  .swarmnumber .out3 store
stop

cond
  *.eye5 70 >
  *.status .food =
start
  -1 .shoot store
stop

cond
  *.eye5 70 >
  *.status .food =
  *.robage 10 mod 0 =
  *.reffixed 0 =
start
  .fixpos .shoot store
  1 .shootval store
stop

cond
  *.eye5 70 >
  *.status .enemy =
start
  -1 .shoot store
  *.nrg 5 div 200 ceil .shootval store
stop

cond
  *.nrg 2000 >
start
  *.aim 317 add .setaim store
  50 .repro store
stop
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)