View Full Version : Extension: Encounter Difficulty Calculator (for 2014 rules)
lesliev
December 28th, 2025, 05:11
Hi everyone
Since it can be a bit of a chore figuring out how difficult an encounter is, I wrote an extension to display that. The idea is that you can adjust encounters and immediately see how challenging they will be for the party currently in the Party Sheet. If you are running a module designed for a higher or lower level party than yours, you can just ctrl-scroll the number of enemies during the game to get to the difficulty you want.
Example of some "Deadly" awakened shrubs:
66067
Demo of it in action:
https://www.youtube.com/watch?v=m-kz4Hj_8gQ
Forge link:
https://forge.fantasygrounds.com/shop/items/2777/view
Code:
https://github.com/lesliev/fantasy-grounds-encounter-difficulty-5e
Extension file (v 1.0)
66068
Note: make sure you get the latest version below.
If you give it a try, I'd appreciate any feedback. This is my first attempt at an extension.
lesliev
December 29th, 2025, 02:41
Encounter Difficulty extension v1.1 - removes some debug message noise from the console.
66079
Zacchaeus
December 29th, 2025, 10:01
Nice one, thanks for the contribution.
The Decepticon
December 29th, 2025, 18:26
Hello, I think this is great! Just uploaded it and it works great except in the placement. Might be conflicting with some other extensions. I haven't had a chance to narrow it down yet.
66087
lesliev
December 29th, 2025, 21:47
Hello, I think this is great! Just uploaded it and it works great except in the placement. Might be conflicting with some other extensions. I haven't had a chance to narrow it down yet.
66087
Oh cool, thanks for that! I couldn't figure out the name of that control just to the left - ideally the difficulty text would be anchored to it. I'll take another look!
lesliev
December 29th, 2025, 22:24
Extension file (v 1.2) - properly aligns difficulty text to the CR refresh button.
66091
I see my Forge access has been approved now so I'll be able to push updates there in future :)
Updated demo video for 1.2:
https://youtu.be/yGoSabydYOs
lesliev
December 31st, 2025, 00:23
Updated for 2024 rules. I'm a little unsure about this calculation because I don't have this book, but I believe it's correct.
I also added a tooltip showing some calculation details.
Version 1.3:
66094
Forge link:
https://forge.fantasygrounds.com/shop/items/2777
Example:
66095
I missed this before, but Olog created a similar extension in 2018:
https://www.fantasygrounds.com/forums/showthread.php?43977-5E-Encounter-Calc-(updated)
My extension does pretty much the same thing with a bit more UI integration.
cwsoots
December 31st, 2025, 18:43
First, thank you for this extension and your support for 5e 2024.
Regarding the combat difficulty for 2024, you can view the Basic Rules for free which include the calculations and terminology for the encounter difficulty tiers (low, moderate, high) here: https://www.dndbeyond.com/sources/dnd/br-2024/dms-toolbox#CombatEncounterDifficulty.
It would be great if your 2024 support matched the current verbiage and was confirmed to use the 2024 calculations. TIA!
lesliev
December 31st, 2025, 21:08
Aha, that's what I couldn't find! Thanks!
Ok I have added tests and updated the 2024 calculation.
Fixes on Github and uploaded to the Forge. Thanks for the help!
Test examples here, let me know if you notice any errors, or want to add any more test cases!
https://github.com/lesliev/fantasy-grounds-encounter-difficulty-5e/blob/main/test_encounter.lua
Note that the 2024 rules don't have an "Extreme" level but I wanted to add something for when the Party Budget is completely blown.
I could put "Over Budget" but that's too long to fit in my nice short label.
lesliev
December 31st, 2025, 22:38
Version 1.6, Changelog below. This has been uploaded to the Forge and Github.
66104
# Changelog
## [1.6] – 2025-1-1
- Add tests and fix 2024 calculations
## [1.5] – 2025-12-31
- Update some text now that we support 2024 rules
## [1.4] – 2025-12-31
- Fix errant colon
## [1.3]
- Added 2024 rules support
- Added tooltip with calculation details
## [1.2] – 2025-12-30
- Improved formatting — difficulty text now anchored to CR
## [1.1]
- Removed debug messages
## [1.0] – 2025-12-28
- Initial release
cwsoots
January 5th, 2026, 05:29
Hi lesliev!
I used your extension for the first time in a live session tonight, and I received several console errors during combat. Nothing was being done that was directly related to the Encounter Difficulty features. Instead the errors appeared while other mundane, combat-related actions were being taken (e.g., moving a token, etc.).
I've attached my logs for your investigation, but here is the error message that kept repeating in the console: "[1/4/2026 6:52:38 PM] [ERROR] Handler error: [string "EncounterDifficulty:..ounter_difficulty.lua"]:332: attempt to index local 'w' (a userdata value)". I'm assuming that since "EncounterDifficulty" is mentioned in the error, it is related to your extension. Let me know if it's not related, and I'll report it elsewhere. TIA!
The Decepticon
January 5th, 2026, 14:03
[QUOTE=cwsoots;755851]Hi lesliev!
I used your extension for the first time in a live session tonight, and I received several console errors during combat. Nothing was being done that was directly related to the Encounter Difficulty features. Instead the errors appeared while other mundane, combat-related actions were being taken (e.g., moving a token, etc.).
I had the same issues when my PCs took hits. No errors on the NPCs, just the PCs. Same error as cwsoots.
lesliev
January 11th, 2026, 08:25
Thanks everyone, I have pushed version 1.7 to the Forge, that should deal with those "attempt to index local" errors.
Let me know if not!
Setran_777
January 13th, 2026, 16:09
I've been using the Calculator and it has been working great, no issues. And, it is very nice to have the ability to adjust the Encounter on the fly. Thank you.
lesliev
January 15th, 2026, 03:10
Pleasure!
Cyrian
January 16th, 2026, 01:40
Nice work, thank you!
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.