Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VALORANT 2.02+ support #206

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
3 changes: 3 additions & 0 deletions Unreal/GameDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,9 @@ const GameInfo GListOfGames[] = {
# if SEAOFTHIEVES
G("Sea of Thieves", sot, GAME_SeaOfThieves),
# endif
# if VALORANT
G("VALORANT", valorant, GAME_Valorant),
# endif
#endif // UNREAL4

// end marker
Expand Down
1 change: 1 addition & 0 deletions Unreal/GameDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
#define KH3 1 // Kingdom Hearts 3
#define JEDI 1 // Star Wars Jedi: Fallen Order
#define SEAOFTHIEVES 1 // Sea of Thieves
#define VALORANT 1 // VALORANT

#define SPECIAL_TAGS 1 // games with different PACKAGE_FILE_TAG

Expand Down
2 changes: 2 additions & 0 deletions Unreal/UnCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,8 @@ enum EGame
GAME_UE4_25_Plus = GAME_UE4(25)+1,
// 4.26
GAME_Dauntless = GAME_UE4(26)+1,
// 4.27
GAME_Valorant = GAME_UE4(27)+1,

GAME_ENGINE = 0xFFF0000 // mask for game engine
};
Expand Down
20 changes: 20 additions & 0 deletions Unreal/UnrealMesh/UnMesh4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,26 @@ struct FPositionVertexBuffer4
}
#endif // DAYSGONE

#if VALORANT
if (Ar.Game == GAME_Valorant)
{
int bUseFullPrecisionPositions;
FBoxSphereBounds Bounds;
Ar << bUseFullPrecisionPositions << Bounds;
if (!bUseFullPrecisionPositions)
{
TArray<FVector4Half> PackedVerts;
PackedVerts.BulkSerialize(Ar);
S.Verts.AddUninitialized(PackedVerts.Num());
for (int i = 0; i < PackedVerts.Num(); i++)
{
S.Verts[i] = PackedVerts[i];
}
return Ar;
}
}
#endif // VALORANT

S.Verts.BulkSerialize(Ar);
return Ar;

Expand Down
21 changes: 21 additions & 0 deletions Unreal/UnrealMesh/UnMeshTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,27 @@ struct FVectorHalf
SIMPLE_TYPE(FVectorHalf, uint16);


struct FVector4Half
{
uint16 X, Y, Z, W;

friend FArchive& operator<<(FArchive &Ar, FVector4Half &v)
{
return Ar << v.X << v.Y << v.Z << v.W;
}
operator FVector() const
{
FVector r;
r.X = half2float(X);
r.Y = half2float(Y);
r.Z = half2float(Z);
return r;
}
};

SIMPLE_TYPE(FVector4Half, uint16);


#if BATMAN

// This is a variant of FQuatFixed48NoW developed for Batman: Arkham Asylum. It's destination
Expand Down
4 changes: 4 additions & 0 deletions Unreal/UnrealPackage/UnPackage4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ void FPackageFileSummary::Serialize4(FArchive &Ar)
int32 ThumbnailTableOffset;
Ar << ThumbnailTableOffset;

#if VALORANT
if (Ar.Game == GAME_Valorant) Ar.Seek(Ar.Tell()+8); // no idea what these bytes are used for
#endif // VALORANT

// guid
Ar << Guid;

Expand Down