Project structure
The layout of the SDK package, the files your game ships, and how to organise your UI content.
The SDK package
The package you download from the portal is a RuntimeBuild. The engine's packaging step
(package_runtime_build) assembles it for one configuration (Debug, Dev or Shipping):
RuntimeBuild/
├── LICENSE.md The SDK licence
├── THIRD_PARTY_NOTICES.md The licences of the third-party components in the package
├── MANIFEST.md Commit, branch, configuration and build date of this package
├── bin/ Engine, V8, ICU, OpenSSL and audio-codec DLLs
│ └── resources/ snapshot_blob.bin, icudtl.dat, v8_icudtl.dat
├── lib/ Import libraries (.lib)
├── include/ Public headers
│ ├── APHTML/ The engine: APEngine.h, API/APUIView.h, Interfaces/, Script/, DOM/ ...
│ ├── APHarrlow/ Command lists and render context base classes
│ ├── DeveloperEngine/ The DevTools server
│ ├── NetworkEngine/ The network provider
│ ├── FontEngine/, Foundation/, Texture/, ThirdParty/Skribidi/include/
│ └── SDKBuildInfo.h
├── shaders/ HLSL and GLSL shader sources; Vulkan/ holds compiled SPIR-V
├── data/
│ ├── Base/Fonts/ Bundled fallback fonts, with their licences
│ ├── JavaScript/ browser_protocol.json (the DevTools protocol definition) and other script data
│ └── apdevtools/front_end/ The Chrome DevTools frontend
└── cmake/ApertureUIConfig.cmakeDebug and Dev packages also carry .pdb files in bin/; a Shipping package does not. The package
holds the engine, its headers and its data. It holds no host application and no samples.
Keep bin/, resources/ and data/ from the same package together. The V8 snapshot, the ICU
data, the DevTools frontend and the DLLs belong to one build. When you update the SDK, replace all
of them at once.
The Unreal plugin keeps its own copy of the RuntimeBuild under ThirdParty/ApertureUI. See
Requirements for what each DLL does and how to link.
Your game's directory
A shipped title that reads its UI from disk looks like this:
MyGame/
├── MyGame.exe
├── apertureuihtmlengine.dll Everything from the package's bin/ that your game needs
├── apertureuiharrlowengine.dll
├── wdtier0.dll
├── ...
├── resources/
│ ├── snapshot_blob.bin
│ ├── icudtl.dat
│ └── v8_icudtl.dat
├── data/
│ └── Base/Fonts/ Fallback fonts
├── aperture.license Signed title certificate
└── ui/ Your HTML, CSS, JavaScript, fonts and images- The DLLs and
resources/go next to the executable, or on the DLL search path. aperture.license, the title certificate, goes next to the executable. See Licensing in practice.- A development build can add
apertureuideveloperengine.dll,apertureuinetwork.dll,libssl-3-x64.dll,libcrypto-3-x64.dllanddata/apdevtools/front_end/so Chrome DevTools can attach, the 26.08.0.1 Windows package accepts connections when the host starts and ticks the server; see Requirements. Leave them out of what you give to players.
A game that packs its assets
If your game keeps content in an archive (.pak, .vresources, an asset bundle), subclass
IAPCFileSystem and read from the archive. Override GetFileData, FileExists,
DirectoryExists and EnumerateFiles, plus RequestCreateFile if scripts use localStorage. The
engine calls into your class whenever:
- A stylesheet, script, font or image is requested, whether by a tag,
@font-face,@importorurl(). localStoragewrites its data file.- The font engine looks for its bundled fonts.
Two limits of the base class apply to a subclass in this SDK version:
loadHtmlFromFilereads the document itself from disk, throughGetFileDataTrusted. That function is not virtual, so your subclass does not see the read. The engine uses the same call to read thelocalStoragedata file back, and to read the Windows system fonts it registers. The bundled fonts are found withFileExistsand then opened from disk directly, so keep them as real files (see File system).- The destructor of
IAPCFileSystemis not virtual. Own your subclass through its own type, such asstd::unique_ptr<MyArchiveFileSystem>, not through a pointer toIAPCFileSystem.
Containment is part of the base class. If you override GetFileData, enforcing the boundary
between page content and the rest of your archive is your job. File system
covers the roots, the overrides and localStorage. See
How Aperture UI differs from a browser for the
rules the stock class applies.
Resources and data
| File | Needed | Purpose |
|---|---|---|
resources/snapshot_blob.bin | Yes | V8 startup snapshot |
resources/icudtl.dat | Yes | V8's ICU data. Startup validation (validateResourcesOnInit, on by default) looks for this file and fails without it. |
resources/v8_icudtl.dat | Ship it | The same data. When it is present, ICU loads this file instead of icudtl.dat. |
data/Base/Fonts/ | For text | The bundled fallback fonts |
data/apdevtools/front_end/ | DevTools only | The Chrome DevTools frontend |
data/JavaScript/browser_protocol.json | DevTools only | The DevTools protocol definition the DevTools server reads |
Organising your UI content
Group by screen, not by file type: one HTML file, one stylesheet and one script per screen, and
a shared/ folder for what several screens use.
ui/
├── main-menu/
│ ├── index.html
│ ├── main-menu.css
│ └── main-menu.js
├── hud/
│ ├── hud.html
│ ├── hud.css
│ └── hud.js
├── inventory/
└── shared/
├── fonts/
├── images/
└── components/
└── button.cssURLs
- Use relative URLs.
href="main-menu.css"resolves against the document, andhref="../shared/components/button.css"reaches the shared folder. - A path that leaves the UI resources root, the document's folder and your trusted roots is
blocked and logged. Put shared files under the UI resources root, or call
IAPCFileSystem::AddTrustedRootfor the folder that holds them. http://andhttps://URLs need a network provider. See How Aperture UI differs from a browser.