sinbad / SPUD

Steve's Persistent Unreal Data library
MIT License
336 stars 51 forks source link

Main Character Position not restored if graphics settings are Cinematic #76

Open RedShy opened 4 months ago

RedShy commented 4 months ago

Hello, SPUD is excellent, and I'm also using the other excellent plugins you have provided (FocusableWidgets, etc.).

I have just noticed something strange. Whenever I die, I show a continue button that calls the "Load Latest Save Game" in BP on the SPUD Subsystem. If I do this multiple times in a row, after 2-3 times, it fails to restore the position, and I get spawned at the start of the level. Other variables on the character seem to be correctly loaded. I searched the log, and it seems there are no errors. I have attached an extract of the log at the point where the character is restored.

Symptoms

Reproducibility Steps

What could be the causes? Are there more logs, or can we enable some verbosity to understand what happens? Given that other variables are correctly loaded, I could save the position in extra variables and, after reloading, relocate the main character's position, but this seems hacky.

Thank you very much

[2024.05.11-08.35.49:717][271]LogSpudState: Verbose: | Class: /Script/UTD.UTDPlayerState [2024.05.11-08.35.49:717][271]LogSpudState: Verbose: | FAST path, 3 properties [2024.05.11-08.35.49:717][271]LogSpudProps: Verbose: | KeypadCodes = 1234 [2024.05.11-08.35.49:717][271]LogSpudProps: Verbose: | KeypadCodes = 7203 [2024.05.11-08.35.49:717][271]LogSpudProps: Verbose: | KeypadCodes = 0713 [2024.05.11-08.35.49:717][271]LogSpudProps: Verbose: | KeypadCodes = 0831 [2024.05.11-08.35.49:717][271]LogSpudProps: Verbose: | bCanBeDamaged = 0 [2024.05.11-08.35.49:717][271]LogSpudState: Verbose: RESTORE Level Actor: BP_UTDPlayerCharacter_C_2147478385 [2024.05.11-08.35.49:717][271]LogSpudState: Verbose: | Class: /Game/Blueprint/Player/BP_UTDPlayerCharacter.BP_UTDPlayerCharacter_C [2024.05.11-08.35.49:717][271]LogSpudState: Verbose: | FAST path, 3 properties [2024.05.11-08.35.49:717][271]LogSpudProps: Verbose: | MaxLightIntensity = 0.000000 [2024.05.11-08.35.49:717][271]LogSpudProps: Verbose: | IsFaultyLight = 0 [2024.05.11-08.35.49:717][271]LogSpudProps: Verbose: | bCanBeDamaged = 1 [2024.05.11-08.35.49:717][271]LogSpudState: Verbose: Destroying actor BP_TriggerTutorial_C_1 [2024.05.11-08.35.49:717][271]LogSpudState: Verbose: * Destroying actor BP_TriggerTutorial_C_2

sinbad commented 4 months ago

So it sounds like a timing issue between the core engine re-initialising the character on respawn and SPUD restoring the state. The core UE respawn init must be getting delayed and ends up running after SPUD has already re-populated everything. It's the weekend so I'm not at my PC to check the details but if you put some debug points in the core UE code vs the SPUD code for this it might throw some light on it.