Author Topic: how to make a bot go at the simulations max velocity all the time!  (Read 3158 times)

Offline fulizer

  • Bot Destroyer
  • ***
  • Posts: 198
    • View Profile
    • http://www.freewebs.com/explodeimplode/
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.
"If this is coffee bring me tea, If this is tea, bring me coffee"

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
how to make a bot go at the simulations max velocity all the time!
« Reply #1 on: March 31, 2008, 11:46:16 AM »
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.
« Last Edit: March 31, 2008, 11:51:24 AM by EricL »
Many beers....

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7715
    • View Profile
how to make a bot go at the simulations max velocity all the time!
« Reply #2 on: March 31, 2008, 12:38:31 PM »
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.

Offline fulizer

  • Bot Destroyer
  • ***
  • Posts: 198
    • View Profile
    • http://www.freewebs.com/explodeimplode/
how to make a bot go at the simulations max velocity all the time!
« Reply #3 on: April 01, 2008, 08:39:30 AM »
oh fair enough
but a bot like this still gets the advantage over those that dont
« Last Edit: April 01, 2008, 08:42:43 AM by fulizer »
"If this is coffee bring me tea, If this is tea, bring me coffee"

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
how to make a bot go at the simulations max velocity all the time!
« Reply #4 on: April 01, 2008, 11:52:31 AM »
Quote from: fulizer
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.
Many beers....

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7715
    • View Profile
how to make a bot go at the simulations max velocity all the time!
« Reply #5 on: April 01, 2008, 01:39:38 PM »
If you have turbulent drag set up especially, moving at maxvel requries way too much nrg.

Offline fulizer

  • Bot Destroyer
  • ***
  • Posts: 198
    • View Profile
    • http://www.freewebs.com/explodeimplode/
how to make a bot go at the simulations max velocity all the time!
« Reply #6 on: April 02, 2008, 09:03:05 AM »
fine  
"If this is coffee bring me tea, If this is tea, bring me coffee"

Offline ashton15

  • Bot Builder
  • **
  • Posts: 99
    • View Profile
how to make a bot go at the simulations max velocity all the time!
« Reply #7 on: March 13, 2010, 05:35:22 PM »
Quote from: fulizer
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
« Last Edit: March 13, 2010, 05:52:52 PM by ashton15 »

Offline Ammeh

  • Queen of the Internets
  • Bot Destroyer
  • ***
  • Posts: 169
    • View Profile
how to make a bot go at the simulations max velocity all the time!
« Reply #8 on: March 13, 2010, 06:53:15 PM »
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: [Select]
*.nrg .drag storewhich just stores the amount of energy into drag
to
Code: [Select]
*.drag *.nrg sub .drag store
which stores change in energy into drag.
« Last Edit: March 13, 2010, 06:53:26 PM by Sammeh »

Offline Houshalter

  • Bot Destroyer
  • ***
  • Posts: 312
    • View Profile
how to make a bot go at the simulations max velocity all the time!
« Reply #9 on: March 13, 2010, 08:40:51 PM »
Quote
Code: [Select]
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.

Quote
Code: [Select]
cond
*.robage 1 >
*.robage 22 <
start
.deltie inc
*.maxvel .up store
*.nrg .drag store
stop
same thing. The ".deltie inc" could be replace with:
Code: [Select]
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:
Code: [Select]
*.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.
« Last Edit: March 13, 2010, 08:49:09 PM by Houshalter »

Offline ashton15

  • Bot Builder
  • **
  • Posts: 99
    • View Profile
how to make a bot go at the simulations max velocity all the time!
« Reply #10 on: March 14, 2010, 09:24:42 AM »
Ok I tried to implement the genes into animal minimalis to make this

Code: [Select]
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

Code: [Select]
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.
« Last Edit: December 22, 2011, 11:59:00 AM by Shasta »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7715
    • View Profile
how to make a bot go at the simulations max velocity all the time!
« Reply #11 on: March 17, 2010, 04:27:46 PM »
Where are they uploaded?

Offline ashton15

  • Bot Builder
  • **
  • Posts: 99
    • View Profile
how to make a bot go at the simulations max velocity all the time!
« Reply #12 on: March 17, 2010, 06:05:41 PM »
Quote from: Numsgil
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.