authorblues / bizhawk-shuffler-2

A script to randomly shuffle between games played in Bizhawk, with plugins to enhance the experience
MIT License
58 stars 21 forks source link

Shuffler is losing progress when there is only one game left #63

Closed Boboblio closed 1 year ago

Boboblio commented 1 year ago

Shuffler is losing progress when there is only one game left and I have saved the game within the ROM

To Reproduce Steps to reproduce the behavior:

  1. Startup EmuHawk.exe and startup the lua console. Open the shuffler.lua within the shuffler folder
  2. Check the box for resuming a session and click resume previous session.
  3. No error appears that I see, however it loads data from a previous time that was prior to when I last saved the game in-game in the ROM.
  4. If I go into the game, warp to the overworld and save the game again, close out of bizhawk and open again, it'll revert back to whatever it loaded last time and not the save I just made in-game. It appears repeatable.

Environment (please complete the following information):

Additional context bizhawk is using Snes9x to run "Final Fantasy IV: The Lunarian Shuffle" found here: (https) ff4-lunarianshuffle.blogspot (dot com)

Logs Please attach message.log and shuffler-src/config.lua.

Couldn't attach config.lua, so here's the text: config= { ["completed_games"] = {[2] = "FF4FE.bBAUAAAAAAAAAAIBsBjgAAAAAAAAAADhAAkCAJAAEAEAAABA.Z6KQWUS1W6.spoiler.txt",[3] = "ff6wc_ZWI4KcSMKNf7.txt",[1] = "FFIV_Shuffle_PlayMe.smc_log.txt",[4] = "FF4FE.bBAUAAAAAAAAAAIBsBjgAAAAAAAAAADhAAkCAJAAEAEAAABA.Z6KQWUS1W6.smc",[5] = "ff6wc_ZWI4KcSMKNf7.smc",}, ["total_swaps"] = 1322, ["hk_complete"] = "Ctrl+Shift+End", ["min_swap"] = 60, ["shuffle_index"] = -1, ["plugins"] = {}, ["sound"] = true, ["nseed"] = 13329865, ["current_game"] = "FFIV_Shuffle.smc", ["max_swap"] = 90, ["frame_count"] = 5846726, ["game_count"] = 6, ["seed"] = 39640492, ["game_swaps"] = {["FF4FE.bBAUAAAAAAAAAAIBsBjgAAAAAAAAAADhAAkCAJAAEAEAAABA.Z6KQWUS1W6.spoiler.txt"] = 1,["FFIV_Shuffle_PlayMe.smc_log.txt"] = 1,["ff6wc_ZWI4KcSMKNf7.txt"] = 1,["FF4FE.bBAUAAAAAAAAAAIBsBjgAAAAAAAAAADhAAkCAJAAEAEAAABA.Z6KQWUS1W6.smc"] = 194,["ff6wc_ZWI4KcSMKNf7.smc"] = 563,["FFIV_Shuffle.smc"] = 562,}, ["output_timers"] = true, ["game_frame_count"] = {["FF4FE.bBAUAAAAAAAAAAIBsBjgAAAAAAAAAADhAAkCAJAAEAEAAABA.Z6KQWUS1W6.spoiler.txt"] = 473,["FFIV_Shuffle_PlayMe.smc_log.txt"] = 1125,["ff6wc_ZWI4KcSMKNf7.txt"] = 817,["FF4FE.bBAUAAAAAAAAAAIBsBjgAAAAAAAAAADhAAkCAJAAEAEAAABA.Z6KQWUS1W6.smc"] = 863456,["ff6wc_ZWI4KcSMKNf7.smc"] = 2509096,["FFIV_Shuffle.smc"] = 2471759,}, ["auto_shuffle"] = true, }

Screenshots If applicable, add screenshots to help explain your problem. message.log

kalimag commented 1 year ago

Currently, the shuffler only creates a savestate when switching games. So, anything that happens in the last game of a session will not be saved by the shuffler, and when resuming a session it will load the state from the last switch.

As a workaround, I recommend making a manual savestate before you close BizHawk and loading that after resuming. If it's the last game of a session and the game has a save feature, you could also just load the ROM without using the shuffler.

I'm closing this issue as a duplicate of #49, but I'll look into making the shuffler save a state when BizHawk is closed.