FName case sensitivity

Hi.

I noticed that the FName string behaviour differs across configurations - it is case sensitive in the editor and case insensitive in the cooked game.

It seems that this behaviour is controlled by the WITH_CASE_PRESERVING_NAME macro which turns it off for non-editor builds.

I am considering making the behaviour of the FName the same across both cooked & editor versions for consistency because I am worried that this might cause discrepancies between different builds as the FName has many uses accross the whole project (for example it is used as a key for indexing into the DataTables). Testing the level in PIE might therefore result with different outcome than testing it in the cooked game, which might cause several annoying and hard to find bugs. Having the behaviour different across the PIE & game just seems unreasonable and too risky.

Therefore, I investigated and tried disabling the WITH_CASE_PRESERVING_NAME macro in all builds which would make all FNames in editor case insensitive (this seemed more reasonable to me than doing it other way around as there will be many FName entries in our project and I wanted to avoid unnecessary memory consumption).

However, this resulted in a few errors and assertions during the editor startup, which makes sense as the layout of some structures changed. The next issue it caused is that it is now impossible to compile certain shaders (FScreenSpaceCastStandaloneRayCS, FAutoExposureReduceFinalCS, FSubsurfaceRecombinePS, FSubsurfaceIndirectDispatchCS to be exact).

I haven’t investigated any further and instead decided to ask here whether you think this is a good idea in the first place. Is it even possible to do such a change, or do some special parts of the engine/editor expect that FNames will always be case sensitive in the editor? Do you have experience with a change like this?

Steps to Reproduce
1) In NameTypes.h define WITH_CASE_PRESERVING_NAME to 0

2) Try running the editor

It is not recommended to change that setting at the editor level. I don’t think that we have tried it in a long time so you would likely end up with a long list of problems (on top of what you have already found). For clarity, the FName are case insensitive in the runtime for performance reason (CPU & RAM).

We are not aware of discrepancies between PIE and the runtime, You don’t need to be worried about it.

Regards,

Martin