Bots and Simulations > Bot Tavern
Is there something wrong with this
bacillus:
Sadly, I have no idea what you are trying to achieve. If you could break the conditions down step-by-step in pseudocode, it would make things much simpler for me.
The post-edit version makes sense, at least. Run it and see if it works
If it helps, this is what it does:
FIXED and NRG (Condition A )
FIT and SPECIES (Condition B )
A or B or EYES or SHELL
Houshalter:
Ya, I hate trying to figure out other peoples bots to.
Here I go
'this is the original code not the one I just changed
start 'obvious
*.reffixed 0 = 'check to see if the robot im looking at is fixed (if it is I either have to feed it or let it go)
*.refnrg 10000 > and 'if its not fixed and it already has plenty of nrg then why bother just staring at it?
*.eye5 40 < or ' If theres nothing in my eye then turn till there is
*.refshell 0 > or 'I am trying to avoid evolving bots with shell so I put this one in there
*.memval *.refmulti 100 mult add *.refkills 2 div add *.refpoison 1000 div add *.refshoot add *.refeye add *.reftie add *.avgfitness <= or 'this line checks
'the fitness of the bot im looking at based on the refvars and tells me if its less then or equal to average fitness
*.totalbots *.totalmyspecies sub 100 > and or 'even if its less then average fitness I can still feed it if the population is to low
157 .aimdx store now if any of those conditions are true turn me right (or left, im not sure)
not 'Otherwise do the following
*.refxpos *.refypos angle .setaim store 'set my aim at the robot in my eye
stop 'we're done here
bacillus:
I never tried using in-line conditions, have you ever tried using algebraic functions as booleans? It's time-consuming but foolproof...
...for example, the genes
cond
*.reffixed 0 =
start
15 .up store
stop
becomes
15 *.reffixed sgn abs -- abs ..up mult store
EDIT => I think I wrote a post about all the possible functions in the DNA section once. Also check out the OCULUS II code; it's a super-efficient piece of code I wrote that puts the closest eye in focus. Then eyef can be read as though it were eye5. It's a monster of conditionless logic that combines at least 45 conditions into a single expression as seen above
Houshalter:
Yes I did but I didn't get it at all so I figured out how to use the boolean operators instead . I already have a hard enough time debugging my bot. By the way there was some improvement with the last change I made. Instead of spinning endlessly it stops and stares at a bot untill it randomly explodes several cycles later . I don't even know where to begin now.
bacillus:
I suppose spontaneous combustion might have its advantages in a species...
To clarify, the bit you posted was designed to only turn and face a bot.
If I understand you intentions correctly, and you want to feed the bot, use -2 .shoot store to fire a food shot.
EDIT => If you want, I could maybe rewite OCULUS II to suit your needs?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version