Save Game Corruption PC (Version 1.3) Please Help!

+
Alright, sure, why not. It sounds like your test worked out just fine though, exactly like mine did in fact? Anyway, here we go.

I took an older savegame this time though, just to make sure me fiddling with the debug console before didn't affect anything. Inventory appears to have been very similar though, as I got the exact same offset. So, I edited the general.ini first to enable debug console and extracted karlblau's workaround to the Mods directory, then loaded my savegame.

Here you can see that I'm missing the Grandmaster legendary Feline gauntlets...


...even though I do have the Grandmaster legendary Feline silver sword. Both are looted from the same container, and I checked to make sure the chest is empty.


Here are some "broken"/"invisible" items (Geralt's body parts).


Output of maxID with recommended offset 158.


I unequipped my mutagens and ran liverhack(158), here's the output. I just ignored the message telling me that I failed, hoping that it'd work out anyway (my offset was positive after all).


Inventory after liverhack(158), all items are now dropped, only things left are protected body parts (unprotected ones are gone). I now saved in a new slot.


New savegame with edited item names opened in HxD, next I saved the file and opened the edited savegame in the game.


The game removed all body part items upon load, as the item names in the savegame don't match any name from existing items. Geralt, apart form his head, is invisible now in the game world. I saved in a new slot again.


New savegame with edited (restored to original) item names opened in HxD, next I saved the file and opened the edited savegame in the game.


I ran the commands additem('Body underwear 01') and equipitem('Body underwear 01'). Did the same for the other 5 protected items, 'Body torso medalion', 'Body palms 01', 'Body feet 01', 'head_2' and 'Preview Hair'. Then I looted the bag that was dropped by liverhack here. As you can see, it recognized the previously missing diagram. I also executed addknownRecipes.


Here you can see that my two other diagrams I was missing were added as well.


The diagram is now appearing in the crafting list. I can finally craft all grandmaster legendary gear sets completely!


Output of maxID after fixing my inventory.


EDIT: Fixed links and descriptions... apparently a forum software update broke my original post by converting it all to some JSON-BBCode, but it wasn't being displayed correctly anymore.
 
Last edited:
Hi Kevin04. Very good news! Another testament this little mod works. It would still be great if CDPR put out an official hotfix for this bug!
 
karlblau (and all those who assisted with this issue), I'm very happy to see that people are able to benefit from this! It was truly a project to track this issue down, but you really seem to have nailed it.
 
Yeah I have no idea how those two(karlblau & ssdanny) walk around...what with the size and weight of their brains:)lol. All joking aside, they are extremely smart and talented to have figured out this pesky bug. I still don't really understand the inner workings of it, or even how the hell this bug initiates within a player's save file, but that's why I am so thankful for finding this thread and extremely happy they were kind enough to share their knowledge and help all of us out. It's a given their "fix" will help many more in the future, unless CDPR can jump in. Speaking of witch SigilFey, have you had a chance to relay this info to them and/or have they responded back?
 
Kevin04;n10018871 said:
Alright, sure, why not. It sounds like your test worked out just fine though, exactly like mine did in fact? Anyway, here we go.

I took an older savegame this time though, just to make sure me fiddling with the debug console before didn't affect anything. Inventory appears to have been very similar though, as I got the exact same offset. So, I edited the general.ini first to enable debug console and extracted karlblau's workaround to the Mods directory, then loaded my savegame.
 
Last edited:
Hey DrDeathhand, no problem, my pleasure, really! Haven't noticed any strange behaviour since the fix (didn't play that much yet though). Have fun playing then, got vacation coming up next week too. I'll hopefully spend much of that on Quake Champions though. ;)

DrDeathhand;n10062331 said:
Just for my information, does this command ONLY add the recipes that one has already found or bought? or does this add ALL recipes including the ones you still need to buy or find while exploring?

Only recipes that you already know are added to the inventory. Haven't checked the code myself, but that's what karlblau said (see quote below).

DrDeathhand;n10062331 said:
And do I really need to run this command even after picking up my entire inventory?

