Author Topic: Velocity, maxvel, mass & like that  (Read 4595 times)

Offline AZPaul

  • Bot Builder
  • **
  • Posts: 76
    • View Profile
Velocity, maxvel, mass & like that
« on: April 07, 2005, 02:18:08 AM »
Let me begin by thanking y'all for all the answers past , present and future. Y'all are all much appreciated.

OK, so let me summarize:  

The maxvel is calculated using cell size and mass of cell and what?

Cell size is what? # bodyfat points? .nrg? amount of poison, venom, waste stored?  Shell value? Is .robage part of the calculation?

Mass is what (yes I know what mass is, but, I mean what does the program take as "mass" determinants)? # bodyfat points? .nrg? amount of poison, venom, waste stored?  Shell value? Is .robage part of the calculation?

My problem is this: My preditor bot starts out maxvel 55 and slowly deteriorates. Makes sense. No Prob. Poor girl gets old, puts on some fat (waste), slows down. So now comes Missy. She is born with maxvel 52? Huh? So I watch and I fiddle (console view) etc. I don't like what I see.

I find lots of Alphas (prey, piece of meat) with about the same amount of energy, same waste accumulation, same age as the predator Delta. I do not use poisons, shells, venoms, body fat, none of that. Maxvel of the lunch is considerably better than for the diner.

Leads to poor diet habits, starvation, hooliganism, grows hair on the palms. All in all, not good form.

Here is a more extreme example, but a true one I assure you:

Delta:  age    615     waste   29     nrg   3315    maxvel  28
Alpha:  age  3644     waste   95     nrg   3295    maxvel  51

Where is Delta's velocity?  Who took it? (Yeh, I know, the Alpha took it. How?)

As I said, I do not use shell, poison, venom, body, etc. etc. etc.  Just plain old shoot and poop.

What other determinants affect maxvel?  DNA length? Bot color? Phase of the moon? Dark energy?

Thank you, again, for your patience.

Let's see now. Some wonderfully interesting and useless bit of trivia.
Ah, I know.

We cannot see planets around other suns in our telescopes but can infer their existance by the wobble a massive planet imposes on its sun. Thing is, we cannot see the sun's wobble with our telescopes either.

What we can see is the light spectra of the distant sun. We infer the wobble by the small slow periodicity of the red/blue shift in the star's spectra over many months. And the raw data of this shifting must be modified by the relative velocity of Earth, away from and toward that distant sun, as we pass through our own orbit over those many months.

Arrivederci, y'all.

-P
« Last Edit: April 07, 2005, 02:22:12 AM by AZPaul »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Velocity, maxvel, mass & like that
« Reply #1 on: April 07, 2005, 04:12:35 AM »
Maxvel is determined soley by body fat and shell (much more by shell than by slime).  Surprise surprise!  All returned food shots contribute a little bit to body.  So that's probably what you're seeing.  If you found 2 bots with seriously different max vels and aboutthe same shell and body, then you'd have found a bug.

Mass too is determined soley by body and shell.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Velocity, maxvel, mass & like that
« Reply #2 on: April 07, 2005, 09:09:19 AM »
So basically, the older a bot gets without reproducing, the bigger its body fat value gets so the slower it gets.

The returned food shots or energy taken via ties is split approximately 20:1 with 20 going to enrgy and 1 going directly to body.

We have to do it this way or all the robots end up with zero body and babies start to go POOF as soon as they are born due to being given no body at all during birth.

If you want to keep your predator's speed up through out its life just add a gene to spend down body points when they get above a certain level. Something like this.

Code: [Select]
cond
*.body 1000 >
start
100 .fdbody store
stop
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline AZPaul

  • Bot Builder
  • **
  • Posts: 76
    • View Profile
Velocity, maxvel, mass & like that
« Reply #3 on: April 07, 2005, 12:26:40 PM »
Oh, you two wonderful people. DB wizards. I thank you, Delta thanks you. Alpha doesn't care for you at the moment, though.

-P

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Velocity, maxvel, mass & like that
« Reply #4 on: April 07, 2005, 01:03:52 PM »
Quote
Alpha doesn't care for you at the moment, though.

Well  :P  to Alpha then!
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline AZPaul

  • Bot Builder
  • **
  • Posts: 76
    • View Profile
Velocity, maxvel, mass & like that
« Reply #5 on: April 07, 2005, 04:14:04 PM »
Oh Great DB Guru PY,

There are secrets to some DNA coding that I have scratched my head over to no avail. In your recent Hunter Bot for instance:

Code: [Select]
cond
*.eye7 *.eye5 >
*.eye7 *.eye3 >
start
mult mult -80 -7
stop

cond
*.eye4 *.eye6 >
start
mult mult 40 4
stop

cond
*.eye6 *.eye4 >
start
mult mult -40 -4
stop


