From b97258d06baff83ed493bf56bdca25053a4c0c96 Mon Sep 17 00:00:00 2001 From: floxay <57007485+floxay@users.noreply.github.com> Date: Thu, 8 Apr 2021 13:01:28 +0200 Subject: [PATCH 1/7] VALORANT 2.02+ support --- Unreal/GameDatabase.cpp | 3 +++ Unreal/GameDefines.h | 1 + Unreal/UnCore.h | 2 ++ Unreal/UnrealPackage/UnPackage4.cpp | 4 ++++ 4 files changed, 10 insertions(+) diff --git a/Unreal/GameDatabase.cpp b/Unreal/GameDatabase.cpp index feef4949..6f75e537 100644 --- a/Unreal/GameDatabase.cpp +++ b/Unreal/GameDatabase.cpp @@ -414,6 +414,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 diff --git a/Unreal/GameDefines.h b/Unreal/GameDefines.h index 3c5fe091..359057fc 100644 --- a/Unreal/GameDefines.h +++ b/Unreal/GameDefines.h @@ -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 diff --git a/Unreal/UnCore.h b/Unreal/UnCore.h index 086e2620..959b00f6 100644 --- a/Unreal/UnCore.h +++ b/Unreal/UnCore.h @@ -493,6 +493,8 @@ enum EGame GAME_Borderlands3 = GAME_UE4(20)+1, // 4.21 GAME_Jedi = GAME_UE4(21)+1, + // 4.24 + GAME_Valorant = GAME_UE4(24)+1, // 4.25 GAME_Dauntless = GAME_UE4(25)+1, diff --git a/Unreal/UnrealPackage/UnPackage4.cpp b/Unreal/UnrealPackage/UnPackage4.cpp index 842b16bb..cc2fbff3 100644 --- a/Unreal/UnrealPackage/UnPackage4.cpp +++ b/Unreal/UnrealPackage/UnPackage4.cpp @@ -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; From 3f92f30e3f0bae045fbcf46a7c070c1b7ec73198 Mon Sep 17 00:00:00 2001 From: floxay <57007485+floxay@users.noreply.github.com> Date: Tue, 8 Jun 2021 23:57:36 +0200 Subject: [PATCH 2/7] Game updated to 4.25 Currently there is one animation which crashes UEViewer due to unsupported compression (ACL), more info on forums. --- Unreal/UnCore.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Unreal/UnCore.h b/Unreal/UnCore.h index 30d78bc4..efba5cfc 100644 --- a/Unreal/UnCore.h +++ b/Unreal/UnCore.h @@ -494,10 +494,9 @@ enum EGame GAME_Borderlands3 = GAME_UE4(20)+1, // 4.21 GAME_Jedi = GAME_UE4(21)+1, - // 4.24 - GAME_Valorant = GAME_UE4(24)+1, // 4.25 GAME_Dauntless = GAME_UE4(25)+1, + GAME_Valorant = GAME_UE4(25)+2, GAME_ENGINE = 0xFFF0000 // mask for game engine }; From 61ed24470ab97d1d0f72d151a469e8a8bc02cac6 Mon Sep 17 00:00:00 2001 From: floxay <57007485+floxay@users.noreply.github.com> Date: Mon, 7 Mar 2022 17:54:27 +0100 Subject: [PATCH 3/7] VALORANT 4.04 --- Unreal/UnrealMesh/UnMesh4.cpp | 19 +++++++++++++++++++ Unreal/UnrealMesh/UnMeshTypes.h | 21 +++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/Unreal/UnrealMesh/UnMesh4.cpp b/Unreal/UnrealMesh/UnMesh4.cpp index b6cb5f53..32a56a8c 100644 --- a/Unreal/UnrealMesh/UnMesh4.cpp +++ b/Unreal/UnrealMesh/UnMesh4.cpp @@ -128,6 +128,25 @@ struct FPositionVertexBuffer4 } #endif // DAYSGONE +#if VALORANT + if (Ar.Game == GAME_Valorant) + { + int bUseFullPrecisionPositions; + Ar << bUseFullPrecisionPositions; + if (!bUseFullPrecisionPositions) + { + TArray 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; diff --git a/Unreal/UnrealMesh/UnMeshTypes.h b/Unreal/UnrealMesh/UnMeshTypes.h index 1e1584fa..f0df21ce 100644 --- a/Unreal/UnrealMesh/UnMeshTypes.h +++ b/Unreal/UnrealMesh/UnMeshTypes.h @@ -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 From d1c3c8aed0ebe9c8d637bf82f741b5054e7de00d Mon Sep 17 00:00:00 2001 From: Huba <57007485+floxay@users.noreply.github.com> Date: Tue, 9 Aug 2022 18:06:08 +0200 Subject: [PATCH 4/7] VALORANT UE4.26 --- Unreal/UnCore.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Unreal/UnCore.h b/Unreal/UnCore.h index c5af8488..54fc90f3 100644 --- a/Unreal/UnCore.h +++ b/Unreal/UnCore.h @@ -497,9 +497,9 @@ enum EGame GAME_Jedi = GAME_UE4(21)+1, // 4.25 GAME_UE4_25_Plus = GAME_UE4(25)+1, - GAME_Valorant = GAME_UE4(25)+2, // 4.26 GAME_Dauntless = GAME_UE4(26)+1, + GAME_Valorant = GAME_UE4(26)+2, GAME_ENGINE = 0xFFF0000 // mask for game engine }; From 30b5eea6e69a455cc92f0872878b4013de35b000 Mon Sep 17 00:00:00 2001 From: Huba Tuba <57007485+floxay@users.noreply.github.com> Date: Thu, 19 Jan 2023 19:20:26 +0100 Subject: [PATCH 5/7] VALORANT 6.01 --- Unreal/UnrealMesh/UnMesh4.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Unreal/UnrealMesh/UnMesh4.cpp b/Unreal/UnrealMesh/UnMesh4.cpp index 32a56a8c..0a966e40 100644 --- a/Unreal/UnrealMesh/UnMesh4.cpp +++ b/Unreal/UnrealMesh/UnMesh4.cpp @@ -133,6 +133,7 @@ struct FPositionVertexBuffer4 { int bUseFullPrecisionPositions; Ar << bUseFullPrecisionPositions; + Ar.Seek(Ar.Tell() + 28); // a Vec3 for offset and a Vec4 for distance? if (!bUseFullPrecisionPositions) { TArray PackedVerts; From c9d4c8d5527918f5cc77c44705894dc6c05b121e Mon Sep 17 00:00:00 2001 From: Huba Tuba <57007485+floxay@users.noreply.github.com> Date: Fri, 20 Jan 2023 00:48:51 +0100 Subject: [PATCH 6/7] Specify FBoxSphereBounds --- Unreal/UnrealMesh/UnMesh4.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Unreal/UnrealMesh/UnMesh4.cpp b/Unreal/UnrealMesh/UnMesh4.cpp index 68ffd6ba..c44db4b1 100644 --- a/Unreal/UnrealMesh/UnMesh4.cpp +++ b/Unreal/UnrealMesh/UnMesh4.cpp @@ -132,8 +132,8 @@ struct FPositionVertexBuffer4 if (Ar.Game == GAME_Valorant) { int bUseFullPrecisionPositions; - Ar << bUseFullPrecisionPositions; - Ar.Seek(Ar.Tell() + 28); // a Vec3 for offset and a Vec4 for distance? + FBoxSphereBounds Bounds; + Ar << bUseFullPrecisionPositions << Bounds; if (!bUseFullPrecisionPositions) { TArray PackedVerts; From d498142f12a69d8f4a7df92166f0b431bbc1de1f Mon Sep 17 00:00:00 2001 From: Huba Tuba <57007485+floxay@users.noreply.github.com> Date: Thu, 25 May 2023 23:03:16 +0200 Subject: [PATCH 7/7] VALORANT UE4.27 --- Unreal/UnCore.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Unreal/UnCore.h b/Unreal/UnCore.h index 01a94310..69ac2f41 100644 --- a/Unreal/UnCore.h +++ b/Unreal/UnCore.h @@ -499,7 +499,8 @@ enum EGame GAME_UE4_25_Plus = GAME_UE4(25)+1, // 4.26 GAME_Dauntless = GAME_UE4(26)+1, - GAME_Valorant = GAME_UE4(26)+2, + // 4.27 + GAME_Valorant = GAME_UE4(27)+1, GAME_ENGINE = 0xFFF0000 // mask for game engine };