Class EntityTickingSystem<ECS_TYPE>
- All Implemented Interfaces:
ISystem<ECS_TYPE>, QuerySystem<ECS_TYPE>, TickableSystem<ECS_TYPE>
- Direct Known Subclasses:
AbilityEntityRepeatSystem, AbilityProjectileTrailSystem, AbilityPullSystem, AmbientEmitterSystems.Ticking, AudioStateSystems.Tick, AudioSystems.EntityTrackerUpdate, AudioSystems.TickMovementAudio, BeamSystems.Tracker, BenchSystems.ProcessingBenchTick, BlockEntitySystems.BlockEntityTrackerSystem, BlockEntitySystems.Ticking, BlockPhysicsSystems.Ticking, CarriedBlockSystems.EntityTrackerUpdate, ChunkBlockTickSystem.PreTick, ChunkBlockTickSystem.Ticking, ChunkSystems.ReplicateChanges, ClearUsedTeleporterSystem, CombatActionEvaluatorSystems.EvaluatorTick, CombatViewSystems.Ticking, CompanionBlockSpawnerSystems.MarkerHeartbeat, CompanionBlockSpawnerSystems.ReconcileTick, DamageSystems.FallDamageNPCs, DamageSystems.FallDamagePlayers, DamageSystems.HackKnockbackValues, DeathSystems.CorpseRemoval, DeathSystems.TickCorpseRemoval, DelayedEntitySystem, DeployablesSystem.DeployableOwnerTicker, DeployablesSystem.DeployableTicker, DespawnSystem, DropItemsSystem, EncounterMemberSystems.Tick, EntityScaleBoundingBoxSystem, EntityStatsSystems.Changes, EntityStatsSystems.ClearChanges, EntityStatsSystems.EntityTrackerUpdate, EntityStatsSystems.Recalculate, EntityStatsSystems.Regenerate, EntitySystems.DynamicLightTracker, EntitySystems.NewSpawnEntityTrackerUpdate, EntitySystems.NewSpawnTick, EntityTrackerSystems.AddToVisible, EntityTrackerSystems.ClearEntityViewers, EntityTrackerSystems.ClearPreviouslyVisible, EntityTrackerSystems.CollectVisible, EntityTrackerSystems.EffectControllerSystem, EntityTrackerSystems.EnsureVisibleComponent, EntityTrackerSystems.EntityModel, EntityTrackerSystems.EntitySkin, EntityTrackerSystems.HideFromPlayer, EntityTrackerSystems.LODCull, EntityTrackerSystems.RemoveEmptyVisibleComponent, EntityTrackerSystems.SendPackets, ExplosiveSystems.Ticking, FallingBlockTickingSystem, FarmingSystems.CoopResidentTicking, FarmingSystems.Ticking, FlockSystems.FlockDebugSystem, FlockSystems.Ticking, FluidSystems.ReplicateChanges, FluidSystems.Ticking, ForcedMusicSystems.Tick, GenericVelocityInstructionSystem, HeightmapSystems.ReplicateChanges, HideEntitySystems.AdventurePlayerSystem, HitboxCollisionSystems.EntityTrackerUpdate, InteractionHostCleanupSystem, InteractionSystems.TickInteractionManagerSystem, InteractionSystems.TrackerTickSystem, InventorySystems.InventoryChangeEventSystem, InventorySystems.LegacyArmorChangeStatSystem, InventorySystems.LegacyHotbarChangeStatSystem, InventorySystems.LegacyUtilityChangeStatSystem, InventorySystems.SyncEquipmentSystem, ItemMergeSystem, ItemPhysicsSystem, ItemPrePhysicsSystem, ItemSystems.TrackerSystem, KnockbackPredictionSystems.CaptureKnockbackInput, KnockbackPredictionSystems.SimulateKnockback, KnockbackSystems.ApplyKnockback, KnockbackSystems.ApplyPlayerKnockback, LegacyProjectileSystems.TickingSystem, LivingEntityEffectClearChangesSystem, LivingEntityEffectSystem, LocalSpawnForceTriggerSystem, MarkerReplicationSystems.EntityTrackerUpdate, ModelSystems.AnimationEntityTrackerUpdate, ModelSystems.UpdateMovementStateBoundingBox, MountSystems.HandleMountInput, MountSystems.TrackerUpdate, MovementStatesSystems.TickingSystem, MusicPlayerSystems.Tick, NameplateSystems.EntityTrackerUpdate, NPCDamageSystems.DropDeathItems, NPCInteractionSystems.TickHeldInteractionsSystem, NPCMemory.GatherMemoriesSystem, NPCVelocityInstructionSystem, ObjectiveLocationMarkerSystems.TickingSystem, ParkourCheckpointSystems.Ticking, PickupItemSystem, PlayerChunkTrackerSystems.UpdateSystem, PlayerConnectionFlushSystem, PlayerCraftingSystems.CraftingTickingSystem, PlayerItemEntityPickupSystem, PlayerPingSystem, PlayerProcessMovementSystem, PlayerSavingSystems.TickingSystem, PlayerSendInventorySystem, PlayerSystems.ProcessPlayerInput, PlayerSystems.UpdatePlayerRef, PlayerVelocityInstructionSystem, PredictedProjectileSystems.EntityTrackerUpdate, PrefabPreviewSystems.PrefabPreviewTracker, RandomTickSystem, ReachLocationMarkerSystems.Ticking, RepulsionSystems.EntityTrackerUpdate, RepulsionSystems.RepulsionTicker, RotateObjectSystem, SnapshotSystems.Capture, SnapshotSystems.Resize, SpawnBeaconSystems.CheckDespawn, SpawnBeaconSystems.LoadTimeDelay, SpawnBeaconSystems.PositionSelectorUpdate, SpawnControllerSystem, SpawnJobSystem, SpawnMarkerBlockStateSystems.SpawnMarkerTickHeartbeat, SpawnMarkerBlockStateSystems.TickHeartbeat, SpawnMarkerSystems.DebugTicking, SpawnMarkerSystems.RemoveFailedValidation, SpawnMarkerSystems.Ticking, SpawnMarkerSystems.ValidationTicking, SpawnReferenceSystems.TickingSpawnBeaconSystem, SpawnReferenceSystems.TickingSpawnMarkerSystem, SpectatorSystems.FollowTarget, SpectatorSystems.HideFromNonSpectators, StaminaSystems.SprintStaminaEffectSystem, StandardPhysicsTickSystem, StateEvaluatorSystem, StepCleanupSystem, SteppableTickingSystem, TargetMemorySystems.Ticking, TraceKnockbackSystem, TransformSystems.EntityTrackerUpdate, TriggerVolumeNoHealSystem, TriggerVolumePlayerStateSystem, UIComponentSystems.Update, UpdateLocationSystems.TickingSystem, WeatherSystem.TickingSystem, WorldSpawnJobSystems.Ticking
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface ISystem
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <ECS_TYPE> voiddoTick(EntityTickingSystem<ECS_TYPE> system, float dt, ArchetypeChunk<ECS_TYPE> archetypeChunk, Store<ECS_TYPE> store, CommandBuffer<ECS_TYPE> commandBuffer) Required reading:CommandBufferbooleanisParallel(int archetypeChunkSize, int taskCount) abstract voidtick(float dt, int index, ArchetypeChunk<ECS_TYPE> archetypeChunk, Store<ECS_TYPE> store, CommandBuffer<ECS_TYPE> commandBuffer) Required reading:CommandBuffervoidtick(float dt, ArchetypeChunk<ECS_TYPE> archetypeChunk, Store<ECS_TYPE> store, CommandBuffer<ECS_TYPE> commandBuffer) Required reading:CommandBufferMethods inherited from class ArchetypeTickingSystem
isExplicitQuery, test, tickMethods inherited from class System
getComponentRegistrations, getResourceRegistrations, registerResource, registerResourceMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ISystem
getDependencies, getGroup, onSystemRegistered, onSystemUnregisteredMethods inherited from interface QuerySystem
getHierarchyScope, getQuery
-
Constructor Details
-
EntityTickingSystem
public EntityTickingSystem()
-
-
Method Details
-
isParallel
public boolean isParallel(int archetypeChunkSize, int taskCount) - Returns:
trueif parallel ticking is enabled.- See Also:
-
tick
public void tick(float dt, @Nonnull ArchetypeChunk<ECS_TYPE> archetypeChunk, @Nonnull Store<ECS_TYPE> store, @Nonnull CommandBuffer<ECS_TYPE> commandBuffer) Description copied from class:ArchetypeTickingSystemRequired reading:CommandBufferCalled once per world tick for each
ArchetypeChunkwith anArchetypethat fulfills theQueryprovided byQuerySystem.getQuery()}.- Specified by:
tickin classArchetypeTickingSystem<ECS_TYPE>- Parameters:
dt- The delta time in seconds.archetypeChunk- The affiliated archetype chunkstore- The entity store for component accesscommandBuffer- The command buffer to execute tasks
-
tick
public abstract void tick(float dt, int index, @Nonnull ArchetypeChunk<ECS_TYPE> archetypeChunk, @Nonnull Store<ECS_TYPE> store, @Nonnull CommandBuffer<ECS_TYPE> commandBuffer) Required reading:CommandBufferCalled once per world tick for each 'entity' inside of an
ArchetypeChunkwith anArchetypethat fulfills theQueryprovided byQuerySystem.getQuery()}.If
isParallel(int, int)returns true then this is called from a worker thread in the thread pool NOT from the world thread. When working with a parallel system special care must be taken to ensure data that is accessed is done so in a thead safe manor and that all components that have data that is modified are present in theReadWriteArchetypeQuery.getWriteArchetype(). TODO: Expand docs to talk more about how other query types tie into this.To access component data when using this method you should use the following:
var component = archetypeChunk.getComponent(index, componentType);- Parameters:
dt- The delta time in seconds.index- The index of the entity in theArchetypeChunk.
-
doTick
public static <ECS_TYPE> void doTick(@Nonnull EntityTickingSystem<ECS_TYPE> system, float dt, @Nonnull ArchetypeChunk<ECS_TYPE> archetypeChunk, @Nonnull Store<ECS_TYPE> store, @Nonnull CommandBuffer<ECS_TYPE> commandBuffer) Required reading:CommandBufferThis is a utility method that contains the underlying ticking functionality for
EntityTickingSystem. This allows systems to provide functionality before the ticking of entities by overridingArchetypeTickingSystem.tick(float, ArchetypeChunk, Store, CommandBuffer))} and then calling to this method when ticking of entities is wanted.For example, to only tick the
ArchetypeChunk's when a condition is met:
This allows for greatly improved performance by only checking the condition once perpublic void tick(float dt, int index, ArchetypeChunkarchetypeChunk, Store store, CommandBuffer commandBuffer) { if (someCondition) { EntityTickingSystem.doTick(this, dt, archetypeChunk, store, commandBuffer, task); } } ArchetypeChunkinstead of for each entity.
-