Kinetic Void

Kinetic Void

View Stats:
ichneumonid May 3, 2014 @ 12:37pm
Weapon Group Logic
I am having some inconsistent results using weapon groups so I thought I would ask for clarification on how the logic is intended to work. Things seem to work more consistently if I have mutually exclusive groups. For example, forward guns assigned to group 1, port to group 2, and starboard to group 3. By mutually exclusive I mean that guns assigned to group 2 and 3 are not assigned to group 1, each gun is assigned to ONLY one of the first three groups. This works well for attacking 3 ships at once where I can assign each group to a different target, but if I want to fire all weapons at one ship I need to assign groups 1, 2, and 3 to that target.

But when I try to assign all guns to group 1, and use 2 and 3 for port and starboard things become more inconsistent. With this setup the forward guns are assigned to group 1 only, but port guns are assigned to groups 1 and 2 and starboard guns are assigned to groups 1 and 3. The idea with this arrangement is I can use group 1 to fire all guns at a target, then, if I want to divert the port guns to a separate target I just need to assign group 2 to that target and the rest of the guns will remain on the first target. This seems to work well as long as I assign group 1 to the primary target, and then assign group 2 (or 3) to a secondary target. But as soon as I try to give new orders things don't behave as I expect, some guns stop firing and tracking targets, and some guns fire when they are not assigned to any target. It seems like the guns get confused about which orders to follow when they are in more than one group.

It makes sense to me that if a gun is in more than one group it should follow the most recent order, so, from the example above, a gun in both groups 1 and 2 should track the first target until it is ordered to track the second. When that gun is ordered to track a new target the other guns not in group 2 should not be affected by an order to group 2 guns. If group 1 is later assigned to a new target that means all guns should now track the new target, even those in group 2 as long as all the group 2 guns are also in group 1.

Is there a flaw in the code that is producing the inconsistent behavior or is my assumption about the logic of following the most recent order incorrect?