Difference between revisions of "Craft Combat Mechanics"

From UFOpaedia
Jump to navigation Jump to search
(→‎UFO Accuracy Mechanics: Updated with Xusilak and Tycho's explanation)
 
(20 intermediate revisions by 5 users not shown)
Line 1: Line 1:
This article attempts to summarise everything we know about air combat game mechanics, a pretty murky area at present. I will also put here the results of testing and investigation I'm doing. [[User:Spike|Spike]] 15:26, 3 July 2009 (EDT)
+
This article attempts to summarise everything we know about craft combat game mechanics - particularly what happens in the Interception Window. This started with some empirical research I did, and has been greatly enhanced by code decompilation done by Xusilak, Seb76, Morgan525/Tycho, and others. [[User:Spike|Spike]] 19:08, 8 September 2012 (EDT)
  
= General Behaviour =
 
 
 
== Survival Time of Multiple Attackers ==
 
 
Engaging a UFO with more than one attacking aircraft makes the UFO split its fire. This gives the attacking aircraft more time to perform attacks, before either being destroyed or being forced to disengage.
 
 
The following table gives the increased average survival time of attacking ships. The test scenario used XCom craft in Aggressive mode. The UFO was a Terror Ship. The test scenario did not consider survival by eliminating the UFO (the XCom craft were effectively unarmed). This was a pure endurance situation, the worst case scenario.
 
 
# of Attackers  Avg Survival Time  Expected  Deviation
 
    1          1.0 - nominal      1.0      100% nominal
 
    2          1.5                2.0      75%
 
    3          2.5                3.0      83.33% (5/6)
 
    4          3.0                4.0      75%
 
 
This is a slightly surprising result. In principle, if the total damage output of the UFO was constant, the average survival time would just be divided by the number of attackers; e.g. 2x as long for 2 attackers, 3x as long for 3 attackers, etc. The UFO actually seems to be doing <b>more</b> damage, or killing targets faster, when facing multiple XCom opponents. This is a result that requires an explanation. The survival time is measured in (zero-damage) rounds fired by the XCom aircraft. So another possibility is that the XCom aircraft are somehow able to fire more rounds when multiply engaged. However I don't think this is the case. It was not systematically tested but the XCom fire rates do not seem to increase noticeably when multiply engaged.
 
 
: The results for 1, 2 and 4 attackers would be consistent with the UFO going into Aggressive Mode from Standard Mode when faced with multiple attackers. This would increase its RoF by 1/3, giving a 4/3 firepower increase and thus a 3/4 survival time for XCom. The attack mode is saved in INTER.DAT. It would be worth comparing saves of a single XCom interceptor with saves of multiple interceptors, and seeing what attack mode the UFO is in. Also to retest with more granularity (Cannon instead of Avalanche timers), in case the data for 3 attackers is actually nearer 2.25 = 75% [[User:Spike|Spike]] 16:13, 15 March 2010 (EDT)
 
  
 
= X-Com Behaviour =
 
= X-Com Behaviour =
  
 +
<i>Note: In all of the following sections, I refer to "game seconds". But actually this is a supposition. What I'm actually measuring is <b>multiples of the firing interval of a standard Cannon</b>. This is stated in the in-game UFOPaedia to be 2 (game) seconds. It may or may not be meaningful to talk about these being actual game seconds. Maybe they are no more than multiples of the Cannon firing interval. And quite possibly the Cannon firing interval itself is not fixed, but is variable.</i>
  
  
== Testing the Effects of Range and Attack Mode ==
 
  
 +
== Rate of Fire ==
  
 +
Rate of Fire is hugely important, as (along with accuracy and damage) it is a major determinant of firepower (the rate at which damage is inflicted on an enemy craft). It turns out that the in game UFOPaedia information on rates of fire is significantly incorrect.
  
I did some tests on timing events in the Interception Window. In particular, I was interested in seeing how long an XCom aircraft is exposed to enemy fire, whilst closing range to the target. In other words, what happens when the XCom aircraft's weapons do not give it a full stand-off advantage.
+
=== Observed Rates of Fire ===
 
 
My test rig for this was to hack up a "magic weapon" to use as a timer. This was a modified Cannon that does no damage, with range increased to the maximum/opening range in the interception window. I use the 2 game second (2gs) firing interval of the Cannon as a timer.
 
 
 
<i>Note: In all of the following sections, I refer to "game seconds". But actually this is a supposition. What I'm actually measuring is <b>multiples of the firing interval of a standard Cannon</b>. This is stated in the in-game UFOPaedia to be 2 (game) seconds. But (as we will see below), the in-game statements of firing intervals of craft weapons are neither accurate or consistent. So it may or may not be meaningful to talk about these being actual game seconds. Maybe they are no more than multiples of the Cannon firing interval. And quite possibly the Cannon firing interval itself is not fixed, but is variable.</i>
 
 
 
I hacked the executable by using XComUtil and editing the XComUtil.cfg configuration file, then rerunning xcusetup.bat to reinstall XCU. I discovered that XCU was not apparently able to reliably change the fire rate of weapons, so I stuck with the game default values (eg 1 per 2 gs for Cannon). Here are my findings:
 
 
 
# In the Interception Window, all aircraft close range with the enemy at the same rate (measured in shots fired).
 
## This is regardless of whether the aircraft is an Interceptor (2100 kts, Acc=3) or an Avenger (5400 kts, Acc=10).
 
## This is also regardless of whether the attack mode is Cautious, Standard, or Aggressive
 
## Of course, the range that the aircraft will attempt to close to, and hold, does depend on the attack mode
 
## The approach speed of 2 mutually approaching aircraft is 0.5km per game second, i.e. 1800 kmh / 900 kts (assuming the Cannon rate of fire to be 1 per 2 game seconds).
 
## Evidence for this:
 
### Closing from 70km to 30km, 40 volleys of Cannon fire are fired, at 1 / 2gs
 
### 40 volleys x 2gs = 80 gs time taken to close
 
### 40km / 80gs = 0.5 km/s
 
## This was also cross checked with a (hacked) Stingray launcher (zero damage, 75km range, 100 rounds) as the timer.
 
### Closing from 75km to 0km. 10 rounds fired. Stingray fire rate is 1 / 15 or 16gs
 
### 10 x 15 gs = Time taken was 150 - 160 gs,
 
### 75km / 150 gs = 0.5 km/s
 
# The fire rate for missiles varies with the attack mode, but the fire rate for cannon type weapons seems to be unchanged. See more below.
 
# Or it's just barely possible that the fire rate, and the closing speed, both change by the same margin and remain in the same ratio.
 
## However I think this is unlikely and it violates Occam's Razor.
 
## Also, even if true, it doesn't really make any difference.
 
# The initial opening range on the Interception Window is 75km (600 distance units).
 
## That is the maximum distance visible, at the top of the window. Opening range = maximum range.
 
## UFOs seem to often settle at 70km range, if they are able to control the range.
 
## XComUtil does not let you enter a weapon range value above 75km. Probably Scott Jones was aware of this limit.
 
# Clearly, the Geoscape phase of Interception is different from the Interception Window
 
## Geoscape time freezes while you are in the Interception window
 
## Nothing happens at all until you hit the first button, so there's no rush
 
## On the Geoscape, relative aircraft speed is highly significant to whether an interception is possible.
 
## Probably so is Acceleration.
 
# Caveats
 
## I didn't try multiple aircraft interceptions. Maybe these are different.
 
## I only tried one target type, a Small Scout (speed 2200 kts). It would be prudent to try other target types though.
 
## I think there's enough granularity in the tests I did (45 data points, greater than 100% difference in speed and acceleration between Interceptor and Avenger). But more is always good.
 
## I didn't test the speed of breaking off, or the speed of opening range after the initial closing. It's possible this is affected by aircraft speed and/or relative speed, and/or by acceleration.
 
# Misc Notes
 
## XComUtil does not let you enter an ammo capacity higher than 200. Other sources claim the field can be hacked higher than this.
 
## There is a bug in the in-game UFOPaedia. It mistakenly reads the damage value field when reporting the hit chance for a craft weapon. Hence:
 
### Cannon shows 10% not 25%
 
### Avalanche shows 100% not 80%
 
### Laser Cannon shows 70% not 35%
 
### Plasma Beam shows 140% not 50%
 
### Fusion Ball shows 230% (!!!) not 100%
 
### Possibly the reason this bug was missed is that the first weapon in the data files, Stingray, actually does have Dmg = %Hit
 
 
 
[[User:Spike|Spike]] 19:38, 2 July 2009 (EDT)
 
 
 
 
 
 
 
: From my own experience: Attack mode only adjusts the range of the inteceptor and UFO. The actual distance between the ships however influences how fast the weapon exchanges go. The closer they are the faster the exchange. However, I believe this is all at the same rate of fire - it just plays out faster between that particular interceptor and UFO (in the case of multiple interceptors).
 
 
 
: By the way, when a UFO flees and you minimize the screen before it goes out of range, and then you chase after it and catch up to it again and then re-open the screen, the UFO will be way out of range as you close in on it. I guess in a way, real world position does influence position of the UFO at the time the interception window is opened. -[[User:NKF|NKF]] 02:52, 3 July 2009 (EDT)
 
 
 
----
 
 
 
Hi NKF. Actually I've found attack mode does affect some important variables and I will reveal all as soon as I get to a proper PC - in transit right now. There is the question of whether fire rate increases at shorter range - the "Space Invaders Effect" - and whether it is real in terms of game time units, or just subjective on the user display. I still don't know though I have seen no evidence for it and pretty good evidence against. But not conclusive and to be honest I have avoided test situations where that might happen in order to reduce variables in my tests. So there might be such an effect.
 
 
 
I am not sure I understand your point about re-engagement. To me it makes sense that Interception always opens at maximum range, since the presumption is that the target has opened the range beyond effective combat range, and then susbequently in the Geoscape we have closed again to within the outer limits of combat range, triggering the Intercept window. Or have I misunderstood what you are saying?
 
 
 
Anyway I hope to be able to write something soon to put together most of how the air combat system works, or at least a good chunk more of it, at least from the human side.
 
 
 
[[User:Spike|Spike]] 15:02, 3 July 2009 (EDT)
 
 
 
:: To test range/ROF You may want to test dual interceptors with your magic test weapon. Have both armed with one test weapon and have one interceptor arm a cannon/laser cannon. Set both to standard range. The one with the cannon/laser cannon would obviously have to be much closer. Watch your test weapon's ammo consumption.
 
 
 
:: What I meant with re-engaging a UFO that had previously fled, but you then minimized the window before it went beyond the limits of the intercept screen (and thus keeping the intercept window 'live' even though it's beyond intercept range). When the UFO slows down enough for the interceptor to catch up, and you then re-open the intercept screen, the UFO will sometimes be way off the screen. I'm guessing this is based off your actual distance in the Geoscape at the time you re-opened that interceptor's intercept window. Also I'm guessing the UFO must be in a fleeing-state for the intercept window to automatically shut itself down once it's beyond range. Heh, not sure if that made any sense. -[[User:NKF|NKF]] 23:00, 3 July 2009 (EDT)
 
 
 
== Observed Rates of Fire ==
 
  
 
The quoted fire rates (or rather fire intervals) in the in-game UFOPaedia are wrong. Results from experiment show the following provisional information:
 
The quoted fire rates (or rather fire intervals) in the in-game UFOPaedia are wrong. Results from experiment show the following provisional information:
  
  Weapon:        Fire Interval in Game Seconds    UFOPaedia
+
  Weapon:        Average Fire Interval (gs)      UFOPaedia
                 Aggressive/Standard/Cautious       Value
+
                 Aggressive/Standard/Cautious     Value (gs)
 
  Cannon                  2 /  2 /  2                2
 
  Cannon                  2 /  2 /  2                2
 
  Laser Cannon            12 / 12 / 12                4
 
  Laser Cannon            12 / 12 / 12                4
Line 111: Line 24:
 
  Avalanche              24 / 36 / 48                20
 
  Avalanche              24 / 36 / 48                20
 
  Fusion Ball            16 / 24 / 32                25
 
  Fusion Ball            16 / 24 / 32                25
 +
 +
Since there is some uncertainty as to whether X-Craft fire rates are constant or variable, and whether the actual fire interval of a Cannon actually is two game seconds (other than "by definition"), this can be restated in multiples of the Cannon fire interval:
 +
 +
Weapon:        Average Fire Interval (vs C)    UFOPaedia
 +
                Aggressive/Standard/Cautious    Value (vs C)
 +
Cannon                  1 /  1 /  1                1
 +
Laser Cannon            6 /  6 /  6                2
 +
Plasma Cannon            6 /  6 /  6                3
 +
Stingray                8 / 12 / 16                5
 +
Avalanche              12 / 18 / 24                10
 +
Fusion Ball              8 / 12 / 16                12.5
  
 
These fire rates/intervals are significantly different from those previously understood. In particular we see a massive increase the relative fire rate of conventional Cannon versus other weapons, identical fire rates for Plasma Cannon and Laser Cannon, and quite similar fire rates as between advanced Cannon and Stingray launchers. This has a major impact on computed firepower and payload characteristics for all weapons, and on the relative differences between weapons.  
 
These fire rates/intervals are significantly different from those previously understood. In particular we see a massive increase the relative fire rate of conventional Cannon versus other weapons, identical fire rates for Plasma Cannon and Laser Cannon, and quite similar fire rates as between advanced Cannon and Stingray launchers. This has a major impact on computed firepower and payload characteristics for all weapons, and on the relative differences between weapons.  
  
It should be noted that in almost every case, these observed fire interval values deviate from the advertised values, and in fact they deviate from values coded into the "craft" data structures of the game executable, which have been retrieved by code digs. The observed values don't even have the same relative relationship as the reported values. Experiment has shown that modifying the reported fire interval values in the executable has <b>no effect</b> of any kind on the observed rate of fire. The conclusion, based on the observed data, must be that the game is ignoring the reported fire intervals in the craft data structure, and hard coding rate of fire values into the air combat algorithms. The fire intervals in the craft data structure are being ignored.  
+
It should be noted that in almost every case, these observed fire interval values deviate from the advertised values, and in fact they deviate from values coded into the "craft" data structures of the game executable, which are shown by the in game UFOPedia. The observed values don't even have the same relative relationship as the reported values. The fire intervals in the craft data structure are ignored in combat.  
  
''I've done some more tests and these confirm that hacking the fire intervals in the craft weapon data structures (of XCom craft weapons) has no effect.'' [[User:Spike|Spike]] 20:09, 13 July 2009 (EDT)
+
=== Projectile Travel Time ===
  
'''Also consider that all missiles AND cannons actually travel to their target and have a speed delta that is added on top of the XCraft's.  This information is the first four numbers before the weapons' rates of fire in the executable.''' [[User:Morgan525|Morgan525]] 07:03, 3 July 2012 (EDT)
+
'''Also consider that all missiles AND cannons actually travel to their target and have a speed delta that is added on top of the XCraft's.  This information is the first four numbers before the weapons' rates of fire in the executable.''' [[User:Morgan525|Tycho]] 07:03, 3 July 2012 (EDT)
  
 
: Though logically, the projectile speed won't affect the rate of fire, it should just create 1. a start lag between the start of firing, and the first hit/miss 2. an end lag, of wasted rounds fired that were fired before the UFO was shot down/escaped, but were still in-flight when the UFO was shot down/escaped. The projectile speed should not affect the actual rate of fire, apart from these lags. Of course, in average use, the lag factors will affect the average effective operational rate of fire, and the average operational ammo consumption per engagement.
 
: Though logically, the projectile speed won't affect the rate of fire, it should just create 1. a start lag between the start of firing, and the first hit/miss 2. an end lag, of wasted rounds fired that were fired before the UFO was shot down/escaped, but were still in-flight when the UFO was shot down/escaped. The projectile speed should not affect the actual rate of fire, apart from these lags. Of course, in average use, the lag factors will affect the average effective operational rate of fire, and the average operational ammo consumption per engagement.
 
: Do you see any evidence of the distance to target changing in Cautious vs Standard vs Aggressive attack mode? I didn't see any, but my methods are pretty crude compared to yours. [[User:Spike|Spike]] 17:57, 3 July 2012 (EDT)
 
: Do you see any evidence of the distance to target changing in Cautious vs Standard vs Aggressive attack mode? I didn't see any, but my methods are pretty crude compared to yours. [[User:Spike|Spike]] 17:57, 3 July 2012 (EDT)
''If you mean for missiles, no.  The part of the interception subroutine that handles missiles only tracks the distance each missile travels and then compares this to the distance to target of the UFO *from the Xcraft* and the maximum range of the missile. If the distance traveled equals the distance to target, it goes through the attack sequence. Each missile is calculated separately but I think the randomization routine is old and since the attack for both missiles, fired in tandem, are calculated microseconds apart, you get nearly the same number generated for both.''[[User:Morgan525|Morgan525]] 06:37, 4 July 2012 (EDT)
+
''If you mean for missiles, no.  The part of the interception subroutine that handles missiles only tracks the distance each missile travels and then compares this to the distance to target of the UFO *from the Xcraft* and the maximum range of the missile. If the distance traveled equals the distance to target, it goes through the attack sequence. Each missile is calculated separately but I think the randomization routine is old and since the attack for both missiles, fired in tandem, are calculated microseconds apart, you get nearly the same number generated for both.''[[User:Morgan525|Tycho]] 06:37, 4 July 2012 (EDT)
 
:: Actually you are right that projectile speed vs distance would affect rate of fire, IF only one projectile (or any limited number of projectiles) were allowed to be in flight at the same time. For cannons this is definitely not true, you can see in the interception window that multiple projectiles are in flight. But this might be the case with missiles. If only one missile is allowed in flight (per launcher), then RoF will be strongly determined by projectile speed vs distance to target. In a lot of my tests I "controlled" for distance by hacking all weapon ranges to 70km, so that the distance to target was always 70km. Maybe I should have done more tests with variable range. I did do some tests with variable range, enough to convince myself it wasn't a factor, but maybe I was wrong. Maybe projectile speed vs distance is a factor, but only for missiles, and maybe that somehow explains the differences in effective rate of fire for missiles in Cautious vs Standard vs Aggressive mode? [[User:Spike|Spike]] 23:14, 6 September 2012 (EDT)
 
:: Actually you are right that projectile speed vs distance would affect rate of fire, IF only one projectile (or any limited number of projectiles) were allowed to be in flight at the same time. For cannons this is definitely not true, you can see in the interception window that multiple projectiles are in flight. But this might be the case with missiles. If only one missile is allowed in flight (per launcher), then RoF will be strongly determined by projectile speed vs distance to target. In a lot of my tests I "controlled" for distance by hacking all weapon ranges to 70km, so that the distance to target was always 70km. Maybe I should have done more tests with variable range. I did do some tests with variable range, enough to convince myself it wasn't a factor, but maybe I was wrong. Maybe projectile speed vs distance is a factor, but only for missiles, and maybe that somehow explains the differences in effective rate of fire for missiles in Cautious vs Standard vs Aggressive mode? [[User:Spike|Spike]] 23:14, 6 September 2012 (EDT)
  
== Effect of Attack Mode on Rate of Fire ==
+
=== Effect of Attack Mode on Rate of Fire ===
  
 
The other major observation in the data above is that Attack Mode does influence rate of fire, but only for missile/launcher weapons. If we take Aggressive mode as the baseline, firing intervals for <i>launched weapons only</i> increase as follows:
 
The other major observation in the data above is that Attack Mode does influence rate of fire, but only for missile/launcher weapons. If we take Aggressive mode as the baseline, firing intervals for <i>launched weapons only</i> increase as follows:
Line 136: Line 60:
 
In effect this penalises launcher weapons when used at stand off range (Standard), especially when weapon types are mixed on the same aircraft (Cautious). Conversely, it gives a high offensive premium to conducting launched weapon attacks in Aggressive mode, conceding the defensive advantage of stand-off range.
 
In effect this penalises launcher weapons when used at stand off range (Standard), especially when weapon types are mixed on the same aircraft (Cautious). Conversely, it gives a high offensive premium to conducting launched weapon attacks in Aggressive mode, conceding the defensive advantage of stand-off range.
  
== Firepower Based on Observed Rates of Fire ==
+
=== Firepower Based on Observed Rates of Fire ===
  
 
The observed rates of fire change the firepower relationships between weapons.  
 
The observed rates of fire change the firepower relationships between weapons.  
Line 154: Line 78:
 
                 1/32    Cau      230
 
                 1/32    Cau      230
  
(The firepower value is an arbitrary relative number based on 16gs of firing)
+
(The firepower value above is just an arbitrary relative number based on 16gs of firing)
  
 
Observations: since even paired launchers must be used in Standard attack mode in order to maintain stand-off distance, it's interesting to compare their Standard firepower figure with the figures for the cannon weapons. In which case we see, for example, that the Laser Cannon is a very close match for the Avalanche in firepower - and can keep firing for 400 game seconds (gs) rather than the Avalanche's endurance of (in Standard mode) 72gs. Of course, stand-off distance is itself a massive advantage which cannot be ignored.
 
Observations: since even paired launchers must be used in Standard attack mode in order to maintain stand-off distance, it's interesting to compare their Standard firepower figure with the figures for the cannon weapons. In which case we see, for example, that the Laser Cannon is a very close match for the Avalanche in firepower - and can keep firing for 400 game seconds (gs) rather than the Avalanche's endurance of (in Standard mode) 72gs. Of course, stand-off distance is itself a massive advantage which cannot be ignored.
  
== Effect of Range on Rate of Fire ==
+
=== Where Rate of Fire Is (Not) Coded ===
  
It's likely that the perception that range can affect rate of fire just arises from the fact that attack mode affects both rate of fire AND range. However this should be tested.  
+
There are no effects from changing the game executable XCom craft weapon data firing interval offsets (starting at offset 0x6fb18 in WinCE geoscape.exe). Neither for missile-type weapons nor gun-type weapons. There is an RoF effect when changing offset 0x10 of UFOs in the craft data at 0x6f9a8. This affects the built-in weapons of UFOs only, and is not used for XCom craft. My conclusion is that the RoFs values in the craft weapon data structure for XCom craft weapons are ignored in combat, that the actual values are hard coded elsewhere in the executable, and are proportional to the values given above at [[UFO Interception#Observed Rates of Fire|Observed Rates of Fire]]. The only effect of hacking these craft data weapon values is to change what is listed in the in-game UFOPaedia; there is no actual combat effect.  
  
Test strategy:
 
  
Attack in Standard mode with different weapons. Hack the ranges of either or both weapons. This allows the actual firing range of the longer-ranged weapon to be controlled to any arbitrary value. Set the range of the shorter-ranged weapon to be eg 25/50/75% of the range of the longer ranged weapon.
 
  
Actually for direct comparisons, you need 2 hacked short ranged weapon and probably one unhacked longer ranged weapon "C" which you are testing (eg Avalanches). Then put up 2 aircraft, one with short range weapon A at 25% of the range of C, and the other with short range weapon B at eg 50% of the range of C. Then attack with both at the same time and watch the ammo counters on the C. As usual, set the damage of all weapons to zero so that the experiment is not interrupted by the untimely destruction of any craft!
+
== Damage Mechanics ==
  
----
+
Air combat damage inflicted by X-Com craft is  a random value between 50% and 100% of the listed damage, which should be understood as the <i>maximum</i> damage. Unlike for Battlescape combat, the listed damage value is not the expected value per hit. The expected damage per hit will be 75% of the listed damage.
  
A high ammo count for the launchers will also assist.  
+
In contrast, damage inflicted by alien craft is 0-100% of the listed weapon power (damage), which again should be interpreted as a maximum damage value. In this case the expected average damage per hit will be approximately 50% of the UFO/USO's listed weapon power.
 +
 
 +
This has been validated by decompilation analysis performed by Morgan525/Tycho. See [[User:Morgan525#Comparison_of_Damage_routines]]
 +
 
 +
== Accuracy Mechanics ==
  
Just to round off the attack mode test towards the end, it might be a good idea to have a test weapon that has a range equal to standoff range (or even beyond) to see how standoff range behaves as an attack mode. A standoff range cannon would certainly be something to look at. -[[User:NKF|NKF]] 18:13, 4 July 2009 (EDT)
+
Accuracy is a function of the weapon type used, as listed in the in-game UFOPaedia. Unlike ground combat there are almost certain to be no skill factors involved. There are <i>probably</i> no tactical factors involved. There is some speculation that different Attack Modes might create accuracy modifiers, but no hard evidence. This needs to be tested. The testing should control for Attack Mode and for range (separately), to make sure these don't have an impact on accuracy. They should also control for target size/type in case that is a factor.
  
:I have been hacking pretty much everything up to 100 ammo as that gives good granularity and a nice round number to work from. It's a good suggestion about Standoff mode, it didn't occur to me to test that - even though I had weapons set at 75km. From memory nothing happens until you select one of the 3 other attack modes - but I will check again. [[User:Spike|Spike]] 19:13, 4 July 2009 (EDT)
+
:I can confirm this as [[User_talk:Morgan525#Decompiled_accuracy_algorithm.3F|I have found the algorithm]] in the executable. See my discussion page. [[User:Morgan525|Tycho]] 06:39, 3 July 2012 (EDT)
  
:OK I've confirmed this and amended the main page. Re your question, even if the range of the weapon is hacked to equal or exceed standoff range, it does not fire when in Standoff mode (or in Disengage). So Standoff mode also appears to mean "Weapons Safe". In fact, with a hacked weapon range, you can have the curious phenomenon that the aircraft actually ''pulls back'' from Standoff range (70km) to maximum firing range (eg 75km) when ordered into a Standard/Cautious attack. [[User:Spike|Spike]] 07:05, 5 July 2009 (EDT)
+
The standard algorithm for X-Com attack accuracy varies with target size but not with game difficulty level (nor with attack mode). The formula is:
  
----
+
[1+(3/UFOsize)]/2 * Weapon Accuracy
Another interesting result. A UFO with a hacked weapon range of 75km will open fire immediately, even if the XCom Craft is at Standoff range. In normal play, the UFO never initiates the attack. The status window message even reflects this "UFO Returns Fire!". In effect, XCom normally controls the initiation of hostilities, by choosing if and when to move into weapon range. The UFOs always react to XCom moves but never initiate. The hacked weapon situation is different. (It also makes testing harder since you have to hit an Attack button quickly or the UFO gets an unfair head start, skewing the numbers). I might try using 69km for testing. It still makes the period of time while the UFO is closing into range pretty insignificant. But it allows me to control when the "clock" starts on the test. [[User:Spike|Spike]] 14:43, 5 July 2009 (EDT)
 
  
----
+
With the UFOsize value going down as UFOs get bigger. In other words, for a typical Medium (size=3) target, the adjusted accuracy is equal to the base unadjusted weapon accuracy.  
Further results: Equip 2 craft with Fusion Ball Launchers and Stingrays. According to the published fire interval numbers (25 and 15 respectively) these have different rates of fire. By observation, they have the same rate of fire. This is seen on Beginner and Superhuman. It is seen on Aggressive, when ranges are the same, and it is also seen on Cautious, when the FBL attacks at more than twice the range of the Stingray. This is using 100 rounds for each weapon, and about 5 trials. I think this proves conclusively that rate of fire does '''not''' vary with range.  
 
  
<s>However, I'm still not sure how to reconcile 2 facts:
+
[[UFO Extender]] / [[TFTDextender]] provide an [[User:Morgan525#Functions_used_in_UFOextender.27s_new_interception_routines|option]] to alter X-Com attack accuracy based on a seperate difficulty rating specified in the INI and target size.
  
# For missile weapons (only), hacking the firing interval bytes in the executable up or down '''does''' decrease or increase the rate of fire.
+
== Range ==
# The observed ratios of rates of fire of the different missile weapons do '''not''' match the ratios between the firing interval bytes in the executable.
 
  
Basically the bytes in the executable must be ''part of'' the rate of fire calculation, but not the whole calculation. [[User:Spike|Spike]] 17:13, 13 July 2009 (EDT)</s>
 
  
----
+
=== Closing Range ===
  
OK contrary to what I said earlier, on repeat testing, I don't see any effects from changing the game executable XCom craft weapon data firing interval offsets (starting at offset 0x6fb18 in WinCE geoscape.exe). I don't see it either for missile-type weapons nor gun-type weapons. I do see an RoF effect when changing offset 0x10 of UFOs in the craft data at 0x6f9a8. This affects the built-in weapons of UFOs only, and is not used for XCom craft. My conclusion is that the RoFs values in the craft weapon data structure for XCom craft weapons are ignored, that the actual values are hard coded elsewhere in the executable, and are proportional to the values given above at [[UFO Interception#Observed Rates of Fire|Observed Rates of Fire]]. The only effect of hacking these craft data weapon values is to change what is listed in the in-game UFOPaedia; there is no actual effect. [[User:Spike|Spike]] 20:09, 13 July 2009 (EDT)
+
I did some tests on timing events in the Interception Window. In particular, I was interested in seeing how long an XCom aircraft is exposed to enemy fire, whilst closing range to the target. In other words, what happens when the XCom aircraft's weapons do not give it a full stand-off advantage.  I use the stated 2 game second (2gs) firing interval of the Cannon as a timer (and verified it using a Stingray as a timer in a second set of a tests).
  
== Damage Mechanics ==
 
  
Air combat damage inflicted by X-Com craft is a random value between 50% and 100% of the listed damage, which should be understood as the <i>maximum</i> damage. Unlike for Battlescape combat, the listed damage value is not the expected value per hit. The expected damage per hit will be 75% of the listed damage.  
+
Here are my findings:
 +
 
 +
# In the Interception Window, all aircraft close range with the enemy at the same rate (measured in shots fired).
 +
## This is regardless of whether the aircraft is an Interceptor (2100 kts, Acc=3) or an Avenger (5400 kts, Acc=10).
 +
## This is also regardless of whether the attack mode is Cautious, Standard, or Aggressive
 +
## Of course, the range that the aircraft will attempt to close to, and hold, does depend on the attack mode
 +
## The approach speed of 2 mutually approaching aircraft is 0.5km per game second, i.e. 1800 kmh / 900 kts (assuming the Cannon rate of fire to be 1 per 2 game seconds).
 +
## Evidence for this:
 +
### Closing from 70km to 30km, 40 volleys of Cannon fire are fired, at 1 / 2gs
 +
### 40 volleys x 2gs = 80 gs time taken to close
 +
### 40km / 80gs = 0.5 km/s
 +
## This was also cross checked with a (hacked) Stingray launcher (zero damage, 75km range, 100 rounds) as the timer.
 +
### Closing from 75km to 0km. 10 rounds fired. Stingray fire rate is 1 / 15 or 16gs [in Aggressive Mode]
 +
### 10 x 15 gs = Time taken was 150 - 160 gs,
 +
### 75km / 150 gs = 0.5 km/s
 +
# The fire rate for missiles varies with the attack mode, but the fire rate for cannon type weapons seems to be unchanged. See more below.
 +
# Or it's just barely possible that the fire rate, and the closing speed, both change by the same margin and remain in the same ratio.
 +
## However I think this is unlikely and it violates Occam's Razor.
 +
## Also, even if true, it doesn't really make any difference.
 +
# The initial opening range on the Interception Window is 75km (600 distance units).
 +
## That is the maximum distance visible, at the top of the window. Opening range = maximum range.
 +
## UFOs seem to often settle at 70km range, if they are able to control the range.
 +
## XComUtil does not let you enter a weapon range value above 75km. Probably Scott Jones was aware of this limit.
 +
# Clearly, the Geoscape phase of Interception is different from the Interception Window
 +
## Geoscape time freezes while you are in the Interception window
 +
## Nothing happens at all until you hit the first button, so there's no rush
 +
## On the Geoscape, relative aircraft speed is highly significant to whether an interception is possible.
 +
## Possibly so is Acceleration (recent suggestions however that Acceleration is completely ignored).
 +
# Caveats
 +
## I didn't try multiple aircraft interceptions. Maybe these are different.
 +
## I only tried one target type, a Small Scout (speed 2200 kts). It would be prudent to try other target types though.
 +
## I think there's enough granularity in the tests I did (45 data points, greater than 100% difference in speed and acceleration between Interceptor and Avenger). But more is always good.
 +
## I didn't test the speed of breaking off, or the speed of opening range after the initial closing. It's possible this is affected by aircraft speed and/or relative speed, and/or by acceleration.
 +
 
 +
 
 +
[[User:Spike|Spike]] 19:38, 2 July 2009 (EDT)
 +
 
 +
 
 +
=== Alternative closing speed observations ===
 +
 
 +
Tested in OpenXcom UFO and TFTD.
 +
 
 +
Equipped interceptor with Stingray missiles and Cannon to set an exact visible and audible approaching range range. It is audible because when interceptor approaches to Cannon fire range it starts firing noticeably loud.
 +
Set missile: range = 60, damage = 0, reload time = 10 (for all modes to not mess up with my observations), number of shots = enough to not run out of missiles with that frequent shooting.
 +
Set cannon: range = 10
 +
 
 +
This way I can clearly count number of missile shots when interceptor closes distance from 60 to 10 km = 50 km.
  
In contrast, damage inflicted by alien craft is 0-100% of the listed weapon power (damage), which again should be interpreted as a maximum damage value. In this case the expected average damage per hit will be approximately 50% of the UFO/USO's listed weapon power.
+
I did about 5 observations an in all of them I can count 20 missile shots. Sometimes maybe last shot was done a split second after cannon start firing. So probably 19.8 - 20 shots. That gives us 50 km / (20 shots * 10 s) = 0.25 km /s.
  
This has been validated by decompilation analysis performed by Morgan525. See [[User:Morgan525#Comparison_of_Damage_routines]]
+
I have tried different reload times just to make sure I don't miscount number of shots and to see how big error I get. In all cases the 50 km closing time was around 200 s, give or take half a shot. I have also tested this in TFTD and got same results. This is about twice as slow comparing to previous author.
  
== Accuracy Mechanics ==
+
I have also independently computed estimated interceptor damage based on this closing time and enemy weapon power and fire rate. Results closely match to experimental observation when I use my approaching speed and they are noticeably off when I try to use Spike's numbers. So I have to conclude my speed is correct.
  
Accuracy is a function of the weapon type used, as listed in the in-game UFOPaedia. Unlike ground combat there are almost certain to be no skill factors involved. There are <i>probably</i> no tactical factors involved. There is some speculation that different Attack Modes might create accuracy modifiers, but no hard evidence. This needs to be tested.
+
==== Note from Meridian ====
  
Testing Strategy:
+
As meridian pointed out here, original XCom assumes UFOpaedia "second" to be equal *two* game ticks. Whereas OpenXcom assumes it to be equal *one* game tick. Hence the difference in calculated results.
 +
https://openxcom.org/forum/index.php/topic,8661.msg133010.html#msg133010
  
This can be confirmed by deduction from long term damage output tests, once damage mechanics and rate of fire mechanics are confirmed. The testing should control for Attack Mode and for range (separately), to make sure these don't have an impact on accuracy. They should also control for target size/type in case that is a factor.
 
  
I can confirm this as I have found the algorithm in the executable. See my discussion page. [[User:Morgan525|Morgan525]] 06:39, 3 July 2012 (EDT)
+
{{REVISIONUSER}}
  
== Control of Range ==
+
=== Control of Range ===
  
 
In general, the craft with the higher airspeed is able to control the engagement range within the Interception Window. Reportedly, Aggressive mode can override this behaviour for a short period of time. On the other hand, it may just be that the target is travelling below its maximum airspeed, as UFOs often do, but then accelerates to maximum speed to avoid a range it does not prefer to be at.  
 
In general, the craft with the higher airspeed is able to control the engagement range within the Interception Window. Reportedly, Aggressive mode can override this behaviour for a short period of time. On the other hand, it may just be that the target is travelling below its maximum airspeed, as UFOs often do, but then accelerates to maximum speed to avoid a range it does not prefer to be at.  
Line 221: Line 188:
 
Question: Is it ever impossible for an XCom craft to break off from a UFO, due to the UFO's higher speed and/or aggression? I don't think so. The rules seem pretty different for UFOs, as opposed to XCom craft.  
 
Question: Is it ever impossible for an XCom craft to break off from a UFO, due to the UFO's higher speed and/or aggression? I don't think so. The rules seem pretty different for UFOs, as opposed to XCom craft.  
  
''No. The code is written so that if the UFO has a higher maximum speed, the Xcraft can never disengaged.'' [[User:Morgan525|Morgan525]] 06:46, 3 July 2012 (EDT)
+
''No. The code is written so that if the UFO has a higher maximum speed, the Xcraft can never disengaged.'' [[User:Morgan525|Tycho]] 06:46, 3 July 2012 (EDT)
  
 
Question: do UFOs attempt to hold an advantageous stand off range, as XCom craft do in Cautious and Standard attack modes?  
 
Question: do UFOs attempt to hold an advantageous stand off range, as XCom craft do in Cautious and Standard attack modes?  
  
''No. The interception routine is strictly one-sided in favor of the player.''[[User:Morgan525|Morgan525]] 06:46, 3 July 2012 (EDT)
+
''No. The interception routine is strictly one-sided. The player chooses the range and when to attack. The UFO only responds if the Xcrafts comes into its weapon's range.''[[User:Morgan525|Tycho]] 06:46, 3 July 2012 (EDT)
  
 
Question: Do UFOs use Attack modes in the same way that XCom craft do, and if so, what are the effects?
 
Question: Do UFOs use Attack modes in the same way that XCom craft do, and if so, what are the effects?
  
''No. The player controls when and how to attack. The UFO simply responds if the Xcraft reaches it's weapon range. The UFO will only disengage if its escape timer reaches zero and its maximum speed is greater than the Xcraft.'' [[User:Morgan525|Morgan525]] 06:46, 3 July 2012 (EDT)
+
''No. UFOs fire rate is based on an internal timer, which is reduced according to the game's difficulty level. '' [[User:Morgan525|Tycho]] 06:46, 3 July 2012 (EDT)
 +
 
 +
=== Standoff Is Independent of Range ===
 +
 
 +
Even if the range of a weapon is hacked to equal or exceed standoff range, it does not fire when in Standoff mode (or in Disengage). So Standoff mode also appears to mean "Weapons Safe". In fact, with a hacked weapon range, you can have the curious phenomenon that the craft actually ''pulls back'' from Standoff range (70km) to maximum firing range (eg 75km) when ordered into a Standard/Cautious attack.
  
= UFO Behaviour =
+
= Alien Behaviour =
  
 
== General Notes ==
 
== General Notes ==
  
The game provides very little access to UFO behaviour, so understanding of UFO mechanics is sketchier and information is harder to come by. However there are some facts to go on and some reasonably well-accepted suppositions.  
+
The game provides very little access to UFO/USO behaviour, so understanding of UFO/USO mechanics is sketchier and information is harder to come by. However there are some facts to go on and some useful findings from code decompilation.  
  
 
UFO craft weapons have a weapon strength and weapon range value stored in the game executable in the [[Talk:GEOSCAPE.EXE#Craft_type_data|structCraftData]] format. This is the same structure that stores their speed, damage capacity, and size.  
 
UFO craft weapons have a weapon strength and weapon range value stored in the game executable in the [[Talk:GEOSCAPE.EXE#Craft_type_data|structCraftData]] format. This is the same structure that stores their speed, damage capacity, and size.  
  
 
UFOs are capable of attempting to hold range, to close, and to break off, just like XCom aircraft. The behaviour is not well understood but appears in part to be influenced by the Attack mode of the XCom craft. Of course, initiating an attack often has an effect on this behaviour (e.g. the UFO attempts to break off).
 
UFOs are capable of attempting to hold range, to close, and to break off, just like XCom aircraft. The behaviour is not well understood but appears in part to be influenced by the Attack mode of the XCom craft. Of course, initiating an attack often has an effect on this behaviour (e.g. the UFO attempts to break off).
 
+
:''UFOs are incapable of holding range or closing on their own initative.  The player's choice of attack mode is the only factor that determines range. The only independent action a UFO can take is escape if the UFO is faster than the Xcraft and its escape timer has reached zero.'' [[User:Morgan525|Tycho]]
== UFO Average Damage Output ==
 
 
 
In repeated tests, a Terror Ship (weapon strength 120) killed an Avenger in 480 game seconds (or more specifically, the time required to fire 20 Avalanches at close range in Aggressive mode). The Avenger has 1200 defence points, so this implies that the Terror Ship generates an average of 2.5 damage points per game second, in this test scenario at least.
 
 
 
Obviously some tests with other UFOs would be useful, followed by tests with hacked UFOs.  
 
 
 
  
 
== UFO Rate of Fire Mechanics ==
 
== UFO Rate of Fire Mechanics ==
  
There is a value in structCraftData (at offset 0x10) which has a bearing on UFO weapons. This value ranges from 56 (decimal) for the smaller UFOs (including the unarmed Small Scout), down to 24 for the 3 largest types: Terror Ship, Supply Ship, Battleship. This is believed to be the base fire interval for the UFO weapon. The possibility that this is value is a fire interval (or an accuracy factor) should be easily testable, once the damage output of UFOs is understood well enough to be predicted.  
+
There is a value in structCraftData (at offset 0x10) which has a bearing on UFO weapons. This value ranges from 56 (decimal) for the smaller UFOs (including the unarmed Small Scout), down to 24 for the 3 largest types: Terror Ship, Supply Ship, Battleship. This is the base fire interval for the UFO weapon.  
  
Test Strategy:
+
Seb76 has found from inspection that the firing interval varies randomly by 100%-200% of this base value, reduced by 2*Difficult Level (i.e. faster firing at higher difficulty level). (XCom craft weapon firing rates are not affected by Difficulty Level).
  
Quite simple to test. Hack the structCraftData value to increase or decrease eg. by a factor of 2. Re run the survival tests (see above). If survival time increases or decreases by the expected (linear) proportion, this is probably the fire interval value. If there is an effect of a different magnitude, this could be an accuracy value rather than an RoF value. If there is no effect, the value is probably unrelated to UFO offensive action, but might be a defensive value of some kind (eg "difficulty to hit").
+
'' A countdown is stored in CRAFT.DAT at offset 0x26 and when it hits 0, the UFO fires. It is reset for the next shot with this formula:
 
 
Also for extra confidence (and a simpler test), try increasing and decreasing the value to extreme levels and observing if UFO fire rate decreases/increases accordingly.
 
 
 
Update: Tests show it's most likely this value is indeed a UFO firing interval value (inverse rate of fire). Seb76 has found from inspection that the firing interval varies randomly by 100%-200% of this base value, reduced by 2*Difficult Level (i.e. faster firing at higher difficulty level). (XCom craft weapon firing rates are not affected by Difficulty Level).
 
 
 
''I'm inclined to agree with the rate of fire theory. A countdown is stored in CRAFT.DAT at offset 0x26 and when it hits 0, the UFO fires. It is reset for the next shot with this formula:
 
  
 
  tmp = offset10-2*difficultyLevel
 
  tmp = offset10-2*difficultyLevel
Line 271: Line 230:
 
=== Effect of Attack Mode on UFO RoF ===
 
=== Effect of Attack Mode on UFO RoF ===
  
From the formula above it does not seem the UFO RoF varies based on either XCom or Alien attack mode - Aggressive, Cautious, Defensive. This would fit with the UFO weapon being a "plasma cannon" type of weapon. However it would be good to test this by engaging a UFO in each of the 3 modes. This would prove whether XCom attack mode influences UFO RoF. It would not prove whether the UFO has its own independent attack mode, and whether this might or might not influence RoF. Some clues might be found to this by hacking the weapon type of the UFO weapon to make it a "missile" - maybe.
+
From the formula above it does not seem the UFO RoF varies based on either XCom or Alien attack mode - Aggressive, Cautious, Defensive. This would fit with the UFO weapon being a "plasma cannon" type of weapon.  
  
 
== UFO Damage Mechanics ==
 
== UFO Damage Mechanics ==
Line 277: Line 236:
 
Damage inflicted by alien craft is 0-100% of the listed weapon power (damage), which again should be interpreted as a maximum damage value. In this case the expected average damage per hit will be approximately 50% of the UFO/USO's listed weapon power.
 
Damage inflicted by alien craft is 0-100% of the listed weapon power (damage), which again should be interpreted as a maximum damage value. In this case the expected average damage per hit will be approximately 50% of the UFO/USO's listed weapon power.
  
This has been discovered by decompilation analysis performed by Morgan525. See [[User:Morgan525#Comparison_of_Damage_routines]]
+
This has been discovered by decompilation analysis performed by Morgan525/Tycho. See [[User:Morgan525#Comparison_of_Damage_routines]]
  
 
== UFO Accuracy Mechanics ==
 
== UFO Accuracy Mechanics ==
Line 289: Line 248:
 
:This could be translated to C as " if(GetRandom_0_n(100) <= 40) { return; } ", for the most part. What this does is skip all of the damage and destruction code if that GetRandom_0_n call rolls 0 through 40, for 41 values, out of 101 total possibilities. I am fairly certain that I recall UFOs missing frequently, as well. --[[User:Xusilak|Xusilak]] 15:36, 11 April 2010 (EDT)
 
:This could be translated to C as " if(GetRandom_0_n(100) <= 40) { return; } ", for the most part. What this does is skip all of the damage and destruction code if that GetRandom_0_n call rolls 0 through 40, for 41 values, out of 101 total possibilities. I am fairly certain that I recall UFOs missing frequently, as well. --[[User:Xusilak|Xusilak]] 15:36, 11 April 2010 (EDT)
  
UFOs have a flat 60% accuracy which is not affected by game difficulty, UFO size, or Xcraft attack stance. [[User:Morgan525|Morgan525]] 06:50, 3 July 2012 (EDT)
+
UFOs have a flat 60% accuracy which is not affected by game difficulty, UFO size, or Xcraft attack stance. [[User:Morgan525|Tycho]] 06:50, 3 July 2012 (EDT)
 +
 
 +
[[UFO Extender]] / [[TFTDextender]] provide an [[User:Morgan525#Functions_used_in_UFOextender.27s_new_interception_routines|option]] for UFO accuracy to vary with the difficulty level and X-craft attack mode. The difficulty level is independent of game difficulty and selected by the user in the INI.
 +
 
 +
= General Behaviour =
 +
 
  
[[UFO Extender]] / [[TFTDextender]] provide an [[User:Morgan525#Functions_used_in_UFOextender.27s_new_interception_routines|option]] for UFO accuracy to vary with game difficulty level and X-craft attack mode.
+
== Survival Time of Multiple Attackers ==
  
== Probable UFO Attack Resolution Mechanics ==
+
Engaging a UFO with more than one attacking aircraft makes the UFO split its fire. This gives the attacking aircraft more time to perform attacks, before either being destroyed or being forced to disengage.
  
Evidence indicates UFO attacks are resolves in this way:
+
The following table gives the increased average survival time of attacking ships. The test scenario used XCom craft in Aggressive mode. The UFO was a Terror Ship. The test scenario did not consider survival by eliminating the UFO (the XCom craft were effectively unarmed). This was a pure endurance situation, the worst case scenario.
 +
 
 +
# of Attackers  Avg Survival Time  Expected  Deviation
 +
    1          1.0 - nominal      1.0      100% nominal
 +
    2          1.5                2.0      75%
 +
    3          2.5                3.0      83.33% (5/6)
 +
    4          3.0                4.0      75%
  
480 game seconds divided by firing interval of 24 (from offset 0x10 for the Terror Ship) = 20 attacks
+
This is a slightly surprising result. In principle, if the total damage output of the UFO was constant, the average survival time would just be divided by the number of attackers; e.g. 2x as long for 2 attackers, 3x as long for 3 attackers, etc. The UFO actually seems to be doing <b>more</b> damage, or killing targets faster, when facing multiple XCom opponents. This is a result that requires an explanation. The survival time is measured in (zero-damage) rounds fired by the XCom aircraft. So another possibility is that the XCom aircraft are somehow able to fire more rounds when multiply engaged. However I don't think this is the case. It was not systematically tested but the XCom fire rates do not seem to increase noticeably when multiply engaged.
20 attacks  x RoF random 2/3 x 120 strength x 0.75 average random damage = 1200
 
  
It's difficult to reliably count the number of attacks made by a UFO, or even the number of hits, as they flash in and out of the Interception Window status display quickly and somewhat erratically. However, the figure of 20 attacks by the UFO during 20 Avalanche attacks made against it, does not seem unreasonable. If offset 0x10 is actually a fire interval value, this would make sense, as both the Terror Ship and the Avalanche (in Aggressive mode) would have a fire interval of 24 game seconds.
+
: The results for 1, 2 and 4 attackers would be consistent with the UFO going into Aggressive Mode from Standard Mode when faced with multiple attackers. This would increase its RoF by 1/3, giving a 4/3 firepower increase and thus a 3/4 survival time for XCom. The attack mode is saved in INTER.DAT. It would be worth comparing saves of a single XCom interceptor with saves of multiple interceptors, and seeing what attack mode the UFO is in. Also to retest with more granularity (Cannon instead of Avalanche timers), in case the data for 3 attackers is actually nearer 2.25 = 75% [[User:Spike|Spike]] 16:13, 15 March 2010 (EDT)
  
As noted above, faced with multiple opponents, the damage rate of the UFO seems to increase. Maybe this literally is a fudge factor, inserted by the game programmers to prevent these mobbing tactics from being too effective. Or it could be a consequence of something similar to an Attack Mode, for UFOs. Or it might be just an artefact of the test scenario - for example, in the test the UFOs were not taking any damage, perhaps this enables them to be more aggressive.
+
So faced with multiple opponents, the rate of damage inflicted by the UFO seems to increase. Maybe this literally is a fudge factor, inserted by the game programmers to prevent these mobbing tactics from being too effective. Or it could be a consequence of something similar to an Attack Mode, for UFOs. Or it might be just an artefact of the test scenario - for example, in the test the UFOs were not taking any damage, perhaps this enables them to be more aggressive.
  
 
= TFTD Submarine Combat Mechanics =
 
= TFTD Submarine Combat Mechanics =
  
 +
== Rate of Fire ==
 +
 +
=== Empirical Data ===
 +
 +
1. In multiples of the reload time of a Gas Cannon (shown as '1' below), reload times of other weapons are as follows:
 +
 +
Weapon Cau Std Agg
 +
Gas      1  1  1
 +
Ajax    16  12  8
 +
DUP    24  18  12
 +
Gauss    6  6  6
 +
Sonic    6  6  6
 +
PWT    16  12  8
 +
 +
2. This is exactly the same as the equivalent EU craft weapons.
 +
 +
3. Range has absolutely no effect on these relative rates of fire / reload rates.
 +
 +
===See also===
 +
[[Talk:Sub_Armaments#USO_observed_rates_of_fire]]
  
Early days yet, here are some quick notes:
 
  
* RoF relationship for missiles, 2::3::4 for Aggressive / Standard / Cautious, seems to be the same as XCOM:EU
+
== Misc ==
* Relative RoF compared to Gas Cannon, for AJAX and DUP, seems to be the same ratio as between Stingray:Cannon and Avalanche:Cannon respectively, i.e 8x and 12x slower (in Aggressive - 2:3:4 ratio applies to other modes). This is despite the fact that the stated reload time for the Gas Cannon is 3gs, vs 2gs for the Cannon. Maybe they just decided to give the actual average rather than the minimum value?
 
** It would be interesting to check UFO RoFs vs USO RoFs, and if they are constant, compare Cannon vs Gas Cannon vs a specific constant USO/UFO RoF, to see if Cannon rate == Gas Cannon rate or not
 
 
* Seems to be evidence from the special case of Ajax vs Survey Ship (base damage 60 vs damage capacity 60) that combat processing is aborted immediately upon a crash or destroyed result.  
 
* Seems to be evidence from the special case of Ajax vs Survey Ship (base damage 60 vs damage capacity 60) that combat processing is aborted immediately upon a crash or destroyed result.  
* Also seems to be some evidence that to-hit and damage for a salvo is resolved with only one roll for each missile/round, not two independent rolls.  
+
* Also seems to be some evidence that to-hit and damage for a salvo is resolved with only one roll for each missile/round, not two independent rolls. (There was a comment to the effect that the RNG is primitive, the rolls are resolved microseconds apart, so the results are likely to be very similar.)
 
* If true, the 2 preceding points probably also apply to XCOM:EU.
 
* If true, the 2 preceding points probably also apply to XCOM:EU.
 
* found offsets for Craft Weapons - see [[Talk:GEOSCAPE.EXE#TFTD_Sub_weapon_stats]]
 
* found offsets for Craft Weapons - see [[Talk:GEOSCAPE.EXE#TFTD_Sub_weapon_stats]]
 
** also need to locate USO stats / Sub stats
 
** also need to locate USO stats / Sub stats
  
See also [[Talk:Sub_Armaments#USO_observed_rates_of_fire]]
+
[[Category:Enemy Unknown/UFO Defense]]

Latest revision as of 21:24, 18 October 2020

This article attempts to summarise everything we know about craft combat game mechanics - particularly what happens in the Interception Window. This started with some empirical research I did, and has been greatly enhanced by code decompilation done by Xusilak, Seb76, Morgan525/Tycho, and others. Spike 19:08, 8 September 2012 (EDT)


X-Com Behaviour

Note: In all of the following sections, I refer to "game seconds". But actually this is a supposition. What I'm actually measuring is multiples of the firing interval of a standard Cannon. This is stated in the in-game UFOPaedia to be 2 (game) seconds. It may or may not be meaningful to talk about these being actual game seconds. Maybe they are no more than multiples of the Cannon firing interval. And quite possibly the Cannon firing interval itself is not fixed, but is variable.


Rate of Fire

Rate of Fire is hugely important, as (along with accuracy and damage) it is a major determinant of firepower (the rate at which damage is inflicted on an enemy craft). It turns out that the in game UFOPaedia information on rates of fire is significantly incorrect.

Observed Rates of Fire

The quoted fire rates (or rather fire intervals) in the in-game UFOPaedia are wrong. Results from experiment show the following provisional information:

Weapon:         Average Fire Interval (gs)       UFOPaedia
                Aggressive/Standard/Cautious     Value (gs)
Cannon                   2 /  2 /  2                 2
Laser Cannon            12 / 12 / 12                 4
Plasma Cannon           12 / 12 / 12                 6
Stingray                16 / 24 / 32                15
Avalanche               24 / 36 / 48                20
Fusion Ball             16 / 24 / 32                25

Since there is some uncertainty as to whether X-Craft fire rates are constant or variable, and whether the actual fire interval of a Cannon actually is two game seconds (other than "by definition"), this can be restated in multiples of the Cannon fire interval:

Weapon:         Average Fire Interval (vs C)     UFOPaedia
                Aggressive/Standard/Cautious     Value (vs C)
Cannon                   1 /  1 /  1                 1
Laser Cannon             6 /  6 /  6                 2
Plasma Cannon            6 /  6 /  6                 3
Stingray                 8 / 12 / 16                 5
Avalanche               12 / 18 / 24                10
Fusion Ball              8 / 12 / 16                12.5

These fire rates/intervals are significantly different from those previously understood. In particular we see a massive increase the relative fire rate of conventional Cannon versus other weapons, identical fire rates for Plasma Cannon and Laser Cannon, and quite similar fire rates as between advanced Cannon and Stingray launchers. This has a major impact on computed firepower and payload characteristics for all weapons, and on the relative differences between weapons.

It should be noted that in almost every case, these observed fire interval values deviate from the advertised values, and in fact they deviate from values coded into the "craft" data structures of the game executable, which are shown by the in game UFOPedia. The observed values don't even have the same relative relationship as the reported values. The fire intervals in the craft data structure are ignored in combat.

Projectile Travel Time

Also consider that all missiles AND cannons actually travel to their target and have a speed delta that is added on top of the XCraft's. This information is the first four numbers before the weapons' rates of fire in the executable. Tycho 07:03, 3 July 2012 (EDT)

Though logically, the projectile speed won't affect the rate of fire, it should just create 1. a start lag between the start of firing, and the first hit/miss 2. an end lag, of wasted rounds fired that were fired before the UFO was shot down/escaped, but were still in-flight when the UFO was shot down/escaped. The projectile speed should not affect the actual rate of fire, apart from these lags. Of course, in average use, the lag factors will affect the average effective operational rate of fire, and the average operational ammo consumption per engagement.
Do you see any evidence of the distance to target changing in Cautious vs Standard vs Aggressive attack mode? I didn't see any, but my methods are pretty crude compared to yours. Spike 17:57, 3 July 2012 (EDT)

If you mean for missiles, no. The part of the interception subroutine that handles missiles only tracks the distance each missile travels and then compares this to the distance to target of the UFO *from the Xcraft* and the maximum range of the missile. If the distance traveled equals the distance to target, it goes through the attack sequence. Each missile is calculated separately but I think the randomization routine is old and since the attack for both missiles, fired in tandem, are calculated microseconds apart, you get nearly the same number generated for both.Tycho 06:37, 4 July 2012 (EDT)

Actually you are right that projectile speed vs distance would affect rate of fire, IF only one projectile (or any limited number of projectiles) were allowed to be in flight at the same time. For cannons this is definitely not true, you can see in the interception window that multiple projectiles are in flight. But this might be the case with missiles. If only one missile is allowed in flight (per launcher), then RoF will be strongly determined by projectile speed vs distance to target. In a lot of my tests I "controlled" for distance by hacking all weapon ranges to 70km, so that the distance to target was always 70km. Maybe I should have done more tests with variable range. I did do some tests with variable range, enough to convince myself it wasn't a factor, but maybe I was wrong. Maybe projectile speed vs distance is a factor, but only for missiles, and maybe that somehow explains the differences in effective rate of fire for missiles in Cautious vs Standard vs Aggressive mode? Spike 23:14, 6 September 2012 (EDT)

Effect of Attack Mode on Rate of Fire

The other major observation in the data above is that Attack Mode does influence rate of fire, but only for missile/launcher weapons. If we take Aggressive mode as the baseline, firing intervals for launched weapons only increase as follows:

Attack Mode  Firing Interval  Firing Rate
Aggressive       x 1.0           nominal
Standard         x 1.5           x 2/3
Cautious         x 2.0           x 1/2

In effect this penalises launcher weapons when used at stand off range (Standard), especially when weapon types are mixed on the same aircraft (Cautious). Conversely, it gives a high offensive premium to conducting launched weapon attacks in Aggressive mode, conceding the defensive advantage of stand-off range.

Firepower Based on Observed Rates of Fire

The observed rates of fire change the firepower relationships between weapons.

Armament       Rate(gs) Mode     Firepower
Cannon          1/2      ALL      40
Stingray        1/16     Agg      98
                1/24     Std      65
                1/32     Cau      49
Avalanche       1/24     Agg      107
                1/36     Std      71
                1/48     Cau      53
Laser Cannon    1/12     ALL      65
Plasma Beam     1/12     ALL      187
Fusion Ball     1/16     Agg      460
                1/24     Std      307
                1/32     Cau      230

(The firepower value above is just an arbitrary relative number based on 16gs of firing)

Observations: since even paired launchers must be used in Standard attack mode in order to maintain stand-off distance, it's interesting to compare their Standard firepower figure with the figures for the cannon weapons. In which case we see, for example, that the Laser Cannon is a very close match for the Avalanche in firepower - and can keep firing for 400 game seconds (gs) rather than the Avalanche's endurance of (in Standard mode) 72gs. Of course, stand-off distance is itself a massive advantage which cannot be ignored.

Where Rate of Fire Is (Not) Coded

There are no effects from changing the game executable XCom craft weapon data firing interval offsets (starting at offset 0x6fb18 in WinCE geoscape.exe). Neither for missile-type weapons nor gun-type weapons. There is an RoF effect when changing offset 0x10 of UFOs in the craft data at 0x6f9a8. This affects the built-in weapons of UFOs only, and is not used for XCom craft. My conclusion is that the RoFs values in the craft weapon data structure for XCom craft weapons are ignored in combat, that the actual values are hard coded elsewhere in the executable, and are proportional to the values given above at Observed Rates of Fire. The only effect of hacking these craft data weapon values is to change what is listed in the in-game UFOPaedia; there is no actual combat effect.


Damage Mechanics

Air combat damage inflicted by X-Com craft is a random value between 50% and 100% of the listed damage, which should be understood as the maximum damage. Unlike for Battlescape combat, the listed damage value is not the expected value per hit. The expected damage per hit will be 75% of the listed damage.

In contrast, damage inflicted by alien craft is 0-100% of the listed weapon power (damage), which again should be interpreted as a maximum damage value. In this case the expected average damage per hit will be approximately 50% of the UFO/USO's listed weapon power.

This has been validated by decompilation analysis performed by Morgan525/Tycho. See User:Morgan525#Comparison_of_Damage_routines

Accuracy Mechanics

Accuracy is a function of the weapon type used, as listed in the in-game UFOPaedia. Unlike ground combat there are almost certain to be no skill factors involved. There are probably no tactical factors involved. There is some speculation that different Attack Modes might create accuracy modifiers, but no hard evidence. This needs to be tested. The testing should control for Attack Mode and for range (separately), to make sure these don't have an impact on accuracy. They should also control for target size/type in case that is a factor.

I can confirm this as I have found the algorithm in the executable. See my discussion page. Tycho 06:39, 3 July 2012 (EDT)

The standard algorithm for X-Com attack accuracy varies with target size but not with game difficulty level (nor with attack mode). The formula is:

[1+(3/UFOsize)]/2 * Weapon Accuracy

With the UFOsize value going down as UFOs get bigger. In other words, for a typical Medium (size=3) target, the adjusted accuracy is equal to the base unadjusted weapon accuracy.

UFO Extender / TFTDextender provide an option to alter X-Com attack accuracy based on a seperate difficulty rating specified in the INI and target size.

Range

Closing Range

I did some tests on timing events in the Interception Window. In particular, I was interested in seeing how long an XCom aircraft is exposed to enemy fire, whilst closing range to the target. In other words, what happens when the XCom aircraft's weapons do not give it a full stand-off advantage. I use the stated 2 game second (2gs) firing interval of the Cannon as a timer (and verified it using a Stingray as a timer in a second set of a tests).


Here are my findings:

  1. In the Interception Window, all aircraft close range with the enemy at the same rate (measured in shots fired).
    1. This is regardless of whether the aircraft is an Interceptor (2100 kts, Acc=3) or an Avenger (5400 kts, Acc=10).
    2. This is also regardless of whether the attack mode is Cautious, Standard, or Aggressive
    3. Of course, the range that the aircraft will attempt to close to, and hold, does depend on the attack mode
    4. The approach speed of 2 mutually approaching aircraft is 0.5km per game second, i.e. 1800 kmh / 900 kts (assuming the Cannon rate of fire to be 1 per 2 game seconds).
    5. Evidence for this:
      1. Closing from 70km to 30km, 40 volleys of Cannon fire are fired, at 1 / 2gs
      2. 40 volleys x 2gs = 80 gs time taken to close
      3. 40km / 80gs = 0.5 km/s
    6. This was also cross checked with a (hacked) Stingray launcher (zero damage, 75km range, 100 rounds) as the timer.
      1. Closing from 75km to 0km. 10 rounds fired. Stingray fire rate is 1 / 15 or 16gs [in Aggressive Mode]
      2. 10 x 15 gs = Time taken was 150 - 160 gs,
      3. 75km / 150 gs = 0.5 km/s
  2. The fire rate for missiles varies with the attack mode, but the fire rate for cannon type weapons seems to be unchanged. See more below.
  3. Or it's just barely possible that the fire rate, and the closing speed, both change by the same margin and remain in the same ratio.
    1. However I think this is unlikely and it violates Occam's Razor.
    2. Also, even if true, it doesn't really make any difference.
  4. The initial opening range on the Interception Window is 75km (600 distance units).
    1. That is the maximum distance visible, at the top of the window. Opening range = maximum range.
    2. UFOs seem to often settle at 70km range, if they are able to control the range.
    3. XComUtil does not let you enter a weapon range value above 75km. Probably Scott Jones was aware of this limit.
  5. Clearly, the Geoscape phase of Interception is different from the Interception Window
    1. Geoscape time freezes while you are in the Interception window
    2. Nothing happens at all until you hit the first button, so there's no rush
    3. On the Geoscape, relative aircraft speed is highly significant to whether an interception is possible.
    4. Possibly so is Acceleration (recent suggestions however that Acceleration is completely ignored).
  6. Caveats
    1. I didn't try multiple aircraft interceptions. Maybe these are different.
    2. I only tried one target type, a Small Scout (speed 2200 kts). It would be prudent to try other target types though.
    3. I think there's enough granularity in the tests I did (45 data points, greater than 100% difference in speed and acceleration between Interceptor and Avenger). But more is always good.
    4. I didn't test the speed of breaking off, or the speed of opening range after the initial closing. It's possible this is affected by aircraft speed and/or relative speed, and/or by acceleration.


Spike 19:38, 2 July 2009 (EDT)


Alternative closing speed observations

Tested in OpenXcom UFO and TFTD.

Equipped interceptor with Stingray missiles and Cannon to set an exact visible and audible approaching range range. It is audible because when interceptor approaches to Cannon fire range it starts firing noticeably loud. Set missile: range = 60, damage = 0, reload time = 10 (for all modes to not mess up with my observations), number of shots = enough to not run out of missiles with that frequent shooting. Set cannon: range = 10

This way I can clearly count number of missile shots when interceptor closes distance from 60 to 10 km = 50 km.

I did about 5 observations an in all of them I can count 20 missile shots. Sometimes maybe last shot was done a split second after cannon start firing. So probably 19.8 - 20 shots. That gives us 50 km / (20 shots * 10 s) = 0.25 km /s.

I have tried different reload times just to make sure I don't miscount number of shots and to see how big error I get. In all cases the 50 km closing time was around 200 s, give or take half a shot. I have also tested this in TFTD and got same results. This is about twice as slow comparing to previous author.

I have also independently computed estimated interceptor damage based on this closing time and enemy weapon power and fire rate. Results closely match to experimental observation when I use my approaching speed and they are noticeably off when I try to use Spike's numbers. So I have to conclude my speed is correct.

Note from Meridian

As meridian pointed out here, original XCom assumes UFOpaedia "second" to be equal *two* game ticks. Whereas OpenXcom assumes it to be equal *one* game tick. Hence the difference in calculated results. https://openxcom.org/forum/index.php/topic,8661.msg133010.html#msg133010


Alpha Centauri Bear

Control of Range

In general, the craft with the higher airspeed is able to control the engagement range within the Interception Window. Reportedly, Aggressive mode can override this behaviour for a short period of time. On the other hand, it may just be that the target is travelling below its maximum airspeed, as UFOs often do, but then accelerates to maximum speed to avoid a range it does not prefer to be at.

Update: An XCom craft with equal airspeed (Interceptor buffed to 2200 vs Small Scout @ 2200) can move to any desired range. A UFO with equal airspeed is unable to break off. So it seems that superior airspeed is required to break off, but equal airspeed is sufficient to control range. Or it may be simpler than that: if the opponent can't break off, then the attacker can always control the range. Spike 20:09, 13 July 2009 (EDT)

Question: Is it ever impossible for an XCom craft to break off from a UFO, due to the UFO's higher speed and/or aggression? I don't think so. The rules seem pretty different for UFOs, as opposed to XCom craft.

No. The code is written so that if the UFO has a higher maximum speed, the Xcraft can never disengaged. Tycho 06:46, 3 July 2012 (EDT)

Question: do UFOs attempt to hold an advantageous stand off range, as XCom craft do in Cautious and Standard attack modes?

No. The interception routine is strictly one-sided. The player chooses the range and when to attack. The UFO only responds if the Xcrafts comes into its weapon's range.Tycho 06:46, 3 July 2012 (EDT)

Question: Do UFOs use Attack modes in the same way that XCom craft do, and if so, what are the effects?

No. UFOs fire rate is based on an internal timer, which is reduced according to the game's difficulty level. Tycho 06:46, 3 July 2012 (EDT)

Standoff Is Independent of Range

Even if the range of a weapon is hacked to equal or exceed standoff range, it does not fire when in Standoff mode (or in Disengage). So Standoff mode also appears to mean "Weapons Safe". In fact, with a hacked weapon range, you can have the curious phenomenon that the craft actually pulls back from Standoff range (70km) to maximum firing range (eg 75km) when ordered into a Standard/Cautious attack.

Alien Behaviour

General Notes

The game provides very little access to UFO/USO behaviour, so understanding of UFO/USO mechanics is sketchier and information is harder to come by. However there are some facts to go on and some useful findings from code decompilation.

UFO craft weapons have a weapon strength and weapon range value stored in the game executable in the structCraftData format. This is the same structure that stores their speed, damage capacity, and size.

UFOs are capable of attempting to hold range, to close, and to break off, just like XCom aircraft. The behaviour is not well understood but appears in part to be influenced by the Attack mode of the XCom craft. Of course, initiating an attack often has an effect on this behaviour (e.g. the UFO attempts to break off).

UFOs are incapable of holding range or closing on their own initative. The player's choice of attack mode is the only factor that determines range. The only independent action a UFO can take is escape if the UFO is faster than the Xcraft and its escape timer has reached zero. Tycho

UFO Rate of Fire Mechanics

There is a value in structCraftData (at offset 0x10) which has a bearing on UFO weapons. This value ranges from 56 (decimal) for the smaller UFOs (including the unarmed Small Scout), down to 24 for the 3 largest types: Terror Ship, Supply Ship, Battleship. This is the base fire interval for the UFO weapon.

Seb76 has found from inspection that the firing interval varies randomly by 100%-200% of this base value, reduced by 2*Difficult Level (i.e. faster firing at higher difficulty level). (XCom craft weapon firing rates are not affected by Difficulty Level).

A countdown is stored in CRAFT.DAT at offset 0x26 and when it hits 0, the UFO fires. It is reset for the next shot with this formula:

tmp = offset10-2*difficultyLevel
nextShot = RAND(0,tmp)+tmp

So the average firing interval will be

1.5 x (structCraftData offset 0x10 - 2 x Difficulty)

Effect of Attack Mode on UFO RoF

From the formula above it does not seem the UFO RoF varies based on either XCom or Alien attack mode - Aggressive, Cautious, Defensive. This would fit with the UFO weapon being a "plasma cannon" type of weapon.

UFO Damage Mechanics

Damage inflicted by alien craft is 0-100% of the listed weapon power (damage), which again should be interpreted as a maximum damage value. In this case the expected average damage per hit will be approximately 50% of the UFO/USO's listed weapon power.

This has been discovered by decompilation analysis performed by Morgan525/Tycho. See User:Morgan525#Comparison_of_Damage_routines

UFO Accuracy Mechanics

... if the code is to be believed, UFOs have a 40.59% chance of missing in a perfect world, but the random number generator isn't perfect, so it's probably skewed in some direction. It doesn't appear to be modified by anything, at all. Here's a snippet:

.text:004470B7 6A 64                         push    100
.text:004470D5 E8 76 67 FF FF                call    GetRandom_0_n
.text:004470DA 83 C4 04                      add     esp, 4
.text:004470DD 66 3D 28 00                   cmp     ax, 40
.text:004470E1 0F 86 C4 00 00 00             jbe     exit
This could be translated to C as " if(GetRandom_0_n(100) <= 40) { return; } ", for the most part. What this does is skip all of the damage and destruction code if that GetRandom_0_n call rolls 0 through 40, for 41 values, out of 101 total possibilities. I am fairly certain that I recall UFOs missing frequently, as well. --Xusilak 15:36, 11 April 2010 (EDT)

UFOs have a flat 60% accuracy which is not affected by game difficulty, UFO size, or Xcraft attack stance. Tycho 06:50, 3 July 2012 (EDT)

UFO Extender / TFTDextender provide an option for UFO accuracy to vary with the difficulty level and X-craft attack mode. The difficulty level is independent of game difficulty and selected by the user in the INI.

General Behaviour

Survival Time of Multiple Attackers

Engaging a UFO with more than one attacking aircraft makes the UFO split its fire. This gives the attacking aircraft more time to perform attacks, before either being destroyed or being forced to disengage.

The following table gives the increased average survival time of attacking ships. The test scenario used XCom craft in Aggressive mode. The UFO was a Terror Ship. The test scenario did not consider survival by eliminating the UFO (the XCom craft were effectively unarmed). This was a pure endurance situation, the worst case scenario.

# of Attackers  Avg Survival Time  Expected  Deviation
    1           1.0 - nominal      1.0       100% nominal
    2           1.5                2.0       75%
    3           2.5                3.0       83.33% (5/6)
    4           3.0                4.0       75%

This is a slightly surprising result. In principle, if the total damage output of the UFO was constant, the average survival time would just be divided by the number of attackers; e.g. 2x as long for 2 attackers, 3x as long for 3 attackers, etc. The UFO actually seems to be doing more damage, or killing targets faster, when facing multiple XCom opponents. This is a result that requires an explanation. The survival time is measured in (zero-damage) rounds fired by the XCom aircraft. So another possibility is that the XCom aircraft are somehow able to fire more rounds when multiply engaged. However I don't think this is the case. It was not systematically tested but the XCom fire rates do not seem to increase noticeably when multiply engaged.

The results for 1, 2 and 4 attackers would be consistent with the UFO going into Aggressive Mode from Standard Mode when faced with multiple attackers. This would increase its RoF by 1/3, giving a 4/3 firepower increase and thus a 3/4 survival time for XCom. The attack mode is saved in INTER.DAT. It would be worth comparing saves of a single XCom interceptor with saves of multiple interceptors, and seeing what attack mode the UFO is in. Also to retest with more granularity (Cannon instead of Avalanche timers), in case the data for 3 attackers is actually nearer 2.25 = 75% Spike 16:13, 15 March 2010 (EDT)

So faced with multiple opponents, the rate of damage inflicted by the UFO seems to increase. Maybe this literally is a fudge factor, inserted by the game programmers to prevent these mobbing tactics from being too effective. Or it could be a consequence of something similar to an Attack Mode, for UFOs. Or it might be just an artefact of the test scenario - for example, in the test the UFOs were not taking any damage, perhaps this enables them to be more aggressive.

TFTD Submarine Combat Mechanics

Rate of Fire

Empirical Data

1. In multiples of the reload time of a Gas Cannon (shown as '1' below), reload times of other weapons are as follows:

Weapon Cau Std Agg
Gas      1   1   1
Ajax    16  12   8
DUP     24  18  12
Gauss    6   6   6
Sonic    6   6   6
PWT     16  12   8 

2. This is exactly the same as the equivalent EU craft weapons.

3. Range has absolutely no effect on these relative rates of fire / reload rates.

See also

Talk:Sub_Armaments#USO_observed_rates_of_fire


Misc

  • Seems to be evidence from the special case of Ajax vs Survey Ship (base damage 60 vs damage capacity 60) that combat processing is aborted immediately upon a crash or destroyed result.
  • Also seems to be some evidence that to-hit and damage for a salvo is resolved with only one roll for each missile/round, not two independent rolls. (There was a comment to the effect that the RNG is primitive, the rolls are resolved microseconds apart, so the results are likely to be very similar.)
  • If true, the 2 preceding points probably also apply to XCOM:EU.
  • found offsets for Craft Weapons - see Talk:GEOSCAPE.EXE#TFTD_Sub_weapon_stats
    • also need to locate USO stats / Sub stats