Bots and Simulations > Tips and Tricks

Hibernation

(1/8) > >>

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: ---'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
--- End code ---

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: ---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
--- End code ---

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.

Numsgil:
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.

Light:
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.

PurpleYouko:
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.

Elite:
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

Navigation

[0] Message Index

[#] Next page

Go to full version