Skip to content

Project setup

What a project needs before it opens its first ArcRmlUI document. A document that only shows information (input-mode game, as in the Quick start) needs the plugin and a font; a menu that takes keys and the gamepad also needs the input setup.

Requirements

  • Unreal Engine 5.8.
  • Win64 is the only supported platform. Other platforms are not supported yet.
  • The plugins ArcRmlUI turns on with itself: UMG Viewmodel (ModelViewViewModel), Common UI Plugin and Enhanced Input; in the editor also Content Browser - File Data Source and GameplayTagsEditor.

Enable the plugin

Install ArcRmlUI to the engine: in the Epic Games Launcher, find it under Library > Fab Library and click Install to Engine. Then enable it in Edit > Plugins. It enables the plugins above with itself.

A C++ module that opens documents or defines view models lists the plugin's modules in its Build.cs: ArcRmlUIData holds FArcRmlDocumentRef, ArcRmlUI the viewport subsystem. Opening documents needs only those two. This excerpt of the samples module's Build.cs also lists the modules its view models use:

ArcRmlUISamples.Build.cs
        PublicDependencyModuleNames.AddRange(
            new string[]
            {
                "Core",
                "CoreUObject",
                "Engine",
                "ArcRmlUIData",
                "ModelViewViewModel",
                "FieldNotification"
            }
        );

        PrivateDependencyModuleNames.AddRange(
            new string[]
            {
                "ArcRmlUI",
                "UMG"
            }
        );

Where documents live

.rml and .rcss files live in the Content folder of the project or of a plugin in the project's Plugins folder that can contain content, and are named by package path: /Game/UI/Rml/Menu.rml is Content/UI/Rml/Menu.rml of the project. The guide and the samples keep them under UI/Rml/. They show in the Content Browser next to the assets.

Fonts

ArcRmlUI ships no font. A project declares its fonts in font sheets: style sheets with @font-face rules, loaded at start; their fonts serve every document. The samples' font sheet:

Fonts/Fonts.rcss
@font-face {
    font-family: 'Arc Samples Sans';
    src: /ArcRmlUISamples/UI/Rml/Fonts/AtkinsonHyperlegible-Regular.ttf;
}

In Project Settings > Game > ArcRmlUI > Fonts (Config/DefaultGame.ini, section [/Script/ArcRmlUI.ArcRmlUISettings]):

Setting ini key What it does
Font Sheets +FontSheets=/Game/UI/Rml/Fonts/Fonts.rcss One line per font sheet, by package path.
Fallback Font Family FallbackFontFamily=Arc Samples Sans The family text is drawn with when no style sets one.
Generic Font Families GenericFontFamilies=(("sans-serif", "Arc Samples Sans")) Maps a generic name such as sans-serif to a declared family.

The family in the last two rows must be one that a listed font sheet declares; a name no sheet declares has no effect. These settings take effect after an editor restart.

Layers

A document opens on a layer, a UI.Layer.* gameplay tag named by <meta name="layer">; Documents explains them. The plugin defines four tags, UI.Layer.Game, UI.Layer.GameMenu, UI.Layer.Menu and UI.Layer.Modal, listed bottom to top in that order by default. A document that names a layer missing from the order is an error; the order is Project Settings > Game > ArcRmlUI > Layers > Layer Order.

Input for menus

A document with input-mode menu or all takes keys through CommonUI:

  • Confirm is always Enter, Space or the gamepad's accept button, and presses the focused element. The click action of the CommonUI input data only supplies the key label a document shows for Confirm.
  • Back is the back action of the CommonUI input data. A Back that no handler stops closes the document.

