Author Topic: Timerless timer  (Read 9125 times)

Offline Reiyuki

  • Bot Neophyte
  • *
  • Posts: 8
    • View Profile
Timerless timer
« on: April 27, 2008, 01:07:20 PM »
cond
*.robage 20 mod 1 =
start
stop

Activates gene every 20 cycles


(change to *.robage 50 for 50 cycles, etc)


Took some tinkering to figure out, but was beautiful once I got it.

Offline gymsum

  • Bot Destroyer
  • ***
  • Posts: 215
    • View Profile
Timerless timer
« Reply #1 on: April 27, 2008, 02:08:49 PM »
Quote from: Reiyuki
cond
*.robage 20 mod 1 =
start
stop

Activates gene every 20 cycles


(change to *.robage 50 for 50 cycles, etc)


Took some tinkering to figure out, but was beautiful once I got it.

I think you should make a bot that uses timed behaviors and timed triggers. You'll need a master gene switcher to prevent retardation or wrong behaviors. I think this would be perfect for say a mating ritual, or even a complex movement by a multi-bot.

Offline Reiyuki

  • Bot Neophyte
  • *
  • Posts: 8
    • View Profile
Timerless timer
« Reply #2 on: April 27, 2008, 03:16:46 PM »
Quote from: gymsum
Quote from: Reiyuki
cond
*.robage 20 mod 1 =
start
stop

Activates gene every 20 cycles


(change to *.robage 50 for 50 cycles, etc)


Took some tinkering to figure out, but was beautiful once I got it.

I think you should make a bot that uses timed behaviors and timed triggers. You'll need a master gene switcher to prevent retardation or wrong behaviors. I think this would be perfect for say a mating ritual, or even a complex movement by a multi-bot.

Actually, I find it most useful in creating very efficient bots for harsh environments.  My test bot was a grasshopper that 'hopped' every 20 cycles but was otherwise dormant unless food was in sight.
[you]Extremely[/you] efficient, almost hibernating.

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Timerless timer
« Reply #3 on: April 27, 2008, 05:44:47 PM »
This would be a very useful approach when using Single Store bots, actually.
If you want to limit this to just a few stores, it would be more efficient to multiply one of the values instead of making a new gene:

start
 VALUE *.robage 20 mod 1 sub sgn abs .MEMLOC mult store
stop
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Timerless timer
« Reply #4 on: April 27, 2008, 09:00:24 PM »
FYI, this will only work for bots of age 32000 or below.  Using .timer is better for periodic firing since it wraps...
Many beers....

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Timerless timer
« Reply #5 on: April 27, 2008, 09:07:45 PM »
Yes, I remember reading this on several forums, and a guy recently put on the wiki. Thanks for the reminder though.
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline Peksa

  • Bot Destroyer
  • ***
  • Posts: 118
    • View Profile
Timerless timer
« Reply #6 on: April 28, 2008, 07:38:07 AM »
The problem with using timer is that it's the same for every bot. If bot relies on *.timer X mod Y =, all bots of the same species trigger at the same time. Of course you could add some randomness with rnd command, but that needs a new gene or some extra lines of code.

Offline fulizer

  • Bot Destroyer
  • ***
  • Posts: 198
    • View Profile
Timerless timer
« Reply #7 on: April 28, 2008, 08:55:51 AM »
cond
*.robage 20 10 rnd sub mod 1 =
start
stop

would this work
"If this is coffee bring me tea, If this is tea, bring me coffee"

Offline Peksa

  • Bot Destroyer
  • ***
  • Posts: 118
    • View Profile
Timerless timer
« Reply #8 on: April 28, 2008, 10:11:54 AM »
Quote from: fulizer
cond
*.robage 20 10 rnd sub mod 1 =
start
stop

would this work

Not with *.robage over 32000. That's the reason to use .timer instead of .robage. There's no need for rnd with trigger with robage as condition. And while I'm at, probably not too much with .timer either. It could cause slight problems in leaguebots when eg. all periodical venom shooting happened during one cycle as opposed to nearly even spread that can be archieved by .robage. League matches rarely last over 32 kcycles though.

Offline gymsum

  • Bot Destroyer
  • ***
  • Posts: 215
    • View Profile
Timerless timer
« Reply #9 on: April 28, 2008, 03:10:15 PM »
Quote from: Peksa
Quote from: fulizer
cond
*.robage 20 10 rnd sub mod 1 =
start
stop

would this work

Not with *.robage over 32000. That's the reason to use .timer instead of .robage. There's no need for rnd with trigger with robage as condition. And while I'm at, probably not too much with .timer either. It could cause slight problems in leaguebots when eg. all periodical venom shooting happened during one cycle as opposed to nearly even spread that can be archieved by .robage. League matches rarely last over 32 kcycles though.

cond
*.robage 32000 sub mod 1 =
start
stop

this works even at birth aeven if it lives to see hundreds of generations at 320,000 cycles (never seen it myself).

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Timerless timer
« Reply #10 on: April 28, 2008, 05:33:17 PM »
Why would synchronized behaviour pose a problem? Besides, you can always make your custom timer.
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline Peksa

  • Bot Destroyer
  • ***
  • Posts: 118
    • View Profile
Timerless timer
« Reply #11 on: April 28, 2008, 06:01:29 PM »
Quote from: bacillus
Why would synchronized behaviour pose a problem? Besides, you can always make your custom timer.

This is just a guess, but I I magine that if multiple bots attack the same bot and periodically shoot venom, it'd be more useful if venom was "adminstered" randomly. The difference - if there is one - wouldn't be big though.

Secondly I love the simplicity of

   *.robage 5 mod 1 =

It looks much nicer than creating a new timer and using it instead

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Timerless timer
« Reply #12 on: April 29, 2008, 02:14:33 AM »
*cough*
Code: [Select]
*.timer 5 mod 1 =*cough*

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Timerless timer
« Reply #13 on: April 29, 2008, 02:19:23 AM »
ahem

Code: [Select]
5 rnd 1 =
ahem

Many beers....

Offline fulizer

  • Bot Destroyer
  • ***
  • Posts: 198
    • View Profile
Timerless timer
« Reply #14 on: April 29, 2008, 08:58:13 AM »
nope timers not my thing wheres the point of randomley moving foward?
that would cause serious problems in friction high sims.
so dont make anyomore refrences about how my timer sucked if I thought it worked I woudnt ask if it did would I?
"If this is coffee bring me tea, If this is tea, bring me coffee"