Ships and UnitY during dmg and destroy triggers inconsistent

Post bug reports and ask for game support here.

Moderator: MOD_Command

Post Reply
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

Ships and UnitY during dmg and destroy triggers inconsistent

Post by KnightHawk75 »

Observed Issue: calls to UnitY() / ScenEdit_UnitY() during Unit-Damage and Unit-Destroyed events can return inconsistent and inaccurate results, especially so when the triggering munition 'impacts' vs 'hit-miss + blast dmg'.

Scene Information (baseline: trigger-UnitDmgUnitDestroyed-postfire2.scen):
- 4 primary targets that all have different guided weapons launched at them.
- Munitions are spaced such that no two should impact during the same second as another.
- Each munition has a target code tacked onto the end of the name for easy identification.
- Damage above 51% will trigger a damage message to user and the log (99% for the MOB), noting UnitX and UnitY contents or 'nil'.
- Each targets destruction will trigger a damage message to user and the log, noting UnitX and UnitY contents or 'nil'.

Running the scene is a bit 'random' dependent, in that some runs' results vary based on if munition(s) 'hit-miss+blast dmg', if they 'impact', or if they do something else. I've included in the attached zip in the baseline folder a summary of the six (6) most common variations i noticed, three of which I will include here as they are imho the most illustrative of what can happen and when.
Run #1B Variant
--------------
NSG BUOY (158c-BUOY1) armor 100% penetrated.
NSG BUOY (158c-BUOY1) impacts, triggers damage, unitY is nil.
NSG BUOY (158c-BUOY1) impacts, triggers destroyed, unitY is nil.
NSG BUOY (sinking) (158c-BUOY2) and (158c-BUOY3) flies off till impacts surface or fuel exhausted.

11m RHIB armor 100% penetrated.
11m RHIB (84k-RHIB1) impacts, triggers damage, unitY is nil.
11m RHIB (84k-RHIB1) impacts, triggers destroyed, unitY is nil.
11m RHIB (sinking) sinks, (84k-RHIB2) flies on to eventually run out of fuel.

LAW (109J-LAW1) armor 100% penetrated.
LAW (109J-LAW1) impacts, triggers damage, unitY is nil.
LAW (109J-LAW1) impacts, triggers destroyed, unitY is nil.
LAW (sinking) sinks, (109J-LAW2) flies on to eventually run out of fuel.

MOB (109I-MOB1) armor 88% penetrated.
MOB (109I-MOB1) impacts, triggers damage, unitY is (109I-MOB1).
MOB (109I-MOB2) armor 88% penetrated.
MOB (109I-MOB2) impacts, (99.5+ damage).
MOB (109I-MOB3) impacts, triggers destroyed, unitY is (109I-MOB2) *wrong*.
MOB sinking, (109I-MOB4) flies on to impact sinking ship.
Run #2 Variant
--------------
NSG BUOY (158c-BUOY1) hits but misses causes blast dmg, trigger damage, unitY is (158c-BUOY2).
NSG BUOY (158c-BUOY2) hits but misses causes blast dmg, triggers destroyed, unitY is (158c-BUOY2).
NSG BUOY sinking.
(158c-BUOY3) flys off till fuel exhausted (i delete it to avoid weapon logic warnings)

11m RHIB (84k-RHIB1) hits but misses causes blast dmg, triggers damage, unitY is (84K-RHIB1).
11m RHIB (84k-RHIB1) hits bug misses causes blast dmg, triggers destroyed, unitY is (84K-RHIB1).
11m RHIB (sinking) sinks, (84k-RHIB2) flies on to eventually run out of fuel.

LAW (109J-LAW1) armor 100% penetrated.
LAW (109J-LAW1) impacts, triggers damage, unitY is (84K-RHIB1) *wrong*.
LAW (109J-LAW1) impacts, triggers destroyed, unitY is (84K-RHIB1) *wrong*.
LAW (sinking) sinks, (109J-LAW2) flies on to eventually run out of fuel.

MOB (109I-MOB1) armor 100% penetrated.
MOB (109I-MOB1) impacts, triggers damage, unitY is (109I-MOB1).
MOB (109I-MOB2) armor 95% penetrated.
MOB (109I-MOB2) impacts (99.5+ damage). (presumably unitY is updated to MOB2 here)
MOB (109I-MOB3) armor 97% penetrated.
MOB (109I-MOB3),impacts, triggers destroyed, unitY is (109I-MOB2) *wrong*.
MOB sinking. MOB (109I-MOB4) flies on to eventually impact surface or sinking ship.
Run #3 Variant
--------------
NSG BUOY (158c-BUOY1) hits but misses causes blast dmg, triggers damage, unitY is (158c-BUOY1).
NSG BUOY (158c-BUOY2) hits but misses causes blast dmg, triggers destroyed, unitY is (158c-BUOY2).
NSG BUOY sinking. (158c-BUOY3) flies off till impacts surface or fuel exhausted.

