Fixed that guard issue... maybe. In any case it is worth putting into the secondary orders restoration pull request. Anyway, I ran a few tests using a mini-rocket pod unit attacking a truck. Below is the current behavior that can be observed using the current patches in my branch.
Code: Select all
longRange: 1088
longHit: 10
shortRange: 512
shortHit 100
minRange: 128 (will not fire at something unless it is at least 1 tile from it)
Optimum range: The rocket-pod would try to get within shortRange before firing at the target (did not fire at long range distance).
Short range: Same as optimum.
Long range: The rocket-pod would fire at longRange, and if it gets within short range to the target, its accuracy used the shortHit value.
Then I swapped shortHit and longHit.
Code: Select all
longRange: 1088
longHit: 100
shortRange: 512
shortHit 10
minRange: 128
Optimum range: The rocket-pod would fire at the target as soon as it got within long range. If the target got within short range, the shortHit accuracy was used (did not move away to make its accuracy better).
Short range: The rocket-pod would only fire at the target if in shortRange distance.
Long range: Same as optimum
I tested a commander to check if range orders work on the units it is commanding. Seems to work.
Also, shortRange and longRange should never be the same value if shortHit and longHit are different. If they are, short range will take precedence and the weapon will use short range accuracy. Additionally, we wouldn't want shortRange to bigger than longRange's value, for sanity reasons.
What to do:
1. longhit, longRange, shortHit, and shortRange need to be tweaked for every weapon.
2. Optimum range needs to be improved so units move to the best accuracy range.
3. Stat checks for shortRange and longRange need to be implemented.
4. Optionally, make long range the default to keep with the "minimal impact" aspect.