This is a generic mech layout. The green arrow is the facing of the mech, the red arcs the range the weapons can aim in, and the yellow arcs the firearcs as Spring would handle them. Here, the body is aligned to the facing, so there is no problem. But when this happens...
...we have a problem. In the worst case scenario, the body can be pointed backwards, which effectively means the weapons can only aim through themselves.
I'm going for a more tactical game, with few units (20-30 per player would be considered 'a lot'), so a) expensive scripts to work around this aren't an issue and b) it's worth it when you have small numbers of units, that those units not act dumb.
With a 360 independent body, the unit should be able to aim with at least one of it's weapons in any orientation. The idea is this:
Against the unit's primary target (ie if the player has placed an attack order on something or whatever it's AI holds as the most dangerous target - how does default target priority work, by the way?), the unit will evaluate which is the most appropriate weapon against that target, and rotate it's body to bring it's arc of fire to bear. The other weapon can then target whatever else happens to be in its cone of fire. I'd like to expand on that (ie rotating the body so that both weapons can aim as best they can), but that's the key part. To this end, I have a few questions:
- How does the unit AI evaluate targets normally?
- Is there a way to force a weapon to try and pick a different target? (I think there is, I just can't remember how)
- What would be the best way to do target evaluation; unitscript or a gadget?
- Is there a reference of Spring specific lua functions anywhere? I mean for things 'Spring.GetUnitHealth(unitID)' etc
- What restrictions are there on what can be inside of a unit's lua script compared to a gadget?