Author Topic: A Few Questions  (Read 4774 times)

Offline Slavakion

  • Bot Neophyte
  • *
  • Posts: 14
    • View Profile
A Few Questions
« on: May 30, 2005, 11:28:05 AM »
If I'm designing an F1 bot, is the current league table still valid? I saw that PY had said it was horribly out of date. If it is, my bot could place in the top 15. (yay)

Is .shoot a free action? I didn't think it was, but I've seen some bots that seem to constantly shoot.

Are viruses stopped by shells like normal shoot? And what is the cost for making/shooting a virus? Could a virus be realistically implemented as another weapon alongside .shoot and .tie?

If I used an initialization gene to set a number for .out, could that work as an ID to avoid conspecifics? How accurate is the reading of .out? If I used that, and Dad happened to swim by while Junior was fighting competition, would Junior all of a sudden think he was shooting family and stop?

Eh, I'm sure I'll think of some more. :)

Thanks

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
A Few Questions
« Reply #1 on: May 30, 2005, 11:41:58 AM »
Hey, welcome.

The F1 table is up to date I think.  There might be one or two bots not entered in yet.

Shooting cost is defined as a chemical emission cost, which is defined in the physics and costs page of the options screen.  It's default is 2, which is quite low, so shooting nonstop won't be a huge energy drain.

Viruses are stopped by slime.  There's an attack-defense for every attack.  Ties and Viruses -> Slime.  -6 shots -> shell, -1 shots -> poison.  I forget which is which for info shots (positive shots) and venom.  If anything in the previous sentence didn't make sense to you yet, don't worry, it's fairly advanced stuff.  If you build 100 of each you'll be fairly safe (if not a bit slow and built like a tank).

.in works like refnrg, or any other ref variables.  They only update when your eye5 is looking at something.  Then they update for what you're looking at.  The only problem with using it as a conspec recognition system is bots who reflect whatever they see in their .ins into their .outs.  There aren't many, but there are some.

A better way is using memloc/memval.  You set memloc to a memory location, then use memval to read back everyone's values at that location.  Much harder to spoof (it's what I use).

Viruses can be constructed that work like a regular weapon, but after a while it ends up just degrading everyone in the field (Helios is a good example of this).  A better way is just to create a self replicating virus that you're immune to.  I've done some posts and bots playing with that idea.  Spanish Conquistador has such a virus, but it's fairly complex, even if you're pretty good with the stack (although I did try to comment it well).

Tetll me if there's something you want me to go over more thoroughly.

Offline Slavakion

  • Bot Neophyte
  • *
  • Posts: 14
    • View Profile
A Few Questions
« Reply #2 on: May 30, 2005, 03:42:57 PM »
How do you use memloc? Just something like this?
Code: [Select]
def species_id 600
77 .species_id store
...
cond
  *.memloc *.species_id !=
start
  shoot sum stuff

I'll see if I can figure out that Spanish Conquistador... Sometimes it'll have some crazy comebacks, and cancer explosions are always fun to watch.

Oh, and can an internal value like my .species_id be used as an immunity to my own virus by having a condition in the gene be that .species_id != whatever?

Offline Light

  • Bot Destroyer
  • ***
  • Posts: 245
    • View Profile
A Few Questions
« Reply #3 on: May 30, 2005, 04:46:20 PM »
Welcome to darwinbots

memloc - selects the memory location from another bot that you want to be able to read the address from
memval - tells you the value from the location stored specified in memloc

so you would need
Code: [Select]
'define address 600 as species_id
  def species_id 600

'store 77 in species_id
  77 .species_id store

'set species_id as the address you want to read
  .species_id .memloc store


cond
   *.memval *.species_id !=
start
   shoot sum stuff
stop

or you could just compare refvariables such as myeye and refeye

ie *.myeye *.refeye !=

Quote
Oh, and can an internal value like my .species_id be used as an immunity to my own virus by having a condition in the gene be that .species_id != whatever?

