flathub / com.fightcade.Fightcade

https://flathub.org/apps/details/com.fightcade.Fightcade
Apache License 2.0
10 stars 4 forks source link

Can't save state #122

Closed not-well closed 1 year ago

not-well commented 1 year ago

When I try to save a state on FB Neo I've got a warning saying "Error creating state file". To reproduce the problem when the emulator start go to Game > Save states > Save state or use the shortcut Ctrl + F10.

I can't found any logs to put here, the only test that I made was put an old save file that I've had a on /var/lib/flatpak/app/com.fightcade.Fightcade/current/active/files/fightcade/Fightcade/emulator/fbneo/savestates and the file was loaded properly when I searched using Load state function or Ctrl + F9.

Pobega commented 1 year ago

This may be fixable but it's not something I've considered, is there a reason you need to use save states? I primarily focus on supporting Fightcade's multiplayer aspects and not using FBNeo as a single player emulator (considering MAME is available and runs natively (rather than through Wine like FBNeo))

not-well commented 1 year ago

I generally use it for NeoGeo games that has training mode and Lua scripts, so this way I can skip to a desired circumstance without having to switch every time on the dip switches to AES mode. But I understand that this should not be a priority, I just reported the problem.

Pobega commented 1 year ago

I see the issue. That directory is currently read-only and ships with all of the default save states (which I believe are loaded when you connect to another player to skip you to character select.)

Allowing write access to the directory isn't hard but I'm a bit concerned with the states being overwritten causing new bugs, though considering this is already the case in the non-Flatpak I'm not sure it's a huge deal. Additionally because of the way I've implemented things any changes to files that already exist in that directory would be overwritten when you launch Fightcade (to be specific, at build time a 'pristine' copy of the original save state is backed up then at runtime all those files are copied into the new r/w version of the directory.)

Could you explain a bit more about the use case and if these limitations would be sufficient?

Pobega commented 1 year ago

Give this build a try and let me know how it works for you; https://github.com/flathub/com.fightcade.Fightcade/pull/124

not-well commented 1 year ago

The notebook that I was using while opened this issue is not working anymore. But the problem only occurs when I was trying to save a state, loading was ok, and if I get a save state from an external source and put it in the states folder I could load it normally.

Pobega commented 1 year ago

I'm not sure what you mean about the notebook, can you elaborate? Edit: Nevermind, I now understand you mean that you don't have a laptop to test it on.

The development build I provided should have a r/w save state directory and allow you do save state using Ctrl+F10 in-emulator. You may need to remove other versions of Fightcade for it to properly launch (no local state will be lost)

I'm just a bit concerned merging this since I'm not fully sure of the expected use-case and whether or not people actually use save states (and if overwriting the default save states is a problem for netplay.)

not-well commented 1 year ago

Sorry, I used a brazilian expression, notebook is what we call laptop. The default save states should not be overriden, this is generally used when the emulator loads the game for netplay, usually is the save states with _fbneo at its name. But when you press Ctrl + F10 the emulator prompts to choose a name for the new save state, and generally suggests a different name from default save state.

Pobega commented 1 year ago

Should be resolved by 69e1a1a