I have checked
Pariah code. I will not support this game, because
Digital Extreme's programmers have modified almost all the basic structures of the game data for obfuscation (I'm sure: they have done this not for any kind of optimization or better code, but to complicate data analysis). I don't want to disfigure umodel code to just support one middling game title.
Following text I was posted
for people familiar with Unreal Engine code, even with UT1 public source.
Small example: serialization of
FCoords structure:
original code looks like this:
friend FArchive& operator<<(FArchive &Ar, FCoords &F)
{
return Ar << F.Origin << F.XAxis << F.YAxis << F.ZAxis;
}
Pariah code looks like this:
friend FArchive& operator<<(FArchive &Ar, FCoords &F)
{
if (!Ar.RetailArchive())
return Ar << F.Origin << F.XAxis << F.YAxis << F.ZAxis; // original Epic code
else
return Ar << F.XAxis << F.YAxis << F.ZAxis << F.Origin; // obfuscated code
}
As you can see, they have changed field serialization order for retail archives!
Another example.
TArray serialization. Their code looks like this:
template<class T> FArchive& operator<<(FArchive &Ar, TArray<T> &A)
{
if (Ar.IsLoading())
{
// loading array
int count;
Ar << AR_INDEX(count);
if (Ar.RetailArchive()) count--; // de-obfuscate count
A.Empty(count);
A.Add(count);
}
else
{
// saving array
int count = A.Num();
if (Ar.RetailArchive()) count++; // obfuscate count
Ar << AR_INDEX(count);
}
// serialize data (using real data count)
for (int i = 0; i < A.Num(); i++)
Ar << A[i];
}
Here we can see, that number of elements in archive written to the file greater by 1 than the real number of elements.
Whole serialization code
flooded with similar code. I think, this game it is not worth the trouble.