"The path to the asset is too long for cooking" - I'm less than 30 characters

Shown below is a bug I’m getting when trying to make a new file in the content browser that’s over 28 characters. I’m running the UE4 engine from the official binaries. The source was not compiled or modified by me.

I’m following the official UE4 tutorial series about animating and setting up a character in UE4 - - YouTube

Upon trying to make the blend space file name at 5 minutes and 51s named idle_walk_run my UE4 version says it’s too long. I’m assuming this is some type of bug.

Has anyone else encountered this issue?


Where is your project on disk, and where is UE4 installed?

Cooking will use the file-system path, which will be much longer than what you see in the content browser.

1 Like

Hmm, well my project is using the default My Documents location of - C:\Users\Administrator\Documents\Unreal Projects

So the location of that new file I’m making is this -
C:\Users\Administrator\Documents\Unreal Projects\ThirdPerson_Scratch\Content\Characters\animations

That animations directory is only 98 characters long - http://i.imgur.com/pZnWEGY.png

Still looks like a bug to me…

It does use a particularly pathological case when working out what it determines to be too long.

Are you building from source? If so, could you put a breakpoint in SAssetView::AssetVerifyRenameCommit (SAssetView.cpp) and see what it’s calculating for SubPath and PathCalcLen? (as compared against MAX_PROJECTED_COOKING_PATH).

I’m not building from source, UE4 was installed normally from the binaries from unreal.com.

You’ll need to specify those instructions a bit more as I’ve never really touched C++ or messed with break points…

Don’t worry about it if you’ve not got yourself set-up to build from source - if you had it would have saved some time, but I can try and repro it myself tomorrow.

I suspect that we can relax the limit on that slightly now, since we’ve made the cook path shorter recently (although only a handful of characters shorter).

Hi Smozius,

What version of the editor are you on currently? I have been unable to reproduce the effect you describe thus far. What are the steps you are taking that cause this specific problem. Have you been able to reproduce this in a clean project with no additional content? For instance, open a blank project and simply create a blend space named idle_walk_run, see if that gives you the same error. Thank you!

Hey ,

I’m currently on Version 4.2.1-2101290+++depot+UE4-Releases+4.2.

I’m easily able to reproduce this in a clean project with and without the starting content provided in a blank work space… So check this out -

I have UE4 installed with all default settings on my C drive. I launch the UE4 launcher, create a new project with the blank workspace template. I create a few folders, import some assets, they come in fine. I try to make a BlendSpace, it creates it fine with the default name, if I go to try and rename it, even down to 1 character, I get an error.

Example - http://i.imgur.com/PquRvCo.png

Say I create another folder and go deeper, I create a default material using the default name, it works fine. If I try to create any other object there with a custom name, boom cannot do it.

Example - http://i.imgur.com/N3kDiW3.png

The fact that I can go even deeper with folders, and that I’m able to create default objects with default names, but then not be able to rename a new object doesn’t make sense.

Something seems very wrong :frowning:

Need any more info?

Hey Jamie,

I’ve built UE4 from source before by following the tutorial. I could do it again I’m sure to try testing out what ever it is you’re thinking.

Just as a confirmation, using UE4 here from binaries too and got the same problem. You can import assets with quite long names that cannot be renamed because of path length so this is a general issue. Why is there such a limit to path length overall, and if there has to be one, just give us the option to set the max length via Editor or console variable or something, if there isn’t already? :slight_smile:

The Windows explorer API has a namespace limit of 260 characters. Unless UE4 some how switches over to a unicode system which supports a character length of 32,000, they are kinda stuck :/.

But something is definitely wrong when I can import assets with longer names than ones I make!

Hi everyone,

We actually run off of a UTF-16 format: Character Encoding in Unreal Engine | Unreal Engine 5.1 Documentation. While the character limit is expected behavior, as Jaime stated, it may be relaxed a bit in the future, but I do not have a time frame available.

Hi ,

Were you able to reproduce this issue? Is there a workaround we can use? This character limit doesn’t seem to be working as intended.

Hi Guys,

You need to move the project from its default location to a more ‘shallow path’ (e.g. c:\udk4\project1). You can do this by doing the following:

  1. Close UDK4
  2. Find the Project you’re having the problem with.
  3. Right Click and select Cut
  4. Create a folder on the hard disk (i.e. c:_udk4)
  5. Paste the project contents at the newly created folder.
  6. Double Click on the Project file in the folder (see image).

Once the project opens, go to the file that couldn’t previously be renamed and give it the name you desire.

]

It is working as intended. If you have too long of a filepath it will throw the warning that the file cannot be named in a certain way. Take the file to a more shallow file path to be able to name it as needed.

Thanks, this is a decent work around but it doesn’t answer the underlying issue with why files with long names can be imported but files created cannot be renamed to the same length.

Also there is no such thing as UDK4, it’s the Unreal Engine 4.

It maybe down to overlapping business logic in the code (e.g. The routine that executes the loading of the project might not check the file path length, but when the user attempts to rename or add a new asset, then the file paths are checked). This would be by design, and hence why it might not have been picked up by the testers.

Whenever you decide to create a project, change the Project folder from the default to a ‘shallow path’ on the hard drive, you generally wont encounter this problem. See Image below:

, I truly don’t believe it is working as intended. Users and myself are able to import files with longer names in directories just fine. However if we create a file in the editor and try and rename it, we cannot. An example of this is in the first image I’ve posted.

If you look at the file names right next to the file I’m creating, they are much longer.

Hi Smozius,

We will continue to look into this. As of yet we have not been able to reproduce this on our end. What OS are you currently using?

I am using Windows 7 Pro x64. What is the normal location for projects that you use in UE4?