Welcome To Darwinbots > Newbie

an awsome gene that needs fixing

(1/2) > >>

d-EVO:
Ok.
I read the reply about the focal eye and revised my options. Came up with a great eyedea,  
I thought, why not alternate focal eye every cycle and use focal eye value as a variable (values -4 to +4) calculate which way the bot should turn.
I came up with this solution, but I have probably made a mistake with the logic but am to lazy to check. Ok it is totaly wrong but it is an interesting idea. will try to fix before any one else does
this gene should turn towards the nearest not friendly bot
pleeze tel my how to fix and what you think.


--- Code: ---cond
start
*.timer .focuseye store
*.refeye *.myeye sub sgn abs
*.eyef *.eye1 1 add sub sgn 0 floor multi
*.eyef *.eye2 1 add sub sgn 0 floor multi
*.eyef *.eye3 1 add sub sgn 0 floor multi
*.eyef *.eye4 1 add sub sgn 0 floor multi
*.eyef *.eye5 1 add sub sgn 0 floor multi
*.eyef *.eye6 1 add sub sgn 0 floor multi
*.eyef *.eye7 1 add sub sgn 0 floor multi
*.eyef *.eye8 1 add sub sgn 0 floor multi
*.eyef *.eye9 1 add sub sgn 0 floor multi
*.focuseye 35 multi multi .aimdx store
stop
--- End code ---

plenty of possabilities manipulating focal eye like this
ooh, just had idea on how to fix. wat the heck. will post anyway

Endy:
Did you mean to mult the values? Multi refers to the sysvar for multibot checking.

Welwordion:
Also even if you fix the multi issue the problem is that when the nearest bot is a friendly bot the comdition to turn will never be fullfilled, I had to build a complicated memory system in my Beholder bot to make him ignore friendly bots, your system does not need to be that complicated but you still need a memory system ignoring the nearest bot when its friendly.
Use some memory locations to store if an eye should be used or ignored, then you can just use a *Number sgn mult with every eye to enhance your code.

d-EVO:

--- Quote from: Endy ---Did you mean to mult the values? Multi refers to the sysvar for multibot checking.
--- End quote ---

man, I feel like such a noob.
explains a lot to.

thanks for the help both of you.

I know I can get it to work now

Moonfisher:
You should also be aware that storing 0 into a valid location will cost you a store every cycle, but storing a value into location 0 is free... also it won't clear the value from the stack... (In case you wan't to use it or check if it was used later on)
So you should move your condition logic to zero out .aimsx instead of the value stored... (.aimsx is just a memmory adress (6 to be exact) and it can be changed just as any other value)

Also when starting out it helps a lot to keep an eye on the sysvar and operator wiki.
Sysvars
Operators

Navigation

[0] Message Index

[#] Next page

Go to full version