Sly 1:Difficulty: Difference between revisions

From SlyMods
Jump to navigation Jump to search
Content added Content deleted
m (→‎Difficulty Levels: Tweaked wording)
(Cleanup, moved Sly 2 section to its own article)
Line 1: Line 1:
{{Infobox game mechanic
| sly1= y
| official= y
}}

'''Difficulty''', also called '''suck''', '''uSuck''' or '''noob mode''', is the mechanic by which the game dynamically becomes easier or harder depending on your gameplay.
'''Difficulty''', also called '''suck''', '''uSuck''' or '''noob mode''', is the mechanic by which the game dynamically becomes easier or harder depending on your gameplay.


== Sly 1 ==
== Suck Score ==
In Sly 1, the player is assigned a uSuck score between 0.0 and 1.0 for each individual level. These scores are stored on the [[LS|level states]] and persist between loads. There is a global <code>DIFFICULTY</code> struct called <code>g_difficulty</code> that tracks some difficulty values and stores a pointer to the current <code>DifficultyLevel</code> struct.
In Sly 1, the player is assigned a uSuck score between 0.0 and 1.0 for each individual level. These scores are stored on the [[LS|level states]] and persist between loads. There is a global <code>DIFFICULTY</code> struct called <code>g_difficulty</code> that tracks some difficulty values and stores a pointer to the current <code>DifficultyLevel</code> struct.


=== Difficulty Levels ===
== Difficulty Levels ==
Sly 1 has three difficulty levels: easy, medium, and hard, each with a corresponding global <code>DifficultyLevel</code> struct. During a level transition, during execution of the function <code>LoadSwFromBrx</code>, the game calls <code>OnDifficultyWorldPreLoad</code>. This function sets the current difficulty level based on the following conditions:
Sly 1 has three difficulty levels: easy, medium, and hard, each with a corresponding global <code>DifficultyLevel</code> struct. During a level transition, during execution of the function <code>LoadSwFromBrx</code>, the game calls <code>OnDifficultyWorldPreLoad</code>. This function sets the current difficulty level based on the following conditions:


Line 15: Line 20:
* If the player's current uSuck on the level is above the difficulty level's <code>uSuckCharmHigh</code>, it instead grants the player a gold charm. This value is always 0.8.
* If the player's current uSuck on the level is above the difficulty level's <code>uSuckCharmHigh</code>, it instead grants the player a gold charm. This value is always 0.8.


=== Changing Suck ===
== Changing Suck ==
On the easy and medium difficulty, your uSuck increases by a 0.1 each time you die. Triggering a checkpoint for the first time lowers your suck by 0.8, and collecting a key resets your suck to 0. These changes happen by function calls to <code>OnDifficultyPlayerDeath</code>, <code>OnDifficultyTriggerCheckpoint</code>, and <code>OnDifficultyCollectKey</code> respectively.
On the easy and medium difficulty, your uSuck increases by a 0.1 each time you die. Triggering a checkpoint for the first time lowers your suck by 0.8, and collecting a key resets your suck to 0. These changes happen by function calls to <code>OnDifficultyPlayerDeath</code>, <code>OnDifficultyTriggerCheckpoint</code>, and <code>OnDifficultyCollectKey</code> respectively.


On the hard difficulty, uSuck is always locked at 0, even if something would normally increase it. This is because each difficulty level stores a [[limit]] that the suck value is always clamped between; for easy and medium, this limit is from 0.0 to 1.0, but for the hard difficulty this limit is from 0.0 to 0.0.
On the hard difficulty, uSuck is always locked at 0, even if something would normally increase it. This is because each difficulty level stores a [[limit]] that the suck value is always clamped between; for easy and medium, this limit is from 0.0 to 1.0, but for the hard difficulty this limit is from 0.0 to 0.0.


=== Coin Drops ===
== Coin Drops ==
Difficulty also controls how many coins you get when you break something or kill an NPC, but this is not controlled by the difficulty level{{Check}}. Each time the player breaks something, the function <code>OnDifficultyBreak</code> is called to calculate the number of coins to drop.
Difficulty also controls how many coins you get when you break something or kill an NPC, but this is not controlled by the difficulty level{{Check}}. Each time the player breaks something, the function <code>OnDifficultyBreak</code> is called to calculate the number of coins to drop.


== Sly 2 ==
{{Navbox Sly 1}}
In {{Sly 2}}, uSuck is set on a per-mission basis{{Check}}. It ranges from 0.0f to 1.0f and increases each time you die or fail a job.

The uSuck value is used in the level scripts to make certain aspects of the game easier. For instance, in [[Moonlight Rendezvous]], Neyla will start off only waiting 5 seconds{{check}} for you to catch up with her. As your suck increases, the time she waits also increases to a maximum of 20 seconds.{{check}} This is done by multiplying the suck value by 15.0f and adding it to the base value of 5.0f to get the number of seconds Neyla waits before you fail the job.
[[Category:Game mechanics]]
[[Category:Game mechanics in Sly 1]]
[[Category:Game mechanics in Sly 2]]

Revision as of 18:06, 23 July 2022

Difficulty
Game Mechanic
GameSly Cooper and the Thievius Raccoonus

Difficulty, also called suck, uSuck or noob mode, is the mechanic by which the game dynamically becomes easier or harder depending on your gameplay.

Suck Score

In Sly 1, the player is assigned a uSuck score between 0.0 and 1.0 for each individual level. These scores are stored on the level states and persist between loads. There is a global DIFFICULTY struct called g_difficulty that tracks some difficulty values and stores a pointer to the current DifficultyLevel struct.

Difficulty Levels

Sly 1 has three difficulty levels: easy, medium, and hard, each with a corresponding global DifficultyLevel struct. During a level transition, during execution of the function LoadSwFromBrx, the game calls OnDifficultyWorldPreLoad. This function sets the current difficulty level based on the following conditions:

  • If the gameworld is Paris/the Hideout (GAMEWORLD_Intro) or The Cold Heart of Hate (GAMEWORLD_Clockwerk), or if the current worldlevel is a hub (WORLDLEVEL_Hub), then it sets the easy difficulty.
  • If the key has not been collected on the level (the FLS_KeyCollected flag is not set), then it sets the medium difficulty.
  • In all other cases it sets the hard difficulty.

Later on in level transition, the game calls OnDifficultyWorldPostLoad. This function compares the player's current uSuck on the level to the current difficulty level.

  • If the player's current uSuck on the level is above the difficulty level's uSuckCharmLow, it grants the player a silver charm. This value is always 0.4.
  • If the player's current uSuck on the level is above the difficulty level's uSuckCharmHigh, it instead grants the player a gold charm. This value is always 0.8.

Changing Suck

On the easy and medium difficulty, your uSuck increases by a 0.1 each time you die. Triggering a checkpoint for the first time lowers your suck by 0.8, and collecting a key resets your suck to 0. These changes happen by function calls to OnDifficultyPlayerDeath, OnDifficultyTriggerCheckpoint, and OnDifficultyCollectKey respectively.

On the hard difficulty, uSuck is always locked at 0, even if something would normally increase it. This is because each difficulty level stores a limit that the suck value is always clamped between; for easy and medium, this limit is from 0.0 to 1.0, but for the hard difficulty this limit is from 0.0 to 0.0.

Coin Drops

Difficulty also controls how many coins you get when you break something or kill an NPC, but this is not controlled by the difficulty level[check]. Each time the player breaks something, the function OnDifficultyBreak is called to calculate the number of coins to drop.