Bots and Simulations > DNA - General
Autotroph Network
Ulciscor:
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.
Ulciscor:
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.
Ulciscor:
So should I leave it was it is or try to work around it? Cos it's really messing the thing up lol.
PurpleYouko:
There are a number of errors in your code.
--- Quote ---def tie1 0
def tie2 0
def tie3 0
--- End quote ---
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
--- End quote ---
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
Ulciscor:
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!!
Navigation
[0] Message Index
[#] Next page
Go to full version