I agree, maybe somebody can post a feature request bug for it?
First, we'll need a new command type: "attack_moving". Note that the "Hold Position" commands map to a type of "attack_stopped" and that the type "attack" means travel into range and then begin (while not moving) attacking. Thus, we get into a lot of other complications, like why do you want to move when you are already close enough to attack. Well, the reasons are obvious, but have a lot of other implications. You may just want to be able to get from point A to point B and also shoot stuff while you're at it. But you may want to be moving to attempt to avoid getting hit. This opens up a WHOLE new can of worms, one that's still in my journal, but not yet in the bug database, and that's chance to hit and leading shots.
myles, wasn't it you that posted the request earlier this year for soldiers to be able to lay down or crawl on their bellies and have a lower chance to be hit? Well, I think this would be the time frame to include that. A moving target should be more difficult to hit for two main reasons: 1.) accuracy in leading your shot and 2.) predictability/changes in movement. Defending units could also have a natural chance to "dodge" attacks and attacks (currently 0%) and attacking units a chance to hit their targets (currently 100%). This would add a lot of complications to the game dynamics, but they could be comfortably ignored by mods that do not wish to use them, and dodge chance remains 0% while chance to hit remains 100%.
So back to rotating turrets, a lot of the new proposed animation enhancements (some are partially coded in 0.3) allow for gluing together different models and frames of animations, so a similar principle can be utilized to support rotating turrets and other movement + attacking animations. Here's a list of what I think will be involved briefly:
- New command type: attack_moving.
- Ability to restrict rotation speed -- this is currently calculated on a "what looks good" basis.
- Ability to restrict attack direction based upon current rotation of unit. Currently, if you want to attack a unit behind you, the attack begins immediately, even though the attacking unit is still rotating and hasn't faced it's target yet. Implementing this restriction will mean that you can only attack targets x degrees off center of your rotation (possibly zero). So if I'm shooting a fireball, I may have some kinetic control over it's path so I can shoot it 15 or 20 degrees off from the direction I'm facing (as an example), but if I'm a cannon, I must face exactly where I want my shot to hit.
- Addition of secondary rotation -- this will require another model glued together with some mechanism discussed above (still have to figure that one out) and secondary rotation will be applied to that.
- Ability to also restrict secondary rotation speed and attack direction.
- Secondary rotation to optionally include pitch rotation restrictions, so moving a cannon to aim at an air target may cause a delay in firing.
- Possible need for an "aim" command. This gets tricky because at currently, units only execute one command at a time. The exception for this is "set meeting point" which can be either queued or take immediate effect, bypassing whatever commands are being executed (and it doesn't behave like a true command anyway). However, it's likely that you may have tanks that are either stopped or moving and anticipate enemy units arriving from a particular direction (other than the direction you are facing) and want to tell them to face that way in anticipation. Thus, the "aim" command can't replace the existing command, but it would be more of meta-data on how to execute the current command. That will require some new infrastructure in the game code to implement and can be skipped in initial phases, I just don't see how it wouldn't eventually become necessary.
The rest of these aren't necessary for turret support, but seems (to me) to be important and related.
- Chance to dodge (currently 0%) - I already have a chance to fall down in an earthquake setting in the "fall_down" skill type, which isn't the cleanest way to do this. So perhaps we need some new base stats to manage these things more cleanly.
- Chance to hit (currently 100%, meaning that it will always hit location it intends to, although the target may no longer be there when the shot arrives). If an attack fails the check for chance to hit, they will fire off-target, but the attack should be allowed to possibly hit somebody else instead (even a friendly).
- Ability to lead shots, so a unit will aim for where it looks like their target will be when their shot arrives.
- Ability to have skills or command alter chance to dodge and hit.
- AI enhancements to accommodate all of this.
That's obviously a lot of stuff and it wont be done soon, but I believe it can be done.