Author Topic: So many questions.  (Read 4255 times)

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
So many questions.
« on: January 21, 2008, 05:12:14 PM »
Hey, I've only finished one bot so far (Ebola) which is just a frankenstein monster of large chunks of code I stole and pieced together with some extra stuff.
I'm working on new concepts from scratch now, but it seems like theres a lot of bugs in the latest versions (DB 2.43y and 2.43z).

It ocurs to me there's a lot here, so I'll add numbers.

Got a lot of questions, but first the bugs (If it's not just me screwing up) :
B1- Either the ref values or the angle operator is bugged. Seems like negative values or combinations of negative and positive values cause some sort of bug. Or something like that anyway.
B2- trefbody didn't work in DB 2.43y, not sure about 2.43z. (It's not useless, I realy needed it in my last (only) bot)
B3- delgene didn't work in DB 2.43y, but I think it got fixed in 2.43z
B4- performing operations on the memmory location no longer seems to work in 2.43z (Worked in 2.43y).
B5- when I run simulations it doesn't seem to take propper advantage of all the processors, although you would think lots of small processes would be idea to distibute... not sure if theres anything I can do to improve performance.


Now the questions :

Q1- I never see anyone using certain operators, so I'm wondering if they work at all. I'm refering to operators like ++ and | and ^ and such. I tryed .variable++ but that didn't seem to work, maybe it should be seperated by a space, but I'm generaly confused about this.

