# Unreal常见的问题

# EpicLauncher乱码

EpicLauncherMess

# 解决方案

关闭EpicLauncher,将"C:\Users\用户名\AppData\Local\EpicGamesLauncher\Saved\webcache"文件夹删除,重新打开EpicLauncher即可。

# Unreal控制台乱码

在编译完成时,Unreal的控制台会显示乱码,这时有两种解决方案:

  1. 设置windows全局编码,在控制面板-》时钟和区域-》区域-》管理 处,点击更改系统区域设置,勾选"使用Unicode UTF-8提供全球语言支持"。
  2. 将Visual Studio 2019的语言设置为英文,在开始菜单打开Visual Studio Installer,然后在语言包里去掉中文(简体),勾选英语,这样Visual Studio就只有英语了。

# 1603错误

在安装epic games的online services installer时出现EOS ERR 1603,解决办法是:

  • 安装.net 3.5安装包。
  • 创建目录C:\Program Files (x86)\Epic Games,然后运行[MY INSTALL LOCATION]\Epic Games\Launcher\Portal\Extras\EOS\EpicOnlineServics.msi。

# UE4使用Rider

目前抢先版官网下载地址为:rider-unreal (opens new window)

  1. 下载并安装Rider。
  2. 在Unreal中激活插件Rider Integration。
  3. 在Rider启动中激活提示的插件。

# 主要快捷键

快捷键名称 作用
shift-shift 搜索文件
alt-enter 显示当前上下文

# UE4更改缓存位置

  1. 删除原来缓存文件夹:

    C:\Users\username\AppData\Local\UnrealEngine\Common\DerivedDataCache

  2. 修改缓存文件夹路径:

    1. 找到引擎路径UE_4.25\Engine\Config路径下BaseEngine.ini。
    2. 在记事本中搜索InstalledDerivedDataBackendGraph模块,在该模块下找到"%ENGINEVERSIONAGNOSTICUSERDIR%DerivedDataCache",修改为"%GAMEDIR%DerivedDataCache"。

# UE4安装python第三方库

  1. 将ue4的python环境变量放入Path中:

    C:\Program Files\Epic Games\UE_4.26\Engine\Binaries\ThirdParty\Python3\Win64
    C:\Program Files\Epic Games\UE_4.26\Engine\Binaries\ThirdParty\Python3\Win64\Scripts

  2. 使用命令安装第三方包:

    python -m pip install package

  3. 直接在UE4中运行python脚本。

# UE4版本控制

在UE4中有SourceControl,该系统能够初始化仓库,lfs。但是需要在.gitignore中:

  1. 去掉Binaries文件夹,其他人拿到不用再编译了,在git lfs中追加该文件夹:

    git lfs track Binaries/**

  2. 添加Source文件夹,该文件夹可被单独仓库管理,不用同步到其他人那里。

# 使用windows平台特性

如果要使用Windows的相关特性,需要将头文件在一对开关中:

#include "Windows/AllowWindowsPlatformTypes.h"
#include "winbase.h"
#include "Windows/HideWindowsPlatformTypes.h"

int RequiredBufferSize = GetCurrentDirectory(0, nullptr);
// Create the buffer
TCHAR* PathIWantToFind = new TCHAR[RequiredBufferSize];
// Get the directory path
GetCurrentDirectory(RequiredBufferSize, PathIWantToFind);
UE_LOG(LogTemp, Warning, TEXT("Source Dir: %s"), PathIWantToFind);

1
2
3
4
5
6
7
8
9
10
11