'Another neural network test
'Just trying to figure out whats possible

'i1 : *.eye5
'i2 : *.refvelup
'i3 : *.refxpos *.refypos angle
'i4 : *.body
'-------
'o1 : .shoot (-6)
'o2 : .up
'o3 : .setaim
'o4 : .repro

'Extras (no initial weights no def)

'i5 : *.refveldx
'i6 : *.refshell
'i7 : *.refpoison
'i8 : *.robage 100 mod
'i9 : *.pain
'i10: *.shang
'i11: *.nrg
'i12: *.shell
'-------
'o5 : .dx
'o6 : .shoot (-1)
'o7 : .shoot (-3)
'o8 : .mkshell
'o9 : .strbody
'o10: .fdbody
'o11: .setaim
'o12: .sx

def downscale 400
def downscaleout 500

def wi1h1 100
def wi2h1 100
def wi3h1 0
def wi4h1 0

def wi1h2 -10
def wi2h2 400
def wi3h2 0
def wi4h2 0

def wi1h3 0
def wi2h3 150
def wi3h3 0
def wi4h3 0

def wi1h4 0
def wi2h4 0
def wi3h4 400
def wi4h4 0

def wi1h5 0
def wi2h5 0
def wi3h5 0
def wi4h5 100

def wh1o1 500
def wh1o2 -200
def wh1o3 0
def wh1o4 0

def wh2o1 0
def wh2o2 50
def wh2o3 0
def wh2o4 0

def wh3o1 0
def wh3o2 300
def wh3o3 -100
def wh3o4 0

def wh4o1 0
def wh4o2 0
def wh4o3 500
def wh4o4 0

def wh5o1 0
def wh5o2 -200
def wh5o3 100
def wh5o4 1000


def h1 51
def h2 52
def h3 53
def h4 54
def h5 55
def h6 56
def h7 57
def h8 58
def h9 59
def h10 60
def h11 61
def h12 62
def h13 63

start
0 .h1 store
100 .h2 store
1 .h3 store
1 .h4 store
-500 .h5 store
0 .h6 store
0 .h7 store
0 .h8 store
0 .h9 store
0 .h10 store
0 .h11 store
0 .h12 store
0 .h13 store
stop


'********** Inputs
'======= h1
start
*.eye5 .wi1h1 mult *.refvelup .wi2h1 mult add *.refxpos *.refypos angle .wi3h1 mult add *.body .wi4h1 mult add *.refveldx 0 mult add *.refshell 0 mult add *.refpoison 0 mult add *.robage 100 mod 0 mult add *.pain 0 mult add *.shang 0 mult add *.nrg 0 mult add *.shell 0 mult add .downscale div *.h1 add .h1 store
stop

'======= h2
start
*.eye5 .wi1h2 mult *.refvelup .wi2h2 mult add *.refxpos *.refypos angle .wi3h2 mult add *.body .wi4h2 mult add *.refveldx 0 mult add *.refshell 0 mult add *.refpoison 0 mult add *.robage 100 mod 0 mult add *.pain 0 mult add *.shang 0 mult add *.nrg 0 mult add *.shell 0 mult add .downscale div *.h2 add .h2 store
stop

'======= h3
start
*.eye5 .wi1h3 mult *.refvelup .wi2h3 mult add *.refxpos *.refypos angle .wi3h3 mult add *.body .wi4h3 mult add *.refveldx 0 mult add *.refshell 0 mult add *.refpoison 0 mult add *.robage 100 mod 0 mult add *.pain 0 mult add *.shang 0 mult add *.nrg 0 mult add *.shell 0 mult add .downscale div *.h3 add .h3 store
stop

'======= h4
start
*.eye5 .wi1h4 mult *.refvelup .wi2h4 mult add *.refxpos *.refypos angle .wi3h4 mult add *.body .wi4h4 mult add *.refveldx 0 mult add *.refshell 0 mult add *.refpoison 0 mult add *.robage 100 mod 0 mult add *.pain 0 mult add *.shang 0 mult add *.nrg 0 mult add *.shell 0 mult add .downscale div *.h4 add .h4 store
stop

'======= h5
start
*.eye5 .wi1h5 mult *.refvelup .wi2h5 mult add *.refxpos *.refypos angle .wi3h5 mult add *.body .wi4h5 mult add *.refveldx 0 mult add *.refshell 0 mult add *.refpoison 0 mult add *.robage 100 mod 0 mult add *.pain 0 mult add *.shang 0 mult add *.nrg 0 mult add *.shell 0 mult add .downscale div *.h5 add .h5 store
stop

