Sly 1:Difficulty: Difference between revisions

From SlyMods
Jump to navigation Jump to search
Content added Content deleted
m (afaik suck never gets harder, unless you're referring to rebooting the game/savefile to reset suck)
(Copyedit wording, layout, structure)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{About|game mechanic|data structure|Sly 1:DIFFICULTY}}
{{Infobox game mechanic
{{Infobox game mechanic
| name= Difficulty
| name= Difficulty
Line 8: Line 9:
'''Difficulty''', also called '''suck''', '''uSuck''' or '''noob mode''', is the mechanic by which the game dynamically becomes easier depending on your gameplay.
'''Difficulty''', also called '''suck''', '''uSuck''' or '''noob mode''', is the mechanic by which the game dynamically becomes easier depending on your gameplay.


== Suck Score ==
== Difficulty levels ==
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.
Sly 1 has three difficulty levels: easy, medium, and hard. Each one has a corresponding global <tt>DifficultyLevel</tt> struct in the elf. During a transition, before loading the map, the function <code>LoadSwFromBrx</code> calls <code>OnDifficultyWorldPreLoad</code>, which sets the current difficulty level based on the following criteria:


* If the [[gameworld]] is <tt>GAMEWORLD::Intro or</tt> <tt>GAMEWORLD::Clockwerk</tt>, or if the current [[worldlevel]] is <tt>WORLDLEVEL::Hub</tt>, then it sets the easy difficulty.
== Difficulty Levels ==
* If the <tt>FLS::KeyCollected</tt> flag has not been set on the current level, then it sets the medium difficulty.
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:
* In all other cases it sets the hard difficulty.
This means that the Prologue, World 5, and hub maps are always easy, and all other maps are initially medium but become hard once you collect the key. Levels which don't have a key are always medium.


== Suck score ==
* If the [[gameworld]] is Paris/the Hideout (<code>GAMEWORLD_Intro</code>) or The Cold Heart of Hate (<code>GAMEWORLD_Clockwerk</code>), or if the current [[worldlevel]] is a hub (<code>WORLDLEVEL_Hub</code>), then it sets the easy difficulty.
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]] in the save file. There is a global [[Sly 1:DIFFICULTY|DIFFICULTY]] struct called <code>g_difficulty</code> that tracks some difficulty values and stores a pointer to the current <tt>DifficultyLevel</tt> struct.
* If the key has ''not'' been collected on the level (the <code>FLS_KeyCollected</code> flag is not set), then it sets the medium difficulty.
* In all other cases it sets the hard difficulty.


=== Changing suck ===
Later on in level transition, the game calls <code>OnDifficultyWorldPostLoad</code>. 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 <code>uSuckCharmLow</code>, 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 <code>uSuckCharmHigh</code>, 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 <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 [[Sly 1:LM|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.

== Lucky charms ==
After loading the map, the game calls <code>OnDifficultyWorldPostLoad</code>. 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 <code>uSuckCharmLow</code>, it gives the player a silver charm. This value is always 0.4.
* If the player's current uSuck on the level is above <code>uSuckCharmHigh</code>, it instead gives the player a gold charm. This value is always 0.8.
The values of <code>uSuckCharmLow</code> and <code>uSuckCharmHigh</code> are determined by the currently difficulty, but for some reason they are the same for all difficulties. However, you will never get a charm on the hard difficulty because your uSuck is locked at 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 drop when you break something or kill an NPC, but this is not affected 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.


{{Navbox Sly 1}}
{{Navbox Sly 1}}

Latest revision as of 02:23, 1 June 2023

Difficulty
Game Mechanic
After dying multiple times, you are granted a lucky charm
GameSly Cooper and the Thievius Raccoonus

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

Difficulty levels

Sly 1 has three difficulty levels: easy, medium, and hard. Each one has a corresponding global DifficultyLevel struct in the elf. During a transition, before loading the map, the function LoadSwFromBrx calls OnDifficultyWorldPreLoad, which sets the current difficulty level based on the following criteria:

  • If the gameworld is GAMEWORLD::Intro or GAMEWORLD::Clockwerk, or if the current worldlevel is WORLDLEVEL::Hub, then it sets the easy difficulty.
  • If the FLS::KeyCollected flag has not been set on the current level, then it sets the medium difficulty.
  • In all other cases it sets the hard difficulty.

This means that the Prologue, World 5, and hub maps are always easy, and all other maps are initially medium but become hard once you collect the key. Levels which don't have a key are always medium.

Suck score

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 in the save file. There is a global DIFFICULTY struct called g_difficulty that tracks some difficulty values and stores a pointer to the current DifficultyLevel struct.

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.

Lucky charms

After loading the map, 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 uSuckCharmLow, it gives the player a silver charm. This value is always 0.4.
  • If the player's current uSuck on the level is above uSuckCharmHigh, it instead gives the player a gold charm. This value is always 0.8.

The values of uSuckCharmLow and uSuckCharmHigh are determined by the currently difficulty, but for some reason they are the same for all difficulties. However, you will never get a charm on the hard difficulty because your uSuck is locked at 0.

Coin drops

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