Jump to content
LaunchBox Community Forums

Launchbox is not exiting Higan correctly, official YouTube videos are wrong.


Clunker

Recommended Posts

From this thread...

Quote

Guys, I figured it out. Sort of. You can't just exit out. For it to save, you first have to go into the menu and click "unload." That's the only way Higan will create an in-game save file. The problem is I don't know how to fix it. I set up my Launchbox using the Unbroken Software YouTube videos, including setting up how Launchbox exits emulators. This means the official YouTube videos are wrong. Whatever I was told to do when setting up Launchbox like a year ago is not right. Launchbox isn't exiting Higan correctly. It should be unloading games first and then closing out. Unfortunately, I don't know how to make that change.

 

Link to comment
Share on other sites

I'm not talking about save states. I'm talking about in-game saves. In-game saves will not actually save if you just press "esc." The only way to get it to save is to press F1 to open windowed mode and then use the drop down menu to "unload." At that point THEN you can close the window. I set my Launchbox up last year, so I'm not sure what part of the tutorials dealt with using escape to close the game, but technically it doesn't work, not if you want to use in-game saves.

 

Link to comment
Share on other sites

It's the auto hotkey script that is wrong. We need a script that unloads the game, not just closes the process. Just closing the process results in your in-game save not actually being saved. I guess Higan doesn't write a save file until you "unload" the game. I don't know how to write a script that unloads the game and then exits the emulator.

Edited by Clunker
Link to comment
Share on other sites

The AHK script isn't wrong, it's a limitation of the emulator so if you wanna take it up with Byuu I am quite sure he will be happy to listen to you.

The script closes out the emulator the best it can from a controller only standpoint. If you can make a better AHK script then by all means feel free to post it and share it with the rest of us.

You could use Snes9x or Retroarch and its Higan core if you want it to properly exit without losing your saves.

Link to comment
Share on other sites

You point out one flaw and everyone starts getting defensive. I don't know Byuu or how to contact him. You're the mod. Maybe you can link him this thread? But technically, yes, the script is wrong. It shuts down Higan in an incorrect way. Now you can argue semantics and say, "well it still shuts it down." But let's be real. Higan doesn't work as intended when you just close the process like this. I actually looked up the emulator's documentation and it specifically says that the emulator shouldn't be shut down like this. It IS wrong. 

You can be snarky and say, "write you're own script then." But like I said, I don't know how. If I did then I wouldn't be in this help forum actually asking for help. I don't have that ability, that's why I'm here. I'm looking for help.

If the Unbroken team doesn't want to correct this flaw then I'll be disappointed, but I get it. But at the very least the video tutorial should be changed to reflect this new information. There should be some kind of notice that says, "Hey, shutting down with this script will have the side effect of in-game saves not functioning correctly."  

Link to comment
Share on other sites

BTW, this is the relevant part of the Higan documentation that I mentioned in the post above...

https://higan.readthedocs.io/en/stable/concepts/game-folders/

  • Quote

    save.ram: Games that include a save feature will create this file. Note that it is only written to disk when higan exits gracefully; if higan crashes or is forced to quit, in-game saves may be lost. Other emulators sometimes call this an “SRAM file”, even though the same filename is used with games that included EEPROM or Flash storage, not just battery-backed Static RAM.

    I don't know how to rewrite the script to make Higan "exit gracefully." Like I said, the only way I found for Higan to save was to "unload" the game and then close the program. Hopefully someone here can come up with some kind of script that works. We need a script that executes the unload command and then closes the program. I wish I knew how to write that.

Link to comment
Share on other sites

@Clunker My apologies for the trouble here. That script is not a default for the Higan emulator in LaunchBox; I'm guessing maybe it was just copied over from another emulator. LaunchBox actually doesn't recommend Higan by default, but we did put out the tutorial video of course. Did the script come from the video?

By default if you create the Higan emulator there won't be any script attached to it, so it shouldn't be a problem by default.

Link to comment
Share on other sites

Yes, the script is in the video (53 seconds in) and it's available as a download link in the YouTube description. I assume it was written by ETAPrime? It's not like the script is useless. We just need a better script that will shut down Higan correctly instead of force closing it. I tried to contact Byuu. (I looked up his social media accounts.) But apparently he has moved to Japan and may not be back online for another two months (his estimate.)

If this isn't the way Higan should be set up in Launchbox then why is there a video tutorial for it? I don't understand. I followed each tutorial for each emulator pretty religiously and now the response is "Oh, well it shouldn't be set up like that by default." Then why does the tutorial exist?

