โ๏ธWorld Travel
How to portal between worlds
Last updated
How to portal between worlds
Last updated
World travel is only available between worlds on the same Base M2 Platform version.
World Travel will not work for users who only have guest access as they only have access to a single world.
World Travel is the mechanism by which clients (i.e. players or bots) move between mods. The typical use case for world travel is when we want to have two separate maps which persist at the same time and where players can connect to either map and travel between them.
Without going into too much technical depth, there are two modes of world travel - manual and automatic. Automatic world travel is usually triggered programmatically as part of client setup, whereas manual involves the user running into or interacting with an object which causes them to world travel.
Since automatic world travel is manual minus some steps, the below is a high-level example of manual world travel:
Step 1: We set up two or more servers with the same M2 build id (aka. venue group). This is a tag which tells us between which servers a client can travel. Letโs say we have Server A and Server B.
Step 2: We start a client, and they connect to Server A.
Step 3: The client interacts with an object, and an Http request is sent which returns the available worlds.
Step 4: The client selects a world to travel to, disconnects from Server A and connects to Server B.
To enable world travel in-game, you need to ensure ImprobableLiveConfig.SetOverride game WorldTravel.PortalEnabled true
in your Live Configs.
Also, in order to interact with portals, you will need to use the Interaction system, setting Interaction.UseNewInteractionSystem
to true.
You hen place a BPM_WorldTravel_Gate
in your world (or something deriving from the underlying BP class). In-game, the UI will be populated with an option for each UE4 server that is registered with the same M2BuildID as your deployment. The M2BuildID is embedded into the binary of your server.
Note: Testing in editor is limited up to the point of finalizing the connection to the target server. At this point, your connection will fail because of a server-side check that youโre connecting with a client with the exact same version. Since youโre using an editor, this wonโt be the case.
You can test the gameplay UX in editor. To do this, make sure you have setup credentials in your Sign-in Settings and are NOT using Offline mode.