Rolly Docs

Hold players until the ground has loaded

After a load, Rolly Save holds each player until the ground under its pawn has loaded, so nobody falls through a floor that has not streamed in, and tells your game when the world is ready to play.

Sheet
12 of 64
Rev
1.0.0
Updated
On this sheet

Choose when players are held

Project Settings > Plugins > Rolly Save > Holding Players > Hold Players:

Value Holds
After Loads (default) Each player whose pawn is there after a Rolly Save load, with or without a map change, part loads included, at its saved place. A player the Game Mode gives a pawn later, such as when a match starts after the load, keeps the world waiting until it has the pawn, up to Max Hold Time, and is held then
After Loads and Travel Also each player after a map change by travel; the game’s first map holds nobody
Off Nobody by itself. Hold Rolly Player still works

A player whose ground has loaded at the first check is not held, and no event fires: a hold always means a wait. On Player Held fires at a player’s first hold, On Player Released at its last, with Timed Out true when Max Hold Time ended it.

Choose how a held player is stopped

Hold Method:

Value While held
Stop Movement (default) The controller ignores move input, stacked with the game’s own Set Ignore Move Input, so a lock the game set stays after release. A character’s movement mode goes to None and back to the mode it had, such as Flying, at release; another pawn’s movement component, such as a Floating Pawn Movement, is deactivated and activated again; a root that simulates physics stops simulating and starts again. A pawn the player possesses while held, such as a vehicle or a respawned character, is stopped in turn, and the one it left moves again
Events Only Nothing stops. Bind On Player Held and On Player Released to hold players your own way

Decide what counts as loaded ground

A hold that waits for ground ends once every test passes, in this order:

  1. In a World Partition map, the cells within Hold Radius (2,000 cm) of the pawn are activated, by the engine’s own streaming query. 0 uses each grid’s loading range.
  2. With Hold Until Ground on, a trace straight down from the pawn hits an object of Ground Object Types (WorldStatic and WorldDynamic) within Ground Trace Distance (10,000 cm). The trace ignores the pawn and the actors attached to it. Add the object type of floors that use a custom channel; with no type listed nothing counts as ground, which Data Validation reports as NoGroundTypes. Outside World Partition this is the only test, so with it off nobody is held there.
  3. For a player on another machine, that machine has loaded the level of the object the trace hit.

The tests run when World Partition updates its streaming and when a level is added to the world, and outside World Partition also four times a second, so a floor your game spawns or moves ends the wait; all of it only while a hold waits for ground. Max Hold Time (15 s) ends such a hold so no player is stuck, with setup warning HoldTimedOut naming the test that failed, or that the pawn went, and also ends a load’s wait for a pawn the Game Mode gives later, so On World Ready can come up to twice Max Hold Time after a load; 0 waits without a limit. A hold without Until Ground never ends by Max Hold Time.

Start gameplay once the world is ready

On World Ready fires once a load’s On Load Finished fired, each player it held stands on loaded ground, each player the Game Mode gives a pawn later has it (or Max Hold Time passed) and its spread After Begin Play values are set (see Save streamed levels and World Partition worlds). After a failed load it fires right after On Load Finished. A load that another load or a travel replaces before then gets none. With After Loads and Travel it also fires when the last player a travel held is released, with an empty Slot Name.

Is Rolly World Ready is false from On Load Started until that load’s On World Ready, and while a player held after a travel waits; true otherwise. Until then On Load Progress reports the phase Waiting for World, from 0 to 1: the share of each held player’s cells that are activated, and of the spread values that are set.

Blueprint

In Begin Play of an actor that should start only on loaded ground, such as an AI or your own fade-in, call Wait for Rolly World Ready. Its Ready pin runs on a later tick: at once when the world is ready, otherwise at On World Ready. When a travel ends the wait without On World Ready, a node called from an object that outlives the map, such as your Game Instance, continues once the next world is ready; one whose world went ends without Ready.

C++

#include "Game/RollySaveSubsystem.h"

URollySaveSubsystem* Save = URollySaveSubsystem::Get(this);
if (Save->IsWorldReady())
{
	StartPatrol();
}
else
{
	Save->OnWorldReady.AddDynamic(this, &AMyGuard::HandleWorldReady);
}

// A UFUNCTION of AMyGuard.
void AMyGuard::HandleWorldReady(const FString& SlotName)
{
	URollySaveSubsystem::Get(this)->OnWorldReady.RemoveDynamic(this, &AMyGuard::HandleWorldReady);
	StartPatrol();
}
C++

Hold a player after your own teleport

Hold Rolly Player holds a player as a load does. Call it right after a teleport of your own: with Until Ground (on), Rolly Save releases the player once the ground under its pawn has loaded, or at Max Hold Time. Without it, the hold lasts until Release Rolly Player with the same Reason, such as for a cutscene. It returns false on a client, for a controller without a pawn, and with Until Ground when the ground has loaded already.

Holds stack by reason: releasing one keeps the others, and the player moves again once none is left. Rolly Save’s own reasons are RollySaveLoad and RollySaveTravel; a hold with Reason None holds for Game. Release Rolly Player with Reason None ends all of a player’s holds; Release Held Rolly Players ends every hold of every player and a load’s wait for players’ pawns. Is Rolly Player Held tells whether a player has any hold.

A hold ends without On Player Released when its controller goes, such as a client that leaves, and when its world goes, seamless travel included.

Blueprint

After Teleport, call Hold Rolly Player with the player’s controller. For a cutscene, untick Until Ground, set Reason to Cutscene, and call Release Rolly Player with Cutscene when it ends.

C++

Character->TeleportTo(Destination, Rotation);
URollySaveSubsystem::Get(this)->HoldPlayer(Controller, /*bUntilGround*/ true, TEXT("Teleport"));
C++

IsPlayerWaitingForGround tells whether one of a player’s holds waits for the ground.

Use your own loading screen

Rolly Save Screens’ loading overlay already waits: with Wait for World (on) it stays up until On World Ready, its bar filling its last 15 % while players are held, and after a load that keeps the map each held local player sees Loading in its corner once Held Delay passed, with Show While Held (on) (see Show when the game saves and loads). For a screen of your own:

  • Keep Stop Movement and hide your screen at On World Ready: the player cannot move until then.
  • With Events Only, show your screen in On Player Held and hide it at On Player Released or On World Ready. Show something: a player whose input works over a floor that has not loaded can fall.
  • When your screen takes over the wait itself, call Release Held Rolly Players.

Hold players in a network game

Holds run on the server or in a standalone game. With Hold Remote Players (on), Rolly Save’s holds also take clients’ pawns; each is released once its client’s machine has loaded the level of the ground below it, asked again a few times a second while it waits, and Stop Movement also makes the client’s own controller ignore move input. A client that joins while the world waits after a load, such as one back after the load’s map change, is held once it has its pawn; one that joins after On World Ready is not, so hold it yourself in the Game Mode’s Post Login once it has a pawn. Off: only the server’s own players are held, and Hold Rolly Player still holds any player you name.

On a client, Is Rolly World Ready is true, Wait for Rolly World Ready continues at once, Is Rolly Player Held is false and Hold Rolly Player does nothing: the server holds the client’s pawn.