#How do i run jobs from System A in parallel with jobs from System B?
1 messages · Page 1 of 1 (latest)
i`m trying to run a system in parallel with KinematicCharacterDeferredImpulsesJob (It is single threaded) with no success
It always end up running before or after it.
@regal shore Is it possible?
Can you show how you're scheduling jobs in system A and B?
Typically if the same components are used, then the System A's dependency is automatically waited on before running system B jobs. If they are completely decoupled then there maybe some excessive waiting done on our end which should be addressed.
They are decoupled
This jobs cant run together with DeferredImpulses but they dont use any component from it
[BurstCompile]
public void OnUpdate(ref SystemState state)
{
DamageableComponents.Update(ref state);
ConeDamageProducerJob producer = new ConeDamageProducerJob()
{
Time = SystemAPI.Time,
CommandBuffer = SystemAPI.GetSingleton<EndFixedStepSimulationEntityCommandBufferSystem.Singleton>()
.CreateCommandBuffer(state.WorldUnmanaged)
.AsParallelWriter(),
Events = Events.AsParallelWriter(),
PhysicsWorld = SystemAPI.GetSingleton<PhysicsWorldSingleton>()
.PhysicsWorld
};
ConeDamageConsumerJob consumer = new ConeDamageConsumerJob()
{
Events = Events
};
state.Dependency = producer.ScheduleParallel(state.Dependency);
state.Dependency = consumer.Schedule(state.Dependency);
}
i`m trying to force it to run at same time/after the deferred input system but it does not run in parallel
[UpdateAfter(typeof(KinematicCharacterDeferredImpulsesSystem))]
[BurstCompile]
public partial struct ConeDamageSystem : ISystem```
I tried to do the same thing with my own system (SpatialEntity) and it works
Looks like only KinematicCharacterDeferredImpulsesSystem can`t run in parallel with other systems
I'll admit I'm not seeing anything that could cause this at the moment. The KinematicCharacterDeferredImpulsesJob writes to: LocalTransform, PhysicsVelocity and KinematicCharacterBody so jobs that don't deal with these components should be able to run at the same time. There's also nothing special about KinematicCharacterDeferredImpulsesJob as far as I can tell; just a standard IJobEntity scheduled in a standard way
Can I ask what DamageableComponents.Update(ref state); does in your system update?
I found the problem. My damageable system was using the physics world and could not run with KinematicCharacterDeferredImpulsesJob
Thank you man. Your character controller is really good. I`m doing a online game and i have bencmarked more than 7500 moving players with my networking library and DOTs/rival