few words about creature properties. In Dragon Age Origins the characters have 59 properties saved in a GDA file, which is basically a binary CSV (comma separated values).
consequently the creature blueprint in Unreal Engine has 59 properties. Only a handful have to be exposed as blueprint read/write, all the other ones should be extrapolated by the engine based on certain criteria. Below you can see an image with only the exposed properties
as you can see some properties were converted from simple integers as used in the original Dragon Age Origins into enums. this way there is a more visual approach when assigning certain properties such as gender, race, class, etc. some properties although assigned as integers, they are meant to be used as Boolean, and I kept it as integers for consistency with DAO, their scripting language doesn’t use Boolean at all.
*The 3 PACKAGE related properties are used in evaluating combat tactics. **
All the properties are extrapolated from the DAO Toolset.
the properties have several types: attribute, simple, depletable, derived. This is the code that fills out the defaults for the properties, in particular the property ID which is an integer that matches the original integers from DAO scripts, and the properties type, via reflection
//property ID
for (TFieldIterator<UStructProperty> It(GetClass()); It; ++It)
{
UStructProperty* StructProp = *It;
FString sStruct = StructProp->GetFName().ToString();
if (StructProp->Struct == FActorProperty::StaticStruct())
{
FString sID = GetM2DACustomString(TABLE_PROPERTIES, "ID", sStruct, "Stat");
FActorProperty* actorProperty = StructProp->ContainerPtrToValuePtr<FActorProperty>(this);
actorProperty->nPropertyID = static_cast<EActorPropertyID>(FCString::Atoi(*sID));
}
}
//property type
for (TFieldIterator<UStructProperty> It(GetClass()); It; ++It)
{
UStructProperty* StructProp = *It;
FString sStruct = StructProp->GetFName().ToString();
if(StructProp->Struct == FActorProperty::StaticStruct())
{
FActorProperty* actorProperty = StructProp->ContainerPtrToValuePtr<FActorProperty>(this);
FString sType = GetM2DAString(TABLE_PROPERTIES, "Type", static_cast<uint8>(actorProperty->nPropertyID));
if (sType == "ATTRIBUTE")
actorProperty->nPropertyType = EActorPropertyType::ATTRIBUTE;
else if (sType == "SIMPLE")
actorProperty->nPropertyType = EActorPropertyType::SIMPLE;
else if (sType == "DEPLETABLE")
actorProperty->nPropertyType = EActorPropertyType::DEPLETABLE;
else //derived
actorProperty->nPropertyType = EActorPropertyType::DERIVED;
}
}
also, this code is used to fill some default values for the nonexposed properties, in this example the main character attributes: strength, dexterity, willpower, magic, cunning, constitution
int32 nClass = static_cast<uint8>(CLASS);
int32 nRace = static_cast<uint8>(RACE);
//baseline
Health.fValueBase = Health.fValueTotal = Health.fValueCurrent = 85.f;
Mana_Stamina.fValueBase = Mana_Stamina.fValueTotal = Mana_Stamina.fValueCurrent = 90.f;
Strength.fValueBase = Strength.fValueTotal = Strength.fValueCurrent = 10;
Dexterity.fValueBase = Dexterity.fValueTotal = Dexterity.fValueCurrent = 10;
Willpower.fValueBase = Willpower.fValueTotal = Willpower.fValueCurrent = 10;
Magic.fValueBase = Magic.fValueTotal = Magic.fValueCurrent = 10;
Cunning.fValueBase = Cunning.fValueTotal = Cunning.fValueCurrent = 10;
Constitution.fValueBase = Constitution.fValueTotal = Constitution.fValueCurrent = 10;
BaseAttackRating.fValueBase = BaseAttackRating.fValueTotal = BaseAttackRating.fValueCurrent = 50;
BaseDefenseRating.fValueBase = BaseDefenseRating.fValueTotal = BaseDefenseRating.fValueCurrent = 40;
switch (nClass)
{
case CLASS_WARRIOR:
{
switch (nRace)
{
case RACE_HUMAN:
{
Health.fValueBase = Health.fValueTotal = Health.fValueCurrent += 15.f;
Mana_Stamina.fValueBase = Mana_Stamina.fValueTotal = Mana_Stamina.fValueCurrent += 10.f;
Strength.fValueBase = Strength.fValueTotal = Strength.fValueCurrent += 4;
Dexterity.fValueBase = Dexterity.fValueTotal = Dexterity.fValueCurrent += 3;
Willpower.fValueBase = Willpower.fValueTotal = Willpower.fValueCurrent += 0;
Magic.fValueBase = Magic.fValueTotal = Magic.fValueCurrent += 0;
Cunning.fValueBase = Cunning.fValueTotal = Cunning.fValueCurrent += 0;
Constitution.fValueBase = Constitution.fValueTotal = Constitution.fValueCurrent += 3;
BaseAttackRating.fValueBase = BaseAttackRating.fValueTotal = BaseAttackRating.fValueCurrent += 10;
BaseDefenseRating.fValueBase = BaseDefenseRating.fValueTotal = BaseDefenseRating.fValueCurrent += 5;
break;
}
}
}
these default values are extrapolated from Dragon Age Origins wikia.
And that’s the basics for properties