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

Client Side Prediction Addition #162

Merged
merged 15 commits into from
Dec 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .vsconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Workload.ManagedGame"
]
}
2 changes: 1 addition & 1 deletion Assets/NetCodeGenerated/PropHunt.Generated.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ protected override void OnCreate()
ghostCollectionSystem.AddSerializer(PropHuntMixedComponentsKCCMovementSettingsGhostComponentSerializer.State);
ghostCollectionSystem.AddSerializer(PropHuntMixedComponentsKCCJumpingGhostComponentSerializer.State);
ghostCollectionSystem.AddSerializer(PropHuntMixedComponentsKCCGroundedGhostComponentSerializer.State);
ghostCollectionSystem.AddSerializer(PropHuntMixedComponentsKCCVelocityGhostComponentSerializer.State);
ghostCollectionSystem.AddSerializer(PropHuntMixedComponentsKCCGravityGhostComponentSerializer.State);
ghostCollectionSystem.AddSerializer(PropHuntMixedComponentsMaterialIdComponentDataGhostComponentSerializer.State);
ghostCollectionSystem.AddSerializer(PropHuntMixedComponentsMovementTrackingGhostComponentSerializer.State);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ namespace PropHunt.Generated
[BurstCompile]
public struct PropHuntMixedCommandsJoinGameRequestSerializer : IComponentData, IRpcCommandSerializer<PropHunt.Mixed.Commands.JoinGameRequest>
{
public void Serialize(ref DataStreamWriter writer, in PropHunt.Mixed.Commands.JoinGameRequest data)
public void Serialize(ref DataStreamWriter writer, in RpcSerializerState state, in PropHunt.Mixed.Commands.JoinGameRequest data)
{
}

public void Deserialize(ref DataStreamReader reader, ref PropHunt.Mixed.Commands.JoinGameRequest data)
public void Deserialize(ref DataStreamReader reader, in RpcDeserializerState state, ref PropHunt.Mixed.Commands.JoinGameRequest data)
{
}
[BurstCompile]
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,47 @@ namespace PropHunt.Generated
[BurstCompile]
public struct PropHuntMixedComponentsKCCGravityGhostComponentSerializer
{
static PropHuntMixedComponentsKCCGravityGhostComponentSerializer()
static GhostComponentSerializer.State GetState()
{
State = new GhostComponentSerializer.State
// This needs to be lazy initialized because otherwise there is a depenency on the static initialization order which breaks il2cpp builds due to TYpeManager not being initialized yet
if (!s_StateInitialized)
{
GhostFieldsHash = 17884505960735121,
ExcludeFromComponentCollectionHash = 0,
ComponentType = ComponentType.ReadWrite<PropHunt.Mixed.Components.KCCGravity>(),
ComponentSize = UnsafeUtility.SizeOf<PropHunt.Mixed.Components.KCCGravity>(),
SnapshotSize = UnsafeUtility.SizeOf<Snapshot>(),
ChangeMaskBits = ChangeMaskBits,
SendMask = GhostComponentSerializer.SendMask.Predicted,
SendForChildEntities = 1,
CopyToSnapshot =
new PortableFunctionPointer<GhostComponentSerializer.CopyToFromSnapshotDelegate>(CopyToSnapshot),
CopyFromSnapshot =
new PortableFunctionPointer<GhostComponentSerializer.CopyToFromSnapshotDelegate>(CopyFromSnapshot),
RestoreFromBackup =
new PortableFunctionPointer<GhostComponentSerializer.RestoreFromBackupDelegate>(RestoreFromBackup),
PredictDelta = new PortableFunctionPointer<GhostComponentSerializer.PredictDeltaDelegate>(PredictDelta),
CalculateChangeMask =
new PortableFunctionPointer<GhostComponentSerializer.CalculateChangeMaskDelegate>(
CalculateChangeMask),
Serialize = new PortableFunctionPointer<GhostComponentSerializer.SerializeDelegate>(Serialize),
Deserialize = new PortableFunctionPointer<GhostComponentSerializer.DeserializeDelegate>(Deserialize),
s_State = new GhostComponentSerializer.State
{
GhostFieldsHash = 17884505960735121,
ExcludeFromComponentCollectionHash = 0,
ComponentType = ComponentType.ReadWrite<PropHunt.Mixed.Components.KCCGravity>(),
ComponentSize = UnsafeUtility.SizeOf<PropHunt.Mixed.Components.KCCGravity>(),
SnapshotSize = UnsafeUtility.SizeOf<Snapshot>(),
ChangeMaskBits = ChangeMaskBits,
SendMask = GhostComponentSerializer.SendMask.Predicted,
SendForChildEntities = 1,
CopyToSnapshot =
new PortableFunctionPointer<GhostComponentSerializer.CopyToFromSnapshotDelegate>(CopyToSnapshot),
CopyFromSnapshot =
new PortableFunctionPointer<GhostComponentSerializer.CopyToFromSnapshotDelegate>(CopyFromSnapshot),
RestoreFromBackup =
new PortableFunctionPointer<GhostComponentSerializer.RestoreFromBackupDelegate>(RestoreFromBackup),
PredictDelta = new PortableFunctionPointer<GhostComponentSerializer.PredictDeltaDelegate>(PredictDelta),
CalculateChangeMask =
new PortableFunctionPointer<GhostComponentSerializer.CalculateChangeMaskDelegate>(
CalculateChangeMask),
Serialize = new PortableFunctionPointer<GhostComponentSerializer.SerializeDelegate>(Serialize),
Deserialize = new PortableFunctionPointer<GhostComponentSerializer.DeserializeDelegate>(Deserialize),
#if UNITY_EDITOR || DEVELOPMENT_BUILD
ReportPredictionErrors = new PortableFunctionPointer<GhostComponentSerializer.ReportPredictionErrorsDelegate>(ReportPredictionErrors),
#endif
};
#if UNITY_EDITOR || DEVELOPMENT_BUILD
ReportPredictionErrors = new PortableFunctionPointer<GhostComponentSerializer.ReportPredictionErrorsDelegate>(ReportPredictionErrors),
s_State.NumPredictionErrorNames = GetPredictionErrorNames(ref s_State.PredictionErrorNames);
#endif
};
#if UNITY_EDITOR || DEVELOPMENT_BUILD
State.NumPredictionErrorNames = GetPredictionErrorNames(ref State.PredictionErrorNames);
#endif
s_StateInitialized = true;
}
return s_State;
}
public static readonly GhostComponentSerializer.State State;
private static bool s_StateInitialized;
private static GhostComponentSerializer.State s_State;
public static GhostComponentSerializer.State State => GetState();
public struct Snapshot
{
public int gravityAcceleration_x;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,47 @@ namespace PropHunt.Generated
[BurstCompile]
public struct PropHuntMixedComponentsKCCGroundedGhostComponentSerializer
{
static PropHuntMixedComponentsKCCGroundedGhostComponentSerializer()
static GhostComponentSerializer.State GetState()
{
State = new GhostComponentSerializer.State
// This needs to be lazy initialized because otherwise there is a depenency on the static initialization order which breaks il2cpp builds due to TYpeManager not being initialized yet
if (!s_StateInitialized)
{
GhostFieldsHash = 17884505960735121,
ExcludeFromComponentCollectionHash = 0,
ComponentType = ComponentType.ReadWrite<PropHunt.Mixed.Components.KCCGrounded>(),
ComponentSize = UnsafeUtility.SizeOf<PropHunt.Mixed.Components.KCCGrounded>(),
SnapshotSize = UnsafeUtility.SizeOf<Snapshot>(),
ChangeMaskBits = ChangeMaskBits,
SendMask = GhostComponentSerializer.SendMask.Predicted,
SendForChildEntities = 1,
CopyToSnapshot =
new PortableFunctionPointer<GhostComponentSerializer.CopyToFromSnapshotDelegate>(CopyToSnapshot),
CopyFromSnapshot =
new PortableFunctionPointer<GhostComponentSerializer.CopyToFromSnapshotDelegate>(CopyFromSnapshot),
RestoreFromBackup =
new PortableFunctionPointer<GhostComponentSerializer.RestoreFromBackupDelegate>(RestoreFromBackup),
PredictDelta = new PortableFunctionPointer<GhostComponentSerializer.PredictDeltaDelegate>(PredictDelta),
CalculateChangeMask =
new PortableFunctionPointer<GhostComponentSerializer.CalculateChangeMaskDelegate>(
CalculateChangeMask),
Serialize = new PortableFunctionPointer<GhostComponentSerializer.SerializeDelegate>(Serialize),
Deserialize = new PortableFunctionPointer<GhostComponentSerializer.DeserializeDelegate>(Deserialize),
s_State = new GhostComponentSerializer.State
{
GhostFieldsHash = 17884505960735121,
ExcludeFromComponentCollectionHash = 0,
ComponentType = ComponentType.ReadWrite<PropHunt.Mixed.Components.KCCGrounded>(),
ComponentSize = UnsafeUtility.SizeOf<PropHunt.Mixed.Components.KCCGrounded>(),
SnapshotSize = UnsafeUtility.SizeOf<Snapshot>(),
ChangeMaskBits = ChangeMaskBits,
SendMask = GhostComponentSerializer.SendMask.Predicted,
SendForChildEntities = 1,
CopyToSnapshot =
new PortableFunctionPointer<GhostComponentSerializer.CopyToFromSnapshotDelegate>(CopyToSnapshot),
CopyFromSnapshot =
new PortableFunctionPointer<GhostComponentSerializer.CopyToFromSnapshotDelegate>(CopyFromSnapshot),
RestoreFromBackup =
new PortableFunctionPointer<GhostComponentSerializer.RestoreFromBackupDelegate>(RestoreFromBackup),
PredictDelta = new PortableFunctionPointer<GhostComponentSerializer.PredictDeltaDelegate>(PredictDelta),
CalculateChangeMask =
new PortableFunctionPointer<GhostComponentSerializer.CalculateChangeMaskDelegate>(
CalculateChangeMask),
Serialize = new PortableFunctionPointer<GhostComponentSerializer.SerializeDelegate>(Serialize),
Deserialize = new PortableFunctionPointer<GhostComponentSerializer.DeserializeDelegate>(Deserialize),
#if UNITY_EDITOR || DEVELOPMENT_BUILD
ReportPredictionErrors = new PortableFunctionPointer<GhostComponentSerializer.ReportPredictionErrorsDelegate>(ReportPredictionErrors),
#endif
};
#if UNITY_EDITOR || DEVELOPMENT_BUILD
ReportPredictionErrors = new PortableFunctionPointer<GhostComponentSerializer.ReportPredictionErrorsDelegate>(ReportPredictionErrors),
s_State.NumPredictionErrorNames = GetPredictionErrorNames(ref s_State.PredictionErrorNames);
#endif
};
#if UNITY_EDITOR || DEVELOPMENT_BUILD
State.NumPredictionErrorNames = GetPredictionErrorNames(ref State.PredictionErrorNames);
#endif
s_StateInitialized = true;
}
return s_State;
}
public static readonly GhostComponentSerializer.State State;
private static bool s_StateInitialized;
private static GhostComponentSerializer.State s_State;
public static GhostComponentSerializer.State State => GetState();
public struct Snapshot
{
public int maxWalkAngle;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,47 @@ namespace PropHunt.Generated
[BurstCompile]
public struct PropHuntMixedComponentsKCCJumpingGhostComponentSerializer
{
static PropHuntMixedComponentsKCCJumpingGhostComponentSerializer()
static GhostComponentSerializer.State GetState()
{
State = new GhostComponentSerializer.State
// This needs to be lazy initialized because otherwise there is a depenency on the static initialization order which breaks il2cpp builds due to TYpeManager not being initialized yet
if (!s_StateInitialized)
{
GhostFieldsHash = 4539255436592233441,
ExcludeFromComponentCollectionHash = 0,
ComponentType = ComponentType.ReadWrite<PropHunt.Mixed.Components.KCCJumping>(),
ComponentSize = UnsafeUtility.SizeOf<PropHunt.Mixed.Components.KCCJumping>(),
SnapshotSize = UnsafeUtility.SizeOf<Snapshot>(),
ChangeMaskBits = ChangeMaskBits,
SendMask = GhostComponentSerializer.SendMask.Predicted,
SendForChildEntities = 1,
CopyToSnapshot =
new PortableFunctionPointer<GhostComponentSerializer.CopyToFromSnapshotDelegate>(CopyToSnapshot),
CopyFromSnapshot =
new PortableFunctionPointer<GhostComponentSerializer.CopyToFromSnapshotDelegate>(CopyFromSnapshot),
RestoreFromBackup =
new PortableFunctionPointer<GhostComponentSerializer.RestoreFromBackupDelegate>(RestoreFromBackup),
PredictDelta = new PortableFunctionPointer<GhostComponentSerializer.PredictDeltaDelegate>(PredictDelta),
CalculateChangeMask =
new PortableFunctionPointer<GhostComponentSerializer.CalculateChangeMaskDelegate>(
CalculateChangeMask),
Serialize = new PortableFunctionPointer<GhostComponentSerializer.SerializeDelegate>(Serialize),
Deserialize = new PortableFunctionPointer<GhostComponentSerializer.DeserializeDelegate>(Deserialize),
s_State = new GhostComponentSerializer.State
{
GhostFieldsHash = 4539255436592233441,
ExcludeFromComponentCollectionHash = 0,
ComponentType = ComponentType.ReadWrite<PropHunt.Mixed.Components.KCCJumping>(),
ComponentSize = UnsafeUtility.SizeOf<PropHunt.Mixed.Components.KCCJumping>(),
SnapshotSize = UnsafeUtility.SizeOf<Snapshot>(),
ChangeMaskBits = ChangeMaskBits,
SendMask = GhostComponentSerializer.SendMask.Predicted,
SendForChildEntities = 1,
CopyToSnapshot =
new PortableFunctionPointer<GhostComponentSerializer.CopyToFromSnapshotDelegate>(CopyToSnapshot),
CopyFromSnapshot =
new PortableFunctionPointer<GhostComponentSerializer.CopyToFromSnapshotDelegate>(CopyFromSnapshot),
RestoreFromBackup =
new PortableFunctionPointer<GhostComponentSerializer.RestoreFromBackupDelegate>(RestoreFromBackup),
PredictDelta = new PortableFunctionPointer<GhostComponentSerializer.PredictDeltaDelegate>(PredictDelta),
CalculateChangeMask =
new PortableFunctionPointer<GhostComponentSerializer.CalculateChangeMaskDelegate>(
CalculateChangeMask),
Serialize = new PortableFunctionPointer<GhostComponentSerializer.SerializeDelegate>(Serialize),
Deserialize = new PortableFunctionPointer<GhostComponentSerializer.DeserializeDelegate>(Deserialize),
#if UNITY_EDITOR || DEVELOPMENT_BUILD
ReportPredictionErrors = new PortableFunctionPointer<GhostComponentSerializer.ReportPredictionErrorsDelegate>(ReportPredictionErrors),
#endif
};
#if UNITY_EDITOR || DEVELOPMENT_BUILD
ReportPredictionErrors = new PortableFunctionPointer<GhostComponentSerializer.ReportPredictionErrorsDelegate>(ReportPredictionErrors),
s_State.NumPredictionErrorNames = GetPredictionErrorNames(ref s_State.PredictionErrorNames);
#endif
};
#if UNITY_EDITOR || DEVELOPMENT_BUILD
State.NumPredictionErrorNames = GetPredictionErrorNames(ref State.PredictionErrorNames);
#endif
s_StateInitialized = true;
}
return s_State;
}
public static readonly GhostComponentSerializer.State State;
private static bool s_StateInitialized;
private static GhostComponentSerializer.State s_State;
public static GhostComponentSerializer.State State => GetState();
public struct Snapshot
{
public int jumpForce;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading