Darwinbots Forum

Bots and Simulations => DNA - General => Tips and Tricks => Topic started by: Elite on January 25, 2006, 05:33:07 PM

Title: Hibernation
Post by: Elite on January 25, 2006, 05:33:07 PM
Una was originally designed as an experiment into 'hibernating' bots. Using conditionless coding, this version of Una (it's an older version) will hibernate when 1 is placed into location 51

Code: [Select]
'Una
'
'With hibernation command

def hibernate 51
def IDcode 55

cond
start
1 .hibernate *.robage -1 mult 1 add mult store

.tie *.robage -1 mult 1 add mult *.hibernate mult inc
.deltie *.hibernate mult inc

.fixpos *.fixed mult *.hibernate mult dec

*.refveldx .dx *.eye5 sgn mult *.hibernate mult *.memval 42 sub dup mult sgn *.refeye *.myeye sub dup mult sgn add sgn mult store
*.refvelup 60 add .up *.eye5 sgn mult *.hibernate mult *.memval 42 sub dup mult sgn *.refeye *.myeye sub dup mult sgn add sgn mult store

42 .IDcode *.robage -1 mult 1 add mult store
.IDcode .memloc *.robage -1 mult 1 add mult store

-6 .shoot *.eye5 sgn 1 add sgn mult *.eye5 40 sub sgn 1 add sgn -1 add -1 mult mult *.hibernate mult *.memval 42 sub dup mult sgn *.refeye *.myeye sub dup mult sgn add sgn mult *.eye5 sgn mult store
-8 .shootval sub sgn 1 add sgn mult *.eye5 40 sub sgn 1 add sgn -1 add -1 mult mult *.hibernate mult *.memval 42 sub dup mult sgn *.refeye *.myeye sub dup mult sgn add sgn mult *.eye5 sgn mult store

-6 .shoot *.refpoison sgn mult *.eye5 45 sub sgn 1 add sgn mult *.hibernate mult *.memval 42 sub dup mult sgn *.refeye *.myeye sub dup mult sgn add sgn mult *.eye5 sgn mult store
-1 .shoot *.refpoison sgn -1 mult 1 add mult *.refshell sgn mult *.eye5 45 sub sgn 1 add sgn mult *.hibernate mult *.memval 42 sub dup mult sgn *.refeye *.myeye sub dup mult sgn add sgn mult *.eye5 sgn mult store
-6 .shoot *.refpoison sgn -1 mult 1 add mult *.refshell sgn -1 mult 1 add mult *.eye5 45 sub sgn 1 add sgn mult *.hibernate mult *.memval 42 sub dup mult sgn *.refeye *.myeye sub dup mult sgn add sgn mult *.eye5 sgn mult store

16 .shootval *.eye5 45 sub sgn 1 add sgn mult *.hibernate mult *.memval 42 sub dup mult sgn *.refeye *.myeye sub dup mult sgn add sgn mult *.eye5 sgn mult store

*.refvelup .up *.eye5 45 sub sgn 1 add sgn mult *.hibernate mult *.memval 42 sub dup mult sgn *.refeye *.myeye sub dup mult sgn add sgn mult *.eye5 sgn mult store
*.refxpos *.refypos angle .setaim *.hibernate mult *.memval 42 sub dup mult sgn *.refeye *.myeye sub dup mult sgn add sgn mult *.robage sgn mult *.eye5 sgn mult store

314 rnd .aimdx *.memval 42 sub dup mult sgn -1 add -1 mult *.refeye *.myeye sub dup mult sgn -1 add -1 mult mult *.eye5 sgn -1 add -1 mult add sgn mult *.hibernate mult store

40 .repro *.body 100 sub sgn mult *.nrg 1000 sub sgn 1 add sgn mult *.hibernate mult store
314 rnd .aimdx *.body 100 sub sgn mult *.nrg 1000 sub sgn 1 add sgn mult *.hibernate mult store

100 .strbody *.nrg 500 sub sgn mult *.hibernate mult store
100 .fdbody *.nrg -1 mult 100 add sgn mult *.hibernate mult store

*.tiepres .tienum *.numties sgn mult *.robage 1 sub sgn mult store
.dn .tieloc *.numties sgn mult *.robage 1 sub sgn mult store
32000 .tieval *.numties sgn mult *.robage 1 sub sgn mult store

*.waste .shootval *.waste 10 sub sgn mult *.hibernate mult store
-4 .shoot *.waste 10 sub sgn mult *.hibernate mult store

.delgene inc .delgene inc
stop

It's also nice and broken up to make it more understandable.

All commands in the DNA (except the anti-virus, but it uses inc anyway) have the code *.hibernate mult in them. *.hibernate is set at birth to be 1, but if you set it to zero using the console, the bot goes into hibernation. While in this state it uses no energy whatsoever. The original plan was for Una to release a deadly virus into the population and come out of hibernation later when the pandemic had (hopefully) wiped out everyone else. I never got round to using this feature when I realised that gearing the bot up for hibernation had made it extrodinarily efficient. I eventually removed the *.hibernation command just before joining this forum.

The virus (or a similar virus to the one) that Una was to be using (designed to be as deadly as possible, with the *.myeye being Una's *.myeye):

Code: [Select]
cond
start
100 .vshoot store
*.thisgene .mkvirus store
? .myeye store
*.genes rnd .delgene *877 -500 add sgn 1 add 2 div mult store
877 inc
.delgene dec
stop

What do you think of the concept?

Problem is that if another bot catches you sleeping they will just kill you  :angry:
I tried making a bot that hibernated when its *.nrg fell below 100. It was reasonably sucessful.
Title: Hibernation
Post by: Numsgil on January 25, 2006, 05:44:53 PM
I can see some uses for it, but it's not really a ground pounder.

I think you're on the right track with a virus.  Really any time that you can gain an advantage but outlasting your adversary somethiung like that becomes really useful.

If you added some code to add shell or slime if you're being attacked it would be even better.  If you look at biology, many hibernating organisms create a defensive shell to protect them from predators.
Title: Hibernation
Post by: Light on January 25, 2006, 06:38:58 PM
Its funny, when I first came to DB, hibernation was one of the first things I played around with.

I dont think it has a lot of use for the leagues, cause as you rightly said any bot that comes accross it sleeping will just kill it while it sleeps, unless you can find some way of making enemy bots ignore you I.e. virus. I also played around with bots that hibernated when they were low on energy and bots with lots of energy would shoot energy particles towards them, to restart them.

Certainly some interesting ideas, but how usefull they are depends on what you want them to do and how you do it. But you certainly are resourcefull and seem to understand the DB language very well, so I look forward to seeing where this leads.
Title: Hibernation
Post by: PurpleYouko on January 26, 2006, 09:47:22 AM
That was the whole point of the early "spinners" such as Circumversor Algificus that Jez pioneered.

They were in a kind of hibernation state but were constantly spinning on the spot and watching for predators.
Title: Hibernation
Post by: Elite on January 26, 2006, 11:22:52 AM
Yes, I was thinking too of a 'keeper' bot that would watch over the bot population and wake them if there was a threat (like the wraith from Stargate Atlantis). I was thinking info shot.
Useless for leagues but it would make a great ecosystem. The hibernation bot poputation could go into hibernation when food was scarce and wake (or be woken) in a time of plenty (also like the wraith - they hibernate for thousands of years and then wake to cull their 'human herd', leaving some alive to breed, they then hibernate until the humans are at a reasonably high population again). That way, huge populations could be sustained with relatively little food.
A 'wraithbot' would be cool  :D ...

It would make an interesting little ecosystem wouldn't you think?

You'll be the first to know if I get anywhere  :)



BTW Does anyone here watch Stargate
Title: Hibernation
Post by: PurpleYouko on January 26, 2006, 12:48:10 PM
I watched the almost all of the original stargate episodes up to the last season. I also watched the first season of Atlantis but the way they stopped half way through the final 2-part season finale pissed me off so much that I just can't get back into it any more.
Title: Hibernation
Post by: Numsgil on January 26, 2006, 01:43:26 PM
I mostly watch them because they come before Battlestar Galactica.  I'm a neo-Battlestar Galactica addict.  They're just very emotionally resonating to me.

To set up an appropriate simulation where hibernation would be useful, you can use day/night cycles, the veggy repop cooldown timer, or both.  I would recommend the veggy repop cooldown timer.  Set it really high and there'll be alot of cycles elapsing between when all the veggies die and when they get repopulated.
Title: Hibernation
Post by: Elite on January 26, 2006, 01:44:41 PM
Go here (http://forum.darwinbots.com/index.php?showtopic=1086) to participate in the community project  :)  :)  :) !
Title: Hibernation
Post by: Welwordion on April 15, 2006, 09:20:59 AM
Somehow I do not get it, there are so many store commands why is it supposed to use no energy when hibarnation is put to zero?
Title: Hibernation
Post by: Elite on April 15, 2006, 09:54:02 AM
Storing into a memory location that doesn't exist (0) costs no energy
Title: Hibernation
Post by: Numsgil on April 15, 2006, 12:12:34 PM
Most impossible actions are free
Title: Hibernation
Post by: Welwordion on April 15, 2006, 12:55:56 PM
Which means instead of conditions, I can use a multiplicator which is either 0 or 1 based on a calculation and so save energy if they conditions are false?

Well, that will be alot of work changing my bot into such a form    
Title: Hibernation
Post by: Numsgil on April 15, 2006, 01:06:53 PM
Bots that do that are called SG bots, and are IMO almost more work than they're worth.
Title: Hibernation
Post by: Elite on April 15, 2006, 01:32:44 PM
You can also make them totally immune to viruses using

.delgene inc
.delgene inc

Me and Endy love SG bots. There's a thread about conditionless coding somewhere.
Title: Hibernation
Post by: PurpleYouko on April 15, 2006, 07:08:42 PM
Quote from: Elite
Storing into a memory location that doesn't exist (0) costs no energy
Unless the costs have ben dramaticly overhauled recently this should not work.  

Costs for storing are calculated by the program going through the DNA and physically counting all the "store" commands then multiplying that number by the store cost. It should make absolutely no difference if any particular store command is successful or not since the costs are applied outside of the main loop.
Title: Hibernation
Post by: Numsgil on April 15, 2006, 07:14:28 PM
A little behind the times aren't we?  

I changed it so that store commands cost energy the moment thye're used.  I believe that was 2.37.  It's what allowed Spanish Conquistador and other short bots to explode in complexity and efficiency.
Title: Hibernation
Post by: Endy on April 15, 2006, 08:06:14 PM
Yep, great little guys. Normally I'll do the initial code regular, then SG'ize it afterwards. Useful also for general cost saving in Multi-gene bots, since every bit of nrg helps.  

Here's a tutorial on the whole concept.

Conditionless bots (http://www.darwinbots.com/WikiManual/index.php?title=Conditionless_Bots)


You could just make a normal condition send them into hibernation. It would effectivly act as a overall state regulator, costs some nrg, but would make the coding easier. Only downside is that the antiviral stuff wouldn't work.  

Maybe it would be useful for bots near death. They could hibernate until a conspec gives them enough nrg to get going again.
Title: Hibernation
Post by: Elite on April 16, 2006, 05:58:34 AM
Damn. I ran a test, and in 2.37.6 hibernation does work, but in 2.4X it doesn't
No wonder Una was dying in 2.4 - there's a lot of stores in there

Grrrrrr ... change it back    

Here's SWARM SGified:

Code: [Select]
' SWARM
'
' Forms swarms to its tactical advantage

cond
start
.tie *.robage 1 add mult inc
.deltie inc
.fixpos *.fixed mult dec
*.refaim .setaim *.refkills *.kills sub sgn 1 add sgn mult *.eye5 sgn mult *.refeye *.myeye sub abs sgn -1 mult 1 add mult store
10 .up *.eye5 sgn mult *.refeye *.myeye sub abs sgn -1 mult 1 add mult store
10 .up *.eye5 -1 mult 1 add mult store
*.eye9 2 mult *.eye8 add *.eye1 2 mult *.eye2 add sub *.eye5 1 add div .aimdx store
*.refvelup 50 add .up 45 *.eye5 sub sgn mult *.eye5 sgn mult *.refeye *.myeye sub abs sgn mult store
*.refxpos *.refypos angle .setaim *.robage sgn mult *.eye5 sgn mult *.refeye *.myeye sub abs sgn mult store
-6 .shoot *.refeye *.myeye sub abs sgn mult *.eye5 34 sub sgn mult store
16 .shootval *.refeye *.myeye sub abs sgn mult *.eye5 34 sub sgn mult store
*.refveldx .dx *.refeye *.myeye sub abs sgn mult *.eye5 34 sub sgn mult *.refveldx *.veldx sub abs 5 sub sgn mult store
30 .repro *.nrg 750 sub sgn mult store
100 .strbody *.nrg 500 sub sgn mult store
*.body 0 floor .fdbody *.body sgn mult 100 *.nrg sub sgn mult store
*.tiepres .tienum *.numties sgn mult *.robage 1 sub sgn mult store
.tieval .tieloc *.numties sgn mult *.robage 1 sub sgn mult store
1000 .tieval *.numties sgn mult *.robage 1 sub sgn mult store
.delgene inc .delgene inc
stop

end

Notice the antivirus code on the end

SG bots with double .delgene inc are totally immune to viruses - the virus is deleted before it can execute

There's a topic here (http://www.darwinbots.com/Forum/index.php?showtopic=1067) about conditionless coding. There's also my Animal Minimalis SGified in there
Title: Hibernation
Post by: Welwordion on April 16, 2006, 08:31:45 AM
Hm, I just realized you could build a bot without store commands, instead it would rely on inc dec and information/venom shots it fires at itself(he could be a MB to do that).
However it would be quite complicated and energy expensive.
Title: Hibernation
Post by: Numsgil on April 16, 2006, 10:36:57 AM
In 2.4 at least inc and dec are no longer free.  They cost 1 / 10th of a store I believe.

If Eric doesn't, I'll try and figure out what makes hibernation no longer work after church.
Title: Hibernation
Post by: PurpleYouko on April 16, 2006, 11:26:31 AM
Quote from: Numsgil
A little behind the times aren't we?  

I changed it so that store commands cost energy the moment thye're used.  I believe that was 2.37.  It's what allowed Spanish Conquistador and other short bots to explode in complexity and efficiency.
Apparently so.
it's been about 6 months since I had the time to delve into the code and since you joined the programming team, everything has been moving at incredible speed.
Title: Hibernation
Post by: Henk on April 16, 2006, 12:48:01 PM
Quote from: Elite
Here's SWARM SGified:

That thing is EVIL

Single-gened bots nowadays are just as good as recent multi-gened ones. Maybe even better...
Title: Hibernation
Post by: Numsgil on April 16, 2006, 12:50:23 PM
Really throws the whole SG league on end doesn't it?  
Title: Hibernation
Post by: abyaly on May 01, 2006, 07:06:52 PM
Quote from: Henk
That thing is EVIL

Single-gened bots nowadays are just as good as recent multi-gened ones. Maybe even better...
Why wouldnt they be? Any bot that has an empty stack after the end of each gene can easily be made into an SG.
Step 1:
Convert all conditional operators as follows:
>   -> sub sqr dup div
<   -> sub -1 mult sqr dup div
!=  -> sub dup div
=   -> sub dup div 1 sub abs
Step 2:
Connect all of the gene's conditions with boolean operations.
or   -> add sgn
and -> mult
not  -> 1 sub dup div
xor -> sub dup div
Step 3:
Find every store, inc, or dec command inside the gene.
Multiply the address being modified by the value from step 2.
Step 4:
After doing this to every gene, put everything together into a conditionless gene.

Bots that don't fit the criteria wont work with that algorithm, but with some effort I think those could be converted to SG bots too  
Title: Hibernation
Post by: EricL on May 01, 2006, 08:41:19 PM
Quote from: Numsgil
In 2.4 at least inc and dec are no longer free.  They cost 1 / 10th of a store I believe.

In all versions of 2.4, inc and dec cost 1/10th of a store as long as the value on the stack is between 1 and 1000 inclusive.  (0 inc costs nothing,  same with 0 dec).

Beginning with 2.42.3, stores have symmetric behaviour (stores to locations outside 1 to 1000 inclusive cost nothing).  In previous versions of 2.4, any store would cost you, including attempted stores to location 0.

In short, if I understand the concept sufficiently, hybernation should once again work in 2.42.3.
Title: Hibernation
Post by: Trafalgar on July 09, 2007, 11:28:26 AM
Quote from: abyaly
Convert all conditional operators as follows:
>   -> sub sqr dup div
I don't get this. Why wouldn't dup div always return 1 (unless the value was 0), since any number (except 0) divided by itself is 1?
(In other words, it looks to me like it would act like a != instead of a >)
Title: Hibernation
Post by: abyaly on July 09, 2007, 04:58:40 PM
sqr turns a positive number into the square root of that number. it turns a negative number into 0
Title: Hibernation
Post by: Jez on July 09, 2007, 06:25:25 PM
What are the chances of luring you into rewriting the conditionless bots part of the Wiki Abylaly? Apart from being (IMO anyway) the best 1g bot writer out there you also have a really simple and accessible way of explaining how it's done.
Not to mention your skill with viruses and venom...  

That post above showing how to convert a standard bot into a 1G bot really deserves to be added to the Wiki at least.  
Title: Hibernation
Post by: Trafalgar on July 09, 2007, 08:58:20 PM
Quote from: abyaly
sqr turns a positive number into the square root of that number. it turns a negative number into 0

Ohh, silly me. I thought it was *squaring*, not square rooting.

Edit: Avoiding double-posting.

There is already an article about how to do that (entitled "Conditionless Bots"), of course, but it doesn't give good solutions for and/or/xor/not. That said, a few of the solutions in the post above are kind of pointless, too (or perhaps out of date? How old are the "new math operators"?). It says:

Quote
Connect all of the gene's conditions with boolean operations.
or -> add sgn
and -> mult
not -> 1 sub dup div
xor -> sub dup div

But when the things you're using them on are going to be only either 0 or 1, you can use these instead:

or becomes |
and becomes &
not becomes - ++
xor becomes ^

Those are just the bitwise versions of those operators, except for not, since the bitwise not operator (~, the complement operator) would (if it works like it does in asm) turn 0 into -1 (0xffffffff) and 1 into 0xfffffffe (-2).

("x - ++" is identical to "1 x sub")

For the other operators, I'm doing this:
> becomes 'sub sgn 0 floor'
< becomes 'sub sgn - 0 floor'
>= becomes 'sub 1 add sgn 0 floor'
<= becomes 'sub 1 sub sgn - 0 floor'
= becomes 'sub sgn abs - ++'
!= becomes 'sub sgn abs'

I haven't given much thought to what ~= and %= and the like could be converted to, since the wiki says that they're more or less useless.
Title: Hibernation
Post by: abyaly on July 10, 2007, 09:54:02 AM
Actually, the ones posted there aren't the same ones I use now, but it all amounts to the same thing in the end. What's important is that it's readable to the creator and accomplishes what is needed

I could write something about that, Jez.
Title: Hibernation
Post by: Jez on July 10, 2007, 05:34:58 PM
Was just a thought; the info on 1G bots you come up with is miles above the information (in the wiki) that is readily available atm.
The Wiki always seems to need updating though so if you don't get time for it then don't worry!  
Title: Hibernation
Post by: fulizer on November 24, 2007, 04:45:11 AM
try making a gene that makes it go back to normal if its energy drops faster than a certain rate
that would wake it up if it were attacked
Title: Hibernation
Post by: Peter on November 24, 2007, 08:39:40 AM
Quote from: fulizer
try making a gene that makes it go back to normal if its energy drops faster than a certain rate
that would wake it up if it were attacked
You have read the thread?

Wow you're really trying to bring your post-count up.
Title: Hibernation
Post by: fulizer on December 06, 2007, 06:20:05 AM
Quote from: Peter
Quote from: fulizer
try making a gene that makes it go back to normal if its energy drops faster than a certain rate
that would wake it up if it were attacked
You have read the thread?

Wow you're really trying to bring your post-count up.
why do you hate me?
a bit off topic I know but really why do you hate me?
Title: Hibernation
Post by: Peter on December 06, 2007, 11:37:12 AM
Quote from: fulizer
Quote from: Peter
Quote from: fulizer
try making a gene that makes it go back to normal if its energy drops faster than a certain rate
that would wake it up if it were attacked
You have read the thread?

Wow you're really trying to bring your post-count up.
why do you hate me?
a bit off topic I know but really why do you hate me?
No, no, I don't hate you, no really I don't hate you. Why do you think like that.

I asked if you have read the thread, and said something about your pst count becouse you are really really really, fast posting in every topic.
Title: Hibernation
Post by: rsucoop on January 16, 2008, 04:45:26 PM
Quote from: Elite
Una was originally designed as an experiment into 'hibernating' bots. Using conditionless coding, this version of Una (it's an older version) will hibernate when 1 is placed into location 51

Code: [Select]
'Una
'
'With hibernation command

def hibernate 51
def IDcode 55

cond
start
1 .hibernate *.robage -1 mult 1 add mult store

.tie *.robage -1 mult 1 add mult *.hibernate mult inc
.deltie *.hibernate mult inc

.fixpos *.fixed mult *.hibernate mult dec

*.refveldx .dx *.eye5 sgn mult *.hibernate mult *.memval 42 sub dup mult sgn *.refeye *.myeye sub dup mult sgn add sgn mult store
*.refvelup 60 add .up *.eye5 sgn mult *.hibernate mult *.memval 42 sub dup mult sgn *.refeye *.myeye sub dup mult sgn add sgn mult store

42 .IDcode *.robage -1 mult 1 add mult store
.IDcode .memloc *.robage -1 mult 1 add mult store

-6 .shoot *.eye5 sgn 1 add sgn mult *.eye5 40 sub sgn 1 add sgn -1 add -1 mult mult *.hibernate mult *.memval 42 sub dup mult sgn *.refeye *.myeye sub dup mult sgn add sgn mult *.eye5 sgn mult store
-8 .shootval sub sgn 1 add sgn mult *.eye5 40 sub sgn 1 add sgn -1 add -1 mult mult *.hibernate mult *.memval 42 sub dup mult sgn *.refeye *.myeye sub dup mult sgn add sgn mult *.eye5 sgn mult store

-6 .shoot *.refpoison sgn mult *.eye5 45 sub sgn 1 add sgn mult *.hibernate mult *.memval 42 sub dup mult sgn *.refeye *.myeye sub dup mult sgn add sgn mult *.eye5 sgn mult store
-1 .shoot *.refpoison sgn -1 mult 1 add mult *.refshell sgn mult *.eye5 45 sub sgn 1 add sgn mult *.hibernate mult *.memval 42 sub dup mult sgn *.refeye *.myeye sub dup mult sgn add sgn mult *.eye5 sgn mult store
-6 .shoot *.refpoison sgn -1 mult 1 add mult *.refshell sgn -1 mult 1 add mult *.eye5 45 sub sgn 1 add sgn mult *.hibernate mult *.memval 42 sub dup mult sgn *.refeye *.myeye sub dup mult sgn add sgn mult *.eye5 sgn mult store

16 .shootval *.eye5 45 sub sgn 1 add sgn mult *.hibernate mult *.memval 42 sub dup mult sgn *.refeye *.myeye sub dup mult sgn add sgn mult *.eye5 sgn mult store

*.refvelup .up *.eye5 45 sub sgn 1 add sgn mult *.hibernate mult *.memval 42 sub dup mult sgn *.refeye *.myeye sub dup mult sgn add sgn mult *.eye5 sgn mult store
*.refxpos *.refypos angle .setaim *.hibernate mult *.memval 42 sub dup mult sgn *.refeye *.myeye sub dup mult sgn add sgn mult *.robage sgn mult *.eye5 sgn mult store

314 rnd .aimdx *.memval 42 sub dup mult sgn -1 add -1 mult *.refeye *.myeye sub dup mult sgn -1 add -1 mult mult *.eye5 sgn -1 add -1 mult add sgn mult *.hibernate mult store

40 .repro *.body 100 sub sgn mult *.nrg 1000 sub sgn 1 add sgn mult *.hibernate mult store
314 rnd .aimdx *.body 100 sub sgn mult *.nrg 1000 sub sgn 1 add sgn mult *.hibernate mult store

100 .strbody *.nrg 500 sub sgn mult *.hibernate mult store
100 .fdbody *.nrg -1 mult 100 add sgn mult *.hibernate mult store

*.tiepres .tienum *.numties sgn mult *.robage 1 sub sgn mult store
.dn .tieloc *.numties sgn mult *.robage 1 sub sgn mult store
32000 .tieval *.numties sgn mult *.robage 1 sub sgn mult store

*.waste .shootval *.waste 10 sub sgn mult *.hibernate mult store
-4 .shoot *.waste 10 sub sgn mult *.hibernate mult store

.delgene inc .delgene inc
stop

It's also nice and broken up to make it more understandable.

All commands in the DNA (except the anti-virus, but it uses inc anyway) have the code *.hibernate mult in them. *.hibernate is set at birth to be 1, but if you set it to zero using the console, the bot goes into hibernation. While in this state it uses no energy whatsoever. The original plan was for Una to release a deadly virus into the population and come out of hibernation later when the pandemic had (hopefully) wiped out everyone else. I never got round to using this feature when I realised that gearing the bot up for hibernation had made it extrodinarily efficient. I eventually removed the *.hibernation command just before joining this forum.

The virus (or a similar virus to the one) that Una was to be using (designed to be as deadly as possible, with the *.myeye being Una's *.myeye):

Code: [Select]
cond
start
100 .vshoot store
*.thisgene .mkvirus store
? .myeye store
*.genes rnd .delgene *877 -500 add sgn 1 add 2 div mult store
877 inc
.delgene dec
stop

What do you think of the concept?

Problem is that if another bot catches you sleeping they will just kill you  
I tried making a bot that hibernated when its *.nrg fell below 100. It was reasonably sucessful.


I like the concept. If being attacked while in hibernation is a problem, perhaps a secondary virus could help. The second virus would cause the carrier to run around in circles, and then feed any hibernating ties.

[code]
cond
*40 1 =
*.hibernate 1 =
start
*.setaim inc
*51 .tienum store
'nrg' .tmemloc store
*.nrg .tmemval store
0 .shoot store
stop
Title: Hibernation
Post by: fulizer on January 25, 2008, 08:43:27 AM
a simpler way to do this is to have an type changing gene
eg
type 1= hibernation
type 2= active
Title: Hibernation
Post by: JossiRossi on January 25, 2008, 01:08:27 PM
Simple is not always preferable. I think the best idea is to provide the base elements that when combine correctly can do almost anything. It's about giving letters, not words and sentences.
Title: Hibernation
Post by: Moonfisher on February 19, 2008, 04:57:15 AM
You call that a hibernater?
THIS is a hibernater : [a href=\'index.php?showtopic=2547\']Pacifist[/a]
It should also work even if they put costs back on stores in adress 0