Announcement

Collapse
No announcement yet.

Unreal trivia: What does the 'F' prefix on classes and structs stand for?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Unreal trivia: What does the 'F' prefix on classes and structs stand for?

    This gets asked all the time and I thought I would share the official story, as I remember wondering the same thing.

    'U' stands for UObject, 'A' stands for actor, 'T' stands for Template. Everyone gets that. But what does 'F' stand for? It's used almost everywhere else!

    The 'F' prefix actually stands for "Float" (as in Floating Point.)

    Tim Sweeney wrote the original "FVector" class along with many of the original math classes, and the 'F' prefix was useful to distinguish from math constructs that would support either integers or doubles, even before such classes were written. Much of the engine code dealt with floating point values, so the pattern spread quickly to other new engine classes at the time, then eventually became standard everywhere.

    This was in the mid-nineties sometime. Even though most of Unreal Engine has been rewritten a few times over since then, some of the original math classes still resemble their Unreal 1 counterparts, and certain idioms remain part of Epic's coding standard today.

    Just a quick and fun story about Unreal's history I thought I'd share.


    --Mike

    #2
    Nice one

    So I guess than the 'F' prefix just grew to be used as the basic prefix for structs? (FUniqueNetId has little to do with floats :P)
    Sr. Engine Programmer @ www.playspace.com - moritzwundke.com
    Remember: be polite and respect other peoples opinions - Join the Unofficial Unreal Discord Channel - Found a bug? Then use the Bug Report Form to get it fixed ^^

    Comment


      #3
      That story is so 10 months ago Mike

      https://forums.unrealengine.com/show...ll=1#post10304

      Comment


        #4
        Originally posted by Moss View Post
        Nice one

        So I guess than the 'F' prefix just grew to be used as the basic prefix for structs? (FUniqueNetId has little to do with floats :P)
        Yeah, and at this point UHT enforces it for all reflected USTRUCT() structs in order to have a consistent mapping from reflected data FName to C++ name, as we don't store the prefix character in the FName.

        Cheers,
        Michael Noland

        Comment


          #5
          Hopefully someday we won't have to require class prefixes on your own game's classes (unless you want to use them, of course!) It is kind of one of those weird Unreal things that is a bit hard for us to fix and not requested very often, so it's low on our todo list, but still bothers me.

          Comment


            #6
            Originally posted by Mike Fricker View Post
            Hopefully someday we won't have to require class prefixes on your own game's classes (unless you want to use them, of course!) It is kind of one of those weird Unreal things that is a bit hard for us to fix and not requested very often, so it's low on our todo list, but still bothers me.
            Agreed, I'd love to get rid of this limitation in game code.

            Cheers,
            Michael Noland

            Comment


              #7
              That would be cool, sometimes I prefer to prefix stuff on a project basis instead of the type itself but after working with the engine (4, 3 and 2.5 ) I kind of grew accustomed to prefix them always.
              Sr. Engine Programmer @ www.playspace.com - moritzwundke.com
              Remember: be polite and respect other peoples opinions - Join the Unofficial Unreal Discord Channel - Found a bug? Then use the Bug Report Form to get it fixed ^^

              Comment


                #8
                Oh, thanks for the story! This thing was bothering me for quite some time.

                My guess was that F stands for "Fast" to distinguish "fast" regular C++ classes from "heavy" and "slow" UObjects.

                Now I see that the truth is much more amusing.
                Realistic Atmosphere 2.0 | YouTube | Forum | Marketplace

                Comment


                  #9
                  It means native class or struct without UObject garbage collections supports.
                  My Github: https://github.com/henrya2

                  Comment


                    #10
                    Framework

                    Comment


                      #11
                      Does anyone else think that Tim Sweeney is really just Sweeney Tim the demon coder of Float street? jk jk It is cool history to look back at.

                      Comment

                      Working...
                      X