Author Topic: Autotroph Network  (Read 6270 times)

Offline Ulciscor

  • Bot Destroyer
  • ***
  • Posts: 401
    • View Profile
Autotroph Network
« on: June 07, 2005, 08:08:04 PM »
Hey as you might have read I'm trying to make a veggie that links to nearby family members and monitors their energy levels, sending energy via ties when they fall below a certain level. I'm hoping this could be the precursor for a multibot that could actually move around and consume other bots.

Anyway this is what I have so far, I have a feeling it is grossly inefficient and bug-filled so can someone help please??

'Start Genome

def tie1 0
def tie2 0
def tie3 0

'Gene1:

cond *.nrg 6000 >
start
50 .repro store
15 .aimdx store
stop

'Gene2:

cond *.eye5 0 !=
        *.refeye *.myeye =
          .tie 0 =
start
1 .tie store
inc .tie1
stop

'Gene3:

cond *.eye5 0 !=
        *.refeye *.myeye =
          .tie2 0 =
start
2 .tie store
inc .tie2
stop

'Gene4:

cond *.eye5 0 !=
        *.refeye *.myeye =
          .tie3 0 =
start
3 .tie store
inc .tie3
stop

end

All this does is make 3 ties and reproduce though. I don't know how to make a bot check to see if a tie still exists or not.
This is harder than I thought lol.
:D Ulciscor :D

I used to be indecisive, but now I'm not so sure.

Offline Ulciscor

  • Bot Destroyer
  • ***
  • Posts: 401
    • View Profile
Autotroph Network
« Reply #1 on: June 07, 2005, 08:52:36 PM »
Well just testing this resulted in the veggies being unable to revolve to reproduce as the ties hardened. Not good. Not really sure what to do so I'll try a few things.
:D Ulciscor :D

I used to be indecisive, but now I'm not so sure.

Offline Ulciscor

  • Bot Destroyer
  • ***
  • Posts: 401
    • View Profile
Autotroph Network
« Reply #2 on: June 07, 2005, 09:16:41 PM »
So should I leave it was it is or try to work around it? Cos it's really messing the thing up lol.
:D Ulciscor :D

I used to be indecisive, but now I'm not so sure.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Autotroph Network
« Reply #3 on: June 07, 2005, 09:20:00 PM »
There are a number of errors in your code.

Quote
def tie1 0
def tie2 0
def tie3 0

This may not be an actual error but I am not quite sure what you are trying to do here.
What you are actually achieving is to create 3 custom variables with a value of zero in each one.
If that is what you wanted then great.
Normally these should point at different location. Also note that you cannot store values in .0  (see reason 1 below)


Quote
cond *.eye5 0 !=
*.refeye *.myeye =
.tie 0 =
start
1 .tie store
inc .tie1
stop

Couple of problems here.
".tie 0 ="
.tie is always going to be zero unless it has been set earlier in the same cycle. It is reset at the end of each cycle. I also assume that you meant this to be ".tie1 0 =" in which case it will never activate the gene. (see reason 1 below)
"inc .tie1"
I assume that you want to increment the value of tie1 but it won't work  for 2 reasons.

1 There is no memory position zero in the memory array so you can't increment the value held in the memory location pointed at by .tie1
2 The command is backwards. it should read ".tie1 inc"

hints

1 use unique tie identifier numbers for each tie. .tie inc just puts a value of 1 in each tie
2 *.tiepres returns the value of a tie
3 *.numties tells you how mamy ties exist on your robot.

try again and let me know if you need some one-on-one help
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Ulciscor

  • Bot Destroyer
  • ***
  • Posts: 401
    • View Profile
Autotroph Network
« Reply #4 on: June 07, 2005, 09:23:49 PM »
Lol sorry I keep forgetting this crazy inverse notation!! And for some mad reason I thought the number after the custom variable name was the value you wanted to initially store in that location. And also sorry for all the idiotic typing mistakes I made. Don't you ever get fed up of pointing out such totally stupid problems lol?

Thanks a ton!!
:D Ulciscor :D

I used to be indecisive, but now I'm not so sure.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Autotroph Network
« Reply #5 on: June 07, 2005, 09:28:36 PM »
Quote
Don't you ever get fed up of pointing out such totally stupid problems lol?

No not really. It just makes me feel all warm and fuzzy inside to know that I am still needed  :D

Maybe I just like making people feel small and stupid too.  B)

Then again maybe I am just plain altruistic.....

NAAAAH! Couldn't be that. Must be one of the first two.  :firedevil:
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Ulciscor

  • Bot Destroyer
  • ***
  • Posts: 401
    • View Profile
Autotroph Network
« Reply #6 on: June 07, 2005, 09:32:32 PM »
Argh how do I get them to turn to find more reproducing room when they are tied?! This is so annoying lol all they do is slightly revolve clockwise then anticlockwise really quickly.
:D Ulciscor :D

I used to be indecisive, but now I'm not so sure.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Autotroph Network
« Reply #7 on: June 07, 2005, 09:46:11 PM »
Once the ties become fixed you have two choices to make them rotate with respect to the hardened tie.

Option 1 the old way.

If you have a tie with a phase of 1 (1 .tie store or .tie inc) then use a gene like this.
Code: [Select]
cond
'your condition
start
1 .tienum store
628 .fixang store
stop
This gene will make all ties with a phase of 1, face directly backward to the robot. (an angle of 628 to the direction of .aim)

Option 2 the new way

Each robot has an array of 4 ties. It can now access these four ties directly by number from this array in addition to addressing them by phase.
If the robot has 1 tie then this will be (by default) tie1 so the command 628 .tieang1 store will set the angle of the first tie to 628 (directly behind).
If you have 3 ties (*.numties 3 =) then you can simultaineously set .tieang1 to 314, .tieang 2 to 628 and tieang3 to 942 (or -314) then your robot will be facing open space and the 3 ties around you will be at 90 degree increments.

