Check( CurrentGWorld != PlayWorld || bIsSimulatingInEditor ) assertion failed

There are no any specific ways to reproduce this problem. But I got this error when I simulated in editor my map and switched to another in game.

Call stack

UE4Editor-UnrealEd.dll!UEditorEngine::Tick(float DeltaSeconds, bool bIdleMode)Строка 934 C++
UE4Editor-UnrealEd.dll!UUnrealEdEngine::Tick(float DeltaSeconds, bool bIdleMode)Строка 368 C++
UE4Editor.exe!FEngineLoop::Tick()Строка 2775 C++
UE4Editor.exe!GuardedMain(const wchar_t * CmdLine, HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow)Строка 148 C++
UE4Editor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow)Строка 189 C++

bIsSimulatingInEditor = false in this case and CurrentGWorld == PlayWorld

Hey -

How are you switching from one level to the other? I tried using the console command “Open [LevelName]” but did not see any crash? Also, can you provide the full callstack and log files from the crash for additional information.

Hi !
Today I got new similar assertion: check( CurrentGWorld == EditorContext.World() );

with call stack (full callstack):

UE4Editor-UnrealEd.dll!UEditorEngine::Tick()Строка 944 C++
UE4Editor-UnrealEd.dll!UUnrealEdEngine::Tick()Строка 368 C++
UE4Editor.exe!FEngineLoop::Tick()Строка 2775 C++
UE4Editor.exe!GuardedMain(const wchar_t * CmdLine, HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow)Строка 148 C++
UE4Editor.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow)Строка 189 C++

I use next code for travel from login screen: GetGameInstance()->BrowseMap(FURL(*CharacterSelectorMapName.ToString()));
Like in check(PIEInstanceID != -1) assertion failed - Programming & Scripting - Epic Developer Community Forums , but without multithreaded run.

	DeltaSeconds	2.47700930	float
	bIdleMode	false	bool
	bViewpointInVolume	true (5)	bool
	bFirstTick	false	bool

Also I can’t show most of local variables due to compiler says about “Variable was optimized and unavailable” and “Unknown error occurs”:

Where are you using the line GetGameInstance()->BrowseMap(FURL(*CharacterSelectorMapName.ToString())); Can you provide the full setup for your level travel system as well as the steps for level travel used inside the editor (are you setting up a button press to change levels, are you entering a trigger that controls the level change, etc). Please provide as detailed steps as possible to help me reproduce the issue on my end.

I provided code of BrowseMap here in this sources:
http://pastebin.com/bxiCbJCp .h http://pastebin.com/eHXfX0LU .cpp

This bug is implicit. I can’t reproduce this everytime, but I use next steps:

.1. Clicked on Play button

1.1. without Dedicated server setting and without other any settings.

1.2. Players count is 2.

.2. Use GetGameInstance()->BrowseMap(...) after some time on second (client) window.

And after this callstack falls to EditorEngine.cpp (30%-50% probability)

In fact level changed by clicking button that calls function in step 2 from C++.

LoginScreen module:

void ULoginScreen::NativeConstruct()
{
	RebuildWidget();
	LoginBtn->OnClicked.AddDynamic(this, &ULoginScreen::OnLoginClick);
}

void ULoginScreen::OnLoginClick()
{
	FString username = LoginEdit->GetText().ToString();
	FString password = PasswordEdit->GetText().ToString();
	OnLoginClicked.ExecuteIfBound(username, password);
}

LoggingIn module:

void ALoggingIn::BeginPlay()
{
	Super::BeginPlay();
	GetGameInstance()->GUIManager->Show<ULoginScreen>();
	GetGameInstance()->GUIManager->Get<ULoginScreen>()->OnLoginClicked.BindUObject(this, &ALoggingIn::OnLogin);


	if (APlayerController* PlayerController = GetWorld()->GetFirstPlayerController())
	{
		PlayerController->bShowMouseCursor = true;
		PlayerController->bEnableClickEvents = true;
		PlayerController->bEnableMouseOverEvents = true;
	}
}
void ALoggingIn::OnLogin(FString username, FString password)
{
	if (auto GameState = Cast<ASADGameState>(GetWorld()->GetGameState()))
		await(this, GameState->ServerManager->login(username, password),
			[=] (bool success, FString access_token, EAccessLevel access_level)
			{
				if (success)
					GetGameInstance()->BrowseMap(FURL(*CharacterSelectorMapName.ToString()));
			},
}

I am still not sure where BrowseMap is being called from. If possible, please provide a sample project or a copy of your project where this crash is occurring to help investigate the crash locally.

Hey ,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will follow up.

Cheers

Hey -

If you’re able to reproduce this crash, could you provide a small sample project that demonstrates the issue? Otherwise please include any information or setup steps to help me reproduce the crash locally.

Browsmap is being called at the bottom of his Onlogin function

I too am having this error happen to me while loading a map. Although it happens 100% of the time. However when I use the command load [mapname] it works fine. I am following the shooterGame template for the loading. But yet while walking through I cant see what could be causing this problem.

Hey ,

Without any leads and no idea where to go next, I decided to update my engine version which ultimately fixed the issue.

Sorry for the late reply.

Hey !
I was able to reproduce this issue in ShooterGame with the latest engine version(4.21). Please, chech this post