Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Random factoids about YR
#8
Part III is here!
  • AI:
    • Script Actions:
      • 6,x - Jump To Script Line: subtracts 2 from the argument, and uses the result as a 0-based index into its own line array. Passing 0 results in the team becoming unresponsive. Passing 1 results in focusing on the first line.
      • 17,x - Change Script: immediately abandons this ScriptType, and starts executing the ScriptType specified as the argument. (Finishes with calling Script Action 6, 1.)
      • 18,x - Change Team: creates the TeamType specified as an argument, liberates all of its own objects, and submits them to the newly created team's control. Limit of 6 different ObjectTypes per team still applies.
      • 31,0 - Commit Suicide: for each unit in the team, creates a fake weapon with Damage=thisUnit->CurrentHealth, Warhead= Rules->[CombatDamage]C4Warhead , and fires it at the unit in question. Naturally won't kill if C4Warhead has <100% Verses.
      • 43,0 - Wait Until Fully Loaded: Only succeeds once the team's first unit is full (that is, passengers in it == its Passengers setting, meaning it assumes all passengers are counted as if they took up one slot, which is only true for infantry). Which naturally leads to lockups when a would-be passenger is killed while trying to enter.
      • 44,0 - Unload TRUCKB: Will convert all TRUCKB in the team to TRUCKA.
      • 45,0 - Load TRUCKA: Will convert all TRUCKA in the team to TRUCKB.
      • 49,0 - Repeat Until Success: Seems more like "this team has achieved their goal". It simply sets an internal flag on the team which no other action (except Scout) ever touches. The "goal" flag is checked when dissolved the team (see the TeamTypes section below).
    • TeamTypes:
      • Group= is an actual "grouping" value for initial team assembly: the game will only recruit existing objects into a team if the object's Group= matches the Team's Group= or the Team's Group= is '-2'. These checks are not made if the team is Recruiter = yes.
      • The search for eligible objects is performed in a linear fashion running over the list of all objects currently on the map. For this purpose, the Team's Waypoint= or the owner house's central base cell is chosen as the 'home point'.
      • Once an eligible object is recruited, all the objects that were further from the home point than the recruited unit are disqualified from the search. This is repeated as long as there are objects to recruit. Objects with a Group setting different from that of the Team's are disadvantaged by artificially adding 12800 leptons to their comparable distance.
      • Each time a team is dissolved, the game iterates over the AITriggerTypes list:
        • For each trigger in that list, if the trigger's Primary TeamType is the same as is being dissolved, the trigger's probability is modified:
          • if its "goal" flag is set, Rules->[General]->AITriggerSuccessWeightDelta is added to its current probability;
          • otherwise, Rules->[General]->AITriggerFailureWeightDelta is added to its current probability.
        • In either case, the trigger's current probability is multiplied by Rules->[General]->AITriggerTrackRecordCoefficient= .
      • TransportsReturnOnUnload=yes will send away all objects with a positive Passengers = value after the first unload script action completes.
      • Each team member gets tagged with the team's Tag= , unless OnTransOnly = yes.
      • When scanning for units to recruit, the team will not take any from teams with Priority= higher than its own.
      • If Whiner=yes is set, members of the team taking any damage are treated as an attack on the AI's base and base defense operations kick in.
    • AITriggerTypes:
      • At least when deciding whether this trigger is eligible for creation, the long string of zeroes is not checked for further conditionals after the first check.
      • MinProbability and MaxProbability are interpreted as "when altering this trigger's probability, don't let it fall outside [MinProbability ... MaxProbability]".
      • Current Probability of 5000 is a special case, forcing this trigger as soon as its conditions are met, without any randomness or Threat-based selection involved.
      • "-G" is not internally enforced as a "global" suffix, the game simply tags all AITriggerTypes loaded from ai(md).ini as global and all loaded from the map as local.
      • The trigger will not be eligible as soon as either one of the two attached TeamTypes reaches its Max= , even if the other team can still be created.
      • It appears that while in skirmish a team's Max= is compared against the count of team's instances owned by the house spawning the trigger, in singleplayer Max= is compared with the total count of this team's instances on the map.
  • Rules:
    • [General]:
      • UseMinDefenseRule makes the AI settle for [General]->MinimumAIDefensiveTeams before starting other teams. When disabled, the AI will not refocus until it reaches [General]->MaximumAIDefensiveTeams instead. (Don't disable unless you have custom teams for soviets - they only have one such TeamType with Max=1, and their AI will act piss poor if it can't get this far.)
      • AIVirtualPurifiers does not apply in singleplayer campaigns.
      • SuspendPriority = suspends all TeamTypes whose Priority= is less than this, for [General]->SuspendDelay frames when base defense operations are invoked. (DZ's AI guide doesn't mention this, only the rules guide does. His AI guide states that lower Priority= makes the team more likely to get selected.)
      • PrerequisiteProcAlternate takes a _single_ VehicleType as a value, not a list.
    • [AudioVisual]:
      • ShakeScreen is still parsed and checked, but the routine supposed to shake the screen on this event has been emptied, meaning no effect happens. (EIP 00441C34) Setting it to zero will cause an IE at EIP 00441C28.
      • SplashList accepts an unlimited number of anims, and picks which one to show depending on the firing weapon's Damage= - a zero-based index is acquired by dividing Damage= by 35 and rounding down to an integer value. Is only activated if tile being attacked is Land=Water.
      • TiberiumExplosive = is only used to determine whether the tiberium carried by a just destroyed unit should explode, if a certain scenario flag is set. I don't yet have the flag, but I can say this doesn't have any effect on deciding whether raw ore lying around is explosive.
    • [BuildingTypes]:
      • IsThreatRatingNode= is broken - when a building with this set is constructed, its owner house takes note of that. However, when such a building is destroyed, its owner house thinks it still has a TRN without ever noticing it lost one. Meaning, once the TRN is built, its house will reap its benefits for the remainder of the game. Some Threat Rating related info is described below, in appendix B.
      • A BuildingType destroyed by a Sparky=yes warhead can display several instances of animations from the [AudioVisual]->OnFire list. By default, OnFire= is not defined in YR, which is why Sparky = yes warheads cause IEs. For each cell formerly occupied by the building, a random number from the interval [0 .. (Building width in cells + Building height in cells + 5)] is generated:
        • 0..4 - First animation from OnFire gets played.
        • 5..7 - Second.
        • 8 - Third.
        • 9+ - No animation.
    • [Infantry/Vehicle/Aircraft/BuildingTypes]
      • DestroyAnim= can take a list of animations and will pick one at random to display.
      • Things that will not retaliate:
        • Objects without weapons (duh...).
        • Infantry possessing C4 (against buildings).
        • Objects with CanRetaliate=no.
        • Enslaved objects.
        • Mind Controllers with no spare links.
        • Objects owned by human players that currently have a target.
        • Objects attacked by countries allied with their owners.
        • Human-owned vehicles that deploy into buildings with Artillary=yes.
        • Human-owned non-building objects that are not in (Guard/Area Guard/Patrol) missions when [General]->PlayerReturnFire = no.
        • AI units managed by a TeamType with Suicide=yes.
        • AI units that already have a target, given that this attacker poses exactly as much threat after ThreatRating work (weird, but hey, I didn't write the code, albeit changing it to "posing as much or less threat" would most likely be a one byte change).
        • Objects whose weapon has 1% or less Verses against attacker armor type (the code is if Verses <= 0.01, very bad float math practice but I am not sure this is the sole reason why the infamous "1% doesn't differ from 2%" bug exists).
    • Projectiles:
      • If Degenerates = yes, then the weapon loses 1 point of damage per frame until its damage drops to 5. Only applicable if the projectile also is Dropping = yes, ROT > 0, or Ranged = yes. (As far as I can see, this is the only place where Ranged = is validated.)
    • [Warheads]:
      • AnimList accepts an unlimited number of anims, and picks which one to show depending on the firing weapon's Damage= - a zero-based index is acquired by dividing Damage= by 25 and rounding down to an integer value. Special case: if EMEffect=yes, it will pick a random anim from AnimList= . Special case: if warhead is the same one as [CombatDamage]->LightningWarhead= , then the animation played will be [AudioVisual]->LightningConBoltExplosion= .
    • [TerrainTypes]:
      • [General]->TreeStrength= is used as a fallback in case you don't explicitly specify a Strength= for this TerrainType or specify -1 as the Strength = .
    • [OverlayTypes]:
      • If Explodes=yes is set, upon receiving any damage this Overlay erases itself and causes an additional explosion which uses [CombatDamage]->AmmoCrateDamage= and [CombatDamage]->C4Warhead= . This will iterate over the debris list in [General]->BarrelDebris with an 85% chance of spawning each debris, and a 25% chance this will also spawn the particle from [General]->BarrelParticle.
      • If Tiberium=yes is set, then this overlay receives Armor=wood.
    • Miscellaneous:
      • Reason for the [General]->PrismSupportModifier glitch: All INI "parse a value" functions take a "fallback" argument which defines the value to use if parsing fails. When reading rules, PSM is read with fallback = 0. Being a float value, PSM is multiplied by 100 and saved. Later, when reading map, if [General] is present, PSM is read with fallback = (saved PSM value from Rules). The value returned by this parser is multiplied by 100 and saved. Which means, if you haven't specified PSM in the map's [General] but the map has [General], the correct PSM value gets multiplied by 100 again.
      • Content Scan is performed by summing up the Points= and ThreatPosed= of all passengers present aboard a transport, adding the transport's own Points= , and adding the transport's own Points= and ThreatPosed= . This is done if difficulty control says ContentScan = yes or the house's IQ level is equal to or above the level in [IQ]->ContentScan = . Otherwise, only the transport's own Points= + ThreatPosed= are counted.
      • As has been mentioned by VK before, the game reads <mapname>.ini when loading a map and interprets it as a rules-addon. It also reads LANGRULE.INI and interprets it the same way.
      • As has been mentioned by VK before, the game still contains residual code meant to load all RULEMD*.INI files as alternatives to RULESMD.INI and give the user a choice to pick which one s/he would like to use. Recreating a dialog with resource ID 0x93 will activate said functionality, although I haven't closely inspected the code that actually populates the list and interprets it.
  • Art:
    • When an animation is triggered over water, the engine generates feedback animations: if the animation has IsMeteor = yes, then it plays the last entry on [AudioVisual]->SplashList list, otherwise it plays the first entry from that same list and the animation from [AudioVisual]->Wake . Neither event is fired if the animation has an ExpireAnim set.
    • If the animation has defined a Spawns = flag, the engine picks a random number from 0 to SpawnCount, adds it to another random number from that same interval, and spawns that many instances of the animation listed in Spawns, all at the same position.
    • Setting TrailerSeperation (not my fault WW can't spell) to zero will cause an IE.
    • Setting Layer=Air on an item forces its Z position to [General]->FlightLevel = .
    • MakeInfantry = falls back to giving ownership of spawned animation to a house named "Civilian" unless this animation has a valid house as an owner. Ownership for this purpose is set only in the following cases:
      • * if the anim is the [AudioVisual]->InfantryVirus/InfantryMutate and is a result of an infantry getting killed;
      • * if the anim is called PSIWARN and spawned as a "PsiWarning" (when a nuke is launched, and its target cell is within radius of a Psychic Sensor, PSIWARN is played as a hint for the owner of said Sensor).
    • HideIfNoOre = does exactly what it says, _hides_ the animation if the tile contains no ore. The animation still gets played, and all associated effects such as spawned Particles, do get created, the anim is just not drawn onto the screen. This is also what happens to the [AudioVisual]->Behind animation if the option to show hidden objects is disabled.
  • Maps:
    • [Tags]:
      • Unlike Triggers, which use "0 - single-shot, any other - repeating" comparison, Tags use "0 - single-shot, 2 - repeating, any other - inactive" comparison. Consistency is for the weak-minded!
    • [Events]:
      • In fact, there is a limit on how many events a Trigger can have. In addition to the event listing string being < 512 chars long, the trigger cannot support over 32 events correctly (same reason as why there can't be over 32 countries in an Owner= string).

Appendix B: Threat Rating
If the house owning this unit does possess a Threat Rating Node, then its TargetEffectivenessCoefficient and related ones are used, otherwise the Dumb- counterparts from [General] are.

As I mentioned earlier, a unit can specify its own TargetEffectivenessCoefficient, TargetStrengthCoefficient and other threat evaluation coefficients or fallback to the defaults in [General]. Below, all unqualified flags are assumed to be referring to "this unit" and not the "Attacker".

A unit evaluates how much threat an Attacker poses to it this way:
Code:
tempValue = Attacker weapon's Verses against this unit * TargetEffectivenessCoefficient;
if(Attacker is currently targeting this unit) { // don't look at me, I didn't write the code
    tempValue = tempValue * (-1);
}
Threat = tempValue;

tempValue = Attacker->SpecialThreatValue (floating point number, btw, not just 0 or 1) * TargetSpecialThreatCoefficient;
Threat = Threat + tempValue;

if(this unit is currently considering Attacker's owner house as the Enemy House ) {
    Threat = Threat + [General]->EnemyHouseThreatBonus;
}

tempValue = This unit's weapon's Verses against Attacker * MyEffectivenessCoefficient;
Threat = Threat + tempValue;

tempValue = TargetStrengthCoefficient * Attacker's current health percentage;
Threat = Threat + tempValue;

tempValue = TargetDistanceCoefficient * Distance between this unit and Attacker;
Threat = Threat + tempValue;

Threat = Threat + 100000;
The result is only used in a couple of cases - when deciding whether to retaliate and in one other case which I haven't quite figured out.


P. S. Next time, I'm planning to describe the way common objects (Infantry/Vehicle/Aircraft/BuildingTypes and rules generic sections such as General, CombatDamage, etc.) are loaded from INI, i.e. which flags are read, what value types they take, etc. Unless anyone has other wishes, of course. That will take up a lot of space, so I will probably do one ObjectType per post (a lot more chances for you to click Thanks too Big Grin 2 ).

P.P.S. Of course, I could stop posting this stuff if nobody actually finds it interesting.

P.P.P.S. Also, I have a revised Map Actions information table that I'm going to post at ModEnc soon.

Worth playing: 1 | 2 | 3
Reply


Messages In This Thread
Random factoids about YR - by DCoder - 29.01.2008, 21:14:24
RE: Random factoids about YR - by Blade - 30.01.2008, 13:43:08
RE: Random factoids about YR - by TSHyper - 30.01.2008, 17:45:49
RE: Random factoids about YR - by DCoder - 31.01.2008, 22:52:13
RE: Random factoids about YR - by TSHyper - 01.02.2008, 20:53:25
RE: Random factoids about YR - by MRMIdAS - 26.08.2008, 02:07:26
RE: Random factoids about YR - by MRMIdAS - 14.06.2009, 02:29:18
RE: Random factoids about YR - by Bobingabout - 01.02.2008, 11:06:42
RE: Random factoids about YR - by gordon-creAtive - 01.02.2008, 12:35:52
RE: Random factoids about YR - by DCoder - 20.02.2008, 22:10:32
RE: Random factoids about YR - by Marshall - 20.02.2008, 23:47:36
RE: Random factoids about YR - by gordon-creAtive - 21.02.2008, 21:22:08
RE: Random factoids about YR - by pd - 22.02.2008, 16:19:57
RE: Random factoids about YR - by TSHyper - 22.02.2008, 18:17:36
RE: Random factoids about YR - by DCoder - 22.02.2008, 18:22:34
RE: Random factoids about YR - by DCoder - 11.03.2008, 21:16:33
RE: Random factoids about YR - by gordon-creAtive - 12.03.2008, 11:37:32
RE: Random factoids about YR - by Vinifera7 - 09.04.2008, 11:19:25
RE: Random factoids about YR - by DCoder - 10.05.2008, 19:10:33
RE: Random factoids about YR - by Guest - 25.08.2008, 13:26:40
RE: Random factoids about YR - by DCoder - 25.08.2008, 15:18:34
RE: Random factoids about YR - by DCoder - 01.03.2009, 22:40:17
RE: Random factoids about YR - by Nighthawk - 08.03.2009, 01:18:12
RE: Random factoids about YR - by DCoder - 08.03.2009, 09:29:45
RE: Random factoids about YR - by AlliedG - 14.06.2009, 00:09:55
RE: Random factoids about YR - by Guest - 29.11.2010, 18:54:08
RE: Random factoids about YR - by DCoder - 30.11.2010, 07:19:14
RE: Random factoids about YR - by lilyroads - 18.07.2011, 15:51:56



Users browsing this thread: 1 Guest(s)