Basically changing the velocity alters the flight path of the projectile. It's really more about physics than anything else. What you've mentioned about the walls, though, ought to not be allowed by the engine. The main problem isn't that you could shoot a bullet into the air and have it come down somewhere not far from you - you could, though it would be horribly inaccurate. The problem is that no one would actually do this, and so the gunpowder units should not be allowed to fire on very steep angles.
As for unit ranges... rather than take a lot of time to explain the physics of determining a unit's range, just suffice it to say that physics dictates that a 45 degree shot is always the best for range.
Luckily for us, there's a very useful tool I found to do all the necessary work relating velocities to range:
http://www.ajdesigner.com/phpproject...e_equation.php
All you have to do is put in 9.8 m/s^2 for gravity, the angle (45 degrees if the unit can shoot at that, otherwise as close to it in either direction as it is allowed to shoot), and the initial velocity the unit shoots at (from the projectile file), and out pops the maximum range the shot can go. Note that the result only holds for a shot that begins and ends at the same height. Firing uphill shortens the range, while firing downhill lengthens it. Uphill would include towers and walls which are somewhat elevated from the ground, and esp in the case of firing on towers could significantly reduce the unit's range.
The only thing the page doesn't do is backwards calculate the correct velocity to hit a given max range, but we can easily figure that out. R = ((v^2)/g)sin(2*theta) looks like the full equation it uses. Solving for v gives R/sin(2*theta)=((v^2)/g), then Rg/sin(2*theta)=v^2, then sqrt(R(g)/sin(2*theta)) = v. At 45 degrees sin(2*theta) is 1 since sin(90), so at the simplest level we can easily determine the right velocity to make a unit have max range R by finding the square root of R*(9.8 m/s^2), provided that the unit is capable of a 45 degree shot. For units that can't shoot at 45 degrees you'd have to keep and figure out the correct sin(2*theta) term, but even that is not too much work.
Bookmarks