So far, no problems have been reported about having recipes and diagrams removed from the inventory (but still available in the alchemy/crafting menus). So no, you don't need to run it. I just ran it because the game adds them to the inventory when you initially pick them up and learn them, so as to reconstruct the inventory as faithfully as possible. I'm kind of a purist in this regard.

Here's also what ssdany and karlblau said about it, in case you missed it earlier:

ssdany;n9691271 said:
Recipes and schematics: I think it’s a bad idea to add yet another hundred of items. Please notify me if disappearance of these “papers” will cause any bugs - I’ll change the code. Regardless, all recipes and schematics should still be available in related menus.
karlblau;n9699901 said:
This is, what I think too. Therefore I omitted these in the changed version of your mod, but I created an additional exec function (= developer console command) addknownRecipes, which can add the recipes and schematics already known as items later on request.
 
Nitnat;n10043901 said:
Speaking of witch SigilFey, have you had a chance to relay this info to them and/or have they responded back?

In brief, yes. It's not a "bug", but an engine limitation. Reaching it requires players to push the engine waaay past its intended design. Technically, any game engine will eventually encounter such issues. It manifests perhaps more quickly in TW3 because the game is so bleeping huge and has to constantly keep track of so much. In short, players simply cannot play TW3 like Dark Souls or Diablo; the inventory IDs will eventually become so large, the engine can't accurately record the data. The only surefire way to "fix" it is to prevent it: "Don't horde items," (...or...use the nifty little fix on this thread if you're on PC. ;)) The runestone / glyph issue is similar but is caused by something else and the cause / fix couldn't be found.

However, all of the teams have moved away from working on TW3 (in this capacity). That, unfortunately, means that CDPR's direct involvement in things like this is very unlikely to happen. So, please do take my statement and congratulations above in the universal spirit with which they are intended! :)
 
Kevin04;n10070521 said:
Hey DrDeathhand, no problem, my pleasure, really! Haven't noticed any strange behaviour since the fix (didn't play that much yet though). Have fun playing then, got vacation coming up next week too. I'll hopefully spend much of that on Quake Champions though. ;)



Only recipes that you already know are added to the inventory. Haven't checked the code myself, but that's what karlblau said (see quote below).



So far, no problems have been reported about having recipes and diagrams removed from the inventory (but still available in the alchemy/crafting menus). So no, you don't need to run it. I just ran it because the game adds them to the inventory when you initially pick them up and learn them, so as to reconstruct the inventory as faithfully as possible. I'm kind of a purist in this regard.

Here's also what ssdany and karlblau said about it, in case you missed it earlier:

Dear Kevin04,

I want to give you an update on what I have experienced after using the mod with my last most furthest savegame.

Well I have been playing for a couple of days now and I have to say that It has sort of felt like immersing your self in something old... something familiar... something
which makes one feel good... at home... at peace... I have really enjoyed new hours of gaming.

But! there is one thing I have noticed. I told you that SSDanny and Karblau warned us about using this mod with a savegame that already has a corrupted inventory and that one always needs to run this on a non inventory corrupted savegame. You ran it on your savegame which already had a corrupted inventory and it apparently fixed your savegame. After you told us about this I also ran the mod and it did seem like it fixed my savegame. I have been playing for a couple of days now until today I noticed that I had two of the famous empty items, this time under my Quest items.
I have not yet noticed if any items have gone missing but well I can not get rid of these two empty items.

So I want to warn you to keep an eye out for your inventory to see what will happen.

I have tried to remove the 2 empty items by running a liverhack but I do not know what offset I can use because maxID doesnt show an offset.
I have ran liverhack a couple of times with just a couple of random offset numbers but the two empty items under my Quest items do not go away.
I do not know how to remove them.

I will continue on playing to see what will happen and I will keep you posted.

I am curious of you also have the same issues I am encountering.

Greetings,

DrDeathhand
 
DrDeathhand;n10129582 said:
I am curious of you also have the same issues I am encountering.

