[PLUGIN] Savior

4.26

I submitted 3.6.5 for Unreal 4.26 too, if that’s the version you have installed you should see the nodes posted above.

I finally managed to reproduce the results you see with runtime spawned component Blueprints. Are your components made off blueprints ?

The RespawnComponent method isn’t executed anymore on them, at least I know what the problem is, now I have to think about how to correct the problem (without breaking something else).

Yes, my ActorComponent is blueprint. While you are looking for a solution to this problem, I will try to work around this problem by storing all the required ActorComponent variables in the parent actor.

Will the plugin support 4.26 for some time or do I need to upgrade to 4.27?

Yes, 4.26 will receive updates until the “gate on marketplace” is closed.
Usually after next +1 major engine release, then the option to update that depot is closed.

I was using the old engine API to Actor → Add Component at runtime.
Things have changed there (Unreal is always changing, OMG)…

I got it working on Unreal 4.27.
I will test 4.26 tomorrow morning:




Runtime respawned:

SAV_ProceduralCMPsArray

Hey Bruno,

We are trying to Save and Load our Dynamic Material Instances the same way your other package, Persistent Dynamic Materials, is doing. However, there seems to be a small bug inside the Reflector::RestoreMaterialFromSnapShot function, where the return bool value Restored always seems to return false, instead of toggling it to true once the operation has succeeded within the scope of the function.

Also, we were wondering if it is possible to add a small node that allows us to Capture and Restore all Instanced Dynamic Materials on a per actor basis. Right now we can only restore all materials at once, only when the OnFinishRespawn_Implementation function has been called because that function contains a SaviorRecord. Is it possible to return a SaviorRecord at runtime on a per actor basis on the fly? We want to be able to restore the materials on a per-object-basis on our objects at any given time, even when the actors are already spawned inside the level and are therefore not respawned again. Sort of like a “reset to previous material state”.

If you could help us out or point us in the right direction, preferably in C++, that would help us out a lot! Code snippets of new nodes would also come in handy, i’ll make sure to add it into the plugin on my end.

Thank you for everything you’re doing! Your plugins are amazing.

@Wabo You are right, sometimes on merges I miss stuff like this.
The Restored variable is never set after crash tests are passed.

On line 342 / 343 if you change this:

if ( !Data.Materials.Contains(ID) ) {return Restored;}

to this:

if ( !Data.Materials.Contains(ID) ) {return Restored;}
// from here we can't crash, so Restored should't be false anymore..
Restored = true;

Then the function will be correct.


And about the extra nodes, I will add them as soon as I can.

1 Like

Yes, you can try something like this:

// after reading data from file..
FSaviorRecord Record = MySlot->FindRecordByGUID( GetActorGUID( MyActorPtr ) );
// Do things with record..
1 Like

I love you :slight_smile:

Hi Bruno. It’s me again. Finally Then I had time to test the work with the components. They are preserved but partially. I am save an ActorComponent with a Custom Struct array that looks like this: Int, Enum, Float, Int. In the save file, I see each element of the structure array. After loading, I have only the 1st element of the structure array and that’s it. And there is a funny pattern. If the declaration of a structure variable in a class is moved to another place, then everything that is declared after it is not loaded.

Example 1:
StructArray (half load)
Float (not loaded)
String (not loaded)
Int (not loaded)
Float (not loaded)

Example 2:
Float (loaded)
String (loaded)
Int (loaded)
StructArray (half load)
Float (not loaded)

That means all your spawned components either have invalid SGuid value or all their SGuid values are the same so the plugin think it’s all the same instance.

I would manually assign SGUID values to each component on Actor’s function that spawn them at runtime.


Usually, there should be something in the Output Log panel, some warning or some error telling you what is going on there. You get no warning?!

Sorry Bruno it’s my mistake. I forgot to restore after loading the parameter table on which the ActorComponent works, and therefore I had only 1 element in the array. I fixed it. And now everything works for me correctly.

1 Like

Don’t worry, save systems are hard.
You can always contact me if you face any difficulty.

2 Likes

I have a vehicle that is based on a physics simulating SKM. When trying to load it, the vehicle’s position does not get updated (either stays on the spot if I save/move/load or spawns on default location when I load the save from a different level)
Also log shows this (multiple messages because of multiple vehicles in the level)
skm_teleport

As logs say, simulated skeletals cannot be moved to saved location, while simulating physics. I will see if I can resolve this on an upcoming update.

It turned out to be not so good. So far I’ve only worked with one ActorComponent for a specific class, everything was fine. As soon as I spawned two identical actors into the level with this ActorComponent, everything broke. ActorComponent is not loading. Considering the fact that when saving ActorComponent in the logs there is also its SGUID at this moment unique and at the same time stable, then there are no problems. But when loading, there is no mention of it in the logs, as I understand it, the SGUID is already invalid or not the same or not unique. The SGUID for the ActorComponent I generate in the ConstructionScript of the parent actor. I also tried to make the SGUID static for the component, also without results.

If you can send me a zip file with a Unreal project with the blueprints isolated to show me the problem I can take a look and see where it’s going wrong for you.

This will be quite problematic. Since there are a lot of dependencies in the blueprints. I don’t know it makes sense to give you these blueprints without dependent files. I tried to do a migration with dependencies, but after I saw the list of files, I realized that this is actually the whole project, with the exception of some systems. I also made it all the same, but not complete, and when I try to open any blueprint, the engine crashes.
Are there any other options besides the complete transfer of the project?

I’m afraid I’ll have to save the components in the actor and then unload them for each parent class … It’s so tedious …

I would bet that’s where your problem is.
I would create SGuid values manually for components, instead of using the Make SGUID nodes.


And the parent actor I would also verify that it’s Guid value is unique.

Because the ID of Components in records will be: Actor_ActorGUID.Component_CompGUID