Author Topic: TieRotation  (Read 4484 times)

Offline Prsn828

  • Bot Destroyer
  • ***
  • Posts: 139
    • View Profile
TieRotation
« on: May 12, 2009, 09:41:01 AM »
This little gem creates quite the interesting evo-sim.  It also demonstrates use of several of the confusing tie features, so it is a good reference if you don't understand them (Although I did clear up some of the confusion on the wiki already).

Code: [Select]
'TieRotation

def nexttie 20
def lasttie 21
def species 971
def wait 22

cond
*.wait 0 >
start
.wait dec
stop

cond
*.numties 2 <
start
*.nexttie .tie store
500 rnd .aimdx store
stop

cond
*.numties 0 >
start
*.tieang1 20 rnd sub 1256 add 50 add 1256 mod .tieang1 store
30 rnd 50 add .aimdx store
stop

cond
*.numties 0 >
*.robage 2 mod 1 =
start
*.lasttie .tienum store
.species .tieloc store
stop

cond
*.numties 0 >
*.robage 2 mod 0 =
*.readtie *.species = not
*.robage 10 >
*.wait 0 =
start
*.lasttie .tienum store
-10 .tieval store
-1 .tieloc store
1 .sharewaste store
stop

cond
*.readtie *.species =
start
50 .sharenrg store
50 .sharebody store
stop

cond
*.numties 1 >
start
*.lasttie .deltie store
stop

cond
*.nexttie *.tiepres =
start
*.nexttie .lasttie store
*.nexttie 2 mod 1 add .nexttie store
stop

cond
*.nexttie 0 =
start
.nexttie inc
stop

cond
*.species 73 = not
start
73 .species store
stop

cond
*.nrg 1000 >
start
10 .strbody store
stop

cond
*.nrg 100 <
start
2 .fdbody store
stop

cond
*.body 1000 >
start
50 .repro store
100 .wait store
stop

cond
*.robage 100 <
start
100 *.tieang add .fixang store
1 .wait store
100 .up store
stop
So, what will it be? Will you submit to my will, or must I bend reality to suit my needs?
Better answer before I do BOTH!

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
TieRotation
« Reply #1 on: May 13, 2009, 07:56:13 AM »
How about tie comunication and trefvars, will they also work propperly... I've been getting the impression that changin tienum og readtie has no effect on what you actualy read from the tie.
No sure though, I find ties confusion and always end up giving up when trying to work with them.

Offline Prsn828

  • Bot Destroyer
  • ***
  • Posts: 139
    • View Profile
TieRotation
« Reply #2 on: May 13, 2009, 11:46:37 AM »
Quote from: Moonfisher
How about tie comunication and trefvars, will they also work propperly... I've been getting the impression that changin tienum og readtie has no effect on what you actualy read from the tie.
No sure though, I find ties confusion and always end up giving up when trying to work with them.

Indeed, I am still not clear on the specifics of all of the tie functions.

Here is what I do know:

tielen1 through tielen4 do not work
tieang1 through tieang4 do work
fixlen works... usually...
because you have to set which tie you want to modify in a sysvar, you can only modify one tie per cycle, including deletion, length change, and angle setting*
*except when using tieang#
tiepres does work&
numties does work&
&except perhaps in the case of birth ties
Sharing appears very flawed.
Tie communication seems flawed, but there are several types, and I have only tried looking at a tied bots memory so far
Setting the angle of the tie usually results in the bot moving, and not the tie, because of momentum.
I haven't tried the trefvars yet, but hopefully will get to that today.

One more thing. Does the boolean stack work correctly, or is it just my bad luck that things never seem to go as they should?
commands like store, inc, dec, add, etc should pop the top value off the stack, right?

also, the in# out# seems to be flawed as well, preventing any efficient and effective forms of conspec or gender recognition.
So, what will it be? Will you submit to my will, or must I bend reality to suit my needs?
Better answer before I do BOTH!

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
TieRotation
« Reply #3 on: May 14, 2009, 02:58:29 AM »
No the integer stack is popped by store asf, the boolean stack is only popped by dropbool and such.
It makes a lot of sence when you think about it realy.

