Skip to content
Brass Orrery

Orrery Terrain · OrreryTerrain module · member function

UOrreryTerrainSubsystem::

LoadTerrainFromFile

Load a save file.

Declaration

EOrreryTerrainLoadResult LoadTerrainFromFile(const FString& Path, uint64 ExpectedFileHash = 0);
Header
#include "OrreryTerrainSubsystem.h"
Module
PublicDependencyModuleNames.Add("OrreryTerrain"); in your module’s Build.cs.
Stability
Stable: changes within a major version only add.
Thread
Every member function is game thread unless it says otherwise. (the rule of UOrreryTerrainSubsystem)

Description

Every byte is hashed and checked first, so a damaged file is refused (Corrupt). With paging on, that pass runs on a task beside the read of the file's head, its sculpt index and its other plugins' sections, and no code is kept: every sculpted tile pages its code from the file when needed, checked against its hash again (a file damaged after the load loses that code, logged; its tile keeps its coarse shape). The file is kept open while any tile pages from it (IsTerrainFileInUse). Paging off reads every byte into memory. A failed load changes nothing. Refused on a read-only terrain and inside a ground-changed broadcast.

Parameters

NameTypeDefaultMeaning
Pathconst FString&—

Absolute path of a save file.

ExpectedFileHashuint640

The save's FileHash as the game stored it; 0 skips the check. A different file is refused as Corrupt (a mismatched pair).

Returns

NotFound when the file does not exist.