Code center > Suggestions
Cost for turning
PurpleYouko:
--- Quote ---That gives rather large values for turning however. I'll double check my work later tonight.
--- End quote ---
Sounds kind of expensive. We should aim a pretty low costs for rotation. Something like 1 point of energy for 1 full rotation (1256) of a bot with mass 1 and diameter 100
Fat bots will obviously cost a lot more, as will large bots.
Numsgil:
The above assumes a bot accelerates then decelerates between each cycle.
I got it from constructing a function for theta with resepect to time. THen differentiating it. Then again, to get alpha. Then using Force(t) * radius = I * alpha(t).
Force(t) = moment of inertia of a sphere / r * alpha(t).
abs(Force) = I / r abs(alpha(t)
Then I integrated abs(Force) over 0 to 1.
Point is I think that's an accurate physics function, assuming that bots turn using the same efficiency with which they move around, and that their little engines are strapped to either side of the bot for maximal torque.
PurpleYouko:
I don't disagree with your formula. It looks pretty accurate from a cursory glance.
All I am suggesting is to apply some kind of scale factor constant to keep total costs managable.
Numsgil:
Okay, here's a better system with easier math that I'm sure works:
Each bot gets a new variable which is it's angular velocity. It holds over between cycles, however, the .aimdx, .aimsx commands still work relative to no turning.
So a bot that wants to spin at a constant speed would do 5 .aimdx store every turn still.
Each bot is charged:
.002 * mass * radius * abs(new desired angular velocity - old angular velocity)
and new angle = old angle + new desired angular velocity) (That's a Euler approximation for you numerical analysis types).
nrg for the turn. I can show the work process I used to get this if you like, or not. Rest assured, it's an accurate mathematical model.
Now, say you aren't moving at all. Then you do 5 .aimdx store, then do nothing. What are you charged and when?
Well, the first turn you're charged .002 * mass * radius * (5-0) = .6 nrg for a normal bot.
Second turn, you're charged .002 * mass * radius * abs0-5) = .6 nrg for a normal bot.
So constantly spinning becomes a very good strategy still for when there's nothing to eat, since you're only charged for starting the spin and ending it. But turning constantly and drastically in combat uses alot of nrg. Trying to turn 90 degrees would cost nearly 38 nrg, and then another 38 nrg if you stop turning the turn after.
I think I'll also add a new component to a shot's vector that comes from the bot turning. If you're spinning really fast, the bullet is going to veer off from what you'd expect it to do if you weren't spinning. Like a sling.
PurpleYouko:
--- Quote ---Trying to turn 90 degrees would cost nearly 38 nrg, and then another 38 nrg if you stop turning the turn after.
--- End quote ---
That is horribly high :(
Charging this much to rotate a bot is going to make building a Multi-bot prohibitively expensive since each segment of a 6 part bot will have to make several turns that will total at least 720 degrees.
That is the only way I could make Hexagonis build his MB body and he isn't even cross tied. Adding that would make at least another 360 degrees.
720 degrees times 6 robots makes a total cost of 1824 energy just to form its structure.
If we implement this cost regime then we can pretty much say goodbye to large MBs altogether.
If you multiply the whole system by a factor of 0.01 (or possibly even 0.1) then it might be affordable otherwise the costs are just going to destroy any chance of MBs evolving or even being designable.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version