Author Topic: How to know you're the first  (Read 5255 times)

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
How to know you're the first
« on: April 08, 2005, 07:06:46 AM »
So you're programming along and you decide you want the first bots that are created to do something no other bots do.

For instance, store a value to a memory location that then transfers to the young through racial memory.

How do you do it?

cond
*.eye5 0 =
*.age 0 =
start
'your code for the first
stop

This is a good way, but it won't work 100% of the time.

cond
*.eye5 77 < 'I think that's the right number.  Test it out
*.age 0 =
start
'your code for the first
stop

This is getting there, but it's still not 100%.  This is as far as I've come.  This should work most of the time.  You won't get any new babies thinking they're the first, but you may get some firsts thinking they're new babies.  But that would only happen if the bot spawns very close and facing another bot.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
How to know you're the first
« Reply #1 on: April 08, 2005, 08:52:31 AM »
How about adding a second gene to make sure?

Activate it when robage = 1 and check for ties. The first rob will have none but babies always will. This should catch 100% of the first robs in combination with the other gene or even on its own.
Only the first rob can ever have no tie at age 1

Try this.

Code: [Select]
cond
*.robage 1 =
*.numties 0 =
'must be first rob
start
your code for the first
stop
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Endy

  • Bot Overlord
  • ****
  • Posts: 852
    • View Profile
How to know you're the first
« Reply #2 on: April 09, 2005, 08:00:30 PM »
Checked eyes and it looks like 74 is the new closest value. Not sure which of the many changes is responsible. Not too much difference just need to change the code.

Endy B)

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
How to know you're the first
« Reply #3 on: April 09, 2005, 11:08:49 PM »
I think I made the distance between robots and the natural length of birth ties the same (they weren't before).

Offline Martian

  • Bot Neophyte
  • *
  • Posts: 44
    • View Profile
How to know you're the first
« Reply #4 on: August 06, 2007, 02:03:08 PM »
How about this?

Code: [Select]

cond
 *.robage 0 =
start
 1 55 store
 *.thisgene .delgene store
stop

Offline Trafalgar

  • Bot Destroyer
  • ***
  • Posts: 122
    • View Profile
How to know you're the first
« Reply #5 on: August 06, 2007, 04:09:05 PM »
Quote from: Martian
How about this?

I use something like that on my shepherds, except I omit the condition on the gene (as far as I know, the gene should be deleted after the DNA runs, before the next cycle starts)

Offline googlyeyesultra

  • Bot Destroyer
  • ***
  • Posts: 109
    • View Profile
How to know you're the first
« Reply #6 on: August 06, 2007, 04:29:55 PM »
Racial memory is wonderful. It does require, however, that you delay severing the birthtie a bit.

cond
*.robage 3 =
start
971 inc
stop

cond
971 1 =
start
'whatever you want the firsts to do
stop

cond
971 1 >
start
'whatever you want anything that's not a first to do
stop

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
How to know you're the first
« Reply #7 on: August 06, 2007, 08:02:36 PM »
Quote from: googlyeyesultra
Racial memory is wonderful. It does require, however, that you delay severing the birthtie a bit.


Note that locations 971-975 get passed on instantly in 2.43.   This was a much discussed feature request.  The Wiki is out of date...

    'First 5 genetic memory locations happen instantly
     For I = 0 To 4
        rob(nuovo).mem(971 + I) = rob(n).mem(971 + I)
     Next I
« Last Edit: August 06, 2007, 08:08:25 PM by EricL »
Many beers....