x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Materials are broken when loaded from a pak file

I've managed to set up a relatively basic custom map system using Steam Workshop and pak files. I have a template project with a custom plugin capable of cooking, packaging, and uploading the pak to steam, and then my game basically just trolls steamapps/common/workshop/content/ for all pak files and mounts them at Game/Content/CustomMaps/UGC using FPakPlatformFile.

This is (mostly) working. I am able to load the map up in my game and all the geometry is there. The issue is that this scene:

alt text

ends up looking like this when actually loaded into the game:

alt text

I know that the 'grass' material is found by the engine because it no longer defaults to the grey grid texture. The lens flare (?) only appeared after I turned on the forward renderer in my template project (my game uses the forward renderer). Neither the lens flare or the black material are present in the template project. I have both a skylight and a lightmass importance volume in this map.

I've now removed the skylight/importance volume and replaced the green texture with the blue texture which had appeared to work.

This is the result.

What's really interesting is that this happens seemingly randomly. If I keep loading up the map through the console, it will sometimes make the drop pod purple like in the video, sometimes it will be black like the landscape, and sometimes it will be all weirdly lit like in the picture. The landscape material NEVER works, regardless of what it is.

This is the code I'm using to load my paks:

 void UProxyWarGameInstance::MountPak(FString PakFileName) {
     UE_LOG(LogTemp, Log, TEXT("MountPak(%s)"), *PakFileName);
 
     // get mod UID
     FString PathPart, FilePart, ExtPart;
     FPaths::Split(PakFileName, PathPart, FilePart, ExtPart);
     FString PathPart2, ModUID, ExtPart2;
     FPaths::Split(PathPart, PathPart2, ModUID, ExtPart2);
     UE_LOG(LogTemp, Log, TEXT("ModUID=%s"), *ModUID);
 
     IPlatformFile& PlatformFile = FPlatformFileManager::Get().GetPlatformFile();
     FPakPlatformFile* PakPlatform = new FPakPlatformFile();
     PakPlatform->Initialize(&PlatformFile, TEXT(""));
     FPlatformFileManager::Get().SetPlatformFile(*PakPlatform);
     
     if (PakPlatform->Mount(*PakFileName, 0, *(FPaths::GameContentDir() / FString("CustomMaps/UGC") + ModUID))) {
         UE_LOG(LogTemp, Log, TEXT("Successfully mounted %s at %s"), *PakFileName, *FPaths::GameContentDir());
     }
     else {
         UE_LOG(LogTemp, Warning, TEXT("Failed to mount %s"), *PakFileName);
     }
 }

Any ideas what's going on here? I'm pretty stumped.

Product Version: UE 4.16
Tags:
greenscene.png (480.7 kB)
darkscene.png (297.1 kB)
more ▼

asked Jul 07 '17 at 04:41 PM in C++ Programming

avatar image

SlimeQ
332 10 21 38

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Okay i fixed this on my own. The issue was that rendering settings in the template project were not the same as in the actual game, so the cooked materials were loading wrong

more ▼

answered Jul 07 '17 at 06:03 PM

avatar image

SlimeQ
332 10 21 38

avatar image Rumbleball Mar 05 '18 at 08:34 PM

Thanks you very much for that. Would never have thought about the rendering settings to be the issue.

Im on the same thing for creating mods via steam workshop. You said template project, is that available for public?

avatar image SlimeQ Mar 06 '18 at 09:08 AM

I basically just made a blank blueprint project but added this plugin i made https://github.com/SlimeQ/UE4-Steamworks and another plugin containing important c++ classes and asets. It makes a toolbar for you, ignore the readme. It's technically a fork

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question