MultiWorld  1.0.0
Getting Started

Getting Started

Quick start guide to use the MultiWorld plugin.

Project setup

To integrate the MultiWorld plugin into a project, a simple preliminary setup is REQUIRED. MultiWorld needs to intercept some system calls of Unreal Engine 4. This can be quickly accomplished configuring few pre-made classes (provided with the plugin) in your Project Settings:

  • override the Game Instance class: go to "Project Settings", "Project > Maps and Modes" section, search for the property "Game Instance Class" and set it to MultiWorldGameInstance.
    ProjectSettings-MultiWorldGameInstance.png
    Set MultiWorldGameInstance as new Game Instance
  • override the Game Viewport Client class: go to "Project Settings", "Engine > General Settings" section, search for the property "Game Viewport Client Class" and set it to MultiWorldGameViewportClient.
    ProjectSettings-MultiWorldGameViewportClient.png
    Set MultiWorldGameViewportClient as new Game Viewport Client

If you're already using custom overrides of the above settings, you can:

  • simply inherit your implementations from our classes (still guaranteeing the point below);
  • follow ALL the instructions in UMultiWorldOverrides to provide the needed hooks into the required UE4 system calls.

Loading a Secondary World

When the game starts, you're in the Main World. From there, you can load Secondary Worlds calling UMultiWorldStatics::LoadWorld(). Any normal UE4 level can be used as-is as a Secondary World.

Example-LoadWorld.png
Loading a Secondary World

The returned World Handle will needed later to refer to the loaded Secondary World.

Using the FMultiWorldLoadParameters parameter you can customize a number of options of the loaded Secondary World.

MultiWorldLoadParameters.png
FMultiWorldLoadParameters options

You can read more about Secondary Worlds and what happens when you load them in the Secondary Worlds section.

Switching to another World

When your Secondary Worlds are loaded, you can switch to one of them calling UMultiWorldStatics::SwitchWorld(). When called, the player will be automatically transferred to the new UWorld and will immediately start to interact with it, like having called the standard UE4 OpenLevel() method, but without loading times and without the need to destroy the origin UWorld.

Example-SwitchWorld.png
Switching to another World

You can use any valid World Handle to switch between worlds (including the Main World).

Read more about world switching in the Active World section.

Transferring an actor to another World

You can transfer a dynamic/movable Actor between different Worlds calling UMultiWorldStatics::TransferActorToWorld().

Example-TransferActorToWorld.png
Transferring and Actor to another World

Using the FMultiWorldTransferActorParameters parameter you can customize how the actor is transferred.

MultiWorldTransferActorParameters.png
FMultiWorldTransferActorParameters options

You can spawn actors as usual, or use UMultiWorldStatics::SpawnActorInWorld() to spawn a new actor in a specific World.

SpawnActorInWorld.png
SpawnActorInWorld

You can read more about spawning and transferring actors in the Actors management section.