You should be able to use method 2 to make sure you are clear to reproduce as well as defining a nice crystal lattice of veggies.

Also set .tielen1 through 4 to set the size of the lattice.
« Last Edit: June 07, 2005, 09:51:21 PM by PurpleYouko »
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Ulciscor

  • Bot Destroyer
  • ***
  • Posts: 401
    • View Profile
Autotroph Network
« Reply #8 on: June 07, 2005, 10:14:31 PM »
Sorry to change the subject again but I just can't work this out. This is what I have:

'Start Genome

def tie1 1
def tie2 2
def tie3 3

'Gene1:

cond *.nrg 6000 >
     *.numties 0 =
start
50 .repro store
15 .aimdx store
stop

'Gene2:

cond *.nrg 6000 >
     *.numties 3 =
start
314 .tinang1 store
314 .tieang2 store
314 .tieang3 store
stop

'Gene3:

cond *.eye5 0 !=
*.refeye *.myeye =
.tie1 1 !=
start
1 .tie store
.tie1 inc
stop

'Gene4:

cond *.eye5 0 !=
*.refeye *.myeye =
.tie2 1 !=
start
2 .tie store
.tie2 inc
stop

'Gene5:

cond *.eye5 0 !=
*.refeye *.myeye =
.tie3 1 !=
start
3 .tie store
.tie3 inc
stop

end

and it just does nothing. Some of the veggies create offspring around themselves but then do nothing. Some veggies don't do anything at all. Ties are created but then disappear for some reason. What the hell am I doing wrong?
:D Ulciscor :D

I used to be indecisive, but now I'm not so sure.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Autotroph Network
« Reply #9 on: June 07, 2005, 10:17:38 PM »
Problem is that mem locations 1, 2, and 3 are already taken by up, dn, and dx (I think it's dx, too lazy to check).

50, 51, and 52 are open (and fairly standard).

Offline Ulciscor

  • Bot Destroyer
  • ***
  • Posts: 401
    • View Profile
Autotroph Network
« Reply #10 on: June 07, 2005, 10:20:06 PM »
Lol right I promise I'm not going to ask any more questions until I read more about memory locations etc I am being stupid. Thanks [num]!
:D Ulciscor :D

I used to be indecisive, but now I'm not so sure.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Autotroph Network
« Reply #11 on: June 07, 2005, 10:23:36 PM »
No prob.  It takes a while to gather all the information in your mind.

Offline Ulciscor

  • Bot Destroyer
  • ***
  • Posts: 401
    • View Profile
Autotroph Network
« Reply #12 on: June 07, 2005, 11:12:57 PM »
Oklies I have done a 'working' version which works in the respect that it reproduces and ties together with other bots, but I don't really know how to test the energy sharing as all the veggies seem to get max energy immediately in my DB.

'Start Genome

def tie1 50
def tie2 51
def tie3 52
def nrg1 53
def nrg2 54
def nrg3 55

'Gene1:
cond *.nrg 6000 >
     *.eye5 0 =
start
50 .repro store
stop

'Gene2:
cond *.eye5 0 !=
     *.numties 0 =
start
15 .aimdx store
stop

'Gene3:
cond *.eye5 0 !=
     *.numties 0 !=
start
314 .tieang1 store
stop

'Gene4:
cond *.eye5 0 !=
*.refeye *.myeye =
*.tie1 1 !=
start
1 .tie store
.tie1 inc
stop

'Gene5:
cond *.eye5 0 !=
*.refeye *.myeye =
*.tie2 1 !=
start
2 .tie store
.tie2 inc
stop

'Gene6:
cond *.eye5 0 !=
*.refeye *.myeye =
*.tie3 1 !=
start
3 .tie store
.tie3 inc
stop

'Gene7:
cond *.numties 1 =
start
1 .readtie store
*.trefnrg .nrg1 store
stop

'Gene8:
cond *.numties 2 =
start
1 .readtie store
*.trefnrg .nrg1 store
2 .readtie store
*.trefnrg .nrg2 store
stop

'Gene9:
cond *.numties 3 =
start
1 .readtie store
*.trefnrg .nrg1 store
2 .readtie store
*.trefnrg .nrg2 store
3 .readtie store
*.trefnrg .nrg3 store
stop

'Gene10:
cond *.nrg1 2000 <
     *.numties 0 >
start
1 .tienum store
-1 .tieloc store
1000 .tieval store
stop

'Gene 11:
cond *.nrg2 2000 <
     *.numties 1 >
start
2 .tienum store
-1 .tieloc store
1000 .tieval store
stop

'Gene 12:
cond *.nrg3 2000 <
     *.numties 2 >
start
3 .tienum store
-1 .tieloc store
1000 .tieval store
stop
end
:D Ulciscor :D

I used to be indecisive, but now I'm not so sure.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Autotroph Network
« Reply #13 on: June 07, 2005, 11:21:27 PM »
you probably have the NRG/cycle way too high.  It's in the general tab.  It should be like ~5.  Older versions used that variable for something else, which is why it's so high.

Offline Ulciscor

  • Bot Destroyer
  • ***
  • Posts: 401
    • View Profile
Autotroph Network
« Reply #14 on: June 08, 2005, 12:08:42 PM »
Is there a way I can check if a tie still exists? I know numties gives the number of ties attached but it doesn't say which is missing. I.e if I had ties 1, 2 and 3 last cycle now I only have 2 ties, which one is missing?
:D Ulciscor :D

I used to be indecisive, but now I'm not so sure.