Author Topic: Tie Feeding Idea  (Read 8552 times)

Offline strangers

  • Bot Neophyte
  • *
  • Posts: 37
    • View Profile
Tie Feeding Idea
« Reply #15 on: December 12, 2006, 08:24:29 PM »
Then couldn't I alter the code to say something like:
Code: [Select]
cond
*.numties 0 >
*.counter 0 =
start
-1 .tieloc store
-1000 .tieval store
*55 .tienum store
stop

cond
*.numties 0 >
*.counter 1 =
start
-1 .tieloc store
-1000 .tieval store
*55 .tienum store
stop


cond
*.numties 0 >
*.counter 2 =
start
-1 .tieloc store
-1000 .tieval store
*55 .tienum store
stop
etc., etc, etc.
« Last Edit: December 12, 2006, 08:30:51 PM by strangers »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Tie Feeding Idea
« Reply #16 on: December 13, 2006, 12:34:38 AM »
You can try to pull more than a 1000 nrg per turn, but only 1000 nrg is actually ever going to be pulled through.  So your gene will work -except- it won't be able to always pull exactly half of the other bot's energy.

Offline Jez

  • Bot Overlord
  • ****
  • Posts: 788
    • View Profile
Tie Feeding Idea
« Reply #17 on: December 13, 2006, 07:04:52 AM »
Quote from: strangers
Then couldn't I alter the code to say something like:

Yes. I would suggest you condense it a bit though, for example;

Code: [Select]
def counter 990 'sets memory location for counter

cond
*.numties 0 >
*.counter 19 < 'saves you having to do gene 19 times!
start
-1 .tieloc store
-1000 .tieval store
*55 .tienum store
.counter inc 'increases counter by 1
stop

'then your other genes like;

cond
*.numties 0 >
*.counter 19 =
start
'do what you want on 19th turn
stop

cond 'safety gene to reset counter if lose tie or turn 19 reached and deleted tie
*.numties 0 =
*.counter 0 !=
start
0 .counter store
stop

cond 'may not want this but it's in case some-bot messes with mem location you used for counter!
*.counter 19 >
*.counter 0 < or
start
0 .counter store
stop

er, don't think I understood the word 'condense' properly!
« Last Edit: December 13, 2006, 07:06:18 AM by Jez »
If you try and take a cat apart to see how it works, the first thing you have in your hands is a non-working cat.
Douglas Adams

Offline strangers

  • Bot Neophyte
  • *
  • Posts: 37
    • View Profile
Tie Feeding Idea
« Reply #18 on: December 13, 2006, 06:46:26 PM »
do you realy need the "*.counter 0 !=" line since thats taken care of in the next gene? Next, is extracting nrg the same with a hardened tie as is with a unhardened one? or do you have to use a different command, such as .sharenrg?
Edit:
Would this gene (modified from a gene in symbioticus v2.5) need to come before, or after the energy feeding gene?
Code: [Select]
cond
*.numties 0 >
*.treffixed 1 =
start
1 .tienum store
.fixpos .tieloc store
0 .tieval store
stop
And how would I make it not pay attention to the veggies its tied to?
« Last Edit: December 13, 2006, 07:16:22 PM by strangers »

Offline Jez

  • Bot Overlord
  • ****
  • Posts: 788
    • View Profile
Tie Feeding Idea
« Reply #19 on: December 14, 2006, 04:35:35 AM »
Quote from: strangers
do you realy need the "*.counter 0 !=" line  since thats taken care of in the next gene?

That gene deals with *.counter being 1-19 when there are no ties, because they have snapped or target died etc
The last gene I put in in case you are writing a competitive bot, it deals with *.counter being a negative value or a value over 19. Just in case another bot fires something that changes the value of .counter to something outside the range of values you are using.

Quote
Next, is extracting nrg the same with a hardened tie as is with a unhardened one? or do you have to use a different command, such as .sharenrg?

A hardened tie is the same as unhardened when it comes to sharing energy; .sharenrg calculates the total energy for all the bots you are tied to and then the number you put into .sharenrg becomes the percentage of the total energy you receive, it doesn't need .tienum to do this. I presume that you can only share at 1000 nrg per cycle max but I don't know this.


Quote
Would this gene (modified from a gene in symbioticus v2.5) need to come before, or after the energy feeding gene?
Code: [Select]
cond
*.numties 0 >
*.treffixed 1 =
start
1 .tienum store
.fixpos .tieloc store
0 .tieval store
stop
Firstly you need to have stored a value in .readtie before you can use *.treffixed,(is a fixed value and only needs to be set once unless you wish to change it). Second I would put this gene after the energy feeding gene, it changes the values of .tieloc and .tieval and the DNA will only use the last value entered for each cycle. Third, if it is after the energy feeding gene it will mean you no longer get any energy through that tie.

I think changing the condition to *.treffixed 0 = because this gene would only work atm if target bot was fixed. Maybe adding *.treffixed 1 = to the energy feeding gene would then make them fire individually. I presume you want to fix the target and then feed off it. Many competitive bots have an unfix gene which would make this gene keep firing though.

Quote
And how would I make it not pay attention to the veggies its tied to?
Basically something like cond/*.trefeye 0 = would identify the bot on the end of tie as a veg.

What you are now talking about is multiple ties by the sound of it though. AFAIK you need a different tie number for each tie, if you called them all tie1 then the DNA would think you are talking about the last tie created. If you are going to stick to a veg until you see a target bot and then once tied to that bot deal with that bot without firing anymore ties then it might not be that hard.

/me waits for someone like Num's to come correct any mistakes...  
If you try and take a cat apart to see how it works, the first thing you have in your hands is a non-working cat.
Douglas Adams

Offline strangers

  • Bot Neophyte
  • *
  • Posts: 37
    • View Profile
Tie Feeding Idea
« Reply #20 on: December 14, 2006, 07:05:49 PM »
Ok, I get the safety gene now.
I think I'll just leave fixing/unfixing alone for now.
Could't I use a tie/info shot to change the in/out values of a veg so the bot could identify it?

Offline Jez

  • Bot Overlord
  • ****
  • Posts: 788
    • View Profile
Tie Feeding Idea
« Reply #21 on: December 15, 2006, 12:30:37 AM »
Quote from: strangers
Could't I use a tie/info shot to change the in/out values of a veg so the bot could identify it?

Yes. There are chameleon bots that read the value of .in and change their value to the same so you'd need to use it with a *.refeye 0 = cond. Don't use the in/out on it's own to identify anything.

Saying that, someone came up with the idea of making .out1 the same as *.myage so *.refage *.in1 = became a useful ID, chameleon bots just imitate the value they can see.
If you try and take a cat apart to see how it works, the first thing you have in your hands is a non-working cat.
Douglas Adams