Hello, if I were to get time that would be decent tutorial but I can’t promise to produce one unfortunately.
My main goal is to deliver broad knowledge about the networked physics solutions I’m developing for Unreal Engine, not how to do specific games with those solutions.
From the knowledge I put out you should be able to do learn and piece together knowledge about physics, gameplay and networked physics to produce whichever game you want.
Hopefully the next Gameplay tutorial helps you a bit more, though doing a physics-based vehicle game should be doable generally from this Pawn tutorial since the vehicle can be driven just by the input system and maybe some custom states for special things like boost etc.
Do you have any ideas regarding this behavior of body system like this? I was testing with 5.8 a long time ago, retested with 5.8 release version today and the results are the same, it was better in 5.7 with the same settings.
I’ve been trying to set this up for a few days now and am coming up short. The linked simple physics pawn tutorial works fairly well, but Chaos Modular Vehicles on every version between 5.5 and 5.8 at least, is completely unplayable in multiplayer - despite having a deep Network Physics integration and being setup for Resimulation out of the box.
Even in PIE with perfect conditions, all the vehicles jitter/shudder and are somewhat undrivable in multiplayer. Using Chaos VD I can see the client triggering resim endlessly, even when they are almost stationary. The simulation itself is also highly undeterministic which exacerbates things considerably, but isn’t the full picture.
Is it expected that Chaos Modular Vehicles don’t work properly with this out of the box? I’ve had to make some considerable changes already which I wasn’t expecting.
--
In regards to the pawn tutorial, something that doesn’t seem right is pushing inputs to async input on the game thread tick. To me, it makes more sense to setup InjectInputs_External on the callback and push them that way. Chaos Modular Vehicles binds this via the Rewind callback for some reason, though both are called from the exact same place in core chaos code.
My updated version looks like so (with APhysicsPawn::Tick removed)
class FPhysicsPawnAsync : public Chaos::TSimCallbackObject<FAsyncInputPhysicsPawn, FAsyncOutputPhysicsPawn,
(Chaos::ESimCallbackOptions::Presimulate | Chaos::ESimCallbackOptions::PhysicsObjectUnregister | Chaos::ESimCallbackOptions::Rewind | Chaos::ESimCallbackOptions::InjectInputsExternal)>
, public TNetworkPhysicsInputState_Internal<FNetInputPhysicsPawn, FNetStatePhysicsPawn>
void FPhysicsPawnAsync::InjectInputs_External(int32 PhysicsStep, int32 NumSteps)
{
check(IsInGameThread());
TStrongObjectPtr<APhysicsPawn> StrongPtr = Pawn.Pin();
if (StrongPtr.IsValid() && StrongPtr->IsLocallyControlled())
{
if (FAsyncInputPhysicsPawn* AsyncInput = GetProducerInputData_External())
{
AsyncInput->MovementInput = StrongPtr->ForwardInput_External - StrongPtr->BackwardInput_External;
AsyncInput->SteeringInput = StrongPtr->SteeringInput_External;
}
}
}