Bots and Simulations > DNA - General

newbie robot

(1/2) > >>

Lorgar:
Ok, I have been through the tutos many times. (and even now, some subtle uses of info shot are still out of reach). I tried to make a small bot. Hubris was greatly rewarded, my boyz were wiped clean by the "animal minimalis" bots I introduced. shame and anger. After a lil bit of work I made this :

'orkyboy
cond
 *.eye1 0 =
 *.eye5 0 =
 *.eye9 0 =
start
 mult 314 rnd
stop


cond
 *.eye1 *.eye5 >
start
 mult -40
stop

'idem oeil5
cond
 *.eye9 *.eye5 >
start
 mult 40
stop


'set aim
cond
start
 .aimdx store
stop

cond
 *.refeye *.myeye !=
 *.eye5 20000 <
start
 15  .up store
stop

'waste shoot
cond
 *.waste 800 >
start
 -4 .shoot store
stop

'attackshoot
cond
 *.eye5 0 !=
 *.refeye *.myeye !=
 *.refdist 1 <
start
 -1 .shoot store
stop

cond
 *.trefeye *.myeye =
 *trefnrg 100 = or
start
 *.tienum .deltie store
stop


'feeding genes
cond
 *.eye5 5000 >
 *.refeye *.myeye != and
 *.tienum 3 < and
start
  1 .tie store
  1 .tienum store
 -6 .tieloc store
 -1000 .tieval store
stop


cond
 *.robage 0 =
start
 *.tienum .deltie store
stop


'reproductive gene
cond
 *.nrg 6000 >
 *.eye5 40 <
start
 -180 .aimdx store
 25 .repro store
 180 .55 store
stop
end

it does manage to survive and thrive competing with animalminimalis, but cant do a thing about more evolved bots. What can I do to make it work better? what mistakes did I make coding its dna? how can I make him create energy sharing ties with his comrades AND taking body points from enemy ties-targeted bots?

looking forward for an answer...
btw, strange thing, I may be tired but it seems that the "newbie-section-presentyourself" disappeard when I loged in after register...
Am I seeing things?

SiriusPrater:
Hey Lorgar.  I'd like to help, though I'm not an expert.  The first thing to work on, I think, would be what the bot does when it eye5 sees a conspec.  You could make the bot continue spinning or have them move away from conspecs.  Other than that, it seems to work.  Good luck.

Panda:

--- Quote from: Lorgar on May 01, 2011, 02:31:07 PM ---
'orkyboy
cond
 *.eye1 0 =
 *.eye5 0 =
 *.eye9 0 =
start
 mult 314 rnd
stop


cond
 *.eye1 *.eye5 >
start
 mult -40
stop

'idem oeil5
cond
 *.eye9 *.eye5 >
start
 mult 40
stop


'set aim
cond
start
 .aimdx store
stop

--- End quote ---

I don't quite get the idea of these genes, what are they meant to do?

Lorgar:
It was thought like this : if one gene is activated, the others are not, mult delete one value of the stack and replace it by 40/-40 etc, wich is then taken and stored in .aimdx.

did not work well, so I nuked it. now it's like this :
 
--- Code: ---'orkyboy
'orkybot

'tie to parent
cond
*.robage 0 =
start
.tie inc
.tienum inc
stop

'untie
cond
*.robage = 1
start
.deltie inc
stop


'movement genes
cond
 *.eye5 0 =
 *.eye3 0 =
 *.eye7 0 =
 *.numties 0 =
start
 314 rnd .aimdx store
 15 .up store
stop

cond
 *.eye3 *.eye5 >
start
 -30 .aimdx store
stop

cond
 *.eye7 *.eye5 >
start
 30 .aimdx store
stop

cond
*.eye5 0 >
*.refeye *.myeye !=
start
*.refxpos *.refypos angle .setaim store
*.refveldx .dx store
*.refvelup 30 add .up store
stop


'waste shoot
cond
 *.waste 800 >
start
 -4 .shoot store
stop

cond
 *.venom 100 <
 *.nrg 3000 >
start
 100 *.venom sub .strvenom store
 .up .vnloc store
 -2 .venval store
stop


'venom shoot
cond
 *.eye5 20 >=
 *.refeye *.myeye !=
start
 -3 .shoot store
stop

'attackshoot
cond
 *.eye5 20 >=
 *.refeye *.myeye !=
start
 -6 .shoot store
stop


'feeding genes
cond
 *.eye5 0 !=
 *.refeye *.myeye !=
 *.refbody *.mybody =<
start
  1 .tie store
stop

cond
 *.numties 0 !=
start
 .readtie

'reproductive gene
cond
 *.nrg 8000 >
 *.body 800 >
 *.eye5 40 <
start
 50 .repro store
stop

cond
 *.numties 0 >
 *.trefeye *.myeye !=
start
 -1 .tieloc store
 -1000 .tieval store
 1 .tienum store
stop



'shell gene
cond
 *.shell 100 <
start
 100 *.shell sub .mkshell store
stop

'poison gene
cond
 *.poison 100 <
 *.nrg 2000 >
start
 100 *.poison sub .mkpoison store
 .shoot .ploc store
stop

cond
 *robage 0 >
start
 1 .deltie store
stop

end
--- End code ---

Panda:
Is there anything wrong with this one now?

Navigation

[0] Message Index

[#] Next page

Go to full version