Criteria and KillCriteria Details

From UFOpaedia
Revision as of 06:58, 8 November 2020 by Noblebright (talk | contribs) (Details on commendation criteria and killCriteria fields.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Commendation criteria are controlled by SoldierDiary.cpp, and function by iterating over the game's record of every takedown a soldier has performed. There are three types of criteria: Scalar Criteria, Noun Criteria, and Kill Criteria

Scalar Criteria depend only on one number, and are generally the number of times some specific event has occured in a soldier's career:

  • totalKills
  • totalMissions
  • totalWins
  • totalScore
  • totalStuns
  • totalDaysWounded
  • totalBaseDefenseMissions
  • totalTerrorMissions
  • totalNightMissions
  • totalNightTerrorMissions
  • totalMonthlyService
  • totalFellUnconcious
  • totalShotAt10Times
  • totalHit5Times
  • totalFriendlyFired
  • total_lone_survivor
  • totalIronMan (unit was solo)
  • totalImportantMissions (any non-ufo crash recovery mission)
  • totalLongDistanceHits (shots from more than 30 tiles away)
  • totalLowAccuracyHits (shots where the firing accuracy is less than the tile distance of the shot)
  • totalReactionFire
  • totalTimesWounded
  • totalDaysWounded
  • totalValientCrux (missions with civilians where no civilians died, and the mission was a success)
  • isDead
  • totalTrapKills
  • totalAlienBaseAssaults
  • totalAllAliensKilled
  • totalAllAliensStunned
  • totalWoundsHealed
  • totalAllUFOs
  • totalAllMissionTypes
  • totalStatGain
  • totalRevives
  • totalSoldierRevives
  • totalHostileRevives
  • totalNeutralRevives
  • totalWholeMedikit (smallest of total heal / total stim / total PK uses.)
  • totalBraveryGain
  • bestOfRank
  • bestSoldier
  • isMIA
  • totalMartyrKills
  • totalPostMortemKills
  • globeTrotter
  • totalSlaveKills (killing mind-controlled dudes)

Noun Criteria function like scalar criteria, but keep separate tallies for each noun

  • totalKillsWithAWeapon - noun is weapon
  • totalMissionsInARegion - noun is region
  • totalKillsByRace - noun is race
  • totalKillsByRank - noun is rank

Kill Criteria commendations take a killCriteria data structure:

  • killsWithCriteriaCareer
  • killsWithCriteriaMission
  • killsWithCriteriaTurn

`criteria` entries are AND grouped, so failing one criteria match fails the entire commendation match.

The killCriteria data structure has the following shape:

killCriteria => [ orCriteria* ] (Outer list of conditions is or-ed together)
orCriteria   => [ andCriteria* ]  (Inner list of conditions is and-ed together)
andCriteria  => [count, [ detail* ]] (A condition is a list of and-ed details)

Where count is the number of matching entries required to trigger the commendation All details in the detail list must match for a kill to be considered matched.

Valid details:

  • BattleTypes: BT_NONE, BT_FIREARM, BT_AMMO, BT_MELEE, BT_GRENADE, BT_PROXIMITYGRENADE, BT_MEDIKIT, BT_SCANNER, BT_MINDPROBE, BT_PSIAMP, BT_FLARE, BT_CORPSE (Type of item that killed the unit)
  • DamageTypes: DT_NONE, DT_AP, DT_IN, DT_HE, DT_LASER, DT_PLASMA, DT_STUN, DT_MELEE, DT_ACID, DT_SMOKE, DT_10, DT_11, DT_12, DT_13, DT_14, DT_15, DT_16, DT_17, DT_18, DT_19 (Type of damage that killed the unit)
  • Unit Rank: units.rank (Victim unit's rank)
  • Unit Race: units.race (Victim unit's race)
  • Weapon Name: items.type (item used)
  • Weapon Ammo: items.type (item used)
  • Kill Status String: STR_KILLED, STR_STUNNED, STR_PANICKED, STR_MINDCONTROLLED (For non-friendly units)
  • Unit Status String: STATUS_DEAD, STATUS_UNCONSCIOUS, STATUS_PANICKING, STATUS_TURNING (For friendly units)
  • Unit Faction String: FACTION_PLAYER, FACTION_HOSTILE, FACTION_NEUTRAL
  • Unit Side String: SIDE_FRONT, SIDE_LEFT, SIDE_RIGHT, SIDE_REAR, SIDE_UNDER (ie, for commending backstabs)
  • Body Part String: BODYPART_HEAD, BODYPART_TORSO, BODYPART_RIGHTARM, BODYPART_LEFTARM, BODYPART_RIGHTLEG, BODYPART_LEFTLEG