Quote Originally Posted by antisocialmunky
I doubt that the game calculate by the real time position of the arrow except for animation purposes and impact. There's no need to since medieval men didn't use Zepplins, you just need to know where and when it will land and a few other things, More likely, when an arrow impacts, it calls a command that checks if a unit's hitbox is over spot and then applies the arrow's angle and the unit's direction to figure out what defense values to apply. That's a simple version of what I would do. Even then, you could calculate the point of impact and time of impact, with parabolic arcs so you don't even need the arrow to return where it will hit.

Guy.ShootArrow() creates an instance of arrow.
If (Arrow.ImpactsGround()) then check BigArrayOfUnitsInZone[] and then check if BigArrayOfUnitsInZone[].ArrayOfIndividualMen[] is .
If it is, then call ApplyArrowDamage(Arrow, BigArrayOfUnitsInZone[].ArrayOfIndividualMen[])

Or something.
This sounds like it's along the correct lines. It can't actually be using the test for when the arrow hits the ground, as some line-drive arrow trajectories would be calculated as hitting the ground way behind the man that ought to be getting hit. However if no unit is taller than say 10 feet, checking above that height can be entirely avoided, which helps a lot.

We also already know that the game calculates a firing trajectory based on what is in the way, so we can assume that if a man's hitbox is intersecting the arrow flight path, the game already knows about it since that level of collision detection (with the flight path, since it has to be preplotted) is already necessary to path the arrows correctly (avoiding the FF kills of RTW due to archers shooting their front row in the back of the head, as well as walls and trees and all manner of other things). That is to say, the game can see everything that intersects the flight path since it must to plot an unobstructed arrow path, and it will just choose to ignore men that do so on the downward portion of flight as they are targets. That being the case, all that remains is to see if something (it can only be a man at this point since the game plots around everything else) intersects the flight path during flight. If not, the arrow obviously falls harmlessly to the ground. If so, then you could check to see if the man still obstructs the flight path when his position is reached by the arrow, at which point he'd be hit. It should likewise be easy to tell when something closer gets in the way, at which point you'd track that man until he is no longer in the way, or the arrow reaches his position and he is hit.

Note that I'm not saying this is what the game is doing, or even speculating that, I'm just laying down a framework so people can have a better idea what could be going on, as few people probably have much knowledge about hit detection or what it might entail.