Code center > Bugs and fixes

Got bots that behave differently in 2.37.6 and 2.42.4?

<< < (2/6) > >>

Elite:
Ok, here's the shooting bug

A single fixed bot in the centre of the screen fires at a veg. It's shots hit the veg but the energy shots that the veg returns don't reach the shooter bot.

PurpleYouko:
There was a routine that I modified back in 2.36 that set returned shots to have the same speed, duration and energy (not *.nrg type enrgy) as the incoming shot.

Prior to that they were all fixed values.

Sounds like it has gone out of whack in 2.4.

Numsgil:
Figuring out the math for returning shots is somewhat difficult.

You want it to have the maximum liklihood of finding the eating bot.  You would expect a bot moving at constant speed firing at a veg moving the same speed to feed successfully.  This took alot of work, but here's what I ended up with.  It would be good to check and see if this is how the VB version is handling it:

Returning shot's velocity = colliding bot's velocity - shooting shot's velocity / 2

EricL:

--- Quote from: Numsgil ---Returning shot's velocity = colliding bot's velocity - shooting shot's velocity / 2
--- End quote ---

This is the essence of the problem.  When shooting at a stationary bot, the returning shot's velocity will be half of the velocity of the incoming shot.  Since range is the number of cycles the shot lasts, this means that the return shot travels only half as far in it's lifetime.  

I have remedied this by doubling the "range" of returned energy shots.  Per the formula above, their return velocity from stationary targets will be half that of the incoming shot, but they will last twice as many cycles.

EricL:
Note that there is an additional issue of much smaller magnitude (nerdly vector math pun intended).  Whereas regular shots begin their journey right at the edge of the firing bot's radius, the starting position of a returned shot is presently specified as the position of the incoming shot at the end of the cycle where the impact of the shot on the bot was detected.  But of course, this is not the actual point of impact - it happened sometime during that cycle.  The actual point of impact is somewhere back along the shot's trajectory.   The faster the incoming shot is traveling, the further it will have penetrated inside the target bot during that cycle.  Thus, at present, returning energy shots start from somewhere inside the bot, not at the edge of the bot.  How far inside is a function of how fast the incoming shot was traveling.

The good news is that I think the shot collision routine takes into consideration shots which pass all the way through a bot in a cycle, either through the edge on a glancing shot or right through the meat of small bot (though it appears it may not take into consideration the target bot's own velocity when determining shot collisions, only the taget bots position at the end of the cycle).  So, for glancing shots, return shots may actually start from outside a tagetted bot or for small bots, even behind them!!!!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version