DemoNetDriver does not work with FastArrays (e.g GAS)

Hello! We’re using the DemoNetDriver to do serverside recordings of gameplay. One thing we’ve noticed, given our extensive use of GAS for gameplay systems, is that sometimes Gameplay Tags and Gameplay Effects from a previous point in time would persists when scrubbing forward in time. From what I can see, it doesn’t appear FastArrays have much logic at all to properly handle a Checkpoint load, but I do see mentions of replays here and there so I would assume it’s at least supported to some extent?

In any case, the fix we have locally is to write/read a bit in Read/WriteDeltaHeader (in FastArraySerializer.h) as to whether or not it’s serializing data for a checkpoint. Then in FFastArraySerializer::TFastArraySerializeHelper<Type, SerializerType>::PostReceiveCleanup we have this little snippet below the first “if (!Parms.bInternalAck)” if statement. Essentially, it assumes that every indice that isn’t new/changed should be deleted (and since net serialize during a checkpoint will delta check against the initial “empty” state, we never get any deletes in the header).

Does this seem like a reasonable fix to you, and to what extent is GAS expected to work with replays in general?

	else if (Parms.bIsReplayCheckpoint)
	{
		for (int i = 0; i < Items.Num(); i++)
		{
			// If the item's most recent array replication key is not the same as the header's array replication key
			// then it was not part of the change elements, so it is an implicit delete
			if (Items[i].MostRecentArrayReplicationKey != Header.ArrayReplicationKey)
			{
				UE_LOG(LogNetFastTArray, Log, TEXT("Adding replay checkpoint implicit delete for ElementID: %i"), i);
				Header.DeletedIndices.Add(i);
			}
		}
	}

Hi,

I believe fast arrays and GAS are expected to work with replays and when scrubbing. I also haven’t been able to find any reports of similar issues.

Could you provide some more info as to how your abilities are being set up and used, as well as how you’re recording, playing back, and scrubbing through replays? If you could provide a test project reproducing the issue, that would be greatly appreciated.

Thanks,

Alex

I just realized now that the caveat in our case is that these actors in question are marked as bReplayRewindable, so technically we’re responsible for resetting their state ourselves (which we accomplish with the fix above). So this might indeed be more of a problem on our end given that we reuse the same actor between scrubs. But for reference, we’re using mixed replication mode, other than that I think our setup is fairly standard

Hi,

I see, thank you for the additional info. In that case, you are correct that the actor’s RewindForReplay function is responsible for making sure the actor’s state is handled as needed during the scrub.

That being said, if you run into any issues with bReplayRewindable=false (or if you have any further questions), please don’t hesitate to reach out!

Thanks,

Alex