yes
« Last Edit: May 30, 2005, 04:48:44 PM by Light »

Offline Slavakion

  • Bot Neophyte
  • *
  • Posts: 14
    • View Profile
A Few Questions
« Reply #4 on: May 30, 2005, 05:48:31 PM »
Quote
or you could just compare refvariables such as myeye and refeye

ie *.myeye *.refeye !=
I had been doing it that way, but what if another bot had the same amount of eye references, unlikely as it'd be? And if I'm going to tinker with a virus system, this will help.

Now I need to figure out how to clean up my stores without borking the navigation...

EDIT: Figured that one out -- aimdx instead of aimsx...

Do -6 shots trigger poison?
« Last Edit: May 30, 2005, 08:22:02 PM by Slavakion »

Offline Slavakion

  • Bot Neophyte
  • *
  • Posts: 14
    • View Profile
A Few Questions
« Reply #5 on: May 30, 2005, 09:26:57 PM »
Is there a limit to how many store commands can be executed in a cycle -- or more importantly, a limit to how much energy can be wasted on stores?
Code: [Select]
' Virus Proper // Gene 9
' =========
cond
  77 *42 !=
  *.nrg 1 >
start
  *.eye5 *.eye5
  100 .up store
  -100 .up store
... [bunch more]
  100 .up store
  -100 .up store
  999 rnd
stop
Just for foolin' around until I get the hang of it. A couple of eye references to throw off refeye conspecific avoidance, a bunch of stores to eat energy, and a random number tossed on the stack to throw off navigation.

I was reading the self-propagating virus example, and what does the sgn operator do? Change signs?

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
A Few Questions
« Reply #6 on: May 30, 2005, 10:31:56 PM »
-6 shots only are stopped by shell.  Poison won't touch them.  -1 shots are only stopped by poison, shell won't touch them.

You can't control how much nrg/cycle your bot uses up.  Each store command costs .2 nrg by default, so it's not a huge burden.

The sgn operator returns the sgn of the top number on the stack (that is, -1 or +1).  The readme contains information on several sysvars and operators that were added in 2.35 (sgn operator included).

Offline Slavakion

  • Bot Neophyte
  • *
  • Posts: 14
    • View Profile
A Few Questions
« Reply #7 on: May 31, 2005, 08:58:01 AM »
Code: [Select]
250
'*.vtimer = 1 then shoot virus
*.vtimer 2 sub sgn
'-1 if ready, 1 else
-1 mult
'1 if ready, -1 else
1 add 3 div
'1 if ready, 0 else
.vshoot mult store

'*.vtimer = 0 then make virus
*.thisgene
*.vtimer 1 sub sgn -1 mult
'now have 1 if making, -1 else
1 add
'2 if making, 0 else
3 div
'1 if making, 0 else
.mkvirus mult store
The last line of each "subgene" -- shouldn't the mult operator come before .vshoot or .mkvirus? Or does it not matter because you haven't stored the number yet, just declared that it's going to be stored in .vshoot? I hate Reverse Polish Notation...

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
A Few Questions
« Reply #8 on: May 31, 2005, 09:05:21 AM »
Here's how a SB (short gene bot)'s genome will work.  Once you understand the form, it makes it all alot easier.

In a regular bot, it's:

value location store

IN a smaller bot it's:

1.  a bunch of operations to get value

2.  A bunch of operations to arrive at either 1 or 0 (or some other value, you'll see in a minute)

3.  put the location on the stack

4.  multiply the last two things.  1 * location = location.  0 * location = 0.  If you try to store to a non existant memory address, you aren't charged any energy (but neither have you just acconplished anything.)  As long as you try to store to <1 or >1000 nothing happens.

5. store command.

So that last mult you're confused about is step #4.  For instance, the second one is basically *.thisgene (.mkvirus or 0) store.
« Last Edit: May 31, 2005, 09:07:13 AM by Numsgil »