Best archive for serializing actors

I’m currently trying to create a save system for my game.
I have an array of actors that I need to save, however, I can’t figure out which archive to use to store it.
Also, when I have the actor serialized in the archive, how do I actually write it to disk?

I have tried to use FBufferArchive and FFileHelper::SaveArrayToFile, however after the engine crash, I found this in a parent class of the FBufferArchive

virtual FArchive& operator<<( class UObject*& Res ) override
{
	// Not supported through this archive
	check(0);
	return *this;
}

Apparently, FBufferArchive does not support UObject (thus AActor) serialization.
Any tips on which archive does support UObject serialization and can be written to disk?

Thanks

Okay, so I figured out how to save an Actor:

	TArray<uint8> bytes;   
	FObjectWriter Ar = FObjectWriter(bytes);
	for (AActor* a : ActorsToSave)
	{
			a->Serialize(Ar);
	}
	FFileHelper::SaveArrayToFile(bytes, TEXT("S://Saves/Test.sav"));

I still don’t know hot to turn the saved actor back into real one though. If I figure it out, I’ll post a solution for anyone who might stumble upon this.

Did you ever find a solution to this? I was able to reconstruct the actor properties that had the SaveGame flag, but never could get the components to save/load their SaveGame properties. :frowning: