Hi @PhilSA , everything is running smoothly except I’m having a hard time getting prediction working with Rival. I have a feeling that it might be an issue with the NetCode documentation but I’m not sure.
I think what I expect to see is the Rival.KinematicCharacter body showing up in bold
after including
public class MobCharacterGhostOverrides : IGhostDefaultOverridesModifier
{
public void Modify(Dictionary<string, GhostComponentModifier> overrides)
{
// TODO: find a way to not have to clear defaults (translation/rotation)
overrides.Clear();
var translationComponentModifier = new GhostComponentModifier
{
typeFullName = "Unity.Transforms.Translation",
attribute = new GhostComponentAttribute { PrefabType = GhostPrefabType.All, OwnerPredictedSendType = GhostSendType.All, SendDataForChildEntity = false },
fields = new[]
{
new GhostFieldModifier
{
name = "Value",
attribute = new GhostFieldAttribute{Quantization = -1, Smoothing = SmoothingAction.InterpolateAndExtrapolate}
},
},
entityIndex = 0,
};
overrides.Add(translationComponentModifier.typeFullName, translationComponentModifier);
var rotationComponentModifier = new GhostComponentModifier
{
typeFullName = "Unity.Transforms.Rotation",
attribute = new GhostComponentAttribute { PrefabType = GhostPrefabType.All, OwnerPredictedSendType = GhostSendType.All, SendDataForChildEntity = false },
fields = new[]
{
new GhostFieldModifier
{
name = "Value",
attribute = new GhostFieldAttribute{Quantization = 100, Smoothing = SmoothingAction.InterpolateAndExtrapolate}
},
},
entityIndex = 0,
};
overrides.Add(rotationComponentModifier.typeFullName, rotationComponentModifier);
var characterBodyComponentModifier = new GhostComponentModifier
{
typeFullName = "Rival.KinematicCharacterBody",
attribute = new GhostComponentAttribute { PrefabType = GhostPrefabType.All, OwnerPredictedSendType = GhostSendType.All, SendDataForChildEntity = false },
fields = new[]
{
new GhostFieldModifier
{
name = "RelativeVelocity",
attribute = new GhostFieldAttribute{Quantization = 100, Smoothing = SmoothingAction.InterpolateAndExtrapolate}
},
new GhostFieldModifier
{
name = "IsGrounded",
attribute = new GhostFieldAttribute(),
},
new GhostFieldModifier
{
name = "ParentEntity",
attribute = new GhostFieldAttribute(),
},
},
entityIndex = 0,
};
overrides.Add(characterBodyComponentModifier.typeFullName, characterBodyComponentModifier);
var trackedTransformComponentModifier = new GhostComponentModifier
{
typeFullName = "Rival.TrackedTransform",
attribute = new GhostComponentAttribute { PrefabType = GhostPrefabType.All, OwnerPredictedSendType = GhostSendType.All, SendDataForChildEntity = false },
fields = new[]
{
new GhostFieldModifier
{
name = "CurrentFixedRateTransform",
attribute = new GhostFieldAttribute{Quantization = -1, Smoothing = SmoothingAction.InterpolateAndExtrapolate}
},
},
entityIndex = 0,
};
overrides.Add(trackedTransformComponentModifier.typeFullName, trackedTransformComponentModifier);
}
public void ModifyAlwaysIncludedAssembly(HashSet<string> alwaysIncludedAssemblies)
{
alwaysIncludedAssemblies.Add("Rival.Runtime");
}
public void ModifyTypeRegistry(TypeRegistry typeRegistry, string netCodeGenAssemblyPath)
{
}
}
Which I found in the OnlineFPS sample. I’m just not sure what the steps are after or inbetween. I know that these fields need to be synced but without editing files to include [GhostField]s I’m not sure how to. I have also noticed an Assembly Definition Asset. Where must this be placed? Is it necessary?
I understand that these things may not be an issue with Rival or the documentation so I apologise in advance.
P.S. I cant get into the discord server with the link. Do I need an invitation?