Announcement

Collapse
No announcement yet.

Saving randomly freezes the game

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Saving randomly freezes the game

    I have made a Savegame Object:

    Click image for larger version

Name:	6a23ff54c1.png
Views:	1
Size:	5.6 KB
ID:	1160029

    When the game starts I do the following check:

    Click image for larger version

Name:	0be2d0c571.jpg
Views:	1
Size:	54.3 KB
ID:	1160030

    When the player dies, this happens:

    Click image for larger version

Name:	e968348f96.jpg
Views:	1
Size:	27.7 KB
ID:	1160031

    Click image for larger version

Name:	895e2ebd77.jpg
Views:	1
Size:	87.0 KB
ID:	1160032
    Click image for larger version

Name:	b80382becb.png
Views:	1
Size:	133.9 KB
ID:	1160033
    Click image for larger version

Name:	36515449e9.png
Views:	1
Size:	54.8 KB
ID:	1160034

    Though some times when I die, the game just freezes and the only way to play again is to restart the game. There is no pattern. The only way to solve the issue is to delete the save file that I created called "mysave.sav", but that deletes all of the save data I put in there defeating the purpose of having the save file in the first place. Does anyone know what could be the issue here?

    #2
    It's hard to say with out having the files to play with but it seems like you might be handling save data poorly.

    For example when the game starts you create a saved game object yet you don't store it in a variable to access later. Because of this you need to keep loading the saved game object every time you need to access the data. Over time this will cause multiple saved game objects to be loaded which could cause performance issues.

    Another thing I noticed is you have a branch where theirs a change it could false with nothing happening which would cause your game logic to stop.

    Hopefully this helps, also below are a few screenshot of how I tend to handle my saved data.

    Click image for larger version

Name:	UE4_LoadSaveGameData.png
Views:	1
Size:	136.2 KB
ID:	1084404

    Click image for larger version

Name:	UE4_LoadSaveGameData2.png
Views:	1
Size:	138.5 KB
ID:	1084405

    Click image for larger version

Name:	UE4_LoadSaveGameData3.png
Views:	1
Size:	126.0 KB
ID:	1084406
    Looking for blueprint tutorials? Then visit my blog... voxagon

    Comment


      #3
      Yeah my saving system is quick and dirty. Never saved data with Blueprints before. I had planned to remake it later as the system I currently got is just for a pre-alpha build and serves it's purpose well. I will take note of your pictures.

      However you pointed out that False branch I didn't complete and actually plugging that out as it should be seems to have solved the issue.

      Comment

      Working...
      X