Skip to content

Commit

Permalink
Added support for "Haunted" and "Rugby" games
Browse files Browse the repository at this point in the history
  • Loading branch information
jjbott committed Jul 24, 2019
1 parent 7a7ce2d commit be1e057
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 17 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ master branch: ![Build status](https://api.travis-ci.org/jjbott/RocketLeagueRepl

Parses replay files generated by the game Rocket League. Parses to C# objects, which can be serialized to JSON.

Supports all replay files created by Rocket League version 1.63 (released 2019-06-05) and earlier. Newer versions may work as well - updates don't always change the replay format. Changes to the replay format are usually supported within a few days. Please create an issue for any replays that fail to parse, or for replays that parse incorrectly.
Supports all replay files created by Rocket League version 1.65 (released 2019-06-24) and earlier. Newer versions may work as well - updates don't always change the replay format. Changes to the replay format are usually supported within a few days. Please create an issue for any replays that fail to parse, or for replays that parse incorrectly.

Includes a library that can be used in your project (```Install-Package RocketLeagueReplayParser```) as well as a basic console based front end that can be used to convert a replay file to JSON.

Expand All @@ -23,8 +23,4 @@ Includes a library that can be used in your project (```Install-Package RocketLe

Further instructions can be found by running ```RocketLeagueReplayParser.exe --help```

#### TODO:
* Get it working under Mono (JSON serialization fails)
* Has some "Unknown" properties that I havent bothered tracking down yet.
* Code needs some cleanup. It's getting scary in there.

16 changes: 14 additions & 2 deletions RocketLeagueReplayParser/NetworkStream/ActorState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,12 @@ public static ClassNetCache ObjectNameToClassNetCache(string objectName, IDictio
case "Archetypes.Ball.Ball_BasketBall_Mutator":
case "Archetypes.Ball.Ball_Puck":
case "Archetypes.Ball.CubeBall":
case "Archetypes.Ball.Ball_Beachball":
return classNetCacheByName["TAGame.Ball_TA"];
case "Archetypes.Ball.Ball_Breakout":
return classNetCacheByName["TAGame.Ball_Breakout_TA"];
case "Archetypes.Ball.Ball_Haunted":
return classNetCacheByName["TAGame.Ball_Haunted_TA"];
case "Archetypes.CarComponents.CarComponent_Boost":
return classNetCacheByName["TAGame.CarComponent_Boost_TA"];
case "Archetypes.CarComponents.CarComponent_Dodge":
Expand Down Expand Up @@ -137,6 +140,13 @@ public static ClassNetCache ObjectNameToClassNetCache(string objectName, IDictio
return classNetCacheByName["TAGame.SpecialPickup_Batarang_TA"];
case "Neotokyo_p.TheWorld:PersistentLevel.InMapScoreboard_TA_1":
return classNetCacheByName["TAGame.InMapScoreboard_TA"];
case "Haunted_TrainStation_P.TheWorld:PersistentLevel.HauntedBallTrapTrigger_TA_1":
case "Haunted_TrainStation_P.TheWorld:PersistentLevel.HauntedBallTrapTrigger_TA_0":
return classNetCacheByName["TAGame.HauntedBallTrapTrigger_TA"];
case "Archetypes.SpecialPickups.SpecialPickup_HauntedBallBeam":
return classNetCacheByName["TAGame.SpecialPickup_HauntedBallBeam_TA"];
case "Archetypes.SpecialPickups.SpecialPickup_Rugby":
return classNetCacheByName["TAGame.SpecialPickup_Rugby_TA"];
}

if (objectName.Contains("CrowdActor_TA"))
Expand Down Expand Up @@ -183,7 +193,8 @@ private static bool ClassHasInitialPosition(string className)
|| className == "TAGame.VehiclePickup_Boost_TA"
|| className == "TAGame.InMapScoreboard_TA"
|| className == "TAGame.BreakOutActor_Platform_TA"
|| className == "Engine.WorldInfo")
|| className == "Engine.WorldInfo"
|| className == "TAGame.HauntedBallTrapTrigger_TA")
{
return false;
}
Expand All @@ -196,7 +207,8 @@ private static bool ClassHasRotation(string className)
return className == "TAGame.Ball_TA"
|| className == "TAGame.Car_TA"
|| className == "TAGame.Car_Season_TA"
|| className == "TAGame.Ball_Breakout_TA"; ;
|| className == "TAGame.Ball_Breakout_TA"
|| className == "TAGame.Ball_Haunted_TA";
}

public static ActorState Deserialize(int maxChannels, IDictionary<UInt32, ActorState> existingActorStates, List<ActorState> frameActorStates, string[] objectIndexToName, IDictionary<string, ClassNetCache> classNetCacheByName, UInt32 engineVersion, UInt32 licenseeVersion, UInt32 netVersion, BitReader br)
Expand Down
20 changes: 15 additions & 5 deletions RocketLeagueReplayParser/NetworkStream/ActorStateProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ public static ActorStateProperty Deserialize(IClassNetCache classMap, string[] o
case "TAGame.GameEvent_Soccar_TA:GameTime":
case "TAGame.CarComponent_Boost_TA:UnlimitedBoostRefCount":
case "TAGame.CrowdActor_TA:ReplicatedRoundCountDownNumber":
case "TAGame.PRI_TA:MaxTimeTillItem":
case "TAGame.Ball_Breakout_TA:DamageIndex":
case "TAGame.PRI_TA:MatchBreakoutDamage":
case "TAGame.PRI_TA:BotProductName":
Expand All @@ -117,6 +116,7 @@ public static ActorStateProperty Deserialize(IClassNetCache classMap, string[] o
break;
case "ProjectX.GRI_X:ReplicatedGameMutatorIndex":
case "TAGame.PRI_TA:TimeTillItem":
case "TAGame.PRI_TA:MaxTimeTillItem":
asp.Data = br.ReadInt32();
break;
case "TAGame.VehiclePickup_TA:ReplicatedPickupData":
Expand All @@ -134,8 +134,12 @@ public static ActorStateProperty Deserialize(IClassNetCache classMap, string[] o
case "TAGame.CameraSettingsActor_TA:CameraYaw":
case "TAGame.PRI_TA:PawnType":
case "TAGame.Ball_Breakout_TA:LastTeamTouch":
case "TAGame.Ball_Haunted_TA:LastTeamTouch":
case "TAGame.PRI_TA:ReplicatedWorstNetQualityBeyondLatency":
case "TAGame.GameEvent_Soccar_TA:ReplicatedServerPerformanceState":
case "TAGame.Ball_Haunted_TA:TotalActiveBeams":
case "TAGame.Ball_Haunted_TA:DeactivatedGoalIndex":
case "TAGame.Ball_Haunted_TA:ReplicatedBeamBrokenValue":
asp.Data = br.ReadByte();
break;
case "TAGame.PRI_TA:SkillTier":
Expand All @@ -152,7 +156,7 @@ public static ActorStateProperty Deserialize(IClassNetCache classMap, string[] o
case "Engine.Actor:bNetOwner":
case "Engine.Actor:bBlockActors":
case "TAGame.GameEvent_TA:bHasLeaveMatchPenalty":
case "TAGame.PRI_TA:bUsingBehindView":
case "TAGame.PRI_TA:bUsingBehindView":
case "TAGame.PRI_TA:bUsingSecondaryCamera": // Ball cam on when true
case "TAGame.GameEvent_TA:ActivatorCar":
case "TAGame.GameEvent_Soccar_TA:bOverTime":
Expand Down Expand Up @@ -192,8 +196,8 @@ public static ActorStateProperty Deserialize(IClassNetCache classMap, string[] o
case "Engine.PlayerReplicationInfo:bTimedOut":
case "TAGame.CameraSettingsActor_TA:bMouseCameraToggleEnabled":
case "TAGame.CameraSettingsActor_TA:bUsingSwivel":
asp.Data = br.ReadBit();
break;
case "TAGame.Ball_Haunted_TA:bIsBallBeamed":
case "TAGame.SpecialPickup_Rugby_TA:bBallWelded":
asp.Data = br.ReadBit();
break;
case "TAGame.CarComponent_TA:ReplicatedActive":
Expand Down Expand Up @@ -395,7 +399,6 @@ protected static void SerializeData(uint engineVersion, uint licenseeVersion, UI
case "TAGame.GameEvent_Soccar_TA:GameTime":
case "TAGame.CarComponent_Boost_TA:UnlimitedBoostRefCount":
case "TAGame.CrowdActor_TA:ReplicatedRoundCountDownNumber":
case "TAGame.PRI_TA:MaxTimeTillItem":
case "TAGame.Ball_Breakout_TA:DamageIndex":
case "TAGame.PRI_TA:MatchBreakoutDamage":
case "TAGame.PRI_TA:BotProductName":
Expand All @@ -407,6 +410,7 @@ protected static void SerializeData(uint engineVersion, uint licenseeVersion, UI
break;
case "ProjectX.GRI_X:ReplicatedGameMutatorIndex":
case "TAGame.PRI_TA:TimeTillItem":
case "TAGame.PRI_TA:MaxTimeTillItem":
bw.Write((Int32)data);
break;
case "TAGame.VehiclePickup_TA:ReplicatedPickupData":
Expand All @@ -424,8 +428,12 @@ protected static void SerializeData(uint engineVersion, uint licenseeVersion, UI
case "TAGame.CameraSettingsActor_TA:CameraYaw":
case "TAGame.PRI_TA:PawnType":
case "TAGame.Ball_Breakout_TA:LastTeamTouch":
case "TAGame.Ball_Haunted_TA:LastTeamTouch":
case "TAGame.PRI_TA:ReplicatedWorstNetQualityBeyondLatency":
case "TAGame.GameEvent_Soccar_TA:ReplicatedServerPerformanceState":
case "TAGame.Ball_Haunted_TA:TotalActiveBeams":
case "TAGame.Ball_Haunted_TA:DeactivatedGoalIndex":
case "TAGame.Ball_Haunted_TA:ReplicatedBeamBrokenValue":
bw.Write((byte)data);
break;
case "TAGame.PRI_TA:SkillTier":
Expand Down Expand Up @@ -483,6 +491,8 @@ protected static void SerializeData(uint engineVersion, uint licenseeVersion, UI
case "Engine.PlayerReplicationInfo:bTimedOut":
case "TAGame.CameraSettingsActor_TA:bMouseCameraToggleEnabled":
case "TAGame.CameraSettingsActor_TA:bUsingSwivel":
case "TAGame.Ball_Haunted_TA:bIsBallBeamed":
case "TAGame.SpecialPickup_Rugby_TA:bBallWelded":
bw.Write((bool)data);
break;
case "TAGame.CarComponent_TA:ReplicatedActive":
Expand Down
5 changes: 4 additions & 1 deletion RocketLeagueReplayParser/Replay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@ public static Replay Deserialize(BinaryReader br)
replay.FixClassParent("TAGame.SpecialPickup_BallGravity_TA", "TAGame.SpecialPickup_TA");
replay.FixClassParent("TAGame.SpecialPickup_HitForce_TA", "TAGame.SpecialPickup_TA");
replay.FixClassParent("TAGame.SpecialPickup_Tornado_TA", "TAGame.SpecialPickup_TA");
replay.FixClassParent("Engine.Pawn", "Engine.Actor");
replay.FixClassParent("TAGame.SpecialPickup_HauntedBallBeam_TA", "TAGame.SpecialPickup_TA");
replay.FixClassParent("TAGame.CarComponent_TA", "Engine.Actor");
replay.FixClassParent("Engine.Info", "Engine.Actor");
replay.FixClassParent("Engine.Pawn", "Engine.Actor");

// Havent had problems with these yet. They (among others) can be ambiguous,
// but I havent found a replay yet where my parent choosing algorithm
Expand Down
8 changes: 4 additions & 4 deletions RocketLeagueReplayParser/RocketLeagueReplayParser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<Copyright>Copyright © 2015-2019</Copyright>

<!--Incrementing minor for every major patch -->
<Version>2.2.1</Version>
<FileVersion>2.2.1</FileVersion>
<PackageVersion>2.2.1</PackageVersion>
<AssemblyVersion>2.2.1.0</AssemblyVersion>
<Version>2.3.0</Version>
<FileVersion>2.3.0</FileVersion>
<PackageVersion>2.3.0</PackageVersion>
<AssemblyVersion>2.3.0.0</AssemblyVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CompareNETObjects" Version="4.52.0" />
Expand Down

0 comments on commit be1e057

Please sign in to comment.