Link to comment
Share on other sites

2 minutes ago, Clunker said:

Yes, the script is in the video (53 seconds in) and it's available as a download link in the YouTube description. I assume it was written by ETAPrime? It's not like the script is useless. We just need a better script that will shut down Higan correctly instead of force closing it. I tried to contact Byuu. (I looked up his social media accounts.) But apparently he has moved to Japan and may not be back online for another two months (his estimate.)

If this isn't the way Higan should be set up in Launchbox then why is there a video tutorial for it? I don't understand. I followed each tutorial for each emulator pretty religiously and now the response is "Oh, well it shouldn't be set up like that by default." Then why does the tutorial exist?

Apparently the tutorial is wrong in this regard. Neither me nor ETA Prime are perfect, so I guess he got that wrong. There unfortunately may not be a good way to shut down Higan gracefully with AutoHotkey, depending on how the emulator was written. There may be a good way too. Regardless, all that is needed is to map Escape to exit the emulator, which you might be able to do in the Higan interface. Once that is set up, the controller shortcuts should work fine.

Link to comment
Share on other sites

2 minutes ago, Jason Carr said:

Regardless, all that is needed is to map Escape to exit the emulator, which you might be able to do in the Higan interface.

I don't understand. Right now escape does exit the emulator. I guess that's the problem? For whatever reason, I guess it needs to do more than just that. It actually needs to use the "unload" command from the drop down box in Higan's menu. I don't know. I'll play around with it right now and see if I can get it to save without using "unload."

Link to comment
Share on other sites

4 minutes ago, Clunker said:

I don't understand. Right now escape does exit the emulator. I guess that's the problem? For whatever reason, I guess it needs to do more than just that. It actually needs to use the "unload" command from the drop down box in Higan's menu. I don't know. I'll play around with it right now and see if I can get it to save without using "unload."

Unbind Escape from unload and bind it instead to Exit or Quit.

Link to comment
Share on other sites

11 minutes ago, Jason Carr said:

Unbind Escape from unload and bind it instead to Exit or Quit.

Uh... how?

Anyway, I did some more testing. You don't actually have to go to the menu and click "Famicom > Unload." The game WILL save if you just hit F1 (get out of fullscreen and go into windowed mode) and then close the window. I'm not sure how just closing the window is any different than what the auto script is doing. I guess the auto script is force closing the program? I don't know. Maybe someone can explain it.

 

Just for clarity... here's the auto script that's not shutting down Higan as intended...

AutoHotkey Script=
$Esc::
{
    Process, Close, {{{StartupEXE}}}
}

I'm not sure what needs to be changed there that makes it more like closing the window and less like force closing a program. But that's what needs to happen.

Edited by Clunker
Link to comment
Share on other sites

3 hours ago, Clunker said:

What does that do @Ateb? Is "process" the right syntax for what we're trying to do?

I just added the two lines -  send a keypress of F1 to the emulator and wait for 1 second so it can save the game before (force) closing.  Based on your posts...

I don't use this emulator, but I did something similar for Citra.

 

Link to comment
Share on other sites

17 hours ago, Ateb said:

Maybe try this?

Just throwing it out there.  Not sure this will work.

 


$Esc::
{
    send {F1}
	sleep, 1000
	Process, Close, {{{StartupEXE}}}
}

 

@Ateb

It doesn't work. The Escape key doesn't work at all now, and I get an error message like...

--------------------------------------------------------------------------------------

Error at line 7

Line text: i>>? (<- or a bunch of similar special characters)

Error: This  line does not contain a recognized action.

This program will exit.

----------------------------------------------------------------------------------------

 

Come on guys, I feel like we're getting closer to figuring this out.

Don't give up!

Edited by Clunker
Link to comment
Share on other sites

@Ateb @Jason Carr @Reynbow @Retro808 

 

WE SOLVED IT!

We did it guys!!! Yay! This script works... 

Quote

$ESC::WinClose, ahk_exe higan.exe

I reached out to the guys at Reddit and they came up with the correct script. This script will close the window normally instead of force closing the program. That will allow the game to save. A big thanks to everyone on Reddit. Luckily the video tutorial will not have to be removed.  But someone does need to change the description of the YouTube video to include the new hotkey script. This existing file in the description needs to be removed and replaced with a text file containing the new hot key script. This will make the tutorial correct. 

I'm not saying I deserve a free lifetime Big Box license for getting this done and fixing an official YouTube tutorial. But, hey, I wouldn't turn it down, lol.

Edited by Clunker
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...