Has anyone tried using a tickable world subsystem for a bullet manager instead of just a custom class? I’ve finally got my projectiles completed and now I just need a way to tick them without ticking them per-object. Just wondering if anyone has done some performance/usability testing here already before I start writing this. I’m thinking the tickable world subsystem would be most ideal here.
We tick them via an actor in the world, but a subsystem would work fine. Our system was designed before Subsystems existed.
Awesome, thank you for your feedback. Will goahead with attempting it using a tickable world subsystem. Seams like this should work out pretty great. Currently I can have 1,000 projectiles (with niagara effects as visuals) with them all individually ticking, but once moved to a manager I should be able to get quite a bit more.
Worked perfectly. Edited out my game specific logic and provided a skeleton below for a simple tickable world subsystem.
MyTickableSubsystem.h
#pragma once
#include "CoreMinimal.h"
#include "Subsystems/WorldSubsystem.h"
#include "MyTickableSubsystem.generated.h"
UCLASS()
class MYTICKABLESUBSYSTEM_API UMyTickableSubsystem : public UTickableWorldSubsystem
{
GENERATED_BODY()
public:
virtual void Initialize( FSubsystemCollectionBase& Collection ) override;
virtual void Deinitialize() override;
virtual void Tick( float DeltaTime ) override;
virtual TStatId GetStatId() const override;
};
MyTickableSubsystem.cpp
#include "MyTickableSubsystem/Public/MyTickableSubsystem.h"
void UMyTickableSubsystem::Initialize( FSubsystemCollectionBase& Collection )
{
Super::Initialize( Collection );
}
void UMyTickableSubsystem::Deinitialize()
{
Super::Deinitialize();
}
void UMyTickableSubsystem::Tick( float DeltaTime )
{
// Do tick behavior here
}
TStatId UMyTickableSubsystem::GetStatId() const
{
RETURN_QUICK_DECLARE_CYCLE_STAT( UMyTickableSubsystem, STATGROUP_Tickables );
}