Could I get some help with getting a standalone app running?

Hi Epic guys!

I need a little help here!

I have been trying for the last two days to get a simple standalone program to work and I am getting really frustrated cause I cant get it to work. I am really lost. Could you pIease give me some advices on how to proceed?

What I need: A simple window with a viewport and a rotating cube on the screen!

I copied SlateViewer code, made some changes, so it was renamed to TestApp and got a simple Slate window up and running. Then I tried to add the Engine module to subclass the FViewportClient class so I could use a SViewport to show a cube on the screen and thats where things got complicated. So I have just been trying to add Engine module to my project. But it seems I am missing something.

I have added the Engine.h include in my TestApp.h header and have added the Engine module name to my TestApp.Build.cs file.

        PrivateDependencyModuleNames.AddRange(
            new string[] 
            { 
                "Core", 
                "Engine", 
                "Slate", 
                "StandaloneRenderer", 
                "Projects" 
            });

Have changed my file TestApp.Target.cs so it would compile against the engine

public override void SetupGlobalEnvironment(
	TargetInfo Target,
	ref LinkEnvironmentConfiguration OutLinkEnvironmentConfiguration,
	ref CPPEnvironmentConfiguration OutCPPEnvironmentConfiguration
	)
{
    UEBuildConfiguration.bCompileNetworkProfiler = false;
    UEBuildConfiguration.bBuildEditor = false;
	OutLinkEnvironmentConfiguration.bHasExports = false;
	OutLinkEnvironmentConfiguration.bBuildAdditionalConsoleApplication = false;
}

And regenerated project files with GenerateProjectFiles.bat.

My solution platform is set to Development Win64 on Configuration Manager I have only UE4 and TestApp set to build, where UE4 is set to Development_Game x64 and TestApp is set to Development_Program x64.

You can look in the log file that it is trying to compile UnrealEd.h even though I have set bBuildEditor to false.

I dont know what to do anymore. Can someone give me some light on this?
I have attached my source files and build log.

Tks.

link text

Hi Fscur,

I would recommend looking at some of the existing standalone apps under the Programs folder in Visual Studio. Getting a standalone app up and running is currently not as easy as it should be and requires various initialization and shutdown steps in the correct order.

A relatively simple example is the SlateViewer application, and a somewhat more complicated example is UnrealFrontend. Another example for iOS is LaunchDaemon. I would recommend starting by duplicating the Main() loop and Build.cs files of one of these existing apps, get it to compile and run, and then remove everything you don’t need.

We have a task scheduled for creating a standalone app template for Visual Studio that will make this easier, but that may still take a while. The main problem is that standalone apps were kind of shoehorned into the existing LaunchEngineLoop implementation, which is, at this point, a nearly intractable accumulation of all kinds of initialization and shutdown code that has accumulated over more than 15 years. We are planning to clean this up as well, but I wouldn’t hold my breath for a quick fix.

Hi Gmpreussner! Thanks for your reply.

I have done exactly that. I copied SlateViewer, copied the build files and could get an standalone Slate app running. My problem is that I was not able to include the Engine module… It seams as if it requires the editor to run… the problem is that I do not want the editor, as I want to create an editor myself. Is there a way to run the engine without the Unreal Build Tool? I mean, I dont want to make changes in the engine code. I would be satisfied by just having the dlls, and header files, so I could just include them in a normal c++ project. Is it possible? I just want to use the engine not change its code.

Anyway, the only code that I see that uses the engine module is the editor itself. There is not any other program that I could use as base to make a new one. What should I do? I think the problem is with the build and target files. How should I set them up, so I could include de Engine.h header in my PCH file?

Hi Fscur, sorry, I missed your comment here. Once you try to use the Engine (or even Editor) module, things get very complicated. Using the Engine in standalone applications cannot be recommended right now. It would be easier to create a game and/or extend the Editor.

What exactly are you trying to do?

Hi, the last comment is already one year old. Are there any new information about using the Engine in standalone applications? What happened to the mentioned standalone app template for Visual Studio?

We also would highly appreciate if the UE4 staff could publish some instructions or a tutorial about these initialization and shutdown steps mentioned in the previous comment.

Thanks

We simply didn’t have a use case for this yet, so nobody at Epic has tried to implement this. Hence there is no official documentation yet, and I can’t say if or when there will be any. There is a possibility that we may have a use case for this in the context of the Epic Games Launcher, but there are no concrete plans yet.

Hi is there any update for using the engine in a standalone application? Any documentation or links would be helpful.
Thanks.

Bump – this is also going to be my use case (building a standalone app with a UE4 window) so I’d like to know if there have been any updates here.

I am also want to do this. we have a project to use UE4 to render our building modules,。 our app is very large so must embed ue4 as a plugs. is there any way to do this?

I am also want to do this. we have a project to use UE4 to render our building modules,。 our app is very large so must embed ue4 as a plugs. is there any way to do this?

Hi,

Maybe an alternative could be to customize where we put the engine rendering view. Be able to create a Slate Window and to put the engine rendering view/viewport inside. Like that we will be able to build a standalone application based on Slate features: dockable window, resizable window, etc… such as the Editor. Today it 's possible to customize the UGameViewportClient, but it’s not possible to control the engine viewport :frowning: