kihashi / stardew_community_checklist

A checklist for the Community Center Bundles in Stardew Valley

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow imports from Game Data

kihashi opened this issue · comments

This one might be a bit harder, but I think the save file format is well known at this point. I should be able to parse out the community center bundle data.

Do you have any pointers documentation of the file format? I'm interested in making a save game importer, but I need to know how the data is organized.

@eirism You might want to check out the source for upload.farm. They presumably parse the save file to get the farm layout, so there might be some clues in there. Note, though, that they have a server-side component in python and SDCC would only have client-side JS available.

I think I've found the part of the save data which represents the bundles. Now I need to map the XML data to bundle names and items.

I've made a simple save game parser with a limited mapping of bundles and items, as a proof of concept.

@kihashi how do you think the necessary data is best represented in bundles.json? For each bundle we need to record the games bundle number/ID. I'm thinking that this can easily be done by adding a value to each bundle, e.g. game_id. And then for each item we need to record the position of it within each bundle it's in. One way to represent this is to use an array of arrays for the "bundles"-value for each item, so that the inner array is [id, position]. Daffodil would then become
{ "id": 1, "name": "Daffodil", "source": "Foraging during Spring. Buy from Pierre's Shop at the Flower Dance.", "seasons": ["spring"], "skills": ["foraging"], "bundles": [[0, 1]] }

Is there going to be any continued progress on this? I've done a mapping of the bundles section (as of 1.4) and can provide positioning information for all items later today when I get home.

@Sempiternity87 That would be really helpful to have! Thanks!

Okay, I'm including a JSON file with the bundle information. The arrays have more elements than is actually used, and unfortunately when a bundle is completed, it marks all elements as true instead of only keeping the ones that were used. Missing IDs correct: they are not in the save file.
SV Bundle Mapping.txt

So, in the save file, the items array just has the turned in items in any order?

For example, my lake fish bundle might look like this-

{ 
    id    : 7,  
    name  : 'Lake Fish Bundle', 
    items : [ 
        'Carp', 
        'Largemouth Bass', 
        'Bullhead', 
        '', 
        '', 
        '', 
        '', 
        '', 
        '', 
        '', 
        '', 
        '' 
    ]
},

If that's the case, this shouldn't be super hard to cobble together. I'll need to get some save files to test with, though.

They are in the same order they appear in-game. So it would be Largemouth Bass first, then Carp, Bullhead and finally Sturgeon. If you've turned in the Carp, then the save file would look like:

{
  id    : 7,
  items : [false, false, true, false, false, false, false, false, false, false, false, false ]
}

Or something (I don't remember how many elements it had). Once you have turn in all of the required number (for example say the Adventurer's requires two with four options), they all get marked as true:

<item>
  <key>
    <int>22</int>
  </key>
  <value>
    <ArrayOfBoolean>
      <boolean>true</boolean>
      <boolean>true</boolean>
      <boolean>true</boolean>
      <boolean>true</boolean>
      <boolean>true</boolean>
      <boolean>true</boolean>
      <boolean>true</boolean>
      <boolean>true</boolean>
      <boolean>true</boolean>
      <boolean>true</boolean>
      <boolean>true</boolean>
      <boolean>true</boolean>
    </ArrayOfBoolean>
  </value>
</item>

As you can see, that makes it a little difficult to know what was actually turned to complete something if you cared to know that information.

I've also found where the Joja Community Form stuff is saved, but it's kind of dumb; it's just based on events seen in the player section. I couldn't find anything else about it (I would have expected it to be either those missing IDs, or in the JojaMart location.

I'll include my save files I used for testing, I think one of them has been run through the Joja Community Form partially, with nothing from the community center (a_235633647.txt).
This other one has some of the CC stuff completed, but not everything, so this would probably be a better option to look at (Test_235530846.txt).