on February 28th, 2024 (opens in a new tab)

WIP work and experiment on SaveGame support

Runtime: Fixing an issue with clamping (opens in a new tab) f3a555f (opens in a new tab) A case was happening of

  • InitDataTable was called with a Datatable and BaseValue of 1000, with 0 for Min and Max value
  • One property was clamped via FGBAClampDefinition and Property at 100 max
  • Then datatable logic kicks in and sets the BaseValue to the value defined in the DT, overriding previously clamped value (from property)
  • we would expect here the value to remain at 100

WIP work and experiment on SaveGame support (opens in a new tab) b3fa4e0 (opens in a new tab)

This time using a USaveGame object created with the standard CreateSaveGameFromSlot, LoadGameFromSlot, etc.

SaveGame has a BinaryData array of bytes (TArray) . Serialize called with an Archive baked by this array of bytes on Actor and its ASC.

ASC in the test setup implements Serialize with:

	Super::Serialize(Ar);
 
	if (!Ar.IsSaveGame())
	{
		return;
	}
 
	// SerializeAttributeSets(Ar);
 
	const TArray<UAttributeSet*>& AttributeSets = GetSpawnedAttributes();
	for (UAttributeSet* AttributeSet : AttributeSets)
	{
		if (!AttributeSet)
		{
			continue;
		}
 
		AttributeSet->Serialize(Ar);
	}

Refactor: Use UE_VERSION_NEWER_THAN macros (opens in a new tab) 99215dd (opens in a new tab) to compare engine versions


Runtime: FGBAUtils prefer dll export on methods (opens in a new tab)

Runtime: Add FGBAUtils::SerializeAttributeSets (opens in a new tab) for backup. not actually used right now and not dll exported

Runtime: Move serialization helpers (opens in a new tab) into their own Blueprint Library

Runtime: Move exec calculation helpers (opens in a new tab) into their own Blueprint Library