only wanted to add - if you do what i said, which you probably wont anyway (i only deduce from that all our previous devs have been frightend about raycasting), you will need an offset totalling to one missile-diameter if you have more than one rocket pod or the rockets will collide a short distance before they hit target. you btw could do something similar for BE-dual cannons only that you calculate trajectory instead of a raycast (while assuming the impact being at the same height as the tanks origin). the trap here is that you can fire at lower positions, so you need a slightly bigger offset to compensate. or you could have it precise, but calculating the whole path considering collisions would be costly - but you could discretize the curve to a bearable level, you dont need traveltime*fps positions, the angle change over 10 frames should be small enough to have only traveltime*6 positions (assuming a 60fps server resolution) or even less. but for long shots it could still be a few hundred raycasts.
The code actually did contain a raycast to compensate for it and it will probably be added again. Unfortunately the previous implementation had problems with the situation you're describing. Offsetting cannons to compensate for gravity is an interesting idea. It can probably be done with a single trace. Not sure if it will feel right.
I did find that you can add entities by their collision type to a trace filter. So we could implement a similar system to what used to be implemented and filter out entities using the projectile collision type. This way the traces pass through the projectiles, eliminating the dual cannon issue.
You could use the previous trace, estimate the travel time and adjust the angle so it'll drop the right amount to hit the crosshair. Then you don't need to actually trace every step of the estimated path.
i still dont get it are we still talking about re-aligning the barrels based on the range at a given upwards aim angle?
wait, wait...were things adjusting direction to the crosshair and its range before? So that missile would have different direction based on the range you are aiming at, so that it would always hit the middle of your crosshair wherever you aimed at. I thought I remember something like that, just wasnt sure if I dont confuse it from other games or something. Or Iam just misunderstanding? Still, the crosshair does change its placement, so it seems like something like that was a thing. (or I guess thats only somewhat correct for close cannon shots) Just those tests I did few days ago seemed like thats not true, so now Iam not sure if it was a thing in empires or not. anyway, if I get it right...for missiles sure, but for cannons? please no whats the problem with dual cannon anyway?
It used to work like this: When you fire your weapon it runs a trace to get the end position (This is where your cursor is.) , then it fires the projectile toward that position from the weapon attachment point on the tank. The problem with this is that the implementation used to use the cannon1 attachment point for all weapons. (It still does on tanks with only 1 cannon slot.) Because of this it caused issues with weapon traces hitting the first projectile fired, and it would calculate the angles wrong for the second projectile to fire. One of the changes that was pushed out with 2.7.0 was to make weapons fire straight forward, but this is obviously quite game changing. I've reverted the change and also fixed traces hitting projectiles, but these changes need to be approved and pushed out with a hotfix.
Oh right, so I wasnt wrong when I said the directions were changing to the crosshair, allright. Thanks for explanation. So thats why when you fired both cannons at the same time, one would fly off somewhere completely else, right? I got used to shooting independently anyway, it also has better "time in area" coverage anyway, especially with HE and its splash. It doesnt happen then. I always thought it has something to do with the recoil of one of the shots messing with the other or so. Unless thats not what you meant by wrong angle for second projectile.