In blueprints a text varaible will be slightly and I mean slighlty more effecient overall since its what the widget classes use. But thats just a guess.
From a code point of view, which your blueprints end up anyway, and in a network setting especially, strings are FAR more effecient.
In c++ strings would be more effecient since they are well optomized in the UE4 API.
FText is 40 bytes ~ (more than 2x size
of FString, more than 4x the size of
an FName)FString is 16 bytes ~ (2x size of
FName, 4x the size of a float/int32)FName is 8 bytes ~ (smallest! Twice
the size of a float/int32)So whenever you dont need the extra
bytes you can use FName, and you
should only use FText for visible
displayed text that actually matters
to be different, region to region,
thus requiring Localization.Your internal naming scheme in code
can be be FString or FNameAdvantage of FString is all the handy
functions in UnrealString.hFString is the easiest type to
manipulate, modify, search and
replace, concatenate, etc etc.Strings you save to hard disk or send
over the network should be FName to
minimize data storage / data transferRemember, with FName you are sending
half the bytes across the network but
you can still reconstruct into an
FString on the other side!
I’m not a staff member but a staff mebmer ddi have this to say
FNames are usually going to be an ID
for something. They’re
case-insensitive, which is probably
the most important thing to remember
about them.Asset names
Material Parameters
Tagging Actors
Skeleton bone names
FText is generally what you want to
use for anything that your users will
see, even if you aren’t planning on
localizing.Any text you show on a HUD
When your player enters their name for
a high scoreCalendar dates & times
FStrings do allow you to manipulate
the variable value, like with
reversing the string or taking a
substring.Building a URL
Creating a save file name
Hope this helps
Don’t forget to accept an answer that best clears your question up or answers it so when the community finds your question in the future via search/google they know exactly what you did to fix it/get it going.
So if your sending 1000 chars over the network of text datatype is roughly 40kb a pop
If you can do it using just strings your looking at under 16
Hope this helps
Don’t forget to accept an answer that best clears your question up or answers it so when the community finds your question in the future via search/google they know exactly what you did to fix it/get it going.