UE:UPL与JNI调用的最佳实践

When developing Android with UE4, it is sometimes necessary to obtain platform-related information or perform platform-related operations. In such cases, it is essential to add Java code in the codebase and call it from C++. Some requirements also necessitate receiving events from the Java side in the game, requiring handling the Java calling C++ process.

This article mainly involves the following sections:

  • Adding Java code to UE projects
  • Java function signature rules
  • Java calling C++ functions
  • C++ calling Java functions

How to utilize UE’s UPL features, Java’s signature rules, and implement JNI calls in UE will be detailed in the article.

Read more »

Hook is a mechanism that allows you to meet your requirements by intercepting and hooking into certain events. Unlike traditional low-level hooks, this article mainly introduces how to use similar hooking mechanisms in UE to achieve business needs.

Some requirements necessitate the global modification of all objects of a specific class, such as playing a uniform sound effect for a certain type of Button in the UI. If every control needs to listen to its OnClicked and then play the sound, it leads to a lot of redundant operations. So, I want to find a method that can globally listen to the click events of all UButtons and handle them collectively. Alternatively, if I want to control an attribute that is invisible in blueprints, modifying the engine’s code for simple needs seems counterproductive.

These requirements can be achieved through UE’s reflection mechanism. This article provides a simple implementation analysis.

Read more »

Typically, there are two ways for UE4 developers to obtain the UE4 engine:

  1. Install from Epic Games Launcher
  2. Clone the code from Github for local compilation

The version installed from Epic Games Launcher is the standard engine, which cannot be modified or recompiled, but you can choose platforms for installation support, debug symbols, etc. Cloning the code from Github and compiling it results in the source version of the engine, with some functionalities only available in the source version (like Standalone Application). However, if you modify the engine’s code in your project, it requires everyone to clone and compile the source again, which is very time-consuming. Additionally, the source version of the engine occupies a significant amount of disk space, reaching hundreds of gigabytes. When deploying the engine to multiple build machines, the time and space for compiling the engine become redundant. Therefore, it’s necessary to compile the engine on one machine, and the others can simply pull the compiled engine, achieving the same behavior as the installed version.

This article mainly introduces the workflow of BuildGraph and analyzes the engine’s default build script InstalledEngineBuild.xml; how to use BuildGraph to configure, compile, and export a binary engine supporting Android/iOS packaging, and how to cut down and accelerate the overall build process.

Read more »

UE工具集:我的开源项目介绍

工欲善其事必先利其器,本文主要介绍我在使用 UE 的过程中开发的一些开源的工具和插件,能够方便地在项目中使用,提高开发效率。之前简单罗列在 资源 页面里,今天做一个详细的整理,对各个工具、插件做一些介绍。

Read more »

如何构建自己的知识体系?

Learning is like rowing upstream; not to advance is to drop back. This is especially true in the field of CS, where new technologies and frameworks are developing rapidly, and the technical iteration on the business level is very fast. You may become familiar with a technology only to see it quickly become obsolete. Therefore, only by continuously engaging with, understanding, and learning new knowledge and skills can one continually expand their programming career.
This article is a reflection on the technical accumulation I’ve made over the past few years while blogging. Originally intended as a record of the notes revision, I now feel it’s appropriate to separate it into a standalone article. I rarely write reflective pieces, thinking that methodologies are too abstract, but if one has the self-discipline to turn theoretical guidance into action, methodologies are indeed necessary. I hope I can accomplish this as well.

Read more »

UE集成WWise:概念与代码分析

WWise is Audiokinetic’s cross-platform audio engine that interacts well with game engines, allowing audio designers to handle audio solely within WWise. This separates game logic from audio production and management, providing events and parameters for use in game engines, achieving decoupling with business logic and precision control over audio.

This article mainly introduces the integration of WWise with UE4, remote building, resource analysis, documentation collection, the control interaction between WWise and UE, and code analysis of generated Banks.

Read more »

UE导入图集:TexturePacker

When developing games, a large number of image resources are used, and the purpose of using texture atlases is to reduce DrawCall and improve performance. In UE, there is no packaging tool for texture atlases, and a popular solution is to use the third-party texture packing tool TexturePacker. The new version of TexturePacker supports direct export of UE4 Sprites and can be imported directly into the engine. In earlier versions, it was possible to import data via a Json Array using VaTexAtlas, but compared to the direct export of UE Sprites by TexturePacker, VaTexAtlas does not have an advantage. UE Sprites can be previewed directly, while VaTexAtlas cannot. Given that official support is already available, it is not recommended to use VaTexAtlas as a method for importing texture atlases into UE.

This article mainly focuses on documenting the analysis of TexturePacker atlas generation files, importing into UE, introducing options, and recording the issues encountered while using it in UE.

Read more »

UE开发笔记:Mac/iOS篇

The main content of this article introduces the deployment of the UE development environment on Mac, configuration of iOS remote packaging, the application of UPL on iOS (intervening in the ipa packaging process), tools and development skills, as well as analysis of related engine code, documenting some pitfalls encountered in the project. It is primarily compiled from my previous notes, and related Mac and iOS content will also be updated in this article in the future.

Read more »

UE热更新:需求分析与方案设计

Game hot updates are a way for players to obtain the latest game content without reinstalling the game. They are widely used in network games on both PC and mobile platforms, as quick adjustments, bug fixes, and content updates are often needed after a game goes live. If even the smallest change requires players to update the app through the App Store, or manually download and install it from a website, and given that different platforms have inconsistent review rules and feedback times, operations could become chaotic.

While there may be relatively mature solutions for hot updates in other engines, comprehensive discussions on implementing hot updates in UE4 are not commonly found. Fortunately, I have previously analyzed and implemented UE4’s hot update mechanism and plan to write a couple of articles to document my thoughts and implementation plans, along with a runnable demo, which I hope will be of help to those who need it.

To conveniently collect and manage common questions and solutions regarding hot updates and HotPatcher, I’ve created a new article to document and organize them: UE4 Hot Update: Questions & Answers. If you encounter issues, please check this FAQ page first.

Read more »