libTAS icon indicating copy to clipboard operation
libTAS copied to clipboard

Game crashes when loading savestates in FTL: Faster Than Light

Open unsightedmetal6 opened this issue 2 years ago • 13 comments

Using libTAS v1.4.3

FTL: Faster Than Light crashes when loading a savestate.

Steps to reproduce:

  1. Start FTL with libTAS
  2. Frame advance through the loading screen until you get to the Main Menu
  3. Create a savestate with Shift+F1
  4. Frame advance and click into Options menu
  5. Load the savestate with F1

Result: Game crashes/freezes.

In the LibTAS console window it says Got wrong message after state loading upon closing the game after a crash.

Surrounding console output:

[libTAS f:20] Thread 41882 (main) Saved state 1 of size 595661287 in 0.989474 seconds
[libTAS f:20] Thread 41882 (main) Loaded state 1 in 0.151373 seconds
recv() returns 0 -> socket closed
Got wrong message after state loading
Killed

unsightedmetal6 avatar Oct 04 '22 01:10 unsightedmetal6

Can't reproduce, at least on noveau drivers.

Are you running it on a laptop or a PC? And what graphics driver do you have installed?

LukeSaward1 avatar Oct 10 '22 16:10 LukeSaward1

I have the nvidia driver. I am using a laptop that dual-boots Windows 10 and Ubuntu 22.04.1 LTS. It has both an Intel iGPU and an Nvidia dGPU.

I'll try the noveau driver.

Edit: In terminal I ran sudo apt install xserver-xorg-video-nouveau, and it says xserver-xorg-video-nouveau is already the newest version (1:1.0.17-2build1).

I tried libTAS with FTL again, but it still crashes when I load a savestate.

Could the issue be that my laptop has two graphics cards?

unsightedmetal6 avatar Oct 10 '22 18:10 unsightedmetal6

image What does it show in here (see screenshot)? If a NVIDIA driver is selected, select the Nouveau one. You may or may not have to reboot after doing this and applying changes.

LukeSaward1 avatar Oct 10 '22 21:10 LukeSaward1

image

I changed it to Nouveau and rebooted the computer but the same issue persists: a freeze/crash when I load a savestate.

unsightedmetal6 avatar Oct 10 '22 23:10 unsightedmetal6

Do you have Video > Force software rendering checked in libTAS main window? Also, when you were using the NVidia drivers, libTAS should have warned you about savestating not working with a popup window when starting the game. There were no such window?

In the terminal, it should print which GPU driver it is using when starting the game with libTAS.

clementgallet avatar Oct 11 '22 08:10 clementgallet

Force software rendering is already enabled. I don't remember getting any pop-ups.

Here is the full console output (aside from where I started libTAS):

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Attempt 1: Connected.
Version: 1.6.13
Loading settings
Failed to load settings file!
Initializing Crash Catcher...
Starting up
Loading text
Initializing Video
Video: 1280x720, windowed
[libTAS f:0] Thread 4074 (main) OpenGL vendor: Mesa/X.org
[libTAS f:0] Thread 4074 (main) OpenGL renderer: llvmpipe (LLVM 13.0.1, 256 bits)
Video Initialized
Renderer: OpenGL version 4.5 (GL_VERSION: 4.5 (Compatibility Profile) Mesa 22.0.5)
Creating FBO...
SteamAPI initialized.
Starting audio library...
[libTAS f:0] Thread 4074 (main) Buffer size is too low, raising to 2048
Audio Initialized!
Resource Preload: 0.290
Initializing animations...
Animations Initialized!
Loading Ship Blueprints....
Blueprints Loaded!
Initializing Sound Data....
Generating world...
Loading achievements...
Initializing Steam achievements for app 1234
Loading score file...
Running Game!
[libTAS f:20] Thread 4074 (main) Saved state 1 of size 596369752 in 0.885165 seconds
[libTAS f:20] Thread 4074 (main) Loaded state 1 in 0.124201 seconds
recv() returns 0 -> socket closed
Got wrong message after state loading
Killed

unsightedmetal6 avatar Oct 12 '22 00:10 unsightedmetal6

I have an issue with savestating on this game, but I don't know if it is the same as yours.

Can you try saving a state three times before attempting to load the state, and tell me if it works?

