Bots and Simulations > Tips and Tricks
how to make a bot go at the simulations max velocity all the time!
Numsgil:
If you have turbulent drag set up especially, moving at maxvel requries way too much nrg.
fulizer:
fine
ashton15:
--- Quote from: fulizer ---fine
--- End quote ---
Aww . . . maybhe you could sense drag with something along the lines of
[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']def drag 50
cond
*.robage 0 =
start
.tie inc
0 .drag store
stop
cond
*.robage 1 >
*.robage 22 <
start
.deltie inc
*.maxvel .up store
*.nrg .drag store
stop
cond
*.robage 21 =
start
*.drag *.nrg sub .drag store
*.drag *.maxvel div .drag store
stop
cond
'conditions for moving forwards
start
*.drag .up store
stop
Ammeh:
I think I see what you're getting at with those genes, but I think you may need to edit the last line of the second gene from
--- Code: ---*.nrg .drag store
--- End code ---
which just stores the amount of energy into drag
to
--- Code: ---*.drag *.nrg sub .drag store
--- End code ---
which stores change in energy into drag.
Houshalter:
--- Quote ---
--- Code: ---cond
*.robage 0 =
start .tie inc
0 .drag store
stop
--- End code ---
--- End quote ---
The "0 .drag store" is unessacary because I think memory location 50, which is where .drag points to, starts at 0.
--- Quote ---
--- Code: ---cond
*.robage 1 >
*.robage 22 <
start
.deltie inc
*.maxvel .up store
*.nrg .drag store
stop
--- End code ---
--- End quote ---
same thing. The ".deltie inc" could be replace with:
--- Code: ---cond
*.robage 1 =
start
.deltie inc
stop
--- End code ---
Also whats the point of storing nrg into drag every cycle between one and 22, which just overwrites the last store. If you want to find the average try something like this:
--- Code: ---*.drag *.nrg add *.robage 1 sub div .drag store
--- End code ---
Im not sure if any of this is helpfull or makes any sense but I hope it does.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version