I haven't noticed any issues yet, and I probably won't. As I said before, the savegame I fixed was already pretty close to the ending. I merely need to finish the B&W main storyline, everything else is done. Did this to get the bad ending and worked all pretty well for me. Currently I'm doing the prison ending and trying to figure out this bug, which seems to be unrelated (although I did test liverhack there).
Seems like the amount of items I need to pick up is just too small to cause any more problems.

But, just to make sure: When you fixed your savegame, did you check if all broken items disappeared from your inventory (like I did in these screenshots: broken, fixed)? Did you rename all six protected body parts (like here: renamed, restored)? If yes then... well, too bad, seems like it doesn't work completely with a broken savegame after all. Can't think of anything else.
After performing liverhack, maxID doesn't show me an offset either. Looking at the code, the offset is only displayed if your maxID is greater than 32768, and it's calculated like this:

Code:
offset = 65536 + 7 - max

EDIT: The bug from burlap is the new stripe wasn't unrelated after all - I realized there was a broken item in the chest (icon from the "trophy" received for completing all the knight for hire tasks, no name), so I ran liverhack right before starting the quest (that is, before the items were taken from me). The "empty" item was gone now, it had the King of Swineherd's crown in there instead (wasn't there before). The quest continued normally this time, so the fix worked. I think the game didn't recognize the chest as fully looted when it contained a broken item.

So, while liverhack does help even on already broken savegames, it doesn't seem to be permanent fix (as opposed to using it on an ok save). Bummer, but it's still better than nothing if you've progressed too far!
 
Last edited:
SigilFey;n10116432 said:
In brief, yes. It's not a "bug", but an engine limitation. Reaching it requires players to push the engine waaay past its intended design. Technically, any game engine will eventually encounter such issues. It manifests perhaps more quickly in TW3 because the game is so bleeping huge and has to constantly keep track of so much. In short, players simply cannot play TW3 like Dark Souls or Diablo; the inventory IDs will eventually become so large, the engine can't accurately record the data. The only surefire way to "fix" it is to prevent it: "Don't horde items," (...or...use the nifty little fix on this thread if you're on PC. ;)) The runestone / glyph issue is similar but is caused by something else and the cause / fix couldn't be found.

However, all of the teams have moved away from working on TW3 (in this capacity). That, unfortunately, means that CDPR's direct involvement in things like this is very unlikely to happen. So, please do take my statement and congratulations above in the universal spirit with which they are intended! :)

Right indeed. The engine limitation, which apparently all of us here have pushed past it's ...limit:) Well it's good to know you at least told them about it, cause we have another gem coming up from CDPR, which looks like may be even grander in terms of size/story and plot. Can't wait!
 
This issue has recently affected me on my NG+ run. I wanted to come back to the game again. Anyhow, I am impressed by the work done on this thread, but sadly I cannot download the fix tools. Are they posted elsewhere? Is there any way to open up access to the linked files again? Thanks.
 
ConQuiX;n10925444 said:
This issue has recently affected me on my NG+ run. I wanted to come back to the game again. Anyhow, I am impressed by the work done on this thread, but sadly I cannot download the fix tools. Are they posted elsewhere? Is there any way to open up access to the linked files again? Thanks.

Hey ConQuix. You need an account and need to be logged in before you can access and download the files posted. Hope this helps you


 

Attachments

  • modDebugItemID.zip
    193.5 KB · Views: 345
  • GERALTBody.zip
    519 bytes · Views: 344
Don't mean to necro this older thread but I just found a conflict between it and the mod Trademan. For everyone that was a part of this thread when it first started, we know how important this little mod(modDebugItemID) is for the health and lifespan of our savegames. At the same time I don't want to loose Trademan either. Don't know where else to post this since the mod DebugItemID is not very known on Nexus or the Script Merger forum. So I'm hoping the old authors of this mod (karlblau & ssdanny) are still around to help:) In fact if anyone knowledgeable can help I would be thankful. Onto the issue:

Both the mods Trademan and DebugItemID make changes to inventoryMenu.ws. Script Merger merges them fine but RedEngine comes up with this error




The next text block is part of the inventoryMenu.ws file that itself is in the mod0000_MergedFiles folder:

"
public function ShowItemTooltip(item : SItemUniqueId, compareItemType : int) : void
{
var tooltipData : CScriptedFlashObject;
showNotification( "item ID " + ItemToFlashUInt(item) + ", " + thePlayer.inv.GetItemName(item));

_tooltipDataProvider.setCurrentInventory(GetCurrentInventory(item));
tooltipData = _tooltipDataProvider.GetTooltipData(item, _currentInv == _shopInv, true);
m_flashValueStorage.SetFlashObject("context.tooltip.data", tooltipData);
}

public function ShowItemMouseTooltip(item : SItemUniqueId, compareItemType : int) : void
{
var tooltipData : CScriptedFlashObject;
showNotification( "item ID " + ItemToFlashUInt(item) + ", " + thePlayer.inv.GetItemName(item));

// TradeMan
var TradeMan : CTradeMan;
var CurrentItemPrice : float;
var CurrentInventory : W3GuiBaseInventoryComponent;

TradeMan = new CTradeMan in this;
TradeMan.T_InitializeValues();
TradeMan.T_GetCurrentMult();

CurrentInventory = _currentMouseInv;
if (CurrentInventory.autoCleanNewMark == true)
{
CurrentItemPrice = _shopInv.GetInventoryComponent().GetInventoryItemPriceModified( _playerInv.GetInventoryComponent().GetItem( item ), true );
TradeMan.T_StorePricePlayer(CurrentItemPrice);
}
else
{
CurrentItemPrice = _shopInv.GetInventoryComponent().GetItemPriceModified( item, false );
TradeMan.T_StorePriceShop(CurrentItemPrice);
}

// TradeMan "




The only two lines of code that DebugItemID mod adds to the inventoryMenu.ws are these(without the quotes)

" showNotification( "item ID " + ItemToFlashUInt(item) + ", " + thePlayer.inv.GetItemName(item)); "

If I delete the second one from that text block the game starts up fine, no error from RedEngine. The mod DebugItemID also seems to still work ok even after deleting that line, but I still would like to know what is causing it and what I can do to fix it.

If you stuck around this long I appreciate it, I know it's a wall of text but I really don't know where else to turn and ask for help.
 
Great topic. Many thanks to authors for solution. It quite a shame developers didn't repair this, it should be quite simply for them. Especially this happen, I think, to people who took a lot effort to the game.

Don't mean to necro this older thread but I just found a conflict between it and the mod Trademan. For everyone that was a part of this thread when it first started, we know how important this little mod(modDebugItemID) is for the health and lifespan of our savegames. At the same time I don't want to loose Trademan either. Don't know where else to post this since the mod DebugItemID is not very known on Nexus or the Script Merger forum. So I'm hoping the old authors of this mod (karlblau & ssdanny) are still around to help:) In fact if anyone knowledgeable can help I would be thankful. Onto the issue:

Well I also had compile errors with other mods. Finally workaround was very simple, just copy mods, you use, somewhere outside Witcher folder (mods), delete them and use only modDebugItemID - you need it only to repair. For me it worked. When you finished repair your inventory, you can delete (make copy) modDebugItemID.

----
Also I'd like to point out, there is one issue with mod. Some gwent cards (most of them are Skellige cards) cannot be remove with command, but nonetheless there are copied to temporary bag. Then when you pick up back items to inventory there are available doubled copies of this cards. Well you don't need to use this copies to build deck, like it was, but it wasn't good enough for me :). So I changed little the mod file to prevent this. If someone would need it let me know.
 
Great topic. Many thanks to authors for solution. It quite a shame developers didn't repair this, it should be quite simply for them. Especially this happen, I think, to people who took a lot effort to the game.

Well I also had compile errors with other mods. Finally workaround was very simple, just copy mods, you use, somewhere outside Witcher folder (mods), delete them and use only modDebugItemID - you need it only to repair. For me it worked. When you finished repair your inventory, you can delete (make copy) modDebugItemID.
----
Also I'd like to point out, there is one issue with mod. Some gwent cards (most of them are Skellige cards) cannot be remove with command, but nonetheless there are copied to temporary bag. Then when you pick up back items to inventory there are available doubled copies of this cards. Well you don't need to use this copies to build deck, like it was, but it wasn't good enough for me :). So I changed little the mod file to prevent this. If someone would need it let me know.

Hi zadymiarz. I was hoping this would be possible and confirming it works makes me very happy!

I actually would like your changed mod file(for the Skellige GWENT cards), just in case I need to run the debugmod again. I'm in the middle of B&W right now but going through numbered IDs fast:) ...you know how it goes amigo
 
I'm replaying the whole thing now, from scratch, not even in NG+, with all the measures to delay this bug (aaand runestones are not the only thing that contributes to the imminent ItemId overflow, hair styles and crossbow bolts can do this too). I'm yet to see a Skellige deck, though. Anyway, I'll start BoW in a couple of weeks, maybe even earlier, and if this mod won't get fixed by other players, then I'll see what we can do here.
 
I'm replaying the whole thing now, from scratch, not even in NG+, with all the measures to delay this bug (aaand runestones are not the only thing that contributes to the imminent ItemId overflow, hair styles and crossbow bolts can do this too). I'm yet to see a Skellige deck, though. Anyway, I'll start BoW in a couple of weeks, maybe even earlier, and if this mod won't get fixed by other players, then I'll see what we can do here.

Technically, I think any item can eventually cause it, but you need to keep in in your inventory for a loooooong time.

Besides, I've played through nearly six times, and I've never once had this issue. I totally understand that it happens, but seriously, the golden rule is: "Don't hoard items." And this is a game in which hoarding is ultimately useless. Too much of the gear cycles. I normally finish a playthrough with tens of thousands of coins, at least 20-30 runes/glyphs of all sorts I never touched, more crafting materials than I could use in 6 more playthroughs...

I don't even loot corpses anymore, unless I'm looking for something specific. Just the coin and the very valuable gear and items, like magic equipment, gems, mutagens and such. Makes it a bit more interesting in the early game, as you're not immediately swimming in money.
 
Hi zadymiarz. I was hoping this would be possible and confirming it works makes me very happy!

I actually would like your changed mod file(for the Skellige GWENT cards), just in case I need to run the debugmod again. I'm in the middle of B&W right now but going through numbered IDs fast ...you know how it goes amigo

I am attaching changed mod (modification are in playerDebug.ws file). Maybe not most professional, but quite simple and it works.
These are cards I excluded from dropping to temporary bag:
gwint_card_olaf, gwint_card_cerys, gwint_card_ermion, gwint_card_war_drakkar, gwint_card_clan_brokvar_archer, gwint_card_clan_dimun_pirate, gwint_card_light_drakkar, gwint_card_clan_drummond_shieldmaiden2, gwint_card_clan_drummond_shieldmaiden3, gwint_card_draig, gwint_card_young_berserker, gwint_card_cock, gwint_card_poor_infantry2 (NR deck), gwint_card_poor_infantry3 (NR deck).

I'd like also to mention these cards don't "block" index id while repair so issue is only with doubling them in available cards.

Besides, I've played through nearly six times, and I've never once had this issue. I totally understand that it happens, but seriously, the golden rule is: "Don't hoard items." And this is a game in which hoarding is ultimately useless. Too much of the gear cycles. I normally finish a playthrough with tens of thousands of coins, at least 20-30 runes/glyphs of all sorts I never touched, more crafting materials than I could use in 6 more playthroughs...

And I've played once (so far) do everything what is available, loot everything and it happened in B&W (last region for me). A was selling weapons, junks, but not all ingredients, materials, glyphs, runes, food, books (only duplicates). From ingredients, materials, food I was selling above two bag slots or some from second slot. So if it didn't happen to you it great, but when it damage others players effort why complaint.
 

Attachments

  • modDebugItemID.zip
    193.7 KB · Views: 139
Last edited:
And I've played once (so far) do everything what is available, loot everything and it happened in B&W (last region for me). A was selling weapons, junks, but not all ingredients, materials, glyphs, runes, food, books (only duplicates). From ingredients, materials, food I was selling above two bag slots or some from second slot. So if it didn't happen to you it great, but when it damage others players effort why complaint.

It's not a complaint. It's the easiest possible solution (for the future). The game was not designed or built to function like Diablo, Dark Souls, or an MMO. Having a large inventory of items that remains static for a long period of time is directly what causes this issue. It's not a bug -- any program will eventually get to this point. It's similar to the issue that occurs with insanely large numbers in Minecraft, resulting in the nutsy terrain one would find in the Far Lands.

Whenever you save the game, the ItemID of every single item in your inventory is stored. When you reload, the items must be checked, then re-saved. Two items cannot be given the same ID. Therefore, every item's ID gets bigger every time you reload. The more of the same item I'm carrying around, the bigger, and bigger, and bigger each ItemID will become with each reload. If I hold a large number of the same (type of) item in my inventory for a long period of time, the game will eventually run out of "place values" that it can assign a new ID label to, and the item...and ultimately your entire inventory...can become corrupted and result in crazy lag in the inventory screen and crashing if a corrupted item is interacted with.

This is a HUGE game. There are limitations like this all over it. Nature of the beast.

Thus -- shortest distance between two points: don't horde items during the game. Sell them off if you're not using them, or at least dump them into the stash. Even if you can repair your game using the brilliant utility released here, it will not prevent it from happening again.

Special note: the Runestone / Glyph "Bomb". Keep only about 10 of each in Geralt's active inventory (what you're walking around with) max, then either stash or sell the rest. There is a separate issue whose cause was never found that can instantly corrupt a saved game if there are too many of the same type of rune or glyph in the active inventory. It's not related to the ItemID thing above -- it's different. And still a mystery.
 