clementgallet avatar Oct 23 '22 18:10 clementgallet

When I load the state after saving it three times, it says State invalid because new threads were created in the bottom-right of the FTL window.

Edit: Made it more clear

unsightedmetal6 avatar Oct 26 '22 03:10 unsightedmetal6

Tried this again on libTAS v1.4.4.

Console output:

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Attempt 1: Connected.
Version: 1.6.13
Loading settings
Failed to load settings file!
Initializing Crash Catcher...
Starting up
Loading text
Initializing Video
Video: 1280x720, windowed
[libTAS f:0] Thread 6445 (main) OpenGL vendor: Mesa/X.org
[libTAS f:0] Thread 6445 (main) OpenGL renderer: llvmpipe (LLVM 13.0.1, 256 bits)
Video Initialized
Renderer: OpenGL version 4.5 (GL_VERSION: 4.5 (Compatibility Profile) Mesa 22.0.5)
Creating FBO...
SteamAPI initialized.
Starting audio library...
[libTAS f:0] Thread 6445 (main) Buffer size is too low, raising to 2048
Audio Initialized!
[libTAS f:1] Thread 6445 (main) Audio mixing will underrun, waiting for the game to send audio samples
[libTAS f:1] Thread 6445 (main)     Timeout
[libTAS f:3] Thread 6445 (main) Audio mixing will underrun, waiting for the game to send audio samples
[libTAS f:3] Thread 6445 (main)     Timeout
[libTAS f:4] Thread 6445 (main) Audio mixing will underrun, waiting for the game to send audio samples
[libTAS f:4] Thread 6445 (main)     Timeout
[libTAS f:5] Thread 6445 (main) Audio mixing will underrun, waiting for the game to send audio samples
[libTAS f:5] Thread 6445 (main)     Timeout
[libTAS f:6] Thread 6445 (main) Audio mixing will underrun, waiting for the game to send audio samples
[libTAS f:6] Thread 6445 (main)     Timeout
[libTAS f:8] Thread 6445 (main) Audio mixing will underrun, waiting for the game to send audio samples
[libTAS f:8] Thread 6445 (main)     Timeout
Resource Preload: 0.290
Initializing animations...
Animations Initialized!
Loading Ship Blueprints....
Blueprints Loaded!
Initializing Sound Data....
Generating world...
Loading achievements...
Initializing Steam achievements for app 1234
Loading score file...
Running Game!
[libTAS f:20] Thread 6445 (main) Saved state 1 of size 596365559 in 0.921907 seconds
[libTAS f:22] Thread 6445 (main) ERROR: Loading not allowed because new threads were created

In the bottom-right of the FTL window it says Loading not allowed because new threads were created, and just below that it says Loading state 1.

So loading the state still doesn't work for me.

I also tried it with Runtime -> Debug -> Keep main first thread but I still am unable to load the savestate.

unsightedmetal6 avatar Oct 28 '22 04:10 unsightedmetal6

Stay on the same screen (e.g. language select) and do the savestate. If you savestate at language select and then go to the screen with the ship, new threads will be created.

LukeSaward1 avatar Oct 28 '22 05:10 LukeSaward1

Are you sure you made three savestates on the same frame, before attempting to load the state? There is an issue with a thread scanning for controller in recent version of FTL, the thread just dies when it resumes from being suspended, and it takes a couple more savestates to save with a clean list of active threads.

clementgallet avatar Oct 28 '22 16:10 clementgallet

Are you sure you made three savestates on the same frame, before attempting to load the state?

Yeah, I'm pretty sure I did. I was on the main menu, pressed Shift + F1 three times with about a second in between (each time it showed a message saying it saved the state), and tried to load it with F1 when I was in the options menu. But in libTAS v1.4.4 it doesn't crash. Instead it just fails to load the savestate.

unsightedmetal6 avatar Oct 28 '22 23:10 unsightedmetal6

Yes, I fixed it in v1.4.4 so that it does not load anymore when it would lead to a crash. When you enter the option menu, maybe it creates another thread. With the current version, it should either load correctly or show the message. You can open the input editor and it will show when savestates are obsoleted by a new thread (all previous frames become dark green).

clementgallet avatar Nov 02 '22 11:11 clementgallet