[Solved-ish] Black vieport in Datasmith imported map after pressing play

Hopedully saves someone some frustration - using UE4 4.21.1 if you start with the MultiUserViewer template map (everythign working fine so far), create a new map and import a Datasmith export everything will seem fine until you hit Play… then everything will be black. It wont matter your lighting setup or if you built lights or anything - totally black viewport and no error messages.You can press F2 and see that everything is there and you can walk around, but switch back to Lit viewport and its totally black.

The quick fix is to go into Edit->Project Settings->Maps and Modes and change Game Instance Class to Game Instance instead of BP_MultiUserGameInstance
I have not looked yet at what needs to be set to allow using BP_MultiUserGameInstance on user created maps. All the other things like pawn and player controller work with custom maps, just not the provided game instance. This quick fix will probably break multi user for your custom map and AFAIK there is no way to do something like have a map set the game isntance in on begin play or anything like that (there is no SetGameInstance node in BP and the C++ method UWorld::SetGameInstance looks kind of shady to me - is it something that can be safely used at runtime?)

I’ll post a more “correct” fix when I get a minute - but this at least gets things basically working :slight_smile:

isn’t simply a matter of exposure and post process volume settings?

It could be I haven’t checked yet. It was just one of the banging my head things when going from the starter level to a new level just wouldn’t work. Going to my early “the first person starter level but archviz” example, with the first person starter thing you can just make a new level and it just works without any additional steps - it didn’t occur to me that there would be some kind of dependency between the level and game instance that prevents other levels from just working so I spent like an hour takign my lights out, putting them back in baking lighting and going ARGH wth and googling “Black Scene in UE4” and “Black Scene Datasmith Import” but all I could find were “my textures are all black” and that was a dead end because this was a 100% black viewport - but only in play mode, not edit mode. Once I get a chance to look at what needs to actually be done to leave the BP_MultiUserGameInstance - like what needs to be set up in a new level before use, I’ll post a step by step thing - for now, though, it works fine for just getting the level playable by changing the Game Instance in the Project Settings.

Like if you create a new game - choose first person template. Make a new Default level with the skybox and plane. Hit play. Nice you can run around the plane.
If you choose the muti user arch viz template to start. Make a new Default level with skybox and plane. Hit play. Black void :frowning:

So just the extra steps need to be documented I think :slight_smile:

Ok so BP_MultiUser_GameInstance actually has a comment in it about why it doesn’t work, it sounds like something that could be done automatically in future versions (or I recommend at least well document to avoid lots of frustrated new users who would never think to look the Game Instance class to solve a black screen issue)

Using BP_MultiUser_GameInstance and copying the Level Blueprint from MultiUserView_p into my new level (minus the streaming level parts) fixes the black screen at startup problem - BUT its causing a pawn mesh to spawn at the player start position with Player Name written above it (and its not the player that you control). I’m not sure whats up here - the code to spawn the player only seems to bet getting called once and there is only one player start position in the level

EDIT alright I think? I fixed this issue by setting the default pawn to None in the project settings in Game Mode

what solved this issue? it’s happening for me in all blueprints. I don’t have a BP_MultiUser_GameInstance, and I don’t have a post process volume, nothing fixes this issue. if I add a post process volume i have to crank exposure compensation to the max in order to see anything, and it’s still kinda dark.

this shouldn’t happen. what can I do?