Blueprints Work in Editor But Not in Packaged Game

I am running into a very interesting issue. The flow of starting the game and playing is your are first brought to the “Start Menu”. From there there are options to “Play” and “Exit”. When the player clicks “Play” it loads the starting area as a listen server.

When I run this in the editor it works fine. I click “Play” and it loads the map as a listen server. I am pretty sure it’s working because when I also play on another computer, in the editor, I can see the other game listed as a game to join.

When I package the game however, things stop working. When the player clicks “Exit” The game closes. However, when I click “Play” nothing happens. It also behaves different depending on if I am logged into Steam or not, neither way works so I won’t get caught up in the minutiae of it.

void UArenaStartMenu::SetUp(UArenaGameInstance* _GameInstance, ULocalPlayer* _PlayerOwner)
{
	GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Red, "Initiate Set Up");
	bIsLanMatch = false;
	GameInstance = _GameInstance;
	PlayerOwner = _PlayerOwner;
}

void UArenaStartMenu::HostGame(const FString& GameType)
{
	if (ensure(GameInstance.IsValid()) && GetPlayerOwner() != NULL)
	{
		GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Red, "Instance and Owner Valid");
		FString const StartURL = FString::Printf(TEXT("/Game/Levels/%s?game=%s%s%s?%s=%d"), TEXT("StagingArea"), *GameType, GameInstance->GetIsOnline() ? TEXT("?listen") : TEXT(""), bIsLanMatch ? TEXT("?bIsLanMatch") : TEXT(""), TEXT("Bots"), 0);

		GameInstance->HostGame(GetPlayerOwner(), GameType, StartURL);
	}
}

void UArenaStartMenu::HostTeamDeathMatch()
{
	HostGame(LOCTEXT("TDM", "TDM").ToString());
}

The code I am executing is 99% identical to the code used for multiplayer in the ShooterGame example

Are you getting any messages on screen? Like your “cast failed” or the ones in SetUp() and HostGame(). Does the play button disappear when you click it?

No print outs appear. So as to the UI there are two cases. The first case is when I am logged into steam: when I click play, the UI disappears for a second then reappears. The second case is when I am not logged into steam: when I click on play, a second UI appears on top of the existing UI.

When I build the game under the “Test” configuration (in visual studios). This allows me to still place break points. When I do this, no break points get hit. It’s almost as if its 100% ignoring the blueprints.

There’s this option in DefaultEditor.ini located in your project’s config folder that’s called bDontLoadBlueprintOutsideEditor. Set it to false, and see if that changes anything.

From what I can tell this problem is related to your UI. Are you using UMG and UserWidgets? What is the parent class for UArenaStartMenu. Could you maybe post your .h file?

I doubled checked and bDontLoadBlueprintOutsideEditor is set to false. The “Exit” button works on the main menu so it seems to be an issue with just the “Play”. Below is my .h

#pragma once
#include "TheArena.h"
#include "SlateBasics.h"
#include "SlateExtras.h"
#include "OnlineIdentityInterface.h"
#include "OnlineSessionInterface.h"
#include "Blueprint/UserWidget.h"
#include "ArenaStartMenu.generated.h"

UCLASS()
class UArenaStartMenu : public UUserWidget
{
	GENERATED_BODY()

public: 

	virtual ~UArenaStartMenu();

	class AArenaGameSession* GetGameSession() const;

	/** Initialize menu */
	UFUNCTION(BlueprintCallable, Category = Online)
	void SetUp(UArenaGameInstance* _GameInstance, ULocalPlayer* _PlayerOwner);

	/** Returns the player that owns the main menu. */
	ULocalPlayer* GetPlayerOwner() const;

	/** Returns the string name of the currently selected map */
	FString GetMapName() const;

	/** Hosts team deathmatch game */
	UFUNCTION(BlueprintCallable, Category = Online)
	void HostTeamDeathMatch();

	/** Hosts a game, using the passed in game type */
	UFUNCTION(BlueprintCallable, Category = Online)
	void HostGame(const FString& GameType);

protected:

	/** Owning player */
	TWeakObjectPtr<ULocalPlayer> PlayerOwner;

	/** Owning game instance */
	TWeakObjectPtr<UArenaGameInstance> GameInstance;

	/** lan game? */
	bool bIsLanMatch;

	/** Common cleanup code for any Privilege task delegate */
	void CleanupOnlinePrivilegeTask();
	
};

Here is a link to my config files:

I’m sorry but I cannot see anything wrong. The only thing I can suggest is to try and use the session frontend tool and launch the game. Hopefully the debug log can help you figure out your issue.

Here is a video of what is happening when I try running the game in both situations. Note that the “Exit” button works hinting that it is just a problem with the “Play” button:

What do you mean the “Session Frontend Tool”? Is this something in the UE4 editor?

Hi, I’m sorry for my late reply.

This is the session frontend. You can find it under Window->Developer Tools->Session Frontend in your editor. It allows you to deploy your game to various machines/devices and monitor the performance as well as to get a the output log.

p.s. The music in your video was awesome :smiley:

I actually figured it out, its pretty embarrassing. So I had source control enabled for my project and there were a bunch of changed that hadn’t been committed so it wasn’t building them when I was fixing things. Works great now!