Bots and Simulations > Bot Tavern
Some fancy aiming:
googlyeyesultra:
Ah, yes; I have returned. After a ridiculously tiring trip, I have an aiming question. I'm working on a crude multi-bot, and I need to know the exact velocity of a shot in grids per cycle. Essentially, I'm working on a wacky bot that will lead when it shoots, hopefully ending the era of bots that ram each other in order to feed.
Anyways, what is this magical constant or formula to determine shot velocity?
EricL:
Two cases:
Shots initiated by a bot. The velocity/direction of such a shot is the vector sum of the firing bot's velocity at the time the shot was fired and a vector of length 40 in the direction the shot is fired +/- a random value of up to 20 degees. The value of 40 is legacy and stems from a day when bot radii were fixed. There is some evidence in the code that the intent is to make larger bots have higher shot velocities but this has not been implemented...
Shots returned as a consequence of being hit by a shot. These have exactly half the velocity (in the exact opposite direction with no random perturbance added) of the shot which caused them to be emitted. They do however, last twice as long as bot-initiated shots...
This is for 2.43. It's been played with over the versions. What is there now is the result of trial and error, especially w.r.t. increasing the chances of released nrg shots impacting the attacker.
One relatively simple addition I have been planning to do someday is to allow for shot velocity and lifetime to be under the control of the firing bot with some nrg cost logarithmicaly scaled to higher velocities and longer ranges. This would allow for sharks with laser beams if they were willing to pay the cost for high velocity shots...
googlyeyesultra:
First of all, I'd like to correct one of your statements. The returning shot has some portion of the hit bot's velocity added. That out of the way, does what you say essentially mean that if I have a bot that is fixed, it's shots will be fired at exactly 40 grids per cycle?
EricL:
--- Quote from: googlyeyesultra ---First of all, I'd like to correct one of your statements. The returning shot has some portion of the hit bot's velocity added.
--- End quote ---
Sorry, right. Meant to say that the returning shot's velocity is half the relative velocty of the impacting shot.
--- Quote from: googlyeyesultra ---That out of the way, does what you say essentially mean that if I have a bot that is fixed, it's shots will be fired at exactly 40 grids per cycle?
--- End quote ---
Yes. The diretion will vary +/- 20 degrees.
Jez:
I find this interesting w.r.t your post on 'should shots have mass' Eric, IIRC, which I doubt I do, isn't mass weight X speed or something? Somewhere along the lines of a small object travelling at a high velocity can cause the same damage as a large object traveling at a slow speed...
I'm not sure how you could calculate costs for such but should shot speed be adjustable as well as shot weigh/nrg?
Navigation
[0] Message Index
[#] Next page
Go to full version