1. This forum is archived for reference. For support & bug reports visit the help section of forums.stardewvalley.net

[PC] Possible solution to sleep/save crashing bug

Discussion in 'Support' started by Standardheld, Jan 14, 2018.

  1. Standardheld

    Standardheld Subatomic Cosmonaut


    I solved the sleep/save bug in my game. No more crashes. Maybe it can help you, too! Read my explanation here.


    Bug/Issue:
    The game closes without warning when I go to sleep. The game doesn't save and I can't reach the next day. Stardevalley isn't playable any longer for me at this point.

    PC version(s):
    Stardew Valley 1.230
    Stardew Valley 1.233
    Tested with SMAPI 2.3 with mods, SMAPI 2.3 without mods, full vanilla game

    Notice:
    The last few days I tested this bug/issue with both PC versions written above. I got the sleep/crash bug at exactly the same time! This is what I noticed (both games):
    • Sleep/Save crash happens first year in summer, ecaxtly on 11th of summer (Luau festival day)
    • The game crashes whether I do something (like farming, visit the Luau etc.) or nothing (just jump out of the bed an back into it to save)
    • I've got an upgraded pickaxe (copper one) in both PC version savegames. In version SDV 1.230 I also have an upraded axe (copper one)
    • I couldn't find any problems with mods or SMAPI (see attached error log files!)
    • I tried to solve this with an announced workaround by add/remove items from inventory and chests - didn't work
    • In both savegames from both SDV versions I didn't upgrade the farm house so there isn't a fridge I could add/remove items from.
    • I took a look into both savegame files. Both ended with </savegame> and I couldn't find any corrupted code (which doesn't mean there could not be something)
    • I didn't have any bugs/issues like this in my very old SDV 1.227 version, so I guess I have to play on this one for now :(
    I hope this can be fixed very soon because it's a heavy bug. It makes the game full unplayable which is kind of very sad. Instead of a multiplayer mode in upcoming versions of SDV I wish nohting more than a fix for this bug.
     

      Attached Files:

      Last edited: Jan 15, 2018
    • Standardheld

      Standardheld Subatomic Cosmonaut

      Update note:
      Maybe I've found something ...

      So again, I tested my game - SDV version 1.233 with SMAPI 2.3 and mods - and I did nothing else than go to the Luau with my tools and something for the soup in my inventory. In detail it was a melon (gold star quality), but I tested it with cauliflower as well and the same thing happened:

      When I put my melon into the soup and play through the festival until its end, the game crash as soon as I go to sleep afterwards.
      I tested other runs by backup my savegame file. I can sleep and reach the new save spot next morning when I don't put something into the Luau soup. Or on the other hand: There is no sleep/save bug when I don't get an empty or changed inventory slot during this event. Yeah I tested it with 2 stacked melons on the same slot, too. It crashed in this way.
      There's only one way (for me) to pass the sleep bug successfully: I don't have to put something in the Luau soup from my inventory!
      I don't know why this didn't work with my first savegame some days before when I really did nothing else then go out of bed an back into it. Maybe this file was too corrupted to rescue it. I don't know.

      Fazit: I think this bug is caused by an inventory/slot problem, maybe during events like Luau or others. So the "change your inventory" workaround sounds good. But it didn't worked for me. I just give this update to inform. Perhaps it helps @ConcernedApe and team to find the right direction for a quick solution.

      Until then (or the next patch) I'll skip the Luau event and keep testing if I get the bug again.
       
      • Standardheld

        Standardheld Subatomic Cosmonaut

        And I've got the sleep/save bug again .... this time I think it's triggered through my hoe upgrade into copper hoe. Whether I get the upgraded hoe from the blacksmith or not the game crashes at the moment I go to sleep. There's nothing I can do.
        I even removed the code lines of the tool upgrade from my savegame file but it didn't work. I loaded the savegame successfully and got an (non upgraded) hoe instant into my inventory because I removed the upgrade hoe from code. But again the game crashes as soon as I go to bed.

        I give up here and wait for a fix ... too bad
         
        • Pathoschild

          Pathoschild Tiy's Beard

          Hi @Standardheld. Try this:
          1. Make sure you have Stardew Valley 1.2.33 (your log shows 1.2.30).
          2. Reset your game files.
          3. Try playing again. If the crash no longer happens, skip steps 4–5.
          4. Temporarily remove all SMAPI mods (but keep SMAPI itself).
          5. Try playing again.
          Does the issue still happen? If so, please post your latest SMAPI log.
           
          • Standardheld

            Standardheld Subatomic Cosmonaut

            Yeah I tested with both versions but 1.2.30 was the last one. The logs were the same, I guess.

            Ok, so I removed every single modded XNB file and resetted my game files like described, except for my modded farm map (otherwise half of my harvest would stay in water). I started with SMAPI 2.3, game version SDV 1.2.33
            What can I say? It saved! Thank you ... I guess I have to find out which modded XNB causes the problem now, step by step. Thank you for your help, I was kind of desperate. :)

            Update: OK, I messed up with a personal dialogue mod which worked fine until my special crash phase. I had to remove it and try to fix. So in case someone else had this save / sleep bug I recommend to deal with some dialogue XNBs (or other xnb files) which can work correct but at some point they mess up your whole save.

            Thanks again to @Pathoschild for the help!
             
              Last edited: Jan 15, 2018
              Pathoschild likes this.
            • Standardheld

              Standardheld Subatomic Cosmonaut

              I found something really big ... perhaps this could solve maaaaaany savegames who has the sleep / save bug in case you use dialogue mods!

              The problem:
              Suddenly - you don't know why - everytime you go to bed and sleep, your game crashes before it can save.
              I've seen lots of people with this issue and many more can't reconstruct this. Some peolpe get the sleep/save bug in summer, others in fall or winter ... some when they upgrade their tools and so on. But it doesn't seem to get triggered at the exact same thing.

              The reason:
              I had this bug 2 times now. First on the Luau event on my first year in summer, but only when I put something good into the soup. So I skipped the event to be able to save. Then second time I got this when I put my hoe to upgrade and get it back ... again in summer.
              BUT NOTHING HAS TO DO WITH BUGGY EVENTS OR TOOL UPGRADES! ... well, in case you use any dialogue mods. They can be the problem for all!
              I'll try to explain this as simple as I can ... and hopefully no in my worst use of English language (it's not my native language though).

              So, how does a simple dialogue mod like "leah.xnb" file for example be the reason for so many announced savegame issues? It's quite simple if you think of heart related dialogue sequences.
              Every SDV player has his/her own gameplay style. Some build their farm, others go mining and some try to get closer to the npcs. Guess you use a dialogue mod with an tricky bugged entry on the following conditions (this is just an example!):
              • there is a code line with correct syntax but missing reference like a question with answers but one of them is bugged. This was my problem, though.
              • This bugged code line is OK to be packed and the game works as long as there is no need to let the NPC use this part of dialogue code.
              • The bugged code line bases on a number of hearts for this character and on a special weekday (or even season + weekday + hearts). So the bug / save crash happens when you reach in your own personal gaming style the exact number of hearts for this npc while changing onto the bugged weekday by saving / sleeping. The game can't save this and crashes.
                Some people reach this conditions in summer, other in fall, other after mining when they give the NPC a gift before went back to the farm and into bed. This is why it happens so randomly for so many people (or doesn't happen because you come over the problematic hearts due to an festival event or heart event....)
              You see? This could explain everything!

              How you can solve you problem?
              First of all make a backup of your savegame. You'll need to put it back into the folder with current savegames again and again for testing.
              Furthermore I recommend to use some tools to unpack xnb files and open/edit the unpacked yaml file.

              • Now remove all you xnb mods (or if you want all mods, except SMAPI) from the game, so you play and test this on vanilla.
              • Start the game via SMAPI, load your savegame and just do nothing than jump out of the bed and go back to save. If it saved successful you know a mod is the probem. End the game.
              • delete your savegame and put your backup into the folder for saves. Start the game again, load your savegame again. Now open the window with all npc relationships and write down their actual hearts somewhere. Then look at the current season and day. Write them down, too.
              • Unpack your dialogue mod(s) and open the yaml file(s) with a note tool like Notepad++ or something simliar. Search for dialogue code lines beginning with
                season_dayHEARTNUMBER: "Here's text" #!String

                For example: summer_Fri2: "It's so hot outside!" #!String

                Look exactly on these code line, if you find some wrong references or syntax error. In case you can't find, search for the same season, same day, but next heart number and take a detailed look onto this code line. If there's an reference/syntax/any other error with the line, try to fix it.
                Save your yaml, pack the xnb file, put it into your game and test if you get your save crash again. If you can save successfully - congratulation, you have fixed it!

              Example to show what was wrong:

              First of all, this was my personal issue. Maybe there's another save/sleep crash bug I'm not aware of but maybe my explanations can save someones farmer life :) Here I show you what went wrong in my game.

              I wrote my own small dialogue mod for Leah, packed it to leah.xnb with notepad++ and didn't get any error message. All went well even when I put my dialogue mod into game. But I didn't notice there was a bugged code line on summer for friday when you get 4 hearts.

              There was the Luau festival for me. Leah had 2 hearts shown. It was Thursday. I put something good into the soup. The gouvenor enjoyed it and everyone was happy. So when I go to bed the game seems to check the heart state + dialogue for the next day ... and I guess with the successful Luau I get 4 hearts for Leah ... on a Friday ... in summer ... when there is the buggy line in dialogue code which prevents your game from saving. It crashed.
              I skip the Luau ... no perfect soup, no upcounting hearts for Leah ... but on another Thursday in summer she got her 4th heart an as soon as I go to bed it happened again. No saving, just crash!

              I opened my dialogue mod, searched for "summer", "friday" and "2 hearts" ... didn't find anything.
              So I searched for "summer", "friday" and "4 hearts" ... and I got this

              summer_Fri4: "Let me ask you something!#$q 45/45 summer_Fri_old#Do you like summer?#$r 45 10 summer_Fri4_good#Yeah, a lot!#$r 45 5 summer_Fri2_okay#I like all seasons#$r 46 -10#I hate summer!"#!String

              summer_Fri4_old: "#$p 45#Do you like summer? I love it so much.|Well .. no, I don't want to ask you." #!String
              summer_Fri4_good: "I like summer, too!" #!String
              summer_Fri4_okay: "I like all seasons, too. But summer is my favorite." #!String
              summer_Fri4_bad: "Oh ... so you're a winter farmer, eh?" #!String


              Did you see the error? In the phrase where you list the possible answers the summer_Fri4_bad reference is missing. The code should look like this in that line:

              summer_Fri4: "Let me ask you something!#$q 45/45 summer_Fri_old#Do you like summer?#$r 45 10 summer_Fri4_good#Yeah, a lot!#$r 45 5 summer_Fri2_okay#I like all seasons#$r 46 -10 summer_Fri4_bad#I hate summer!"#!String

              And that's something you can pack back into xnb file and play the game without error as long as you reach this code line. I fixed it and my game work again.
              I guess there could be a bugged code line in some dialogue mod many people downloaded and have problem with the save/sleep bug. Hopefully my words can help you to get your games work smooth again :)
               

              Share This Page