View Full Version : Help?! Every time I load my campaign, its adding extra "dmg dice"
sgtwhy
January 19th, 2024, 23:20
This is very odd behavior - it seems, with every restart of my fantasy grounds unity (updated today), its adding extra "damage dice" ...
:cry:
To confirm it wasn't just my campaign ... I created a brand new pathfinder (1e) campaign, with no extensions or modules loaded.
Then I "loaded" all of pf1e core books and the kingmaker AP. (the original kingmaker not the updated 2022 one)
(to clarify: NO EXTENSIONS and UPDATED today)
I open up an NPC, using ZOREK for this example, and expand the damage dice listed for the Heal spell.
The first time opening it, there is a second "empty" damage dice field along with the expected (first) entry.
However, every time I RELOAD this campaign ... it adds another, then another, etc ... until eventually it seems to "max out" at around 376 or 377 entries.
Over time, my db.xml is "spammed" with these "empty" entries causing the app to grind to a near halt.
The "empty" dice damage entries look like the following;
<id-00376>
<bonus type="number">0</bonus>
<dice type="dice"></dice>
<dicestatmax type="number">0</dicestatmax>
<statmax type="number">0</statmax>
</id-00376>
Screenshots for more context ... first, is a brand new campaign ... no changes made ... simply opened ZOREK and expanded the spell damage ... already has (1) more than it should and its empty.
59731
now ... a few reloads later ... again, I made no changes at all ... besides clicking the unlock button and viewing the contents ... and its already grown by 3-4 more "blank" entries for damage.
59732
sgtwhy
January 19th, 2024, 23:37
I tried locking the NPC before restarting. still happens.
tried manually closing the app and manually starting FGU up (rather than using "reload" command) ... same effect, still seeing the additional damage dice showing up.
see the screenshot, after 6 restarts ... +6 empty dice entries are there for HEAL spell :/
59733
sgtwhy
January 19th, 2024, 23:48
update:
I'm only able to reproduce this after loading the "original" kingmaker APs ... using pathfinder 1e.
again:
creating a new campaign with pathfinder 1e and no AP
... then copying and editing a creature from the bestiary (and rebooting)
... does not trigger this effect.
(no new damage dice are added)
hmm ... could it be a data issue with the "old" AP since it was made decades ago ??!
Then, I went thru each of the Kingmaker APs ...
loaded each AP and copied a NPC ... then edited the original
(unlocked to edit and expand the damage dice fields)
then rebooted and observed.
the "copy" is left un-changed (lock or not)
yet the "original" (from the AP) now has an extra empty damage dice entry (locked or not).
sgtwhy
January 20th, 2024, 00:22
ok, I've narrowed it down to a couple conditions ...
(1) Any of the original Kingmaker APs loaded
(2) editing any of the NPCs included in the AP
(3) restarting ...
... each time, it will add (1) more "damage dice" entry for the given NPC action that was being edited.
AFAIK - nothing stops this constant growing bug ... not even locking / disabling edit on the NPC.
eventually it causes lag and loading issues, etc ... and has to be manually cleaned up.
POSSIBLE WORK AROUND
1. open the AP(s)
2. COPY the chosen NPC (dont edit the originals)
3. make changes to the COPY
4. restart and cross fingers ... if lucky, it will remain unchanged.
conclusion:
due to (unknown) issues with the original kingmaker APs ... you should avoid EDIT'ing any of the NPCs directly.
Instead, copy the NPC and edit the copy.
otherwise, it will eventually inflate you db.xml to insane sizes and causing lag and likely making the game un-playable.
Trenloe
January 20th, 2024, 13:21
Very good find!
The following is a detailed FG code explanation for why it's happening. This is primarily for the FG devs to be able to get review and get a fix lined up. It may be of interest to you, or it may not... ;) Hopefully, it'll be enough for the FG devs to get a fix lined up.
This is based off some update code (in scripts\manager_version_2.lua) that updates NPCs that can be changed (not read only) - so the bestiaries aren't effected but pretty much all PFRPG adventure modules are. The function in question is updateModule that checks for the version of the module and does some updates based on how old the module is. The problem is, this code is running in the 3.5E ruleset - which the PFRPG ruleset runs on top of; so it's checking the 3.5E version of the module - which is 0 because the module is for the PFRPG ruleset. So every time a module is loaded (campaign restart, first opening, close/open) all of the updateModule code runs - and the convertModuleNPCs13 function runs, that tries to convert spells to the version 13 format (using the migrateSpells12 function) - which is pretty old and doesn't need to run, but due to the issue with checking the PFRPG version of the module, the code runs the migrateSpells12 function. It impacts damage and heal actions.
There're some issues here that need fixing:
1) The scripts\manager_version_2.lua code needs to be updated to properly check PFRPG module versions.
2) The migrateSpells12 function runs again and again, even if the update has been previously carried out. This function should be updated to on run once.
3) Removing all of the additional empty entries from campaigns that already have these erroneously created.
Moon Wizard
January 20th, 2024, 20:55
Looks like it's even deeper. It seems like FGU hasn't been saving ruleset version to module edit files, so the ruleset version wasn't getting incremented. I'll have to patch the client for that one. I'll need to see how that fits into our current development cycle.
In the mean time, it looks like some of these modules were possibly created manually (thus no version info in modules); so the version migration was running every time. I'll update the version migration code to bail if it doesn't see the data to migrate in the short term; so that should at least stop the extra data. I'll be able to push that on Tuesday.
Regards,
JPG
sgtwhy
January 20th, 2024, 23:56
Thanks guys, appreciate the quick follow ups and detailed responses. always interesting to here "how the heck is that happening?!"
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.