Hi,
I just started thinkering with the amazing UE4, trying to getting through all the editor and the programming. I am an iOS and Android developer and I was considering using UE4 to develop part of native apps instead of resorting to plain OpenGL ES X.
For now I am focusing on iOS and then I will try to integrate everything with Android NDK.
What I need to do is to implement the following logic, for both Android and iOS:
- App launches
- Native interfaces are shown to the user
- App connects to a remote server via its own platform SDK methods
- Server replies
- If it’s ok, the Game launches, that is the UE4 “portion” of the app begins execution.
Now, researching on the topic I wasn’t able to find anything regarding how to launch the game part of the app after the app has started natively and users have taken some actions.
Looking at the UE source, I see that for iOS at least, the engine takes control of the AppDelegate (the entry point of the app), so I assume that if I wanted to override this behaviour and use the sdk libraries I’d have to rewrite quite a big part of the engine itself.
So my approach switched to leaving the app entry point to the engine and launch platform-specific methods as soon as the lifecycle of the game begins, that is:
- App launches
- UE launches, inits, sets up the environment etc
- Before the first level is presented, the native GUI is shown and the engine stays on hold
- Server replies using platform SDK methods
- UE resumes execution and presents the first level of the game
I found this amazing post on how to call a ViewController from the Engine, but the problem is that that topic refers to presenting a VC in response to a user action.
What I would need to do is to somehow “pause the engine loop” and use UIKit/Activities to manage user navigation before the game starts.
Problem is: I don’t know where should I intercept the lifecycle of the engine as a whole.
I created my GameMode class and set it as the default. I did override the BeginPlay method after calling Super::BeginPlay(). It compiles fine and I can see the iOS View, but I don’t know if I am doing it correctly or I am messing up the whole engine logic and I think that the engine is still running underneath while the display shows the iOS GUI.
After this wall of text, my questions are:
-
In order to properly show a native GUI at launch, what class and which method should I look into? Or better, is there any doc/topic where it’s possible to have an idea of how the Engine (not only Actors) lifecycle works?
-
Say I can successfully “pause/ignore/return” the engine loop how can I get back to the game from native code?
Thanks in advance and thanks for creating such a poweful thing - for free!