Darwinbots Forum
Bots and Simulations => DNA - General => Tips and Tricks => Topic started by: fulizer on March 31, 2008, 08:59:20 AM
-
with varing max velocity is a problem if you go faster than it you waste energy, if you go slower than it you are inferior to the bots that go fatser than you.
so all you have to to is add this to your dna
[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']*.maxvel .up store
making your bot go at the top speed without wasitng any energy and it gives your bot a large advantage over those who dont
I do not know if this has been done but some newer people (even newer than me) can use this to a good effect.
-
The assumption that storing values above *.maxvel in a movement sysvar wastes nrg is incorrect. It is a general rule in the simulator that bots only get charged for the resultant action, not the action attempted. The simualtor code limits the magnitude of the vector sum of the bot attempted accelerations and thus the action portion of the cost equation to the max velocity (which then gets multiplied by the movement cost and the cost multiplier to determine the actual cost). Bottom line, bots storing huge values in movement sysvars are not charged more than that needed to accelerate to maxvel.
I should also point out here that there is a hard limit on voluntary movement costs, restricting them to values between -100 and 100 (costs can be negative if the cost multiplier is negative). This limit is very old code. It predates the cost multiplier. No matter what the result of the cost calculation above, no matter how high the cost multipler or the user-specified movement cost, the actual cost applied is capped at 100.
I would very much like to remove this restriction if there are no objections. It is one of the few places where costs have a hard cap. It is also one of the few places where the will of the cost multiplier is overridden.
-
It was restricted to limit a killer info shot attack that caused the enemy to fly backwards at full speed (this was before my time, I think Carlo added it actually). I think 100 is a bit low in the modern program, and the charge-for-the-action-not-the-attempt fixes the original issue with that the cap was meant to fix. So yeah, removing it is fine.
-
oh fair enough
but a bot like this still gets the advantage over those that dont
-
but a bot like this still gets the advantage over those that dont
That's a pretty niave statement, like saying "bigger is always better". Always moving at maxvel is only advantageous if it's advantageous. It depends entirely on environmental conditions.
-
If you have turbulent drag set up especially, moving at maxvel requries way too much nrg.
-
fine
-
fine
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
-
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
*.nrg .drag store
which just stores the amount of energy into drag
to
*.drag *.nrg sub .drag store
which stores change in energy into drag.
-
cond
*.robage 0 =
start .tie inc
0 .drag store
stop
The "0 .drag store" is unessacary because I think memory location 50, which is where .drag points to, starts at 0.
cond
*.robage 1 >
*.robage 22 <
start
.deltie inc
*.maxvel .up store
*.nrg .drag store
stop
same thing. The ".deltie inc" could be replace with:
cond
*.robage 1 =
start
.deltie inc
stop
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:
*.drag *.nrg add *.robage 1 sub div .drag store
Im not sure if any of this is helpfull or makes any sense but I hope it does.
-
Ok I tried to implement the genes into animal minimalis to make this
def drag 50
cond
*.robage 0 =
start
.tie inc
stop
cond
*.robage 1 =
start
.deltie inc
stop
cond
*.robage 1 >
*.robage 21 <
start
*.maxvel .dn store
stop
cond
*.robage 20 <
start
*.drag *.nrg add *.robage 1 sub div .drag store
stop
cond
*.robage 22 =
start
*.drag *.maxvel div .maxvel store
stop
cond
*.robage 23 >
*.eye5 0 >
*.refeye *.myeye !=
start
*.refveldx .dx store
*.refvelup *.drag add .up store
stop
cond
*.robage 23 >
*.mass 1.1 >
start
30 .repro store
stop
cond
*.robage 23 >
*.eye5 50 >
*.refeye *.myeye !=
start
-1 .shoot store
*.refvelup .up store
stop
cond
*.robage 23 >
*.eye5 0 =
*.refeye *.myeye = or
start
314 rnd .aimdx store
stop
cond
*.robage 23 >
*.waste 40 >
start
.backshot inc
-4 .shoot store
*.waste .shootval store
stop
end
and by the way here is the original
cond
*.eye5 0 >
*.refeye *.myeye !=
start
*.refveldx .dx store
*.refvelup 30 add .up store
stop
cond
*.mass 1.1 >
start
30 .repro store
stop
cond
*.eye5 50 >
*.refeye *.myeye !=
start
-1 .shoot store
*.refvelup .up store
stop
cond
*.eye5 0 =
*.refeye *.myeye = or
start
314 rnd .aimdx store
stop
cond
*.waste 40 >
start
.backshot inc
-4 .shoot store
*.waste .shootval store
stop
end
Anyways I used F1 league conditions and faced both the bots against each other, though I made one change, one batch of tests was in thick fluid (left) and the other was in thin fluid (right). The total energy graphs have been uploaded showing the results from each of the three tests which each lasted about 1k cycles, red is modified, blue is original. Overall I'd say the modification helps though it seems to give the bot slightly random behaiviour sometimes.
-
Where are they uploaded?
-
Where are they uploaded?
oh opps I thought I attached them strangely though it does better in thin rather than thick fluid, by the way though I now have a better approach to this which is to use the epignematic memory locations.