Solved [BUG] Multiplayer crash upon entering cellar

NeKoconut

Greenhorn
After plenty of trouble and no luck resolving the issue on my end, I'm hoping someone out there can help me out with this issue.

I have been playing SDV with a group of 3 other people, and recently encountered 2 separate bugs. One much more game-breaking than the other.
The lesser of two bugs:
Occasionally, an NPC that a farmhand has married will be stuck out of bounds, inaccessible to the player. Exiting and re-entering the building does not fix this. It does not happen every day, and no action in particular seems to cause this.

The game breaking bug:
The 2nd farmhand's house has just been upgraded to gain access to the cellar. The issue is that whenever any player attempts to enter said cellar, the game crashes. This does not end the multiplayer session for anyone except the individual who has tried to enter the cellar. Currently, no other farmhand nor farmer has their house upgraded far enough to include the cellar.

Additional information:
I suspect that this bug has been a result of editing the save file, in order to swap who is hosting the world. This was done as the 2nd farmhand's internet was not stable enough to host. No other changes have been made.
Opening the save in single player still crashes the game.
I have verified game file integrity via steam, the game still crashes upon entering the cellar.

First few lines of crash log states: Message: Object reference not set to an instance of an object.
InnerException:
Stack Trace: at StardewValley.Game1.onFadeToBlackComplete() in C:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\stardewvalley\Farmer\Farmer\Game1.cs:line 7096
at StardewValley.BellsAndWhistles.ScreenFade.UpdateFade(GameTime time) in C:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\stardewvalley\Farmer\Farmer\BellsAndWhistles\ScreenFade.cs:line 46

Full crash logs attached, as well as copy of save file.

Is anyone able to repair this save file, to where the cellar can be accessed? Does anybody know why the NPCs sometimes are stuck out of bounds?
If any additional info is needed to proceed, I will provide said info as soon as possible.
 

Attachments

Here try this patched version.
The game pre-builds the cellars, and hides them until unlocked by players.

Y'all were missing the cellar warp points, for the new cellar. And then the cellar assignment IDs were incorrect. One player was attached to 2 cellars causing a secondary crash.

As for the NPC spouses stuck out of bounds. I'm not sure.
I see Emily is currently affected. Been trying to tweak a few things here, & there to fix her on the save side. But, she still loads in broken so far.
So, I'll have to dig further.

For now; this is patched so y'all can use the cellar. If I figure anything out with the spouses; I'll follow up again.
 

Attachments

NeKoconut

Greenhorn
Hey friend thanks so much for checking that out! It working great now. In my search I found 0 help or documentation on how to fix things like this. Could you explain what values you changed where, for any unlucky souls in the future? Also so that I'm able to better troubleshoot my own issues as well :P
 
Okay, well to start. It'll be good to have an example file of a cellar.
I have one here: https://forums.stardewvalley.net/th...th-cellars-causing-players-to-get-stuck.7935/

* Note that the file from there that we want to look at is the "CellarBug_284227857_old" file.
As that's the working file. The other file is for a bug report, and showed incorrect data.


---

Now if we open your original save: Weegee_312784644

We're going to want to look for "cellarWarps"; for the cabin that has the cellar.

These are the points on the cellar stairs that warp us into/from the cellar.
Found within the cabin code; just under the 'fridgeposition' section.


Here's a snippet from my example save:
Code:
  <fridgePosition>
              <X>9</X>
              <Y>13</Y>
            </fridgePosition>
            <cellarWarps>
              <Warp>
                <flipFarmer>false</flipFarmer>
                <npcOnly>false</npcOnly>
                <TargetX>3</TargetX>
                <TargetY>2</TargetY>
                <TargetName>Cellar2</TargetName>
              </Warp>
              <Warp>
                <flipFarmer>false</flipFarmer>
                <npcOnly>false</npcOnly>
                <TargetX>4</TargetX>
                <TargetY>2</TargetY>
                <TargetName>Cellar2</TargetName>
              </Warp>
            </cellarWarps>
----
Now the "TargetName" in this case is the cellar for the cabin.
But, the X & Y targets; should always be 3,2 & 4,2; for the stairs.

Your farmer & farmhands:
Thwomp
Jace
Justin
Carrot


In y'alls case. The one with the cellar is Justin; or the 3rd user.
So, they need the above code, but with a TargetName of "Cellar3".

----------------------
That alone fixes the first issue, but it still crashes due to the cellarAssignements I referenced.

If we search for "cellarAssignments" further down in the file; we'll find what we need.

Here's the broken snippet from y'alls save:
Code:
  <cellarAssignments>
    <item>
      <key>
        <int>1</int>
      </key>
      <value>
        <long>-3088480964705994237</long>
      </value>
    </item>
    <item>
      <key>
        <int>2</int>
      </key>
      <value>
        <long>-259546482745951085</long>
      </value>
    </item>
    <item>
      <key>
        <int>3</int>
      </key>
      <value>
        <long>-3088480964705994237</long>
      </value>
    </item>
    <item>
      <key>
        <int>4</int>
      </key>
      <value>
        <long>7824582178756464997</long>
      </value>
    </item>
  </cellarAssignments>
Notice how the value in "long" is a long number. And, there are 4 sections as defined by each "int" value.
Now if you look closely. The "long" value of "int" 1 & 3 are the same number.
That causes the secondary crash.

Each long value is actually a farmer/farmhand number. Specifically, the "UniqueMultiplayerID" value assigned to each person.
So, in order from top to bottom of the savefile again.

Search for the "UniqueMultiplayerID", and cross-reference that with the order of the users.
Your farmer & farmhands:
Thwomp
Jace
Justin
Carrot

After going back through you can see we had to fix Justin's cellar assignment as it was overwritten by Thwomp's ID.

-----
That's what I patched in your save file to fix the cellar being broken. Hope that helps a bit.
 
Top