Adding New Asset Types to UE4

Adding custom asset types is an important, yet underused feature in Unreal Engine 4. This article shows how to accomplish this task and offers some deeper insights into the various APIs.

Almost everything you interact with in Unreal Engine 4 is some type of content asset that can be created, imported, organized, viewed, and edited in the Content Browser. The Engine includes a large number of asset types out of the box. That doesn’t mean that you wouldn’t want to add your own. The asset types shipping with UE4 were designed for wide applicability, but at some point your game might benefit from introducing custom assets tailored to your project’s specific needs.

Adding new asset types requires programming and, depending on how ambitious you are, can become quite involved. The basic steps to get up and running are pretty straightforward though and always follow the same pattern. In this article I will try to convince you that this is not some black magic art mastered only by a chosen few, but a simple process that can be copied even by less seasoned programmers.

Read More

Hooking into the Windows message queue in UE4

I recently came across several community projects that try to process Windows messages by hacking the Engine’s message loop, but there is a better way. Earlier this year I added the IWindowsMessageHandler API, which does not require any Engine code changes and keeps your plug-in completely self-contained.

Some third-party hardware and software SDKs for Windows communicate with the host application via Windows messages. When trying to integrate such SDKs into Unreal Engine 4 plug-ins, access to the Windows message queue is required. There are many examples on the internet that show how to use the message queue, and it is often tempting to shoehorn such code into the Windows platform layer in UE4. However, this makes the plug-in less modular and more dependent on future Engine changes, and excludes a potentially large number of users, because not everyone is able or willing to merge Engine code changes. It also prevents the plug-in from making it into the Unreal Engine Marketplace.

Luckily, there is an Engine API that allows any plug-in to intercept and process Windows messages without requiring such modifications. This article explains how to use it and provides working sample code on Github.

Read More