[Tool] DebugWidget - 3D Widget to help debugging (VR)

Pre UE4.25[SPOILER]
What is it?
A Plugin that provides an extendet WidgetComponent that helps to debug your game. Its main purpose is VR development, as onscreen messages are not that useable in VR.

What does it do?
It displays text.

What text does it display?
It grabs into the engine and reads out the message buffers for GEngine->AddOnScreenDebugMessage (C++) and PrintString (Blueprint). In addition, every component instance can be fed with individual messages.

Features!
-Display of engine debug messages (GEngine->AddOnScreenDebugMessage and PrintString) (toggleable)
-Individual debug messages for every component instance
-Colored Messages
-Background color for Panel/Text
-Disabling of debug messages on the screen
-Billboard behavior (toggleable)
-Fill from Bottom/Top
-Individual text size
-Actor/World viewport setup preview
-Adds PrintStringAdvanced node to Blueprint (exposes message key and adds some other functionality)
-Completely written in C++
[/SPOILER]

What is it?
A Plugin that provides an extendet WidgetComponent that helps to debug your game. Its main purpose is VR development, as onscreen messages are not that useable in VR.

What does it do?
It displays text.

What text does it display?
The plugin has its own message buffers where every DebugWidgetComponent reads from. Use **PrintString_DW **or **PrintStringAdv_DW **to print into these.
In addition, every component instance can be fed with individual messages. Use DebugWidgetComponent->PrintString_DebugWidget

Features!
-Shared message buffer where every component reads from
-Individual debug messages for every component instance
-Colored Messages
-Background color for Panel/Text
-Billboard behavior (toggleable)
-Fill from Bottom/Top
-Individual text size
-Actor/World viewport setup preview
-Adds **PrintStringAdv_DW **node to Blueprint (exposes message key and adds some other functionality)
-Completely written in C++

Text print order
1: Instance specific messages (key = -1)
2: Global messages (key = -1)
3: Instance specific with key (key != -1)
4: Global messages with key (key != -1)

Known Issues :frowning:

Some setup possibilities to showcase


Individual text for every component with billboard functionality, general debug messages ignored

How to set it up?
1: Download and place the contents into ‘…/MyGame/Plugins’
2: Restart Editor
3: Add DebugWidget (Component) to an actor
4: All setup options can be found in the ‘Setup’ section when clicking the component.

How do I get Text to show up in the Widget?
-FDebugWidgetManager::Get().AddMessage (C++) (Prints to all instances)
-PrintString_DW (Blueprint and C++) (Prints to all instances)
-PrintStringAdv_DW (Blueprint and C++) (Prints to all instances)
-DebugWidgetComponent->DebugWidget_PrintString (Blueprint and C++) (Prints to specific instance)

Mine is not transparent, what am I doing wrong?
Nothing. Click on the Component and look for ‘Blend Mode’. Change it to ‘Transparent’.

The text is unreadable, blurry and stuff!
You might want to change some of your postprocessing settings. ‘Edit->ProjectSettings->Rendering->DefaultSettings’
-Turn everything off (should be for VR anyway)
-Anti-Aliasing Method ‘FXAA’ or ‘TemporalAA’

**Changelog **
[SPOILER]
Version 1.5 2020.05.07
-Update to UE4.25 with rework to internal message buffers cause unreal made the engine buffers private.

Version 1.4 2020.04.09
-Added SetFontSize function to the compoennt
-Fixed: Can’t save when using the component in an actor placed in a streaming level.

2018/05/03
-Fixed DebugWidetComponent not calling Super::BeginPlay() which causes an ensure break.
2018/03/01
-Applied a fix that caused crash in startup of shipping build.
2018/01/29
-Extended the PrintStringAdvanced node with Prefix and Suffix. It does now also display the message source (the originating class) by choice.
-PrintStringAdvanced now prints an error message if there is no Prefix, Message or Suffix
2017/11/15
-Widgets register to the manager now within BeginPlay. This fixes an issue where meta objects created by the engine were registered as well.
This issue came up as messages did not time out when EnableScreenDebugMessages was unchecked.
-Widgets now get updated only when the owning actor is in view (Actor::WasRenderedRecently)
[/SPOILER]

Download
UE4.16 (Update: 08.08.2017)
UE4.17
UE4.18 (Update: 01.03.2018)
UE4.19 (Update: 03.05.2018)
UE4.20
UE4.21
UE4.22
UE4.23
UE4.24(Update: 09.04.2020)
UE4.25important
UE4.26

Source on GitHub

Any feedback, bugs and ideas for improvement are welcome.

-Fixed: Display issues when doing local multiplayer test
-Billboard target is now PlayerViewPoint instead of PawnLocation.

Thank you for this plugin! Works great, but how do I overwrite a single line of text in the DebugWidgetComponent instead of having scrolling output?

Sorry for the late reply. Not getting notifications about new posts.
Glad you like it.

You need to specify a key for the message. This is right now possible with the DebugWidget_PrintString function. But this is for component specific messages.

