Code center > Bugs and fixes
Is this a bug?
PurpleYouko:
--- Quote ---I think we should consider .up to be the force applied by the bot and charge based on that force alone.
--- End quote ---
That is exactly how it works now.
The net acceleration change (from up dn sx dx) in the direction the robot is facing is first calculated.
This is the value that is charged for.
Additions of other accelerations (such as those caused by collisions) are added after costs are calculated, then adjustments to acceleration due to mass considerations are applied at the end.
This means that a fat robot with a mass of 2 storing 10 into .up will be charged 10 but will only acrue 5 extra speed.
A really skinny bot with a mass of 1/2 storing 10 into .up will be charged 10 but will acrue 20 extra speed
I have no idea where this strange behaviour of your robots is coming from. I will see if I can check it out as soon as my present F2 league run finishes.
I am currently up to 37 rounds in a battle between a new Hunter species and Light's Icarus. Hunter is up by 21 to 15 but that is still a statistical draw. A typical round lasts about 10,000 cycles so it is likely to take a while. :(
Shen:
Just wondering how maxvel figures into this? If I just write a gene that is constantly on with 50 .up store, will the bot get charged for the 50 or will it be decreased because of the velocity cap?
shvarz:
--- Quote ---This means that a fat robot with a mass of 2 storing 10 into .up will be charged 10 but will only acrue 5 extra speed.
A really skinny bot with a mass of 1/2 storing 10 into .up will be charged 10 but will acrue 20 extra speed
--- End quote ---
Well... see, I seem to remember that Numsgil changed that at some point.
Shen's question is good too. Because Alga grexa almost constantly stores 16 (or 17) in .up Will that bring it to high velocity and then allow it to stay there at little cost?
Numsgil:
Here's how it works:
Calculate how fast the robot wants to go.
cost = Sqr((Newaccelx / .mass) ^ 2 + (Newaccely / .mass) ^ 2)
Normalize speed so the bot isn't going too fast. Ie:
If tvel > Maxspeed Then 'limits speed to maxspeed
Reduce = tvel / Maxspeed
.ax = .ax / Reduce
'Newaccelx = Newaccelx / Reduce
.ay = .ay / Reduce
'Newaccely = Newaccely / Reduce
tvel = Maxspeed
End If
Does that answer any questions? My brain is tired right now
:D :D
PurpleYouko:
--- Quote ---cost = Sqr((Newaccelx / .mass) ^ 2 + (Newaccely / .mass) ^ 2)
--- End quote ---
The two Newaccel variables represent the x and y vectors of the acceleration applied only by up, dn, sx and dx
This is done before we calculate the actual change in velocity
--- Quote ---Well... see, I seem to remember that Numsgil changed that at some point.
--- End quote ---
He changed some of the code in that part of the program but this is the way the code is right now in th ecurrent version. I just checked. And the bits that Num just posted are directly out of 2 different parts of the source code.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version