How to load preconstructed decks into module?

Hi there,
I’m designing the Volition CCG module and I have manually created two decks so that players can start playing straight away.
However, as the game is a card collectible game, people will want to create their own decks and although I will allow for players to create such decks manually from the full card playset, that is quite dull.
I am in very good terms with the creators of Volition and they can actually generate the decks from their website (specifically, each player has a crypto wallet with all the cards they own). So the idea would be for players to create their decks directly using the Volition CCG wallet (website) and then click on a button that would generate the vdck file for that deck that then gets loaded into the module.

My question is, how to generate the vdck decks? Is it just a renamed zip file with all the PNGs of the cards?

Many thanks!
Carlos

The only current way to create a .vdck file is to use the option to save an existing deck to a file from within VASSAL (the same option that allows loading decks also allows saving them). You might want to consider creating a separate VASSAL module just for creating decks… (The other option is to reverse-engineer the deck format, which I suspect will be quite difficult.)

I expect VASSAL 4 will support this sort of thing much better, but it’s only in the planning stages at the moment, so don’t expect it to be released any time soon.

1 Like

Thank you so much for the quick answer.
I will probably improve my current deckbuilding thingy in the Volition CCG module and do a video tutorial explaining how to save the manually created deck so that you can import them in future games.

It wouldn’t require reverse engineering to write out a deck file—the code which writes them is public and freely available. But you would have to put some time into understanding it if you wanted to go that route.

2 Likes

I don’t know if it is relevant or helpful, but my Oath module contains a custom class (not written by me) that, among other things, imports and exports a deck of cards as part of a text string, by moving all the relevant cards from offboard decks onto the main board.

I imagine you could do something similar, assuming you have a module with all the possible cards for X decks already present - a player could click import, paste their text string, and have their deck set up and ready to play.

1 Like

I will definitely check it out!

OK, there’s a repository of chronicled games (text seeds) at oath.vision you can use to test the import function.

1 Like

I tested the import function and it worked very nicely.
I tried to edit your module so that I can check how the string generator works, but the option is greyed out. How can I explore that? Is there a way to open up the .vmod file?
Many thanks!

Somehow, now I can edit the module.
I’ll spend time trying to understand how it works.
Thank you so much for taking the time to answer my question.

I don’t seem to find that custom class in the folder tree. I got the name of the commands to be executed, but I cannot find where those are to explore the code.
Would you mind pointing me in the right direction?
I have all the possible cards in a deckbuilder (scrollable list), but I am guessing that I will need them physically in a secret/hidden board, so that they can be moved to the player’s deck.
The cool thing is that we could potentially generate the string using the Volition wallet’s website.

Vmod files are just .zip files, and the custom class is two files in the root directory. I forget the names, but it should be pretty obvious: the two files that aren’t in every .vmod by default.

Hi @uckelman, I think I will invest the time studying the code that writes them so that I can parse the text file into a correct .sav format.
Where is that code?
I could only find the Deck entry in the reference manual:
https://vassalengine.org/doc/latest/ReferenceManual/Deck.html#top

Also, in Github, I found the Deck folder, but couldn’t identify any .java to do with loading or saving a deck:

Many thanks in advance!
Carlos

VASSAL.build.module.map.Deck is not the right class. The one you’re looking for is VASSAL.counters.Deck.

The function producing the output when you save a deck is Deck.saveDeck().

1 Like

I managed to learn the format.
I have successfully created a deck manually from outside Vassal and correctly load it for play :slight_smile:
Now I have to talk to the Volition developer so that he implements the “easy export” button in the Volition wallet website.
This is really cool!

4 Likes

For anyone searching for the solution, what I did was:

  1. Create a new game
  2. Manually create a deck by dragging and dropping cards onto the playing board (have a look at my module)
  3. Stack all of the cards and right-click->Save deck to save it as master.sav (for example)
  4. Open the master.sav file and swap all the card images and card names for placeholders like card01, card02, card03…, for example:

DECK e+/1645700394009/obs;70,130;ThetaBack.png;Flip;GThetaBack.png;?;player:;Peek;;false;; placemark;Place Token;84,130;+/null/delete;Delete;68,130;\ piece;;;token.png;/\ null;37;32;4869;0;null;0;0;false;;;4869;0;false\ delete;Delete;68,130;\ rotate;8;93,130;91,130;Rotate CW;Rotate CCW;;;;;;;;true\\ piece;;;card01.png;card01/null; \ \ 0\\ null;5295;2125;4816;0e+/1645700394010/obs;70,130;ThetaBack.png;Flip;GThetaBack.png;?;player:;Peek;;false;; placemark;Place Token;84,130;+/null/delete;Delete;68,130;\ piece;;;token.png;/\ null;37;32;4869;0;null;0;0;false;;;5101;0;false\ delete;Delete;68,130;\ rotate;8;93,130;91,130;Rotate CW;Rotate CCW;;;;;;;;true\\ piece;;;card02.png;card02/null; \ \ 0\\ null;5295;2125;4817;0e+/1645700394011/obs;70,130;ThetaBack.png;Flip;GThetaBack.png;?;player:;Peek;;false;; placemark;Place Token;84,130;+/null/delete;Delete;68,130;\ piece;;;token.png;/\ null;37;32;4869;0;null;0;0;false;;;5102;0;false\ delete;Delete;68,130;\ rotate;8;93,130;91,130;Rotate CW;Rotate CCW;;;;;;;;true\\ piece;;;card03.png;card03/null; \ \ 0\\ null;5295;2125;4818;0

Then at the backend, on the Volition wallet website, you just select the cards for your deck and we have a script that finds+replaces card01 with whatever the official name of a card is, for example Bannerman, and generates a valid .sav file (deck.sav) from the master.sav. This means that the name of the images that got uploaded to the Vassal module need to match the names used when exporting to deck.sav.