11m RHIB (84K-RHIB1)armor 100% penetrated.
11m RHIB (84k-RHIB1) impacts, triggers damage, unitY is (158c-BUOY1) *wrong*.
11m RHIB (84k-RHIB1) impacts, triggers destroyed, unitY is (158c-BUOY2) *wrong*.
11m RHIB (sinking) sinks, (84k-RHIB2) flies off till impacts surface or fuel exhausted.

LAW (109J-LAW1) armor 97% penetrated.
LAW (109J-LAW1) impacts, triggers damage, unitY is (158c-BUOY1) *wrong*.
LAW (109J-LAW1) impacts, triggers destroyed, unitY is (158c-BUOY2) *wrong*.
LAW (sinking) sinks, (109J-LAW2) flies off till impacts surface or fuel exhausted.

MOB (109I-MOB1) Weapon Malfunction
MOB (109I-MOB2) armor 100% penetrated.
MOB (109I-MOB2) impacts, triggers damage, unitY is (109I-MOB2).
MOB (109I-MOB3) armor 95% penetrated.
MOB (109I-MOB3) impacts (99.5+ damage). (presumably unitY is updated to MOB2 here)
MOB (109I-MOB4) armor 96% penetrated.
MOB (109I-MOB4) impacts, triggers destroyed, unitY is (109I-MOB3) *wrong*.
MOB sinking.

It would seem if a 'impact+penetration' happens UnitY() is typically not updated, the exception in the sample being the MOB. In the case of the MOB however while it's updated during and 'impact-penetration' and usually accurate for Unit-Damage, it is not for Unit-Destroyed, where it appears to use the last value of UnitY PRIOR to the actual current munition. It's unclear to me what causes this and also what is special about MOB's (and probably some other untested ship types or impact specifics).

The end result is UnitY() can not be counted on at the moment to contain accurate data or even accurate-non-data(nil), during a Unit-Destroyed event, (at least for ships?), nor during Unit-Damaged if of impact type (excluding select shiptypes? MOB is one for whatever reasons).

att: UnitY_5104622.zip
UnitY\RunSummaryOfInterest.txt
UnitY\baseline - primary test .scen file + run and exception logs for chosen runs.
UnitY\goodenums - same but units changed who all have valid ShipType enum values (.exe is missing some)
UnitY\goodenumsDiforder - same but munitions moved around such that different units get hit first,second,etc.
UnitY\noDestEvents - baseline but without Unit-Destruction events happening.
UnitY\noDmgEvents - baseline but without Unit-Damage events happening.

Repo: Play attached baseline scene, watch+click through popups. Reload scene,Do so at least 2-3 times to notice various results.

Version:1147.36 (.35 was tested as well) + DB3K491
Attachments
UnitY_5104622.zip
(433.88 KiB) Downloaded 39 times
User avatar
nukkxx5058
Posts: 3141
Joined: Thu Feb 03, 2005 2:57 pm
Location: France

RE: Ships and UnitY during dmg and destroy triggers inconsistent

Post by nukkxx5058 »

I'm also having issue with UnitY() returning nil value on destroyed trigger ... Hope this will be fixed.
Winner of the first edition of the Command: Modern Operations COMPLEX PBEM Tournament (IKE) (April 2022) :-)
User avatar
KLAB
Posts: 509
Joined: Tue Feb 27, 2007 5:24 pm

Re: RE: Ships and UnitY during dmg and destroy triggers inconsistent

Post by KLAB »

nukkxx5058 wrote: Wed Dec 29, 2021 5:07 pm I'm also having issue with UnitY() returning nil value on destroyed trigger ... Hope this will be fixed.
Testing this with 1297.1 DB 497a and SE_UnitY the weapon is consistently being returned as a value but any aircraft is not?

So I can get it to return say AA-10 from side A has shot down A-400 from side B but if SAR Helicopter A rescues pilot Captain X then SE_UnitY does not return SAR Helicopter A as the "destroying unit' is there a SAR value that can be used to trigger SE-UnitY?

I can post a demo file is necessary?
Thanks K
User avatar
michaelm75au
Posts: 12467
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

Re: Ships and UnitY during dmg and destroy triggers inconsistent

Post by michaelm75au »

Mmmm. Wouldn't expect a non-weapon to be returned.
If you post a demo, I'll have a look to see what (if anything) can be done.
Michael
User avatar
michaelm75au
Posts: 12467
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

Re: Ships and UnitY during dmg and destroy triggers inconsistent

Post by michaelm75au »

I would only expect UnitY when it actually causes the damage. If there is subsequent or collateral damage, then I would not expect UnitY to be set.

I'll have a look at the examples.
Michael
Post Reply

Return to “Tech Support”