DynamicDifficulty
Description
Are Minecraft’s mobs not challenging enough for you? Do you find that survival lacks the tension it once had because the mobs no longer pose any threat to you? On the other hand, maybe you find some of Minecraft’s mobs too challenging. Perhaps you wish that these mobs were less difficult and overwhelming. If you fall into either of these groups or just want more control over the difficulty of the mobs in general, then DynamicDifficulty may be the plugin you are looking for.
What is dynamic difficulty?
Dynamic difficulty is a system where the difficulty of the videogame scales up or down in the middle of game play to match how well the player is currently performing at the game. In the case of this plugin, DynamicDifficulty scales how tough the mobs are based on its assessment of the player’s capability to fight off the mobs.
Performance Levels
Each player has one “auto performance level” for each type of hostile mob (not including bosses). A player’s auto performance level can range anywhere from 50 to 200 with 100 being the default value. 100 means that the mob is at its normal level of difficulty. 200 means that the mob is twice as tough as normal, and 50 means that the mob is only half as tough.
As a player fights each type of mob, the plugin calculates the player’s auto performance levels based on how much damage a player receives from a type of mob on average and how much damage a player gives to a type of mob on average.
Players also have a “manual performance level” for each mob if they would prefer to set the difficulty manually rather than have the plugin calculate the difficulty for them.
The plugin scales certain attributes of the mobs based on the player’s performance level for that mob. The chart below shows how much the mob attributes scale in relation to some sample performance levels.
Example Performance Level | 50 | 100 | 200 |
Attack Damage (% of damage normally dealt) | 50 | 100 | 200 |
Defense (% of damage normally taken) | 200 | 100 | 50 |
Speed (% of normal speed) | 75 | 100 | 150 |
Knockback Resistance (%) | 0 | 0 | 50 |
Max Follow Distance (% of normal distance) | 100 | 100 | 200 |
XP (multiply amount of xp normally dropped by this %) | 100 | 100 | 200 |
Loot* (multiply amount of loot normally dropped by this %) | 100 | 100 | 200 |
*
Loot scaling does not affect items worn or held by the mob; it only affects standard drops.
Note that this plugin scales the mob's attributes based on the player the mob is currently targeting. This means that this plugin can cater the difficulty to each individual player on the server all simultaneously.
Settings
DynamicDifficulty provides several adjustable settings for each type of mob.
Difficulty Settings
There are three difficulty settings: auto, manual, and disabled.
Setting | Description |
auto | The plugin will calculate your auto performance level and use it to scale the mob’s attributes. |
manual | The plugin will not calculate your auto performance level. It will change the mob’s attributes based on the manual performance level you provide. |
disabled | The mob’s attributes will not change from their normal values. |
Max Increment
Every 30 seconds, the plugin will update a player’s auto performance level. The max increment setting determines the maximum amount that a player’s auto performance level can change by in a single update. For example, if the player’s max increment is 10 and the player’s current auto performance level is 100 and the plugin determines that the player’s auto performance level should be 150, during the first update, it will change it to 110. Every 30 seconds, the player’s auto performance level will change by 10 units until it reaches 150.
Scale Attributes
Scaling for the following attributes of the mob can be toggled to true or false so that the plugin either will scale them based on the player’s performance level or will not scale them.
- Attack
- Defense
- Speed
- Knockback resistance
- Max follow distance
- XP
- Loot
Commands
DynamicDifficulty features commands to allow players fine-tuned control over the difficulty of the mobs. Commands are listed here: Commands.
Permissions
DynamicDifficulty features permissions to allow or deny players from using certain commands. Permission nodes are listed here: Permissions.
Configuration
Each player has a config file, named <player-uuid>.yml. When the player logs onto the server, the plugin will generate this file if the file does not exist. It will be placed in the "players" folder. The plugin saves a player’s dynamic difficulty settings to their config file when they log out. The next time a player logs onto the server, their data will be loaded back up.
The plugin will also generate a default_player.yml file. Server owners can specify default values for players’ settings using this file. When the plugin goes to generate the player's config file for the first time, it will load the values from default_player.yml.
The default config for default_player.yml is listed here: Configuration.
Source Code
The source code can be viewed here: Source Code.
Important Information
- The descriptions here are for the most current version of DynamicDifficulty. Older versions of the plugin do not have some of the features listed here and some features have changed slightly between updates.
- Each version of DynamicDifficulty is only compatible with the version of Bukkit it is listed with.
- As of DynamicDifficulty v1.3.0, this plugin is compatible with the new UUID system. Previous versions use a player’s name to link them with a yml file. Under old versions, if a player changes their name, they will lose their old yml file and a new one will be generated for their new name.
Hey, I seem to have run into an issue, in which even though I customize some settings in default_player.yml, its changes aren't applied after deleting player data and restarting the server. When I join, my uuid.yml doesn't contain settings from default_player.yml. Is this a known issue?
@Metromones
When I was designing the plugin, one of my goals was to have the difficulty scaling be as unnoticeable as possible so that the player's immersion would not be ruined by seeing the difficulty change so suddenly.
It is true that if you load the plugin on your server and do not change any of your settings and try fighting a mob right away, then the plugin will appear to do nothing. What is really happening is that the plugin must pass certain conditions before it starts lowering or raising the difficulty of mobs on you.
First, you must fight at least 3 mobs of a particular type before the difficulty for that mob type will change. For example, if you fight 3 zombies, the plugin will record information about the fights, but will not change the difficulty yet. When you go to fight your 4th zombie, the plugin will scale the difficulty based on your previous fights with zombies and record more information on this 4th fight.
Second, the plugin updates the difficulty every 30 seconds, and it only increases it by 10% at a time. So even if the plugin thinks you can handle a mob at 175% power, it will only increase the difficulty to 110% after the first 30 seconds. This is to prevent the difficulty from changing too fast.
You can use commands to change a lot of these rules or bypass these rules entirely. For example, if you type "/dynamic changelevel all 150" (without quotes) followed by "/dynamic changesetting all manual" (without quotes), then this will immediately force all mobs to be at 150% power for you all of the time.
It looks like the plugin does nothing. Or I do something wrong. Don't understand config anyway.
@HalestormXV
The mod does not scale the difficulty of the Boss Mobs. The main reason for this is that the plugin requires the player to fight at least 3 mobs of a given type in a single session before it starts scaling that mob type in order to get a good idea of how much to scale the mobs. Players will not typically fight the same Boss Mob 3 times during a single session, so it did not make sense to add scaling for Boss Mobs.
I'm glad you and your players enjoy the plugin!
Rather silly question, but does DynamicDifficulty work with Boss Mobs as well like the Wither and Ender dragon? I have a modded server and this plugin is absolutely amazing for scaling mobs to the levels of my players but Im curious if it can or does do the same with bosses.
after using this plugin I have exessive amounts of mobs spawning and they are seriously waaay to OP make them less spawn crazy plz
@blazen988
The scaling of the mob attributes occurs at two different points in time.
The attack and defense of the mob are adjusted immediately when the mob or a player attack each other, and the damage caused is scaled on an individual basis every time a hit is caused. For example, suppose two players, let's call them P1 and P2, are attacking a zombie together. P1 has a performance level of 150 for zombies and P2 has a performance level of 75 for zombies. If they both hit the zombie and the base damage is 4, P1 will do 3 damage to the zombie and P1 will do 6 damage to the zombie. If the zombie attacks both players with a base damage of 4, the zombie will hit P1 for 6 damage and P2 for 3 damage.
The speed, knockback, and max follow distance of the mob are scaled as soon as a mob targets a player and are scaled based on that one player's performance level. By "target," I mean that the mob detects a player in the area and has the intent of attacking that player when the player is within range of the mob's attacks. Using the previous example, if the zombie targets P1 first, the zombie's speed will increase by 25%, knockback by 25%, and max follow distance by 50%. Even if P2 attacks the zombie, the zombie will have these stats based on P1's performance level so long as the zombie is focusing on P1. If the zombie later targets P2, the stats will change based on P2's performance level.
The reason I went these two different routes is because Bukkit has a convenient way for plugins to both detect when hits occur and modify properties of the hits before they take effect. Even though the plugin gives the appearance of scaling the values, I never had to directly change the mob's attack and defense; I just had to scale the effects of these values. Bukkit does not have a convenient system for changing speed, knockback, and max follow distance and especially for changing them in regards to multiple players. I had to access these three attributes directly and the simplest way to change them was to trigger the change when a mob targets a player.
How is targeting done? Is the difficulty of the mob scaled once you start attacking it because you can kill mobs super fast so are mobs given enough time to scale from your first hit? I think a region around the player or chunks loaded by the players would be a good alternative or option. So the loaded region of the player is affected by their preformance and then it takes an average or top player when multiple players are close together.
@CloudeLecaw
Both auto and manual performance level values show up in all of the correct locations on my test server and with the source code, so I do not think it is a bug caused with the way the plugin is set up by default. I tried to reproduce your situation by deleting and changing values in the config, but could not reproduce it.
In your yml file, just delete one of the manualPerformanceLevel lines and add in a line for autoPerformanceLevel and the plugin should work just fine. Also check that your default_player.yml file has only one spot for the manual and auto values.
While searching for a cause for your error, I actually found a different small bug with the default_player.yml file for v1.4.0. Some of the values for the performance levels are not 100 by default like they are supposed to be. For now, just go into the default_player.yml file and manually set them to 100 or whatever other values you want them to be.
good plugin :D
@CloudeLecaw
First off, sorry for the very late response to your question, but the answer is yes; I just began working on an update for Spigot 1.8.6 today. I assume by this point you are probably using Spigot 1.8.6 instead of 1.8.3.
For anyone wondering why DynamicDifficulty has not been updated for almost a year now, ever since September of last year, I was extremely busy with other commitments I had to keep, mainly graduate school. On top of that, this was the same time that CraftBukkit was going through legal issues with the DMCA. Because of my other commitments, I did not have time to deal with the extra hassles brought on by these legal issues.
Currently, my plan is to keep DynamicDifficulty up to date with the current version of Bukkit/Spigot. I do not plan to add anything major to the plugin at this time with two possible exceptions i am considering. The first being a way to purge old player files because that is a useful tool for admins, and the second being an option to allow the difficulty level above 200 because many people have requested this.
very nice plugin, very useful config-files to manually change things!
@TraedpoD
I am glad your players are enjoying the plugin so much!
I have not considered MySQL support up to this point although the thought did occur to me that old player files would build up over time. I definitely want to keep refining the plugin. Others have suggested great additions to the plugin as well that I still plan to include (Definable regions that control the difficulty, adding a leveling system setting, and increasing the performance level cap past 200 come to mind). Unfortunately, I don't have as much time to devote to adding to the plugin as I would like, at least time that is more consistent.
As for the offer to donate, I appreciate the thought. The main reason I have not included a link to donate or anything like that is because right now I cannot guarantee consistent service on the plugin. I understand donations are given because a person willingly chooses to, but if I am going to receive any form of payment for working on the plugin, I want to make sure that the service I provide on the plugin is more consistent than what it has been.
Might I suggest MySQL support? Or at least a way to automatically purge files unaltered over a certain threshold? This is a magnificent plugin that my players absolutely adore! I'm inclined to donate to the project if you keep continue to refine it. Especially when it comes to saving on resources! Thank you!
Sorry about the delay in replying. I was away on vacation for the past week and could not respond.
@madtomic
Use DynamicDifficulty v1.2.2 for cb1.7.2-r0.3. DynamicDifficulty v1.2.2 is compatible with that version of Bukkit.
@Max633
DynamicDifficulty v1.3.1 only works for cb1.7.10. It appears as though you were using cb1.7.9. Use DynamicDifficulty v1.3.0 with cb1.7.9. For v1.3.1, I had to list the game version as CB1.7.9-R0.2 because there was no option for CB1.7.10 when posting the plugin file. I listed CB1.7.10 in the file name to compensate. Sorry if that caused some confusion.
The errors you both got are because each version of DynamicDifficulty is only compatible with the major version of Bukkit it is listed with. For example, DynamicDifficulty v1.2.2.1 is only compatible with cb1.6.4. Most plugins can get away with being compatible with multiple major versions, but DynamicDifficulty requires specific information from Bukkit that changes each time there is a major update. When you see an error like: "net/minecraft/server/v1_6_R3/EntityInsentient does not exist" or any error that mentions something about "net.minecraft.server.v#_#_R#", you are getting it because the plugin cannot get the information it needs due to a compatibility issue.
Error, what is this? i'm using CB1.7.2-r0.3
[23:01:27 INFO]: [DynamicDifficulty] Enabling DynamicDifficulty v1.2.2.1 [23:01:27 ERROR]: [DynamicDifficulty] Plugin DynamicDifficulty v1.2.2.1 has fail ed to register events for class com.cjmcguire.bukkit.dynamic.controller.Controll erListener because net/minecraft/server/v1_6_R3/EntityInsentient does not exist.
Error console...
Thanks
Update for cb1.7.2-r0.3?
@CloudeLecaw
First of all, I apologize for the inconveniences you ran into when dealing with the loot scaling, and I apologize for the confusion regarding how the loot scaling works. Thank you for pointing out this issue to me.
The loot percent means, "take the original amount of loot the mob will drop and multiply that original amount of loot dropped by the percentage, and round appropriately." For example, if the percentage is 150% and the zombie would normally drop 1 rotten flesh, then the zombie will actually drop 2 rotten flesh because 1 * 1.5 will round up to 2.
If a mob drops one rare item and the percentage is high, say 150% or higher, then the normal intention of the plugin is to make the mob drop 2 of that item. However, it was not my intention to make the plugin duplicate existing items that the players throw at a mob.
I will look into stopping this method from working in the next update.
@broluigi
Right now DynamicDifficulty can only go up to 200%. Unfortunately, because of the way performance level is calculated, there is no easy way to increase the cap past 200% without some serious reworking of the performance level calculation. Several people have requested increasing the cap past 200%, so I will do my best to find a way to increase the cap past 200%.
@Lyillihn
The loot and xp scaling of DynamicDifficulty stacks with the scaling of DynamicDropRate.