Author Topic: Beholder(F3) (Welwordion) 28-10-08  (Read 1318 times)

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 324
    • View Profile
Beholder(F3) (Welwordion) 28-10-08
« on: October 28, 2008, 12:52:18 PM »
Well this is Beholder with some fixes and changed to F3 (mention that just in case I posted a previous version somewhere in the Bestiary)
I hope its not bad that I took some shooting waste and reproduction genes from multiply to complete my moving, eye and targeting systems.

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
Code: [Select]
'initializing eye configuration

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
stop



'setting friend "1" or foe "0" status


cond
*.refeye *.myeye =
start
1 *.focuseye 4 add 9 mod 61 add store
stop

'eye1 specific

cond
*.eye1 *51 10 !~=
*.eye1 *52 10 ~=
*62 1 = and
*.eye1 *59 10 ~=
*69 1 = and or
start
1 61 store
stop

cond
*.eye1 *51 10 !~=
*.eye1 *52 10 !~=
*.eye1 *59 10 !~=
start
0 61 store
stop

cond
*.eye1 0 =
start
0 61 store
stop

'eye2 specific

cond
*.eye2 *52 10 !~=
*.eye2 *53 10 ~=
*63 1 = and
*.eye2 *51 10 ~=
*61 1 = and or
start
1 62 store
stop

cond
*.eye2 *52 10 !~=
*.eye2 *53 10 !~=
*.eye2 *51 10 !~=
start
0 62 store
stop

cond
*.eye2 0 =
start
0 62 store
stop


'eye3 specific

cond
*.eye3 *53 10 !~=
*.eye3 *54 10 ~=
*64 1 = and
*.eye3 *52 10 ~=
*62 1 = and or
start
1 63 store
stop

cond
*.eye3 *53 10 !~=
*.eye3 *54 10 !~=
*.eye3 *52 10 !~=
start
0 63 store
stop

cond
*.eye3 0 =
start
0 63 store
stop

'eye4 specific

cond
*.eye4 *54 10 !~=
*.eye4 *55 10 ~=
*65 1 = and
*.eye4 *53 10 ~=
*63 1 = and or
start
1 64 store
stop

cond
*.eye4 *54 10 !~=
*.eye4 *55 10 !~=
*.eye4 *53 10 !~=
start
0 64 store
stop

cond
*.eye4 0 =
start
0 64 store
stop



'eye5 specific

cond
*.eye5 *55 10 !~=
*.eye5 *56 10 ~=
*66 1 = and
*.eye5 *54 10 ~=
*64 1 = and or
start
1 65 store
stop

cond
*.eye5 *55 10 !~=
*.eye5 *56 10 !~=
*.eye5 *54 10 !~=
start
0 65 store
stop

cond
*.eye5 0 =
start
0 65 store
stop

'eye6 specific

cond
*.eye6 *56 10 !~=
*.eye6 *57 10 ~=
*67 1 = and
*.eye6 *55 10 ~=
*65 1 = and or
start
1 66 store
stop

cond
*.eye6 *56 10 !~=
*.eye6 *57 10 !~=
*.eye6 *55 10 !~=
start
0 66 store
stop

cond
*.eye6 0 =
start
0 66 store
stop

'eye7 specific

cond
*.eye7 *57 10 !~=
*.eye7 *58 10 ~=
*68 1 = and
*.eye7 *56 10 ~=
*66 1 = and or
start
1 67 store
stop

cond
*.eye7 *57 10 !~=
*.eye7 *58 10 !~=
*.eye7 *56 10 !~=
start
0 67 store
stop

cond
*.eye7 0 =
start
0 67 store
stop

'eye8 specific

cond
*.eye8 *58 10 !~=
*.eye8 *59 10 ~=
*69 1 = and
*.eye8 *57 10 ~=
*67 1 = and or
start
1 68 store
stop

cond
*.eye8 *58 10 !~=
*.eye8 *59 10 !~=
*.eye8 *57 10 !~=
start
0 68 store
stop

cond
*.eye8 0 =
start
0 68 store
stop

'eye9 specific