Please explain. What the (**^ is being multiplied, not once but twice, and what the ever lovin' %#(@ is being stored into what anywhere? This syntax has me baffled.

In the last gene you compare eye6 and eye4. So the value of eye6 (say 20) goes on the stack then the value of eye4 (say 0) goes on the stack. To my understanding the compare is made on the stack, a 'true' is returned and the gene is executed. The first instruction is mult. No preceeding values so I assume this will multiply the two eye values left on the stack in the conditional, yes? No? What?

According to my documentation these two values are deleted and replaced by the product (0). Then there is [you]another multiply?[/you] Multiplying the 0 on the top of the stack to what?  What was left on the stack from the prior gene? Which in this case (to my understanding) would be the eye6 value again from the compare in the prior gene even though that gene did not fire, yes? We get a value of 0, which seems usless at this point. Something is not right in Graceland.

And then this -40 -4 stuff. Are these values placed on the stack? So what good was the 'mult mult' prior? Are they mem locations (no, there is no "store")? Are they intended to survive somehow the compares that take place in the following gene conditionals prior to the "rotate" gene (I assume these are intended to populate sx and aimsx)? And the "rotate" gene:

Code: [Select]
' rotate
' *******
cond
start
.sx store
.aimsx store
stop

No stated values to be stored? Do these come off the top of the math stack? Are they then bumped off the stack when stored? If this is so then, again, how do the -40 and -4 above survive the intervening conditionals? In your Hunter the last thing done prior to this gene is a compare eye5 with 30.

To my understanding this conditional uses the math stack to accomplish the compare. So the last values on the stack, even though the prior gene did not fire, are eye5 value and 30? That's not very helpful. Is there some other stack somewhere?

Obviously, the thing works and my understandings are bogus.

There is a deep dark secret about the workings of the DNA and the math stack not in the documentation and of which I am wholly ignorant.

What's it all about, Alfie?

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Velocity, maxvel, mass & like that
« Reply #6 on: April 07, 2005, 05:34:41 PM »
This is all about balancing the stack.

Would it make more sense if the gene read like this?
Code: [Select]
cond
*.eye4 *.eye6 >
start
40 .aimsx store
4 .sx store
stop
Essentially that is all it does, but without wasting all that energy on store commands.

here is how it works in detail.

Assume that there is some junk on the stack. In Hunter 2.2 there will always be one junk value on top of the stack. I designed it that way.

I will explain the second gene in your list of 3

First of all the eyecell comparrissons add two values then the ">" comparitor removes them both and sets the tag to execute the gene.

Next we use mult to remove the top 2 values and replace them with 1. Clears one junk value. We don't use it for anything. We just want it gone
Same thing again to clear a second junk value. If only 1 junk value is present then 1 junk value will be left. We can never get rid of that last one with mult, add, sub, div or any of the operators, but provided only 1 is left then no problem. That is what we want anyway.
Next we put a value of 40 onto the stack.
Then we put a value of 4 onto the stack.
end of gene!

So now, assuming that this gene was activated, we have the stack values as follows from top down.


4
40
junk value


Now we go through the rest of the turning genes. Some will be activated and some will not. If no other turning genes are activated then these values will still be on top of the stack when the rotate gene is activated.

Code: [Select]
' rotate
' *******
cond
start
.sx store
.aimsx store
stop

This will store the top value 4 into .sx and the next value 40 into .aimsx so the robot will rotate and accelerate sideways in the same direction as its rotation, thereby nullifying some of its forward momentum (in the old direction. Remember that robots rotate before accelerating).

if a further turning gene is activated, it will place the two eye values onto the stack. then remove them again immediately as before. This still leaves 4 and 40 as the top two values. We don't want these anymore as this second turning gene supercedes the earlier one. We need to remove and replace these before activating the rotate gene so we use
mult mult to reduce the 3 values now on the stack down to 1 junk value. (as above)
now we can put our rotate and sideways acceleration values on top of the stack again.
In this way each turning gene deletes values left by previous turning genes leaving only those values placed there by the last gene to be activated.

In this way we can have any number of highly accurate rotations implemented on each cycle at very little cost. All you have to do is to make sure that you place them all in the correct hierarchy so that the last ones are more important than the first ones.
Coarse turning is done first followed by medium turning and finally fine turning to get zeroed in on robots that are in the inner eyes.

For more details please see my tutorial  for 2.3.
You can find this at the DarwinBots FTP server in the zip file "DarwinBots V2.3 Tutorial.zip"

In the tutorial, I show you how to use this technique for "SimpleBot", a demo robot that I build in stages.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline AZPaul

  • Bot Builder
  • **
  • Posts: 76
    • View Profile
Velocity, maxvel, mass & like that
« Reply #7 on: April 08, 2005, 03:23:39 PM »
Now how did I miss this jewel of a document?

Wonderful, PY. My hero!

Thank you ever so much.

-P