Difficulty System - SilentChaos512/ScalingHealth GitHub Wiki
Updated 2018-10-13 for version 1.3.30. If this seems out-of-date, please bug me on my Discord server
Overview
The difficulty system in Scaling Health is separate from any vanilla system. It is tracked as a non-negative floating-point number (real number with decimal part). This is normally tracked per-player, but can be per-server. This value can go up or down on various triggers, or it can be fixed. The minimum, maximum, and starting values can be changed to any non-negative number. Settings these values to zero will effectively disable the difficulty system.
Note: I recommend using the in-game config GUI (Mods menu, select Scaling Health, click Config). Aside from applying most changes instantly, this also protects you from typos with convenient toggle buttons. If you still want to edit the file by hand, it's under config/scalinghealth/main.cfg
. If you see an asm.cfg
file, it is not used in recent versions.
How Mobs Are Affected
When any living entity (hostile or passive) is spawned, a difficulty value will be calculated, assuming the entity is not blacklisted from the difficulty system. How this value is calculated depends on the "area mode" (I'll explain in a bit) set in the config. The calculated difficulty value for the entity will be used to determine several things:
- Maximum health increase (somewhat randomized, can be disabled)
- Attack damage increase (somewhat randomized, can be disabled or capped to a specific value)
- "Blight" status (higher difficulty = more blights, can be disabled)
- Random potion effects (possible effects can be added/removed in config)
If difficulty is calculated as zero, no changes will be made to the entity, aside from adding some NBT data to mark it as "processed".
Difficulty Tracking
Difficulty can be tracked on one of two levels, per-player or per-server/world. There is also an "area mode" setting, which determines both the tracking level and how difficulty is applied to newly spawned mobs. The SERVER_WIDE
area mode causes difficulty to be tracked at the server-level. Otherwise it is tracked per player.
The per-player methods are generally more server-friendly, as new players will run into weaker mobs than those who have played a while... mostly. Any mobs that have already spawned and stuck around for whatever reason will not change difficulty, it is fixed for the life of the mob.
Things That Change Difficulty
There are quite a few options in the config, under the "difficulty" category. Most are self-explanatory. By default, difficulty increases slowly whenever the player is logged-in. You can also set difficulty to change whenever different types of mobs are killed (there are a few categories and a list where you can set values for specific mobs), or when the player dies or sleeps. There is also an "idle multiplier", which changes the time-based increases for players that are not moving.
Difficulty Calculations
The method used to calculate difficulty on a newly-spawned mob depends on the area mode. Note the area modes are listed in the config using CAPITAL_CASE
. Possible values are listed in the config setting's comment, but I strongly recommended using the in-game config GUI to change this.
Area Modes
Most modes use player difficulty for the calculation. The calculated value is called the area difficulty. All players within a certain distance of the mob apply. This distance can be changed in the config ("Search Radius"). The Y-axis (height) is ignored when calculating distance.
Player Difficulty - The difficulty value currently tracked for a specific player
Area Difficulty - The difficulty calculated for a specific point, based on the area mode and player difficulty of nearby players (if applicable)
- Weighted Average - Takes a weighted average of the difficulty of all nearby players, with distance being used for the weight. In other words, players closer to the mob will have a greater impact on its difficulty.
- Average - Simple average of all nearby players, not considering exact distance.
- Min Level - Uses the lowest difficulty level of nearby players.
- Max Level - Uses the highest difficulty level of nearby players.
- Distance from Spawn - Uses the distance from world spawn, ignores player difficulty and the Y-axis. The rate of change can be set with the "Distance Per Block" config option.
- Distance from Origin - Same as "Distance from Spawn", but measures distance from (0, 0) instead of the world spawn point.
- Distance and Time - A combination of "Weighted Average" and "Distance from Spawn".
- Server-Wide - Uses a per-server difficulty value, ignores player difficulty.
Blights
Blights are mobs that are buffed far more than most. They can be identified for by their purple fire effect. Blights can be disabled entirely and the exact changes applied can be configured to your liking. The default settings multiply difficulty by 3 and add speed, strength, and fire resistance potion effects. The effect amplifier levels can be changed and the defaults are much lower than they were in Difficult Life.
Blights will usually drop heart containers and lots of XP when killed (depending on the config). But they hit hard and move fast, so make sure you are well equipped before going anywhere near them.
Note that the chance of a mob becoming a blight scales with its calculated difficulty value. If the value is 0, it has no chance of being a blight. Specific mobs can also be blacklisted from becoming blights.