I’m new to Unreal and I spent 30min searching online and could not land a single match for my question, so here I am.
Basically, I noticed that UE prefixes my classes and I want to avoid that. For instance, say I crate an Actor called TestActor. The autogenerated class in TestActor.hpp is declared as ATestActor instead. That is, it ads an ‘A’ prefix.
Is there a way to prevent this? I tried the obvious: renaming the class in the code as well as the visible members but the message log says it should be ‘ATestActor’. So clearly there is some extra scaffolding already in place.
UE4 allows classes without prefixes if they are not utilizes compiler features. In all other cases you must put prefix to describe purpose of type.
For example there is class in my game named BulletSystem, declaration looks like this:
class SA_API ABulletSystem : public AActor
UFUNCTION(BlueprintCallable, Category = "Bullet System")
void BulletsTick(float DeltaTime);
UPROPERTY(BlueprintReadOnly, Category = "Bullet System")
BulletSystem uses compiler features like generated .h, GENERATED_BODY, UFUNCTION, UPROPERTY, it’s actually UCLASS, that can interact with blueprints, so it must have prefix.
Now notice there class Bullet. It hasn’t got prefix and it’s compilable. It’s declaration looks like this:
class ABulletSystem; //forward declaration
class SA_API Bullet
ABulletSystem * owningSystem;
FVector location, velocity;
void Tick(float DeltaTime); // It's NOT virtual function override
This class can’t be debugged through editor (values never will be visible), it’s can’t use generated .h, it hasn’t GENERATED_BODY(), it’s obviously can’t be used in blueprints, but it still can use game API (see class decorator) and it’s prefix-free.
This is real example I used in my game. Profit of using clean class Bullet is in higher performance and lower memory consumption (single class instead of thousands).
Ok so I guess the name of the class is part of the scheme the engine uses. That’s a bit disappointing but cool, thanks!