stardew_community_checklist icon indicating copy to clipboard operation
stardew_community_checklist copied to clipboard

Allow imports from Game Data

Open kihashi opened this issue 8 years ago • 10 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.

kihashi avatar Oct 08 '16 19:10 kihashi

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 avatar Nov 09 '17 22:11 eirism

Unfortunately, you'll need to do a little digging on this. The wiki seems to think that saves are xml files, but you'll need to figure out the schema.

On Thu, Nov 9, 2017, 23:38 Eirik Smithsen [email protected] wrote:

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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kihashi/stardew_community_checklist/issues/64#issuecomment-343315205, or mute the thread https://github.com/notifications/unsubscribe-auth/AAlPwpvrY3PPFLkdWFJ-jixqWh3jR6XFks5s037mgaJpZM4KRzjB .

kihashi avatar Nov 10 '17 04:11 kihashi

@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.

kihashi avatar Nov 14 '17 12:11 kihashi

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.

eirism avatar Nov 14 '17 12:11 eirism

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]] }

eirism avatar Dec 01 '17 15:12 eirism

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 avatar Dec 10 '19 18:12 Sempiternity87

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

kihashi avatar Dec 10 '19 18:12 kihashi

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

Sempiternity87 avatar Dec 11 '19 04:12 Sempiternity87

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.

kihashi avatar Dec 11 '19 15:12 kihashi

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).

Sempiternity87 avatar Dec 11 '19 18:12 Sempiternity87