Author Topic: an awsome gene that needs fixing  (Read 4078 times)

Offline d-EVO

  • Bot Destroyer
  • ***
  • Posts: 125
    • View Profile
an awsome gene that needs fixing
« on: October 28, 2008, 06:47:07 PM »
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: [Select]
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

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

Offline Endy

  • Bot Overlord
  • ****
  • Posts: 852
    • View Profile
an awsome gene that needs fixing
« Reply #1 on: October 28, 2008, 08:01:08 PM »
Did you mean to mult the values? Multi refers to the sysvar for multibot checking.

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
an awsome gene that needs fixing
« Reply #2 on: October 28, 2008, 08:19:33 PM »
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.

Offline d-EVO

  • Bot Destroyer
  • ***
  • Posts: 125
    • View Profile
an awsome gene that needs fixing
« Reply #3 on: October 29, 2008, 09:38:45 AM »
Quote from: Endy
Did you mean to mult the values? Multi refers to the sysvar for multibot checking.

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
1:      2 is true
2:      1 is false

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
an awsome gene that needs fixing
« Reply #4 on: October 29, 2008, 01:00:35 PM »
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
« Last Edit: October 29, 2008, 01:02:24 PM by Moonfisher »

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
an awsome gene that needs fixing
« Reply #5 on: October 29, 2008, 02:09:15 PM »
No, a store will cost nrg anyhow. The way you use it doesn't matter. You have to pay for the amount of stores you have in your dna. Not for the amount of stores you do.
Oh my god, who the hell cares.

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
an awsome gene that needs fixing
« Reply #6 on: October 29, 2008, 04:42:37 PM »
When did this happen ?
I know it was changed once but then changed back to no costs on 0 stores.... but has it been changed again ?
And if so why are people building the conditions into the store? It would be better to build it into a single inline condition, they cost 1/10th of a store...

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
an awsome gene that needs fixing
« Reply #7 on: October 29, 2008, 05:03:53 PM »
Last I was aware storing to 0 (or any invalid location) was a free action.  I don't know if that's still true or not, though.  Definetely having 20 0 store leave 20 on the stack is a recent change (bug?).

Offline Endy

  • Bot Overlord
  • ****
  • Posts: 852
    • View Profile
an awsome gene that needs fixing
« Reply #8 on: October 29, 2008, 08:48:17 PM »
As of 2.43.1L zero stores don't appear to cost anything. I set up a test bot with 20 some zero stores at a cost of 1 each, didn't see any nrg lost from them.

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
an awsome gene that needs fixing
« Reply #9 on: October 30, 2008, 06:01:47 AM »
Yes slam me, endy seems to be right. I missed that it was changed back.

And when I tested, I was little to fast. Cousing the number left at the stack to couse a real store.
Oh my god, who the hell cares.