Anyway you always add on to the boolean stack, and only the top value in the stack determines if the next line of code is executed (And all fllowing lines untill the boolean stack is changed again)

Last I checked the regular in/out vars worked... but the ones for ties didn't point at the right bot if you tried to change the readtie.
Ofcourse I don't know wich version you're testing though.

And tie angles such completely... whatever way it works it makes no sence and it's impossible to work with. One good example is when giving birth to a new bot you spawn a birth tie, this changes the angle of all your current ties... why wouldn't it ? messing up the whole shape your organism had taken, and ofcourse at this point the offset of your tie angles are changed, so trying to bring the ties back to their previous position will just mess things up more... Generaly whenever I work with ties even in the slightest way, I feel like DB2 is giving me the finger.

Offline Prsn828

  • Bot Destroyer
  • ***
  • Posts: 139
    • View Profile
TieRotation
« Reply #4 on: May 14, 2009, 10:55:27 AM »
I ran a check with a boolean stack testing bot.
You are wrong.
The boolean stack does pop after every command.

Birth ties suck, but otherwise ties do set angles correctly.
So, what will it be? Will you submit to my will, or must I bend reality to suit my needs?
Better answer before I do BOTH!

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
TieRotation
« Reply #5 on: May 14, 2009, 06:03:22 PM »
If store, dec and inc popped the boolean stack then inline conditions would be anoying to work with, you would need to use dupbool constantly so you don't "loose" your condition every time something is executed.
No bot with inline conditions I've ever made would actualy work if what you say is true.

It would be very easy to test, if a store pops the boolean stack then this gene :

start
true
false
70 .aimsx store
50 .repro store
stop

Should cause the bot to reproduce cancerously as false would be popped by the first store.
« Last Edit: May 14, 2009, 06:03:51 PM by Moonfisher »

Offline Prsn828

  • Bot Destroyer
  • ***
  • Posts: 139
    • View Profile
TieRotation
« Reply #6 on: May 14, 2009, 07:32:56 PM »
Quote from: Moonfisher
If store, dec and inc popped the boolean stack then inline conditions would be anoying to work with, you would need to use dupbool constantly so you don't "loose" your condition every time something is executed.
No bot with inline conditions I've ever made would actualy work if what you say is true.

It would be very easy to test, if a store pops the boolean stack then this gene :

start
true
false
70 .aimsx store
50 .repro store
stop

Should cause the bot to reproduce cancerously as false would be popped by the first store.

Yeah, well I even checked whether or not it clears after genes finish, and if you try that code, you should see some reproduction happening.
So, what will it be? Will you submit to my will, or must I bend reality to suit my needs?
Better answer before I do BOTH!

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
TieRotation
« Reply #7 on: May 15, 2009, 02:23:24 AM »
How did you check these things ? I'm not getting the same results...
I tryed running that gene in a bot, there was no reproduction.
Using 2.43.1L I can say that a store does NOT pop the boolean stack.

Not trying to get in your face or anything, but what you're saying makes no sence.
The reason I chose this example was because I wouldn't have to test it.

This is from fruitflies :

*.body 5 >
*.nrg 80 > and
*.totalmyspecies .maxpop 2 mult < and
*.maxvel .dn store
50 .repro store


This is why I'm so sure the boolean stack doesn't get popped, if it did fruitflies would kill itself instantly.
Was very confused when you said I should see reproduction, thought maybe you had tryed it and gotten reproduction from it...
But I get no reproduction in my tests, and I'm more than sure there shouldn't be "some" reproduction, it should either be cancerous or infertile.
(If you get some reproduction that isn't cancerous, then I recommend a fresh installation of DB)

If you tell me how your test works I can try to reproduce it here.

Offline Prsn828

  • Bot Destroyer
  • ***
  • Posts: 139
    • View Profile
TieRotation
« Reply #8 on: May 15, 2009, 05:18:57 AM »
 

You were right!  I can't believe I had such a fundamental misunderstanding of the bool stack, and still managed to make semi-working bots...
So, what will it be? Will you submit to my will, or must I bend reality to suit my needs?
Better answer before I do BOTH!