cond
*.eye9 *59 10 !~=
*.eye9 *51 10 ~=
*61 1 = and
*.eye9 *58 10 ~=
*68 1 = and or
start
1 69 store
stop

cond
*.eye9 *59 10 !~=
*.eye9 *51 10 !~=
*.eye9 *58 10 !~=
start
0 69 store
stop

cond
*.eye9 0 =
start
0 69 store
stop

'the focuseye is set

cond
start
5 .focuseye *.eye1 sgn abs mult *61 1 sub abs mult store
6 .focuseye *.eye2 sgn abs mult *62 1 sub abs mult store
7 .focuseye *.eye3 sgn abs mult *63 1 sub abs mult store
8 .focuseye *.eye4 sgn abs mult *64 1 sub abs mult store
9 .focuseye *.eye5 sgn abs mult *65 1 sub abs mult store
1 .focuseye *.eye6 sgn abs mult *66 1 sub abs mult store
2 .focuseye *.eye7 sgn abs mult *67 1 sub abs mult store
3 .focuseye *.eye8 sgn abs mult *68 1 sub abs mult store
4 .focuseye *.eye9 sgn abs mult *69 1 sub abs mult store
stop


'the visual memory is stored

cond
start
*.eye1 51 store
*.eye2 52 store
*.eye3 53 store
*.eye4 54 store
*.eye5 55 store
*.eye6 56 store
*.eye7 57 store
*.eye8 58 store
*.eye9 59 store
stop

'set and fire

cond
*.refeye *.myeye !=
start
'*.focuseye 9 mod 140 mult
'70 500 *.focuseye 4 add 9 mod add * *.eyef sub abs sgn 1 sub abs mult 'sub
'70 500 *.focuseye 6 add 9 mod add * *.eyef sub abs sgn 1 sub abs mult 'add
'1256 add 1256 mod
*.refxpos *.refypos angle -1 mult *.aim add
.aimshoot store
stop

cond
500 *.focuseye 4 add 9 mod add * *.eyef =
500 *.focuseye 6 add 9 mod add * *.eyef = and not
*.eyef 0 = or
start
1 .aimdx store
stop

cond
500 *.focuseye 4 add 9 mod add * *.eyef =
500 *.focuseye 6 add 9 mod add * *.eyef = or
*.refeye *.myeye !=
start
7 .aimsx store
stop


'movement

cond
*.eyef 70 <
*.refeye *.myeye !=
start
'*.focuseye 9 mod 140 mult
'70 500 *.focuseye 4 add 9 mod add * *.eyef sub abs sgn 1 sub abs mult 'add
'70 500 *.focuseye 6 add 9 mod add * *.eyef sub abs sgn 1 sub abs mult 'sub
*.refxpos *.refypos angle -1 mult *.aim add
stop


'Flee from attack(multiply gene)

'25
cond
*.nrg 250 <
*.pain 50 > and
start
250 add
stop


cond
*.eyef 70 <
*.refeye *.myeye !=
start
1256 add 1256 mod

dup dup dup dup dup 314 ceil swapint
314 floor 942 ceil 314 sub sub swapint
942 floor 942 sub add 2 div
dup  0 swapint 3 pow 600 div 100 div sub add
2 div *.veldx sub .dx store


628 ceil -1 mult 314 add swapint
628 floor 628 sub add 2 div
dup 0 swapint 3 pow 600 div 100 div sub add
2 div *.velup sub .up store

stop

'swarm behavior

cond
start
5 *.eye1 25 sub sgn 1 sub 2 div abs mult *51 mult
6 *.eye2 25 sub sgn 1 sub 2 div abs mult *52 mult
7 *.eye3 25 sub sgn 1 sub 2 div abs mult *53 mult
8 *.eye4 25 sub sgn 1 sub 2 div abs mult *54 mult
9 *.eye5 25 sub sgn 1 sub 2 div abs mult *55 mult
1 *.eye6 25 sub sgn 1 sub 2 div abs mult *56 mult
2 *.eye7 25 sub sgn 1 sub 2 div abs mult *57 mult
3 *.eye8 25 sub sgn 1 sub 2 div abs mult *58 mult
4 *.eye9 25 sub sgn 1 sub 2 div abs mult *59 mult
*51 *52 add *53 add *54 add *55 add *56 add *57 add
*58 add *59 add div
9 mod 140 mult