Hi SigilFey and zadymiarz ! Thanks for the new version of the mod.

Whenever you save the game, the ItemID of every single item in your inventory is stored. When you reload, the items must be checked, then re-saved. Two items cannot be given the same ID. Therefore, every item's ID gets bigger every time you reload. The more of the same item I'm carrying around, the bigger, and bigger, and bigger each ItemID will become with each reload. If I hold a large number of the same (type of) item in my inventory for a long period of time, the game will eventually run out of "place values" that it can assign a new ID label to, and the item...and ultimately your entire inventory...can become corrupted and result in crazy lag in the inventory screen and crashing if a corrupted item is interacted with.
It's even simpler, actually. Game just assigns a new ItemId (which is an autoincrement) to any new stack of items or any new unstackable item, e.g. sword, whenever it appears in your inventory. The "problem" with reloads / fast traveling between major locations is that the game deletes all the runestones/glyphs from your inventory and adds them back on each subsequent save-load - that's why ItemId can grow very fast. Other items of note are a technical entity for a "head" (or hair style?) and default crossbow bolts. Game handles the former in a similar way as runestones and the latter... Well, there are 2 types of default crossbow bolts and game just swaps them, i.e. removes bolts of one type and adds bolts of another type, whenever you dive or get back on boat/land. That's basically it. Not blaming developers who implemented it this way, though, because, all in all, the way game handles runestones/glyphs and bolts is probably a bugfix or a somewhat standard measure to prevent bugs like "default crossbow bolts are missing". NG+ is another story, of course, since, technically, you're starting it with an old inventory, and ItmeId will just keep increasing.

So, the common rules to avoid this problem are:
1. Do as SigilFey recommends: do not hoard on items. Specifically, do not loot each and every sword, club etc, and try to avoid multiple stacks of the same item to appear in your inventory; sell all the excesses, for example. Constantly keeping a stack of 100 Silver Ore in one slot and selling another stacks of Silver Ore once they appear simply won't help.
2. Put runestones/glyphs to stash. Stash has its own limitations, but is much, much easier to fix.

Followed these rules in a fresh playthrough, and now, with BoW started and main story and HoS completed, I have an ItemId values like 134xx (limit is 65535), which is for sure enough to finish the BoW and even do the NG+.
 
Top Bottom