Automating the creation of a save game file

I am starting to build a force/scenario creation tool for a game. It will be in JS but I was thinking that it would be great to be able to take your created scenario and forces and export a Vassal game file for it.

When I looked at my local save games they all appear to be binary. Are there docs for creating a save game file from outside of Vassal?

No, and there are no docs for creating saves from inside Vassal, either.

There will be a save converter for V4, but it will go in the opposite direction—from the legacy V3 format to V4’s new format. It’s not likely anyone who knows the V3 code presently will author any new code that writes the V3 format.

If you look at the documentation for Decks, you will see they have the ability to save and load from an external file.

As a deck can hold any pieces, not just cards, you can (theoretically) use this to import pieces into a game. You would have to either build your force creation tool in VASSAL itself (having it put all the pieces in a deck and then saving them), or you might be able to reverse-engineer enough of the format of the external deck file to figure out how to create one using JS (good luck with that, though).

And, of course, this doesn’t help with creating new scenarios.

1 Like

Hi Joel

I am starting to look at a saved game converter for VASL. You mention that VASSAL4 will have a save converter. Is any work being done on this? Is there any opportunity to do something in parallel or use VASL as a test case?

Doug

I’ve already done some work for extracting data.

What are you trying to convert your saved games to?

From one version of vasl to the next. When we make counter changes or add functionality from one version to another, it is not picked up when games saved in previous versions are opened. Counters/prototypes are the biggest issue.

Right, that’s due to a design decision way back at the start that looked plausible at the time but turned out to be a bad idea.

Have you tried the refresher for updating saved games?

Yes, with mixed results. In some situations it worked and in others it did not. I have not done extensive enough testing to describe the results in detail but can certainly do so.

It is a bit awkward in that it will not work if there is an extension loaded and we make considerable use of those. I don’t know a player who doesn’t have any loaded. But of course they can be moved and then brought back in after conversion; not a game breaker but awkward for the average user.

That sounds like something which should be looked at for the refresher, in that case.