1256 add 1256 mod

dup dup dup dup dup 314 ceil swapint
314 floor 942 ceil 314 sub sub swapint
942 floor 942 sub add 2 div
dup  0 swapint 3 pow 600 div 100 div sub add
5 div *.dx add .dx store


628 ceil -1 mult 314 add swapint
628 floor 628 sub add 2 div
dup 0 swapint 3 pow 600 div 100 div sub add
5 div *.up add .up store

stop



'From multiply
'______________________


cond
*.shflav 0 !=
*.refpoison *.refshell <
start
*.shang .aimshoot store
32 .shootval store
-1 .shoot store
0 .shflav store
stop


cond
*.shflav 0 !=
*.refpoison *.refshell >
start
*.shang .aimshoot store
32 .shootval store
-6 .shoot store
0 .shflav store
stop


cond
*.eyef 25 >
*.refeye *.myeye !=
*.refshoot *.myshoot !=
*.refpoison *.refshell =>
and
and
and
start
16 .shootval store
-6 .shoot store
stop

cond
*.eyef 25 >
*.refeye *.myeye !=
*.refpoison *.refshell <
start
16 .shootval store
-1 .shoot store
stop

cond
*.waste 100 >
start
*.waste .shootval store
-4 .shoot store
stop

cond
*.nrg 5000 >
start
50 .repro store
100 .strbody store
stop

cond
*.nrg 4000 >
*.body 500 <
start
100 .strbody store
stop

cond
*.nrg 100 <
start
100 .fdbody store
stop


end
« Last Edit: May 13, 2014, 02:26:29 PM by Botsareus »

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Beholder(F3) (Welwordion) 28-10-08
« Reply #1 on: October 28, 2008, 02:16:03 PM »
Quote from: Welwordion
I hope its not bad that I took some shooting waste and reproduction genes from multiply to complete my moving, eye and targeting systems.
Not bad at all. I hope they work well.

Please some extra information. It seems to play a lot with eyes. But in short what does it do.
« Last Edit: October 28, 2008, 02:18:03 PM by Peter »
Oh my god, who the hell cares.

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 324
    • View Profile
Beholder(F3) (Welwordion) 28-10-08
« Reply #2 on: October 28, 2008, 08:36:16 PM »
Beholder has 360 degree vision,it remembers in which eyes friends are (If the do not move to fast)  it does not turn to look but changes focuseye instead and also moves without turning by using a sinus cosinus approximation to calculate values to be stored in up and dx .
Well there is also some experimental code for swarmlike behaviour in it by keeping a certain distance, but most stuff you see is for managing the friend memory, like handling when a friendly bot switches to another eyefield.

I actually have a slightly better version of the code that also adjust the eyeposition so the eyes always look the same direction even if the bot turns but for sentimental reasons I only use that for another bot, heh its not like Beholder is supposed to turn much.
« Last Edit: October 28, 2008, 08:37:08 PM by Welwordion »

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Beholder(F3) (Welwordion) 28-10-08
« Reply #3 on: October 28, 2008, 11:35:04 PM »
By the look of it, it might have trouble feeding on certain eyes. If you have not already adressed it (I'm too lazy to check), I'd suggest two ways to solve this issue:
 1-Clear eye conspec when eye reaches 0
 2-Clear eye conspec after a certain time
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 324
    • View Profile
Beholder(F3) (Welwordion) 28-10-08
« Reply #4 on: October 29, 2008, 02:06:11 AM »
cond
*.eye1 *51 10 !~=
*.eye1 *52 10 !~=
*.eye1 *59 10 !~=
start
0 61 store
stop

cond
*.eye1 0 =
start
0 61 store
stop
<---what do you think those files are? Its delete friendly status when its 0 and delete friendly status when the eye value is different to its previous or its neighbours previous state, that one of the main part of the code ^^