Level window and debug info

Hello community!
I would like to display debug information that is tied to a tile map in Unreal Editor.

For now (because it is impossible to attach meta data to tiles ) I made an object with an actor component that calls appropriate debug draw functions in its ::TickComponent function:

void UTileMetaDataComponent::TickComponent( float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction )
{
	Super::TickComponent( DeltaTime, TickType, ThisTickFunction );

	// Displaying tile meta data debug info
	DrawDebugBox( GetWorld(), FVector( 160.0f, 0.0f, -160.0f ), FVector( 160.0f, 160.0f, 320.0f ), FColor::Yellow );
	DrawDebugString( GetWorld(), FVector( 160.0f, 0.0f, -160.0f ), "TileA", nullptr, FColor::White, 0.0f );
}

Now this is fine but it doesn’t display when editing the level ( only when the game runs ) which makes sense given how it is implemented.

My question is: would there be a way to implement this so that it displays whether the game is running or not ? Like this it can be used during level edition : )

Thanks,

Erwan

Three options are:

Enable ticking in the editor (be careful what you do/process when doing so, as you can easily pollute the editor world) via bTickInEditor=true on a component.

Check out FComponentVisualizer, which can be used to do arbitrary rendering when a specific kind of component is selected. However, this is editor-only and won’t work in the game (and requires that it be selected).

Create a debug component + scene proxy, this will work in both editor and game and gives you the most control, but it’s also the most work.

As an aside, what kind of metadata are you interested in storing for tile maps?

Cheers,
Michael Noland

Thank you Michael!

I am going to go the bTickInEditor=true route as I have only one actor in the world using that component. It should do the trick for now at least.

As for the metadata in tile maps, I’d like to be able to tag them.
For now per tile I have:
A room tag and A unique id

Right now I am using a separate xml file to do that.

Hum actually bTickInEditor seems to only call ::TickComponent when the blueprint editor is opened. It isn’t called for blueprints instanced in the world. I guess I’ll have to have a look at that debug component thing.

bTickInEditor is how flipbook components work, and they appear to tick fine both in the level editor and in the blueprint editor. Their setup is as follows:

PrimaryComponentTick.bCanEverTick = true;
PrimaryComponentTick.TickGroup = TG_DuringPhysics;
bTickInEditor = true;

Cheers,
Michael Noland