So the project needs its own Confirm and Back actions, one project-wide mapping context and the CommonUI input data that names the two actions:

  1. Make the game use the CommonUI viewport client: in Project Settings > Engine > General Settings > Default Classes set Game Viewport Client Class to CommonGameViewportClient (GameViewportClientClassName in [/Script/Engine.Engine]).
  2. In Project Settings > Engine > Input > Default Classes set Default Player Input Class to EnhancedPlayerInput and Default Input Component Class to EnhancedInputComponent.
  3. In the Content Browser create two Input Actions (Input > Input Action), for example IA_Confirm and IA_Back.
  4. Create an Input Mapping Context (Input > Input Mapping Context). Map Enter, Space and the gamepad's bottom face button to Confirm, Esc and the gamepad's right face button to Back. These keys are also the labels a document shows for Confirm and Back.
  5. Add the context in Project Settings > Engine > Enhanced Input > Default Mapping Contexts with Add Immediately on.
  6. In Project Settings > Game > Common Input Settings turn on Enable Enhanced Input Support and restart the editor; the Blueprint's Enhanced Input fields stay hidden until then.
  7. Create a Blueprint class with the parent Common UI Input Data. Set its Enhanced Input Click Action to IA_Confirm and its Enhanced Input Back Action to IA_Back.
  8. In Common Input Settings set Input Data to that Blueprint.

A menu document whose Back action has no key logs a warning when it opens. Keep Confirm and Back out of a document's own mapping context.

The ready-made input assets come with the samples plugin, under /ArcRmlUISamples/Input/ (IA_Sample_Confirm, IA_Sample_Back, IMC_Sample_Common, BP_SampleInputData). A project without its own setup can use them instead of the steps above by adding each block below to the file in its title:

Config/DefaultEngine.ini
[/Script/Engine.Engine]
GameViewportClientClassName=/Script/CommonUI.CommonGameViewportClient
Config/DefaultGame.ini
[/Script/CommonInput.CommonInputSettings]
bEnableEnhancedInputSupport=True
InputData=/ArcRmlUISamples/Input/BP_SampleInputData.BP_SampleInputData_C
Config/DefaultInput.ini
[/Script/Engine.InputSettings]
DefaultPlayerInputClass=/Script/EnhancedInput.EnhancedPlayerInput
DefaultInputComponentClass=/Script/EnhancedInput.EnhancedInputComponent

[/Script/EnhancedInput.EnhancedInputDeveloperSettings]
+DefaultMappingContexts=(InputMappingContext="/ArcRmlUISamples/Input/IMC_Sample_Common.IMC_Sample_Common",Priority=0,bAddImmediately=True,bRegisterWithUserSettings=False)

IMC_Sample_Common maps Enter, Space and gamepad A to IA_Sample_Confirm, Esc and gamepad B to IA_Sample_Back; these lines are the ini form of steps 1, 2, 5, 6 and 8. Restart the editor after changing them. The Input and gamepad page covers navigation, hotkeys and a document's own mapping context.

Packaging

The settings are under Project Settings > Game > ArcRmlUI > Packaging.

  • The folder UI/Rml/Test/ of a content root is never packaged, whatever the settings below say, and the editor does not create a document there.
  • Package Everything on (the default): a packaged build ships every document and style sheet of every content root, compiled.
  • Package Everything off: Paths to Package lists the folders or files to ship (+PathsToPackage=/Game/UI/Rml/Menus in Config/DefaultGame.ini under [/Script/ArcRmlUI.ArcRmlUISettings]). The cook also adds the frames of what it ships (documents that show other documents, see Frames and tabs), the documents that data-action="open:<package path>" names as a literal, the documents that Blueprints and data assets reference, and the documents listed in Documents To Preload (Keep-alive and preload).
  • A Game Feature plugin lists its own paths with the action Package RML Documents (UArcRmlGameFeatureAction_PackageDocuments) of the companion plugin ArcRmlUIGameFeatures, which does not ship with this plugin (it is Plugins/ArcRmlUIGameFeatures of the Arc Lunzo Samples repository). The cook packages them when that Game Feature plugin is enabled on the platform, so they need no entry in Paths to Package. A path outside the plugin is a cook error.
  • The font sheets always ship.