Difference between revisions of "HPL2/AMFP/Infection"

From Frictional Wiki
< HPL2‎ | AMFP
Jump to navigation Jump to search
m (Syntax highlightin fix)
 
(2 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
The mechanic is quite similar to sanity from TDD. It is a meter which fills up in certain circumstances and plays visual and sound effects, which depend on the meter's value.
 
The mechanic is quite similar to sanity from TDD. It is a meter which fills up in certain circumstances and plays visual and sound effects, which depend on the meter's value.
  
Currently the only known way of raising the infection meter is the infection areas. There are multiple of them placed in the game, but they all have been deactivated (which means that they can be restored).
+
The infection meter is primarily changed by Infection areas. There are multiple of them placed in the game, but they all have been deactivated (which means that they can be restored). Infection areas can either increase or decrease infection. The only other functional method of changing infection (outside of scripting) is by standing in a Liquid area with the InfectionLevel variable set.
  
There are 4 levels of infection, all of which play increasingly noticeable effects. The first level is when the player has infection above zero. After reaching level 3, the player can't run, and at level 4 their movement speed is cut in half.
+
There are 4 levels of infection, all of which play increasingly noticeable screen effects (sepia, image trails, and radial blur).
 +
{|class=wikitable
 +
! Level !! Value Range (Check) !! Value (Set) !! Effects
 +
|-
 +
| 0 || 0 || 0 ||
 +
|-
 +
| 1 || 1-25 || 30 ||
 +
|-
 +
| 2 || 26-50 || 50 ||
 +
|-
 +
| 3 || 51-75 || 70 || Running disabled
 +
|-
 +
| 4 || 76-100 || 90 || Running disabled, -50% speed
 +
|-
 +
|}
  
The meter goes down automatically after the player leaves the infected area. It will gradually fall to zero, unless the player has gathered above 80 infection; in that case, they will die even if the meter goes down to level 3. Interestingly, above 75 the infection stops to fall, which leaves a tight margin of 5 infection points which won't kill the player but will not decrease.
+
Infection levels are calculated differently when going from level to value when checking infection level compared to setting infection level. Because of this quirk, setting infection to level 1 actually puts it in the level 2 range.
 +
 
 +
The meter goes down automatically after the player leaves the infected area. It will gradually fall to zero, unless the player has gathered above 80 infection; in that case, they will die after 2 seconds (unless "faux mode" is enabled). Interestingly, infection no longer decreases over time above 75, which leaves a tight margin of 5 infection points which won't kill the player but will not decrease.
  
 
Currently the only way to view the meter (aside from the audiovisual effects) is to press F1 in debug mode and turn on player info.
 
Currently the only way to view the meter (aside from the audiovisual effects) is to press F1 in debug mode and turn on player info.
Line 17: Line 33:
 
== Other evidence ==
 
== Other evidence ==
  
According to this fragment of '''game.cfg''', the infection system was a slightly modified version of the sanity mechanic.
+
According to these sections of '''game.cfg''', the infection system was a slightly modified version of the sanity mechanic.
  
 
<syntaxhighlight lang="xml">
 
<syntaxhighlight lang="xml">
Line 38: Line 54:
 
     InfectionArea_CheckTimeMin = "1"
 
     InfectionArea_CheckTimeMin = "1"
 
     InfectionArea_CheckTimeMax = "2"
 
     InfectionArea_CheckTimeMax = "2"
 +
/>
 +
 +
<Player_Infection
 +
 +
HitZoomInSpeed = "3.5"
 +
HitZoomOutSpeed = "0.6"
 +
HitZoomInFOVMul = "0.06"
 +
HitZoomInAspectMul = "0.15"
 +
 +
InfectionDecreaseSpeed = "0.75"
 +
InfectionDecreaseLimitLevel = "3"
 +
 +
InfectionVeryHighLimit = "80"
 +
InfectionEffectsStart = "35"
 +
 +
InfectionWaveAlphaMul = "1"
 +
InfectionWaveSpeedMul = "1"
 +
 +
CheckEnemyNearOrSeenInterval = "0.3"
 +
 +
NearEnemyDecrease = "0.3"
 +
NearCritterDecrease = "0.1"
 +
 +
StartSwayMinInfection = "15"
 +
SwayMaxSavedPositions = "30"
 +
 +
  HighInfectionLimitForDeathTimer = "80"
 +
TimeUntilDeathAtHighInfection = "2"
 +
 +
LightLampMinInfectionIncrease = "0.1"
 +
LightLampMaxInfectionIncrease = "5"
 +
 
 +
  NumberOfInfectionLevels = "4"
 +
 
 +
  InfectionLevelOneSpeedMultiplier = "1.0"
 +
  InfectionLevelTwoSpeedMultiplier = "1.0"
 +
  InfectionLevelThreeSpeedMultiplier = "1.0"
 +
  InfectionLevelFourSpeedMultiplier = "0.5"
 +
 
 +
  MaxInfectionLevelAtWhichPlayerCanRun = "2"
 +
 
 +
  GradientThresholdOffset = "1.1"
 +
  GradientFallofExponent = "8.0"
 +
  InfectionMapZoom = "0.95"
 +
 
 +
  VomitEffectDuration ="3.0"
 +
 
 +
  InfectionEffectGrowSpeed = "1"
 
/>
 
/>
 
</syntaxhighlight>
 
</syntaxhighlight>
Line 45: Line 109:
 
The mentioned sanity events config file contains exactly the same data as TDD, which means that it wasn't used in the end.
 
The mentioned sanity events config file contains exactly the same data as TDD, which means that it wasn't used in the end.
  
Interestingly, infection was supposed to fall near creatures:
+
Infection was supposed to increase near creatures, yet the config still has the old sanity property names:
  
 
<syntaxhighlight lang="xml">
 
<syntaxhighlight lang="xml">
Line 52: Line 116:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
However, this seems to have no effect. Being near either of those doesn't seem to lower the infection meter.
+
The proper names for these are <code>NearEnemyIncrease</code> and <code>NearCritterIncrease</code>, although only CritterSpider increases infection, as a result of repurposed TDD code.
  
The lantern might have shone brighter, too:
+
These property names were changed to replace "Sanity" with "Infection", but are entirely unused:
  
 
<syntaxhighlight lang="xml">
 
<syntaxhighlight lang="xml">
Line 61: Line 125:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Pigman enemies have unused vomit animations and unused entity parameters, such as:
+
ManPig enemies have unused vomit animations and unused entity parameters, such as:
  
 
* DistanceAtWhichFleeingPigVomitAttacks
 
* DistanceAtWhichFleeingPigVomitAttacks
Line 67: Line 131:
 
* MinTimeBeforeIgnoringPlayerAfterVomit
 
* MinTimeBeforeIgnoringPlayerAfterVomit
  
These seem to indicate that the pig enemies would have to run away from the player and would attack them with vomit in the process, possibly increasing their infection meter. It is also further evidenced by this part of the game.cfg:
+
These seem to indicate that ManPigs would have attacked the player by vomiting, increasing the infection meter. The C++ source code shows that being vomited on would instantly set infection to the maximum level:
  
<syntaxhighlight lang="xml">
+
<syntaxhighlight lang="c++">
<Player_Infection
+
void cLuxPlayer::VomitDamage()
 +
{
 +
mfTimeSinceLastVomit = 0.0f;
  
    HitZoomInSpeed = "3.5"
+
/*if ( GetInfectionLevel() < 3 )
    HitZoomOutSpeed = "0.6"
+
{
    HitZoomInFOVMul = "0.06"
+
SetInfectionLevel( 3 );
    HitZoomInAspectMul = "0.15"
+
}
 +
else*/ if ( GetInfectionLevel() < 4 )
 +
{
 +
SetInfectionLevel( 4 );
 +
}
 +
}
 
</syntaxhighlight>
 
</syntaxhighlight>
  
A particle effect called "''pig_attack_vomit''" was also left in the game.
+
A particle effect called "''ps_pig_attack_vomit''" was also left in the game.
  
 
== Missing parts ==
 
== Missing parts ==

Latest revision as of 20:51, 19 January 2025

Infection

Infection is a mechanic which was cut from the final game, but it wasn't fully removed from it.

Overview

The mechanic is quite similar to sanity from TDD. It is a meter which fills up in certain circumstances and plays visual and sound effects, which depend on the meter's value.

The infection meter is primarily changed by Infection areas. There are multiple of them placed in the game, but they all have been deactivated (which means that they can be restored). Infection areas can either increase or decrease infection. The only other functional method of changing infection (outside of scripting) is by standing in a Liquid area with the InfectionLevel variable set.

There are 4 levels of infection, all of which play increasingly noticeable screen effects (sepia, image trails, and radial blur).

Level Value Range (Check) Value (Set) Effects
0 0 0
1 1-25 30
2 26-50 50
3 51-75 70 Running disabled
4 76-100 90 Running disabled, -50% speed

Infection levels are calculated differently when going from level to value when checking infection level compared to setting infection level. Because of this quirk, setting infection to level 1 actually puts it in the level 2 range.

The meter goes down automatically after the player leaves the infected area. It will gradually fall to zero, unless the player has gathered above 80 infection; in that case, they will die after 2 seconds (unless "faux mode" is enabled). Interestingly, infection no longer decreases over time above 75, which leaves a tight margin of 5 infection points which won't kill the player but will not decrease.

Currently the only way to view the meter (aside from the audiovisual effects) is to press F1 in debug mode and turn on player info.

Other evidence

According to these sections of game.cfg, the infection system was a slightly modified version of the sanity mechanic.

<Infection
    EventsFile = "misc/main_sanity_events.cfg"

    MinTimeBetweenEvents = "300"
    MaxEventSanity = "65"

    MaxSanity_LongWait = "65"
    MaxSanity_MedWait = "45"
    MaxSanity_ShortWait = "25"

    TimeBetween_LongWait = "270"
    TimeBetween_MedWait = "180"
    TimeBetween_ShortWait = "80"

    MinExamineInfection = "50"

    InfectionArea_CheckTimeMin = "1"
    InfectionArea_CheckTimeMax = "2"
/>

<Player_Infection
	
	HitZoomInSpeed = "3.5"
	HitZoomOutSpeed = "0.6"
	HitZoomInFOVMul = "0.06"
	HitZoomInAspectMul = "0.15"
	
	InfectionDecreaseSpeed = "0.75"
	InfectionDecreaseLimitLevel = "3"
	
	InfectionVeryHighLimit = "80"
	InfectionEffectsStart = "35"
	
	InfectionWaveAlphaMul = "1"
	InfectionWaveSpeedMul = "1"
	
	CheckEnemyNearOrSeenInterval = "0.3"
	
	NearEnemyDecrease = "0.3"
	NearCritterDecrease = "0.1"
	
	StartSwayMinInfection = "15"
	SwayMaxSavedPositions = "30"
	
  HighInfectionLimitForDeathTimer = "80"
	TimeUntilDeathAtHighInfection = "2"
	
	LightLampMinInfectionIncrease = "0.1"
	LightLampMaxInfectionIncrease = "5"
  
  NumberOfInfectionLevels = "4"
  
  InfectionLevelOneSpeedMultiplier = "1.0"
  InfectionLevelTwoSpeedMultiplier = "1.0"
  InfectionLevelThreeSpeedMultiplier = "1.0"
  InfectionLevelFourSpeedMultiplier = "0.5"
  
  MaxInfectionLevelAtWhichPlayerCanRun = "2"
  
  GradientThresholdOffset = "1.1"
  GradientFallofExponent = "8.0"
  InfectionMapZoom = "0.95"
  
  VomitEffectDuration ="3.0"
  
  InfectionEffectGrowSpeed = "1"
/>

However, in the game it uses a separate meter (which is visible via the aforementioned debug menu method).

The mentioned sanity events config file contains exactly the same data as TDD, which means that it wasn't used in the end.

Infection was supposed to increase near creatures, yet the config still has the old sanity property names:

    NearEnemyDecrease = "0.3"
    NearCritterDecrease = "0.1"

The proper names for these are NearEnemyIncrease and NearCritterIncrease, although only CritterSpider increases infection, as a result of repurposed TDD code.

These property names were changed to replace "Sanity" with "Infection", but are entirely unused:

   LightLampMinInfectionIncrease = "0.1"
   LightLampMaxInfectionIncrease = "5"

ManPig enemies have unused vomit animations and unused entity parameters, such as:

  • DistanceAtWhichFleeingPigVomitAttacks
  • MinimumTimeBetweenVomitAttacks
  • MinTimeBeforeIgnoringPlayerAfterVomit

These seem to indicate that ManPigs would have attacked the player by vomiting, increasing the infection meter. The C++ source code shows that being vomited on would instantly set infection to the maximum level:

void cLuxPlayer::VomitDamage()
{
	mfTimeSinceLastVomit = 0.0f;

	/*if ( GetInfectionLevel() < 3 )
	{
		SetInfectionLevel( 3 );
	}
	else*/ if ( GetInfectionLevel() < 4 )
	{
		SetInfectionLevel( 4 );
	}
}

A particle effect called "ps_pig_attack_vomit" was also left in the game.

Missing parts

When the infection is used in-game by enabling the infection areas, some errors get printed to the log:

ERROR: Could not load sound 'infection_loop_1'
ERROR: Can't find sound 'infection_loop_1'!
ERROR: Couldn't create SoundEntity 'infection_drain_high.snt'
ERROR: Couldn't create SoundEntity 'infection_heartbeat.snt'
WARNING: Could not find language file entry 'InfectionHigh'
ERROR: Couldn't create SoundEntity 'infection_pant.snt'

This indicates that some of the sound entity (.snt) files are missing. They don't have the raw sound files (.ogg) either.

Furthermore, the game displays an empty hint when player reaches level 4 of infection. Its lang file name is "InfectionHigh", which means that it can be remade and will display automatically. It is unknown if hints for other infection levels exist.