The Witcher 3

File information

Last updated

Original upload

Created by

Maciej Polanski

Uploaded by


Virus scan

Safe to use

About this mod

Rewrite of mod that restores Gwent cards "lost in development". Upgrade thru console for pre-existing games. Backward compatible, only original CDPR work.

Permissions and credits
"Gwent restore... rewrtitten" (GRR) is inspired by recent update by adamaskoff of old mod that was an update of just older mod.
But this time there is a console command to upgrade pre-existing game. And no restored cards is given to Player until explicitly requested in console, so it can keep full vanilla compatibility. Code re-written basing on new files, so diff is clean.

Optional download - version with all non-Hero cards changed to be neutral (per Reoneress request).

What this mod is about? (small technical talk)
Internally, "cards-items" that player can loot or win are totally different entities then "cards-gwent" used in Gwent(GwintManager class). When players finds a card-item, card is added to Inventory as invisible item, then a new card-gwent is added to GwintManager. Theoretically, this should be 1:1 mapping. But it looks that person handling Northen and Nilfgard decks got lost and a few cards-items are mapped to one card-gwint (making stacked cards), while other cards-gwint are unused.
Also, naming conventions of card-items is "xxx; xxx2; xxx3" while pictures naming convention is "xxx; xxx_1; xxx_2". This created some pictures miss-assignments.
GRR tries to iron this out, while refraining form adding any non-CDPR stuff.

Vanilla mode (100% backward compatible)
After mod installed, AI opponents starts using restored cards. Balance is untouched, because those are alternative versions of old cards, just with new pictures. AI decks are not saved, but generated each time. So if mod uninstalled, restored cards safely disappear without leaving any traces.

Player is not given any restored cards, because such save game would not be 100% identical to vanilla. Player may replace his stacked cards for restored ones, using console command described below. This is main difference against old mods, where starting a new game made player receive restored cards - so return to vanilla was not 100% sure.
Player may see new fixed pictures on some cards (e.g. poor infantry) - this disappears if mod uninstalled.

Command "grrUpgradeSafe" (still backward compatible)
GRR allows player automatically replace cards with alternative versions with added console command: grrUpgradeSafe
This replaces some cards in GwintManager with alternative versions, that always existed in The Witcher 3. Saved game still is backward compatible, but not identical. If mod uninstalled, replaced cards will stay as separate cards (not stacked) and most will return to common base picture.

This function can be called safely multiple times. And should be, to replace next looted cards.
Calling this function is advised way of using this mod.

Command "grrUpgradeRisky" (non backward-compatible)
Cards for alternative Blue Stripes and second Siege Tower existed only as pictures, so are created in this mod - thus aren't backward compatible.
Player may replace his base Blue Stripes cards and receive a free new Siege Tower with console command: grrUpgradeRisky

Such game, if saved, is not compatible with vanilla. Gwent will be broken without GRR, because its code can not handle non-existing cards.
Adding restored cards to player can not be reverted (as far as I know) because of poor implementation in native code of GwintManager class.

Some more technical talk
I am not sure 100% - but it looks that for any received card, GwintManaged generates an entry in its internal array, storing card Id and number of cards. Removing card decrements that number, but an entry itself is never removed. So, while this may sounds strange, removed card "still exists in the database, 0 pieces of it". This still counts as "exists" and breaks Gwent. So once cards are added and saved, will never be removed. No problem with "safe" cards, that exists also in vanilla. But no compatibility for "risky" ones.

Mod adds more commands player may use (on his own risk) to manage cards using GRR: grrAdd(Id), grrRemove(Id),grrVanilla. Last one tries to restore vanilla state - but mind above reservations. Also, I suppose that having saved card that "exists, 0 pieces of it" may introduce an instability to game.

All manipulations GRR does are inside GwintManager, i.e. apply to "cards-gwint" only. GRR is not affecting a game world ("cards-items") at all, and is not expected to affect "Gwent Colletor" achievement in any way. People looking for solutions to theirs problems with mentioned achievement, should rather use standard functions "addCardByName(name)" or "additem(name)". Names of cards can be found at the end of file "content0\scripts\game\gui\menus\", inside functions converting name of "card-item" to Id's of "card-gwent".

Reference sheet - upgrades GRR does
3x gwint_card_poor_infantry -> gwint_card_poor_infantry[125]; gwint_card_poor_infantry2[126]; gwint_card_poor_infantry3[127]
3x gwint_card_crinfrid      -> gwint_card_crinfrid[130]; gwint_card_crinfrid2[131]; gwint_card_crinfrid3[132]
3x gwint_card_kaedwen       -> gwint_card_kaedwen[150]; gwint_card_kaedwen2[151]; gwint_card_kaedwen3[152]
2x gwint_card_catapult      -> gwint_card_catapult[140]; gwint_card_catapult2[141];
4x gwint_card_impera_brigade-> gwint_card_impera_brigade[245] [...246...247...] gwint_card_impera_brigade4[248]
3x gwint_card_nausicaa      -> gwint_card_nausicaa[250]; gwint_card_nausicaa2[251]; gwint_card_nausicaa3[252]

3x gwint_card_blue_stripes  -> gwint_card_blue_stripes[160]; gwint_card_blue_stripes2[161]; gwint_card_blue_stripes3[162]
0x                          -> gwint_card_siege_tower2[171]