'======= h6
start
*.eye5 0 mult *.refvelup 0 mult add *.refxpos *.refypos angle 0 mult add *.body 0 mult add *.refveldx 0 mult add *.refshell 0 mult add *.refpoison 0 mult add *.robage 100 mod 0 mult add *.pain 0 mult add *.shang 0 mult add *.nrg 0 mult add *.shell 0 mult add .downscale div *.h6 add .h6 store
stop

'======= h7
start
*.eye5 0 mult *.refvelup 0 mult add *.refxpos *.refypos angle 0 mult add *.body 0 mult add *.refveldx 0 mult add *.refshell 0 mult add *.refpoison 0 mult add *.robage 100 mod 0 mult add *.pain 0 mult add *.shang 0 mult add *.nrg 0 mult add *.shell 0 mult add .downscale div *.h7 add .h7 store
stop

'======= h8
start
*.eye5 0 mult *.refvelup 0 mult add *.refxpos *.refypos angle 0 mult add *.body 0 mult add *.refveldx 0 mult add *.refshell 0 mult add *.refpoison 0 mult add *.robage 100 mod 0 mult add *.pain 0 mult add *.shang 0 mult add *.nrg 0 mult add *.shell 0 mult add .downscale div *.h8 add .h8 store
stop

'======= h9
start
*.eye5 0 mult *.refvelup 0 mult add *.refxpos *.refypos angle 0 mult add *.body 0 mult add *.refveldx 0 mult add *.refshell 0 mult add *.refpoison 0 mult add *.robage 100 mod 0 mult add *.pain 0 mult add *.shang 0 mult add *.nrg 0 mult add *.shell 0 mult add .downscale div *.h9 add .h9 store
stop

'======= h10
start
*.eye5 0 mult *.refvelup 0 mult add *.refxpos *.refypos angle 0 mult add *.body 0 mult add *.refveldx 0 mult add *.refshell 0 mult add *.refpoison 0 mult add *.robage 100 mod 0 mult add *.pain 0 mult add *.shang 0 mult add *.nrg 0 mult add *.shell 0 mult add .downscale div *.h10 add .h10 store
stop

'======= h11
start
*.eye5 0 mult *.refvelup 0 mult add *.refxpos *.refypos angle 0 mult add *.body 0 mult add *.refveldx 0 mult add *.refshell 0 mult add *.refpoison 0 mult add *.robage 100 mod 0 mult add *.pain 0 mult add *.shang 0 mult add *.nrg 0 mult add *.shell 0 mult add .downscale div *.h11 add .h11 store
stop

'======= h12
start
*.eye5 0 mult *.refvelup 0 mult add *.refxpos *.refypos angle 0 mult add *.body 0 mult add *.refveldx 0 mult add *.refshell 0 mult add *.refpoison 0 mult add *.robage 100 mod 0 mult add *.pain 0 mult add *.shang 0 mult add *.nrg 0 mult add *.shell 0 mult add .downscale div *.h12 add .h12 store
stop

'======= h13
start
*.eye5 0 mult *.refvelup 0 mult add *.refxpos *.refypos angle 0 mult add *.body 0 mult add *.refveldx 0 mult add *.refshell 0 mult add *.refpoison 0 mult add *.robage 100 mod 0 mult add *.pain 0 mult add *.shang 0 mult add *.nrg 0 mult add *.shell 0 mult add .downscale div *.h13 add .h13 store
stop


'in
'-----------------------------------------------------------------
'out


'********** Outputs

'======= o5
start
*.h1 0 mult *.h2 0 mult add *.h3 0 mult add *.h4 0 mult add *.h5 0 mult add *.h6 0 mult add *.h7 0 mult add *.h8 0 mult add *.h9 0 mult add *.h10 0 mult add *.h11 0 mult add *.h12 0 mult add *.h13 0 mult add .downscaleout div .dx store
stop

'======= o6
start
*.h1 0 mult *.h2 0 mult add *.h3 0 mult add *.h4 0 mult add *.h5 0 mult add *.h6 0 mult add *.h7 0 mult add *.h8 0 mult add *.h9 0 mult add *.h10 0 mult add *.h11 0 mult add *.h12 0 mult add *.h13 0 mult add .downscaleout div sgn -1 mult 0 ceil .shoot store
stop

'======= o7
start
*.h1 0 mult *.h2 0 mult add *.h3 0 mult add *.h4 0 mult add *.h5 0 mult add *.h6 0 mult add *.h7 0 mult add *.h8 0 mult add *.h9 0 mult add *.h10 0 mult add *.h11 0 mult add *.h12 0 mult add *.h13 0 mult add .downscaleout div sgn -3 mult 0 ceil .shoot store
stop

