# Best archive for serializing actors

**URL:** <https://forums.unrealengine.com/t/best-archive-for-serializing-actors/438250>\
**Category:** C++\
**Tags:** serialization, unreal-engine, question, CPP\
**Created:** [November 24, 2018, 11:48pm UTC](https://forums.unrealengine.com/t/best-archive-for-serializing-actors/438250 "2018-11-24T23:48:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DELTA\_12](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DELTA\_12](https://forums.unrealengine.com/u/DELTA_12)\
**Post date:** [November 24, 2018, 11:48pm UTC](https://forums.unrealengine.com/t/best-archive-for-serializing-actors/438250/1 "2018-11-24T23:48:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DELTA\_12](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DELTA\_12](https://forums.unrealengine.com/u/DELTA_12)\
**Post date:** [November 25, 2018, 12:26am UTC](https://forums.unrealengine.com/t/best-archive-for-serializing-actors/438250/2 "2018-11-25T00:26:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sbseltzer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sbseltzer/32/1200007_2.png) [@sbseltzer](https://forums.unrealengine.com/u/sbseltzer)\
**Post date:** [March 31, 2023, 4:05am UTC](https://forums.unrealengine.com/t/best-archive-for-serializing-actors/438250/3 "2023-03-31T04:05:12Z")

</div>

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. ☹
