Search code examples
unreal-engine4

Project struct on unreal engine


I'm moving from unity to unreal and for week I’ve been trying to understand how to organize a project. The documentation Unity to UE4 indicates only primitive points like Update () is Tick(), Start() is BeginPlay() etc. I reviewed a bunch of videos, and read a lot of articles, but all this is either for beginners or without of context, so I still have no idea what to do. I have a few main questions that I can’t find the answer to, in general, if you explain to me I will be very grateful.

  1. How to create general managers with global access at one level, such as the ManagerMainMenu (in the Unity you need to create a singelton and add it to the scene) some articles talk about singleton, but do not recommended using it because of possible memory problems, and suggesting GameInstance.
  2. What needs to be done so that the script lives the whole game and is not deleted when the level is changed.
  3. How to save the game interface so that it also does not delete when loading another level

Solution

    1. you can open Level Blueprint to access this level. also, you can create a new C++ class which inherits the LevelScriptActor class. and reparent current Level Blueprint to him. GameInstance serves for saving variables between levels.

    2. first way, it's to store the script in the Persistence Level, while you will switching streaming levels. the second way, it's serialize your actors and restore them after. there are well ready to use solutions in the marketplace. also, you can read about Seamless Traveling with GetSeamlessTravelActorList method. it's more for multiplayer, but you can try to use it.

    3. the same way, that in 1 and 2. but your interface shouldn't keep any states between levels.