Q2- I'm also wondering if ~= and %= works, it sais they're depercated in the description. (Also sais they're not usefull, but I disagree  )

Q3- How does negation work ? I see examples where people use -1 mult, but from the description it would seem like this is the same as just writing - .

Q4- This brings me to my general confusion about the stack.
Q4.1#- When I write -1 mult, from what I can read I negate the value in the stack and muliply it by 1... Or would that be - 1 mult ?
Q4.2#- It sais I can have 20 values in the stack at one time, but as I understand it, if I write :
a b add c d add mult
Then I only have 3 values in the stack at one time, I have a+b in one "slot" and c and d in the 2 others, when peeking (When performing the last add before mult). Or do I actualy load all 4 values into the stack before performing any operations ?
If I understand correctly then :
a b c d mult mult mult
Would load 4 values into the stack before multiplying them, whereas :
a b mult c mult d mult
Wouldn't load more than 2 values into the stack at the same time.
Q4.3#- Just to verify if what I think is right :
When I write :
a b c d mult mult mult
The when I hit the first mult I take the 2 top values from the stack and add them together, these would then be c and d (since it's a stack) and the result would then be placed at the top of the stack, making the next 2 values b and c*d ... right ?

Q5- I noticed a lot of energy can be saved by "compiling" you code to eliminate conditions, is this intentional because natural evolution should be capable of optimizing the code, or should I be expecting costs on operators in the leagues ?

Q6- How many store comands can be excuted in one cycle ? And what actions can be performed at the same time ? Can I turn, accelerate, reproduce, comunicate through a tie, while making a new tie and shooting waste ? It just seems like eveything starts to fall appart when the dna gets too long. Is there a max nr of genes ? Max DNA length ?

Q7- If I write 50 .repro store and then 0 .repro store, will I reproduce ? Does the last or first value overide the other one ? I'm guessing the last value removes any previous ones and the first value is "destroyed" (So it won't intefere with anything).

Q8- When are memmory shots and tie comands executed ? I would guess it's at the end of the dna execution  ? And what about ties, same thing ?

Q9- When I tie to something, do I have to wait for the next cycle before I can interact with the tie, or does it appear right away ?

Q10- Can you perform several actions through a tie at the same time ? It seems like I can share energy while performing another action on the tie, like storing a value in a memmory location or trying to feed. But what if 2 bots are performing an action on the tie between them at the same time, can one bot share energy while the other one is comunicating back ? And if not then which one has the priority ?

As you can tell I'm confused about a lot

Also a sugestion, if you guy's don't want to mess around with the angle operator, you could just make cos, sin, tan, atan, atan2, asf...  available as operators
Would be nice for creating advanced aim functions

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
So many questions.
« Reply #1 on: January 21, 2008, 08:49:47 PM »
Regarding the bugs:

B1 - I need more info than this.  Please see the guidelines on bug reporting.  Would appreciate it if you could file a separate bug in the Bug Reports forum for this one with sample bot code or a sim and the expected behaviour.

B2 - I'll take a look at trefbody.  Nothing there changed in 2.43z, so if it was busted in 2.43y, its still busted.

B3 - delgene was indeed fixed in 2.43z.

B4 - I don't understand what you mean here.  Which memory operation no longer works?

B5 - DB is single threaded.  I'm afraid this won't be fixed until we port the simulator to a new programming language.
« Last Edit: January 21, 2008, 08:50:51 PM by EricL »
Many beers....

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
So many questions.
« Reply #2 on: January 22, 2008, 01:47:00 PM »
Thank you.

I'll take a look at the bug report section and post something for B1, but I'm pretty sure somethings wrong here, any bot that uses refvalues to target their enemies seems to have this problem. I figured maybe the center had been moved and the bot wasn't updated, but it doesn't seem like the error in their aim has a stable offset and the aim seems to work fine in certain directions. I'll figure out the details and post a bug report.

B4 : Yeah I guess I didn't explain that very well
What I ment was :
50 .repro *.nrg 1000 sub sgn mult store
Just seems to reproduce no matter how low your energy drops.
I figured maybe somehow I was ending up with the absolute value, but it works if I only opeate on the input value :
50 *.nrg 1000 sub sgn mult .repro store

Maybe the memmory locations are unsigned now ? Or maybe you need to specify the memmory location with a number ? Other than that I have no clue... maybe I'm wrong about this, but it just seems like all the single gene bots fall appart in 2.43z ...


I hope I'm not scaring anyone off with the long list of questions, I'm not counting on anyone answering everything at once

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
So many questions.
« Reply #3 on: January 22, 2008, 04:31:15 PM »
Store attempts always take the absolute value of the value on the top of the int stack mod 1000 and use that as the momery location (with special case code for stores to mutiples of 1000 to store to 1000).   The only store that does nothing is a store to location 0.  It has been this way for a very long time...


   



Quote from: Moonfisher
Q1- I never see anyone using certain operators, so I'm wondering if they work at all. I'm refering to operators like ++ and | and ^ and such. I tryed .variable++ but that didn't seem to work, maybe it should be seperated by a space, but I'm generaly confused about this.
It should be separated by a space.  Operators such as ++ operate on the top value of the int stack.
Many beers....

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
So many questions.
« Reply #4 on: January 22, 2008, 04:43:08 PM »
Quote from: Moonfisher
Q2- I'm also wondering if ~= and %= works, it sais they're depercated in the description. (Also sais they're not usefull, but I disagree  )
They work.  If they don't its a bug.

Quote from: Moonfisher
Q3- How does negation work ? I see examples where people use -1 mult, but from the description it would seem like this is the same as just writing - .
They should be equivalent.

Quote from: Moonfisher
Q4- This brings me to my general confusion about the stack.
Q4.1#- When I write -1 mult, from what I can read I negate the value in the stack and muliply it by 1... Or would that be - 1 mult ?
-1 mult multiplies the top value int eh stack by -1.  - 1 mult negates the top value of the stack then multiplies it by 1.

Quote from: Moonfisher
Q4.2#- It sais I can have 20 values in the stack at one time, but as I understand it, if I write :
a b add c d add mult
Then I only have 3 values in the stack at one time, I have a+b in one "slot" and c and d in the 2 others, when peeking (When performing the last add before mult). Or do I actualy load all 4 values into the stack before performing any operations ?
If I understand correctly then :
a b c d mult mult mult
Would load 4 values into the stack before multiplying them, whereas :
a b mult c mult d mult
Wouldn't load more than 2 values into the stack at the same time.
The last part is correct.

Quote from: Moonfisher
Q4.3#- Just to verify if what I think is right :
When I write :
a b c d mult mult mult
The when I hit the first mult I take the 2 top values from the stack and add them together, these would then be c and d (since it's a stack) and the result would then be placed at the top of the stack, making the next 2 values b and c*d ... right ?
correct
Many beers....

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
So many questions.
« Reply #5 on: January 22, 2008, 05:01:57 PM »
Quote from: Moonfisher
Q5- I noticed a lot of energy can be saved by "compiling" you code to eliminate conditions, is this intentional because natural evolution should be capable of optimizing the code, or should I be expecting costs on operators in the leagues ?
The F1 costs charge 0.004 nrg per conditional comparison whether or not it is in a cond section of a gene.  The leagues are about human authored bots competing and have little to do with evolution.  People code league bots for minimal conditionals to be effecient in combat given the F1 costs.

Quote from: Moonfisher
Q6- How many store comands can be excuted in one cycle ?   And what actions can be performed at the same time ? Can I turn, accelerate, reproduce, comunicate through a tie, while making a new tie and shooting waste ? It just seems like eveything starts to fall appart when the dna gets too long. Is there a max nr of genes ? Max DNA length ?
You can store as many times per cycle as you want.  Only the last one to a given memory location will matter.  You can indeed do all those things in a single cycle.  Max genome length is currently 32000 base pairs.  There is no gene limit other than that dictated by the max genome length.

Quote from: Moonfisher
Q7- If I write 50 .repro store and then 0 .repro store, will I reproduce ? Does the last or first value overide the other one ? I'm guessing the last value removes any previous ones and the first value is "destroyed" (So it won't intefere with anything).
You will not reproduce.  The later store of 0 overrides the eariler store of 50.  

Quote from: Moonfisher
Q8- When are memmory shots and tie comands executed ? I would guess it's at the end of the dna execution  ? And what about ties, same thing ?
There are detailed posts on the order of execution in the DNA forum.

Quote from: Moonfisher
Q9- When I tie to something, do I have to wait for the next cycle before I can interact with the tie, or does it appear right away ?
Short answer is you must wait.  trefvars, tiepres, tienum adn so on will not reflect the tie until the cycle after the .tie operation suceeds.
Many beers....

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
So many questions.
« Reply #6 on: January 23, 2008, 11:06:25 PM »
Quote from: Moonfisher
B2- trefbody didn't work in DB 2.43y, not sure about 2.43z.
This is a real bug that has been there a very long time.  trefbody was duplicatly defined in the internal sysvar table, for both memory locations 437 and 472.  The code was setting location 437 correctly, but the bot DNA parse routine was using location 472.   Thus the .refvar sysvar was essentially being mapped to the wrong location in both bot code and the console window.   This bug is at least 2 years old.  Very nice find.

Fixed in 2.43.1.  Location 437 is used as trefbody.  472 is now an unused location.
Many beers....

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
So many questions.
« Reply #7 on: January 24, 2008, 04:59:36 PM »
Ok, it looks like the angle and ref positions works, I just didn't negate the stack before adding my aim I guess...
Still dunno how I managed to get Aura to miss... works fine now... maybe somethings wrong with my memmory (the one in my head that is).

I'm guessing the answer to Q10 is either the same as for Q8 or difficult to explain.

Concerning the operations on memmory locations, it looks like it's something different which is affecting Aura, seems like it's first repro thing depended on sight, and it looks like changing your eyewidth now also reduces it's range, which I guess is only fair, but which also kinda sucks since now I have to rethink the eyes on the bot I'm working on, and that was about the only part I was done with

I'm assuming there are no plans to put costs on math opperations in the leagues then
I'm realy hopping you'll tell me if people are concidering this, since I'd be wasting a lot of time if the leagues suddenly adjust costs to weed out the heavy 1G bots.

And thank you for all the help

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
So many questions.
« Reply #8 on: January 24, 2008, 05:20:08 PM »
Don't know whether Eric has plans implementing this, but I'd guess that nothing like that is planned or will be planned. The general sentiment around here is that placing costs on DNA length or on specific commands is counterproductive, because it puts undue pressure on DNA structure that has nothing to do with the bot's behavior. In my own sim I got rid of all specific DNA command costs and I charge a tiny fee for DNA upkeep cost just to prevent overblown genomes produced by viruses. But recently it seems that my bots developed their own methods of controlling viruses so I will probably soon get rid of DNA upkeep cost too.
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
So many questions.
« Reply #9 on: January 24, 2008, 06:32:40 PM »
I have no plans to add DNA operator costs and even if I did, it is unlikely there would be consensus to include them in the F1 league costs.

Regarding Q10, you can do simultanious tie operations in the same cycle if they are on the same tie and if separate sysvars exist for what you want to do.  So, a bots can share nrg, waste, shell, slime etc. all in the same cycle.  What you can't do currently is share nrg through multiple ties in a single cycle since the last write to .tienum will supercede any previous writes.
Many beers....