I gues you are using the original PrintString node? Unreal did not expose that feature to blueprint, no idea why, it’s quite usefull. I will add a Blueprint exposed function that adds this feature. Gues I can do it tomorrow.

-Improved performance for local multiplayer testing
-Added PrintStringAdvanced node that exposes the message key to Blueprint

Thanks for the plugin! I could not yet figure it how to setup a layout like yours, with multiple instances of the component. No matter what I specify for “key” the string always shows in each instance.
Any guidance is greatly appreciated. Thanks!!

Hey BreakMaker, sorry for the late reply.

In order to print to a single instance of the component, you need to use DebugWidgetComponent->DebugWidget_PrintString function. PrintString and PrintStringAdvanced will print to all widgets.
The “Key” is for overwriting a previous message and it is important for the order in which the messages are displayed. If you have trouble finding the function in Blueprint, you need to be in the context of the DebugWidgetComponent or disable the context sensitive search in blueprint.

If you still need help, please come back to me.

Regards

Uploaded versions for UE4.17 and UE4.18.
Removed [WIP] tag.

If you have any ideas or requests, let me know.

Pushed an update and added changelog.

Hello! Is there maybe visual BP examples, pictures or video, for beginner level, how to set things up, to get variations of results? Let’s say, I would like one billboard, not attached to dynamic actor (simply floating somewhere), and feed N different texts there, with manual written prefixes (descriptions), each color coded, each representing changing (but not scrolling) value that I would be otherwise getting from PrintString-s ? I would really appreciate somehelp for novice here, Thank You. :slight_smile:
EDIT: ah, okay, I mostly figured out usage of this. Thanks a lot to Author, for this nice addition to engine! Trick was to use “PrintStringAdvanced” and setting the key there, which is basically position of non-scrolling row. Nice!

If you want text to not scroll (apart of using the message key), you can use the trick of a duration of 0. This prints the text only for one frame. But then you will need to print the text every frame.

Let me know when you still need help or have a feature request.

Thank you, Rumbleball, for being there, and not ignoring some novice (me) :wink: I had not much free time to play more with widget, but for now i did not really understand, how can i easily “stick it flat” to screen, to viewport?
As for features… Maybe something like these can be added, into body of “PrintStringAdvanced”? Here:



https://www.reddit.com/r/unrealengine/comments/2ysz5u/question_bp_easy_value_debuggingviewing/
Basically, manually or by giving it, adding prefix and suffix. I was using this “DebugMe” function days before I started to dig DebugWidget.

Pushed an update.

If you want the widget to be fix in front of you, add it as child to the camera of your character/pawn. You will need to position it manually. In this case you might want to set the render option “Space” to “Screen” (Section “User Interface”) in the Component. This way it will always render in front of everything)

Already update! Oh, my… You are so helpful, can not thank you enough. So, Thank You! :wink: Later at home will tweet about this Widget, there are some others UE4 fans hanging around, they might not know this yet. By the way, another thing that I have been searching recently is getting enemies stats (health, speed, etc) to HUD, to screen widget (not floating above them). Well this Widget is kinda solution to that too, I can just “Print” those values out of enemies (I already tried that with flying AI thrust values. So, Thanks again! :))
About those enemies, one thing I can not (yet) wrap my head around - how to get several separate stats, if they all are the same enemy BP (so, one “PrintString” to all of them) spawned N-times… But, this went off-topic.

You would need to describe this further. I don’t understand what you are trying to do.

Okay, I sure would like to ask, and since it is related right now to DebugWidget and PrintStringAdvanced, here we go: In game, there is one flying enemy BP, and it is spawned several instances in level. See those flying (well, semi-static for now) fighters here: https://www.youtube.com/watch?v=z8zgfR622IA
Since Blueprint is just one, PrintStringAdvanced is one for all of them (let’s say, “Health”). PrintString will print something, depending on change in value, and time period that is set. Can I distinct those flying ships one from another? Put stats in different colors, for example? I am afraid not, with such approach. Or can I? :wink:

Here is latest updated version of tandem PrintStringAdvanced - DebugWidget, in action! Top-Right corner. Shows thrust componentes of flying AI (advancing, retreat). And, I say, this is great tool, thanks for this!
(P.S.: never mind that widget on the left, that is just “normal” HUD widget experiments)

Uhm, well. I gues you want something like shown in the second screenshot of the first post. This is done with the instance specific **Debugwidget_PrintString **node. Drag of a DebugWidget instance variable and search for “print string” again. That will print only to that specific instance.

As far as I understand it you have a single BP that has multiple static meshes (or instanced static) that are spawned dynamically. In that case you would need to spawn a DebugWidgetComponent for each spawned static mesh and attach it. It would be easier to handle if one blueprint spawns multiple other blueprints.

Hello again! Some idea, but maybe I am day-dreaming on this one. Could it be possible to have PrintStringAdvanced optionally self-ticked, self-exec? Or that is a bad idea for some reason (or just impossible)? Thanks… :slight_smile:

Do you mean the node shall execute itself, without having a white execution line connected? That is not possible. An I don’t see reason for that. You want to log at a specific point, that you do by executing the node.