# Attention: Platform Changes Ahead!

**URL:** <https://forums.unrealengine.com/t/attention-platform-changes-ahead/126005>\
**Category:** Announcements\
**Tags:** unreal-engine\
**Created:** [May 10, 2019, 6:43pm UTC](https://forums.unrealengine.com/t/attention-platform-changes-ahead/126005 "2019-05-10T18:43:35Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fitz](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fitz/32/1078894_2.png) [@Fitz](https://forums.unrealengine.com/u/Fitz)\
**Post date:** [May 10, 2019, 6:43pm UTC](https://forums.unrealengine.com/t/attention-platform-changes-ahead/126005/1 "2019-05-10T18:43:35Z")

</div>

Platform Extensions (and how they may impact you)

## Background

Unreal has a rich history of multi-platform support. We have had various methods of separating out the platform code from the rest of the engine but even our latest method of platform separation is not “trivial” to keep platform code nicely segregated:

- Perforce permissions are incredibly complex
- There are references (not API calls) to every platform hardcoded in the engine[/li][li]Adding a new platform touches many parts of the engine
- Protecting an unreleased platform from disclosure is complicated

To this end, we are introducing **Platform Extensions**. A Platform Extension is similar to a plugin that can be “dropped in” next to the Engine to create a new platform. This means that we can avoid platform references in the Engine code, Epic samples, project files, shaders… you get the idea.

Most existing platforms will **not** be be converted to a Platform Extension. In the future, we plan to have a Stadia Platform Extension, and we are considering possibly converting Xbox and PS4 as well. Win32/64, iOS, Linux etc will remain integrated as they are today, albeit with some notable changes (below).

## Who is affected?

In order to enable Platform files to be discoverable across multiple locations, big changes have been made to UBT. Implementing Platform Extensions has also required changes in general engine code. The following is a list of developers who are very likely to be impacted:

- Developers who modify Engine code
- Platform developers (any platform)
- Developers who author/modify their project’s Build.cs and Target.cs files
- Developers modifying ini hierarchy
- Developers using the platform tables in PlatformInfo.cpp
- Rendering programmers

## When does this change take place?

These changes are checked into //UE4/Dev-Build/ and have merged to //UE4/Main/ main as of CL 6631504.

The first release branch these changes are expected to land in will be **4.23**.

## Note:

_This article covers fundamental changes to how platform files are handled throughout UE4’s codebase. Occurrences of [Platform] herein should be treated as an appropriate platform name (ie ‘Android’, ‘PS4’ or 'Windows’). For example, the Platforms/[Platform]/ folder mentioned below would be Platforms/PS4/ for the PS4 platform._

## New directory structure

The most important part of the change is how the directories are laid out. The platform extensions live in [UE4Root]/Platforms/[Platform]/… This makes provisioning Perforce permissions much easier, keeps all restricted platform code in one place and generally is much more tidy.

A project can also have [ProjectRoot]/Platforms/… , but it is optional. You may leave platform specific code and other files in their original location, but Epic projects will have their files in the new structure. (If you are distributing your project, you may want to refactor the files to keep NDAd platforms separated).

The old directory structure, whereby platform files are distributed all throughout the codebase according to the feature they implement, will remain mostly intact, except for the changes mentioned below.

## Sample Platform Extension

For a very basic example of a Platform Extension, we have created a sample platform named ‘XXX’ located in the /Platforms/XXX/ directory which shows how this new approach works in practice.

## Rules for Platform Extensions

Given these changes, the following assertions apply to all Platform Extensions:  
All files for the Platform must live inside [Engine|Project]/Platforms/[Platform]/ , including Developer modules, .Build.cs subclasses, Plugins, .inis, etc.

- PLATFORM\_[Platform] is not defined for Engine modules!
- A module must set bAllowConfidentialPlatformDefines to true in order to have it set
- Any ShaderPlatforms are defined in DataDrivenPlatformInfo.ini
- PlatformInfo objects are defined in DataDrivenPlatformInfo.ini
- The UnrealTargetPlatform for the platform is not referenced from outside the platform-specific .cs files

## Workflow Impact

### UnrealBuildTool

**Impacted Audience:** Anyone working in Build.cs and Target.cs files

**Description:** UnrealTargetPlatform was previously an enum with all platforms listed. To remove the hardcoded platform names, UnrealTargetPlatform has been changed to a class with static members named the same as the enum values. Additionally, it is a partial class, so a Platform Extension can extend the class to add a member with the platform’s name.

In general, it should act the same as enum (you can compare them, assign them, etc). However, since they are static members, they are not a constant value, so they cannot be used in a switch statement. All existing uses in the engine have been converted to if statements instead. In addition, the SupportedPlatforms attribute on a Target subclass now uses strings that match the platform name instead of the UnrealTargetPlatform.

This is likely to be the single biggest impact on you as a developer, unless you have also made engine/platform code changes.

### HAL Header Filename Standardization

**Impacted Audience:** All Platform programmers (additional notes for Windows, TVOS, PS4, XboxOne, and Android developers)

**Description:** Platform references have been removed from the Hardware Abstraction Layer (HAL) “uber” headers, such as PlatformTime.h (used below as an example). Platform-specific versions of these header files are now referenced in the following manner:

```
 #include COMPILED_PLATFORM_HEADER(PlatformTime.h)

```

The COMPILED\_PLATFORM\_HEADER macro expands to add the current being compiled as a prefix. As such, all platform header file names must be standardized to the form [Platform]PlatformTime.h

**PS4, XboxOne, and Android:**

Historically these platforms did not have the word “Platform” in their header file names (e.g. PS4Time.h), which was in contrast with other platforms. These headers and source files have been renamed in order to make them consistent with other platforms (e.g. PS4Time.h is now PS4PlatformTime.h).

Platforms which are not converted to Platform Extensions will still have these files renamed, so _developers that have made changes to affected platform files will need to make sure to move their changes over._

**Win32, Win64 and TVOS:**

Since Win32 and Win64 each share common headers, and since TVOS uses the IOS headers, we have added a mechanism to override the platform name that results when expanding the COMPILED\_PLATFORM\_HEADER macro. The override is declared in UEBuild[Platform].cs in the SetupEnvironment method by adding a new CompileEnvironment definition with:  
CompileEnvironment.Definitions.Add("OVERRIDE\_PLATFORM\_HEADER\_NAME=[SharedPlatform]”);

_Examples:_

- Win32 and Win64 override to “Windows”, so they would share “WindowsPlatformTime.h”
- TVOS overrides to “IOS”, so it would use “IOSPlatformTime.h”

### Log categories for Platforms

**Impacted Audience:** Anyone writing engine code

**Description:** Platform log statements like UE\_LOG(LogWindows, …) have used hardcoded Log categories, which were globally defined for all platforms. Now, the category is generated based on a define that is only set on that platform. This means that if you use UE\_LOG(LogWindows, …) on any other platform than Windows, it will no longer compile. This should be an easy fix

### Ini File Specification

**Impacted Audience:** Anyone who has added or will add new .ini files into the ini hierarchy.

**Description:** We have simplified the ability to search for .ini files in deep directory structures. The current implementation used a rigid list of files, which has now been replaced with a more programmatic solution we call “Ini Layers”. This concept breaks up the ini stack into discrete layers which can each be expanded according to various factors. Consider the following ini stack, which we can describe as having 5 layers:

- Engine/BaseEngine.ini
- Engine/Base[Platform]Engine.ini
- Project/DefaultEngine.ini
- Engine/[Platform]Engine.ini
- Project/[Platform]Engine.ini

The **Ini Layer** feature enables us to expand each layer of the ini stack into multiple ini files according to the permutations appropriate for that layer.

For instance, Epic uses NotForLicensees and NoRedist as directories to segregate certain confidential/secret settings into directories with reduced distribution, which increases the permutations for each of these layers.

Additionally, this new feature expands upon our existing support for Ini Platform Parents, which now allow for a chain of parents, rather than just a single platform parent.

For example, suppose you have three platforms, A, B and C which are related in a chain; Grandparent A, Parent B and Child C. Ini settings for platform A (the grandparent) should be inherited by both A and B. Likewise, platform B settings should be inherited by platform C.

Previously, we did not have a way to specify platform A, and interlacing the appropriate ini files to cause C to inherit B’s settings was a challenge. Using **Ini Layers** , this full chain is now possible and would result in an ini stack for platform C as follows:

- Engine/BaseEngine.ini
- Engine/Base[…]Engine.ini
  - Engine/Base[A]Engine.ini
  - Engine/Base[B]Engine.ini
  - Engine/Base[C]Engine.ini

- Project/DefaultEngine.ini
- Engine/[…]Engine.ini
  - Engine/[A]Engine.ini
  - Engine/[B]Engine.ini
  - Engine/[C]Engine.ini

- Project/[…]Engine.ini
  - Project/[A]Engine.ini
  - Project/[B]Engine.ini
  - Project/[C]Engine.ini

The specification of these Layers (GConfigLayers) and Expansions (GConfigLayerExpansions) is in ConfigCacheIni.cpp. See also EnumerateConfigFileLocations which defined in ConfigHierarchy.cs.

Two layers from the GConfigLayers definition are shown below. These definitions use bracketed tokens which are expanded to valid permutations when generating the ini file names.

```auto

// Project/Default*.ini
{ TEXT("ProjectDefault"), TEXT("{PROJECT}{ED}{EF}Default{TYPE}.ini"), TEXT(""), Flag_AllowCommandLineOverride | Flag_GenerateCacheKey },

// Project/Platform/Platform*.ini
{ TEXT("ProjectPlatform"), TEXT("{PROJECT}{ED}{PLATFORM}/{EF}{PLATFORM}{TYPE}.ini"), TEXT("{EXTPROJECT}/{ED}{EF}{PLATFORM}{TYPE}.ini") },

```

Valid tokens are as follows:

- {PROJECT}
  - The project directory
  - Has no permutations
  - Token ends in a ‘/’

- {ENGINE}
  - The engine directory
  - Has no permutations
  - Token ends in a ‘/’

- {TYPE}
  - The type of ini file it is
  - Expands for each ini type; Game, Input, Engine, Editor, etc

- {ED}
  - The DirectoryPrefixs defined in GConfigLayerExpansions
    - NotForLicensees, NoRedist, etc

  - Expands for each DirectoryPrefix in GConfigLayerExpansions
  - Token ends in a ‘/’

- {EF}
  - The FilePrefixs defined in GConfigLayerExpansions
    - DedicatedServer, etc

  - Expands for each FilePrefix specified in GConfigLayerExpansions

- {PLATFORM}
  - The current platform and any parent platform(s) in the IniParentChain
  - Expands once for each platform in the chain

Note that your existing .ini files will still work. This only changes the way the hierarchy is specified, enabling more files to be easily added, and adds the PlatformExtension location to the search.

### PlatformInfo structure

**Impacted Audience:** Anyone modifying the large table in PlatformInfo.cpp

**Description:** We currently specify information about every platform in PlatformInfo.cpp. This naturally needed to change to remove platform information from the engine. The settings are now discovered by looking for DataDrivenPlatformInfo.ini files in each platform’s Engine/Config/ directory.

Currently, the DataDrivenPlatformInfo.ini files are not project-extendable, as they are meant to simply describe a platform. However, in the future this may change.

### ShaderPlatforms

**Impacted Audience:** Rendering programmers

**Description:** A ShaderPlatform is used to define characteristics of rendering capabilities of a rendering API on a platform. The information about these ShaderPlatforms have always been hard-coded in C++, which need to be removed.

A ShaderPlatform can now be specified in a DataDrivenPlatformInfo.ini via the FDataDrivenShaderPlatformInfo class. This class will have more settings added to it as the rendering code adds more capabilities to check.

Currently, the existing ShaderPlatforms have not been converted to .ini-driven, so only about half of the functions named things like RHISupportsXxxxxx make use of the new system. This is a work in progress.

---

<div class="post-metadata">

**Author:** ![issam1975](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/issam1975/32/967889_2.png) [@issam1975](https://forums.unrealengine.com/u/issam1975)\
**Post date:** [September 7, 2019, 12:59am UTC](https://forums.unrealengine.com/t/attention-platform-changes-ahead/126005/2 "2019-09-07T00:59:29Z")

</div>

From the 4.23 release notes page

> [@](#):
>
> HTML5 platform support will be migrated to GitHub as a community-supported [Platform Extension](https://forums.unrealengine.com/announcements-and-releases/1617783-attention-platform-changes-ahead) and no longer officially supported by Epic in upcoming releases.

this mean that HTML5 will not be supported by Epic from now and upcomming releases ?

---

<div class="post-metadata">

**Author:** ![timg\_razer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@timg\_razer](https://forums.unrealengine.com/u/timg_razer)\
**Post date:** [September 8, 2019, 3:12pm UTC](https://forums.unrealengine.com/t/attention-platform-changes-ahead/126005/3 "2019-09-08T15:12:02Z")

</div>

The platform extension link there is bad. Where can we read more about it? Wait it’s this page…?

---

<div class="post-metadata">

**Author:** ![AE\_3DFX](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ae_3dfx/32/1194637_2.png) [@AE\_3DFX](https://forums.unrealengine.com/u/AE_3DFX)\
**Post date:** [September 9, 2019, 1:38pm UTC](https://forums.unrealengine.com/t/attention-platform-changes-ahead/126005/4 "2019-09-09T13:38:00Z")

</div>

I want to believe that EPIC one day reduces Launcher version size too so download is smaller and more optimal. Currently deselecting unneeded platforms/source in launcher still keeps so much platforms stuff. There should be possible to download only chosen platform support and even possible to get “blueprint only UE” that has no headers, pdb, help, python, .lib included.

![iwtb.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/1/1/11151159fd67e2a23040a91ceaa2c677013d10b7.jpeg)

---

<div class="post-metadata">

**Author:** ![spacegojira](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@spacegojira](https://forums.unrealengine.com/u/spacegojira)\
**Post date:** [September 9, 2019, 5:18pm UTC](https://forums.unrealengine.com/t/attention-platform-changes-ahead/126005/5 "2019-09-09T17:18:30Z")

</div>

> [@AE\_3DFX](#):
>
> and even possible to get “blueprint only UE” that has no headers, pdb, help, python, .lib included.
> 
> ![iwtb.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/1/1/11151159fd67e2a23040a91ceaa2c677013d10b7.jpeg)

That would be so great !

---

<div class="post-metadata">

**Author:** ![Troglobytes](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Troglobytes](https://forums.unrealengine.com/u/Troglobytes)\
**Post date:** [September 10, 2019, 9:38am UTC](https://forums.unrealengine.com/t/attention-platform-changes-ahead/126005/6 "2019-09-10T09:38:14Z")

</div>

Are these changes live in 4.23? I can’t find a Platforms folder in either UE4 or Project root (I’m currently porting the game on Nintendo Switch, so the platform add-on is installed).

---

<div class="post-metadata">

**Author:** ![Sean\_Maxhell](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Maxhell](https://forums.unrealengine.com/u/Sean_Maxhell)\
**Post date:** [November 29, 2019, 11:43am UTC](https://forums.unrealengine.com/t/attention-platform-changes-ahead/126005/8 "2019-11-29T11:43:27Z")

</div>

I still don’t get how I can export my UE4 project in HTML now.

---

<div class="post-metadata">

**Author:** ![Zeblote](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zeblote](https://forums.unrealengine.com/u/Zeblote)\
**Post date:** [December 2, 2019, 11:01am UTC](https://forums.unrealengine.com/t/attention-platform-changes-ahead/126005/9 "2019-12-02T11:01:38Z")

</div>

> [@Sean\_Maxhell](#):
>
> I still don’t get how I can export my UE4 project in HTML now.

Basically, you don’t. Stay on the version you have now for that project.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_ea465cab](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_ea465cab](https://forums.unrealengine.com/u/anonymous_user_ea465cab)\
**Post date:** [March 6, 2020, 3:09am UTC](https://forums.unrealengine.com/t/attention-platform-changes-ahead/126005/10 "2020-03-06T03:09:53Z")

</div>

Do we have an updated estimate for when this change will be complete? As of 4.24.1, running UAT BuildGraph to build the engine for internal team distribution with platform support (PS4 in our case) in the same way as worked perfectly in 4.22 no longer works; the engine builds successfully, but platform support isn’t working ([example](https://forums.unrealengine.com/development-discussion/playstation-4-development/1726094-binary-distribution-version-of-ue4-from-source-doesn-t-properly-include-ps4-support-files)).

The platform files are in there, just incomplete and in the wrong place.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b43a4b891](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b43a4b891](https://forums.unrealengine.com/u/anonymous_user_b43a4b891)\
**Post date:** [April 3, 2020, 5:06pm UTC](https://forums.unrealengine.com/t/attention-platform-changes-ahead/126005/11 "2020-04-03T17:06:04Z")

</div>

HTML support is ALMOST the only reason I chose to get started in Unreal Engine. Imagine the possibilities… what a bummer. Are there any updates on the questions previously posted?

---

<div class="post-metadata">

**Author:** ![TBBle](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tbble/32/996112_2.png) [@TBBle](https://forums.unrealengine.com/u/TBBle)\
**Post date:** [April 7, 2020, 5:35am UTC](https://forums.unrealengine.com/t/attention-platform-changes-ahead/126005/12 "2020-04-07T05:35:49Z")

</div>

The HTML5 Platform now lives at [GitHub - UnrealEngineHTML5/Documentation](https://github.com/UnrealEngineHTML5/Documentation) as documented (in cyan-on-brown for some reason…) on [Developing HTML5 Projects | Unreal Engine Documentation](https://docs.unrealengine.com/en-US/Platforms/HTML5/GettingStarted/index.html)

---

<div class="post-metadata">

**Author:** ![Amanda.Schade](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Amanda.Schade](https://forums.unrealengine.com/u/Amanda.Schade)\
**Post date:** [April 7, 2021, 8:08pm UTC](https://forums.unrealengine.com/t/attention-platform-changes-ahead/126005/13 "2021-04-07T20:08:52Z")

</div>



---

<div class="post-metadata">

**Author:** ![eblade](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@eblade](https://forums.unrealengine.com/u/eblade)\
**Post date:** [March 8, 2023, 8:46am UTC](https://forums.unrealengine.com/t/attention-platform-changes-ahead/126005/14 "2023-03-08T08:46:09Z")

</div>

I hate to necro resurrect an old post, but this does seem like the most appropriate place to inquire.

The document mentions the idea of having multiple platforms that are descendents of an earlier platform (A, B, C) in the INI files section, but doesn’t mention anything about that in the other sections.

If, say, you had a couple of drastically different Android devices, that required the ability to have some different code in different spaces for each, would this be a _good_ and/or _recommended_ way of doing that? Creating a couple of platforms that are descendents of Android?