'======= o8
start
*.h1 0 mult *.h2 0 mult add *.h3 0 mult add *.h4 0 mult add *.h5 0 mult add *.h6 0 mult add *.h7 0 mult add *.h8 0 mult add *.h9 0 mult add *.h10 0 mult add *.h11 0 mult add *.h12 0 mult add *.h13 0 mult add .downscaleout div .mkshell store
stop

'======= o9
start
*.h1 0 mult *.h2 0 mult add *.h3 0 mult add *.h4 0 mult add *.h5 0 mult add *.h6 0 mult add *.h7 0 mult add *.h8 0 mult add *.h9 0 mult add *.h10 0 mult add *.h11 0 mult add *.h12 0 mult add *.h13 0 mult add .downscaleout div .strbody store
stop

'======= o10
start
*.h1 0 mult *.h2 0 mult add *.h3 0 mult add *.h4 0 mult add *.h5 0 mult add *.h6 0 mult add *.h7 0 mult add *.h8 0 mult add *.h9 0 mult add *.h10 0 mult add *.h11 0 mult add *.h12 0 mult add *.h13 0 mult add .downscaleout div .fdbody store
stop

'======= o11
start
*.h1 0 mult *.h2 0 mult add *.h3 0 mult add *.h4 0 mult add *.h5 0 mult add *.h6 0 mult add *.h7 0 mult add *.h8 0 mult add *.h9 0 mult add *.h10 0 mult add *.h11 0 mult add *.h12 0 mult add *.h13 0 mult add .downscaleout div .setaim store
stop

'======= o12
start
*.h1 0 mult *.h2 0 mult add *.h3 0 mult add *.h4 0 mult add *.h5 0 mult add *.h6 0 mult add *.h7 0 mult add *.h8 0 mult add *.h9 0 mult add *.h10 0 mult add *.h11 0 mult add *.h12 0 mult add *.h13 0 mult add .downscaleout div .sx store
stop



'======= o1
start
*.h1 .wh1o1 mult *.h2 .wh2o1 mult add *.h3 .wh3o1 mult add *.h4 .wh4o1 mult add *.h5 .wh5o1 mult add *.h6 0 mult add *.h7 0 mult add *.h8 0 mult add *.h9 0 mult add *.h10 0 mult add *.h11 0 mult add *.h12 0 mult add *.h13 0 mult add .downscaleout div sgn -6 mult 0 ceil .shoot store
stop

'======= o2
start
*.h1 .wh1o2 mult *.h2 .wh2o2 mult add *.h3 .wh3o2 mult add *.h4 .wh4o2 mult add *.h5 .wh5o2 mult add *.h6 0 mult add *.h7 0 mult add *.h8 0 mult add *.h9 0 mult add *.h10 0 mult add *.h11 0 mult add *.h12 0 mult add *.h13 0 mult add .downscaleout div .up store
stop

'======= o3
start
*.h1 .wh1o3 mult *.h2 .wh2o3 mult add *.h3 .wh3o3 mult add *.h4 .wh4o3 mult add *.h5 .wh5o3 mult add *.h6 0 mult add *.h7 0 mult add *.h8 0 mult add *.h9 0 mult add *.h10 0 mult add *.h11 0 mult add *.h12 0 mult add *.h13 0 mult add .downscaleout div .setaim store
stop

'======= o4
start
*.h1 .wh1o4 mult *.h2 .wh2o4 mult add *.h3 .wh3o4 mult add *.h4 .wh4o4 mult add *.h5 .wh5o4 mult add *.h6 0 mult add *.h7 0 mult add *.h8 0 mult add *.h9 0 mult add *.h10 0 mult add *.h11 0 mult add *.h12 0 mult add *.h13 0 mult add .downscaleout div .repro store
stop


'----- some regular genes to help it along...

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

cond
*.venom 20 <
*.nrg 200 >
start
10 .mkvenom store
stop

cond
*.poison 20 <
*.nrg 200 >
start
10 .mkpoison store
stop

cond
*.robage 10 <
start
*.maxvel - .up store
*.maxvel .sx store
*.refxpos *.refypos angle .setaim store
.setaim .shoot store
*.aim .shootval store
stop

start
.deltie inc
.fixpos dec
stop

cond
*.nrg *.body 10 mult >
start
100 .strbody store
stop

cond
*.body 10 <
*.robage 0 >
start
-2 .shoot store
31000 .shootval store
stop

cond
*.totalmyspecies 1000 >
start
20 .shootval store
stop

end