Talk:Craft Combat Mechanics

From UFOpaedia
Revision as of 05:43, 6 October 2011 by Volutar (talk | contribs) (→‎Acceleration: new section)
Jump to navigation Jump to search

Testing Air Combat Mechanics

Done

See main article page for completed research.

Relative rates of fire for XCom weapons

Closing speed

Control of Range

To Do

Make a hit counter

Counting rounds fired, and the ratios between rounds fired of different XCom weapons is now easily done. But it's hard to tell how many hits (and by implication misses) have occurred. Should be possible to make a hit counter by the following process:

  1. Set a test weapon to a value of 1 damage and a large ammo count (1000 maybe). In theory, this will always do 1 point of damage, since 0.5 - 1.0 range should always round to 1. Of course it depends on the rounding algorithm used, so it needs to be tested.
  2. Set a control weapon to 0 damage and a larger ammo count. This is only to make sure combat doesn't break off before you can save the game, when the test weapon runs out of ammo.
  3. Verify the test weapon. Run a thousand rounds. Hopefully the damage will average close to 1.00, maybe less.

Once the hit counter is validated it useful for lots of new tests

Test relative fire rates between XCom and UFOs

This is hard to do because it's hard to spot a hit from a UFO. It can be done approximately by using high damage, slow fire rate weapons. With a hit counter, it's possible to do it much more accurately. The XCom number of rounds fired can be easily determined from the ammo counter. The hit counter, and the XCom damage level, can then be used to determine the number of UFO rounds fired.

Test if hit probability / damage changes based on attack mode

This has not been tested in detail, it would be much easier to test with a hit counter.

Check if "Cannon Timer" is fixed or variable

Verify variable rate of fire and see if it applies to XCom

UFO rate of fire is believed (from code decompilation) to vary by 1.0x to 2.0x nominal value, reduced by Difficulty Level. Observations show the average to be 1.5x, which matches this range. What is not known is whether XCom rate of fire also varies, or if it is (for example) constant at the nominal level. The hit counter helps with verifying this. This is quite important, since it determines whether the "Cannon Timer", the baseline for all other time measurements, is a fixed time (2gs) or a variable time (2gs - 4gs, average 3gs). Test procedure:

  1. Create an XCom test craft with a test weapon, reload rate 96, damage 1, high ammo
  2. Create a UFO test craft with a test weapon, reload rate 96, damage 1
  3. Set the ranges of both weapons to be the same value, say 65km
  4. Ensure Difficulty is on Beginner, to maximise the UFO RoF penalty and keep it constant. If also testing on other difficulty levels, e.g. Superhuman, start a new game or use XComUtil to change difficulty of a saved game.
  5. Add a dmg=0 weapon with greater ammo and range, to prevent early abort of the combat
  6. First of all find out if the initial XCom shot and the first UFO return shot are synchronised, or if the return fire is delayed. Take this into account.
  7. Run short tests
  8. Repeat many times but only for short runs. If the UFO ever fires more hits than XCom, XCom is also random. If XCom always fires more times, then (probably) UFO has a random reload rate but XCom has a fixed reload rate.
  9. If the shots are always exactly synchronised, either both are fixed (contrary to the code decompilation) or both vary but use the same random value.
  10. Even with a reload rate of 96, it could be quite hard to save the game. Hopefully it won't matter much as, whatever time you save the game, the hit counts on either side will still be useful data
  11. Don't go above a reload rate of 96 in case there is a byte value that might overflow at 255.
  12. Actually saving while the Intercept window is hard anyway. Still need to figure out how to do it reliably. It might require multiple aircraft (the others must be unarmed), breaking off with another aircraft and minimising, then saving. The hotkeys from UFO Extender certainly help. Slight risk that the extra aircraft might bias the results (see Engagement by Multiple Attackers for weirdness). So unfortunately, at least at first, do tests with 2/3/4 aircraft to see if it makes a difference.

Open Questions

Can a UFO be given limited ammo?

No. When UFO fires it neigther checks ammo value nor decreasing it.

Can an XCom Craft be given a UFO-type weapon?

Can a UFO be given a hardpoint mounted weapon and ammo?

What are all the values in INTER.DAT?

Does air combat damage vs UFOs persist between Intercept screens?

I'm pretty sure it does. Once I tested using an Avenger vs a Battleship which was in a retaliation mission. I let the Avenger attack, and then withdraw after inflicting some damage and let the UFO get to a X-COM base. It took less defence hits than usual to destroy the battleship (IIRC, it was destroyed after 1 or 2 hits. The first being impossible without retaining damage, the second being very unlikely). Cesium 16:12, 15 March 2010 (EDT)

Can the attacking side be switched so that up to 4 UFOs attack one XCom plane?

Acceleration

This value of craft just for Ufopaedia information. It doesn't affect on anything of gameplay itself. It's just a virtual value.