Post 02 Jan 2011, 01:21 by JBSnorro
Ok, the range of bowmen has been established. About the trajectories, let me picture the problems it contains and sketch my solutions:
I created a program which took thousands of screenshots of a bowmen and a target in flat level in the original KaM. I captured every position of the arrow in every combination of the relative position of shooter and target, and after acquiring those it is only straightfoward work to get the offsets of the arrows in pixels. The logical thing to do is to put that in a file, and load that when TKE loads. So I have the data. Well, almost....
There are only four things I needed to account for. Firstly, I only covered half of all combinations of relative positions between shooter and target, since it is horizontally symmetric(actually in the original it isn't, but in TKE it will be). Secondly, the trajectories of the projectiles thrown by watchtowers and shot by ballistas aren't projected like that, but lineary, although I haven't verfied that assumption in the original. The third thing to think about is when the world isn't flat as in my testcase. To take heightdifferences into account I just scale the trajectory to fit the heightdifference. The fourth thing/problem I encountered was that the program did not capture arrowtrajectories when fired over very great distances, which can be accomplished when the target moves. I calculate these trajectories by taking the largest available trajectory in the same direction, and with some simple interpolating and extrapolation of that trajectory, I acquire a new trajectory which looks fine, but probably isn't exactly equal to trajectory the projectile would have in the original KaM.
If you have any question, I'd be happy to answer.
Edit:
There is a fifth thing, namely firing at buildings. I intend to find out what ratio of arrows shot at a building actually hit it. The exact percentage doesn't really matter, just a rough estimate will do. After a random coinflip has decided whether an arrow hits, I choose a targettile accordingly. On a random tile on the building if it is supposed to hit and otherwise on a random tile on the far side next to the building.