Unreal
共 45 篇文章
error C4668: 没有将“_WIN32_WINNT_WIN10_”定义为预处理器宏,用“0”替换“#if/#elif”
在 UE5 中进行 C++ 编码时,Header 中引入 Windows 库的头文件如下: #include "stdafx.h" #include <stdio.h> #include <windows.h> #include <ctime> 出现以下错误: fatal error C1083: 无法打开包括文件: “stdafx.h”: No such file or directory error C4668: 没有将“_WIN32_WINNT_WIN10_TH2”定义为预处理器宏,用“0”替换“#if/#elif” error C4668: 没有将“_WIN32_WINNT_WIN1…
运行中出现 Access violation reading location 0x0000000000000000.
问题:Unhandled exception at 0x00007FF84A0059C5 (UE4Editor-XXX.dll) in UE4Editor.exe: 0xC0000005: Access violation reading location 0x0000000000000000. 错误消息表明这是一个空指针取消引用,“访问冲突读取位置 0x00000000” 意味着你正在取消引用尚未初始化的指针,因此具有垃圾值。这些垃圾值可以是任何值,但通常它恰好是 0,因此你尝试从内存地址 0x0 读取,操作系统会检测并阻止你这样做。 Linux 等操作系统将最低地址(例如前 32MB:0…
项目发布 Windows 安装包
发布 Windows 安装包及相关问题。 首先要在 VS 2019 的 Extensions 中搜索 “Microsoft Visual Studio Installer Projects” 扩展并安装,然后重启 VS2019。 1、准备 exe 执行文件。 2、VS 2019 下创建 Setup 工程(项目类型选择“安装项目”)。 创建完后,目标计算机的文件系统出现: Application Folder:存放打包文件,包括 exe, icon, dll 等; User's Desktop:安装完后,添加到开始菜单,包括 Uninstall 文件。 User's Programs Menu…
UE4 enable logs in Shipping builds
默认情况下,使用 Shipping 配置的打包游戏根本不会记录任何内容。这对安全性非常有用。但是,当您的游戏测试人员和现场玩家遇到问题时,如果没有日志,就很难进行故障排除。 UE4/UE5 在Shipping 版本中默认是不会有日志的(USE_LOGGING_IN_SHIPPING = 0),要在 Shipping build 中启用日志。 虽然交付构建的默认设置不会打印任何平台的日志,但可以定义 USE_LOGGING_IN_SHIPPING (Source/Runtime/Core/Public/Misc/Build.h)在 UBT 中启用 bUseLoggingInShipping 来…
2022-05-11 11:26 · Unreal
UE 受 git 影响的 UBT 统一构建中产生的 Build 错误或编译正确但运行异常的问题
最近 UE4 项目从 SVN 迁移到 git ,配合其他工具完成 CI/CD 的自动化过程,迁移后遇到非常奇怪的问题: 行为描述 写道 1、SVN 下工程编译且运行时正常。 2、迁移到 git 仓库后, pull 下来到本地仓库,编译且运行时正常。 3、本地 git 仓库内工程编辑代码文件,哪怕是换行符或加注释,编译正常,运行时异常,具体表现为多个地方,比如容器明明有值却突然变成空值,像被 GC 回收一样,堆栈又没有产生回收,UI 等显示也异常等。 4、回到 SVN 下打开工程修改文件,加换行或加注释,编译且运行时正常。 5、删除本地 git 仓库下的 .git 文件夹,编译且运行时正常,恢…
UE5 中使用 zip 库及对应编译 error
1、在 UE4 中使用 zip 库的时候编译遇到以下问题: if (!has_seeded) srand(GetTickCount()^(unsigned long)GetDesktopWindow()); error C4302: “类型强制转换”: 从“HWND”到“unsigned long”截断。 GetDesktopWindow() 为 HWND 类型,是一个窗口的句柄引用类型。它是一个 unsigned long int 值,表示 windows 指定当前窗口的句柄。 HWND 其他用法: //查找窗口 HWND _h = ::FindWindow(_T("xxx"), NULL…
UE4 Container
仍处于测试阶段。目前仅包含 Linux 开发镜像,无 Windows 开发镜像(由于技术和法律限制,官方无法发布 Windows 开发镜像)。所有支持像素流的 Windows 运行时镜像都支持基于 NVIDIA 和 AMD 显卡的 GPU 加速。Linux 镜像只支持 NVIDIA 显卡,对AMD 显卡的支持将在未来推出。 E4 Container 基于 TensorWorks 开源架构开发,并由 虚幻容器 社区维护。 E4 Container 的作用:增强生产管线,开发次世代云应用程序,大规模部署企业解决方案等。 UE4 Container 属于轻量级的,以容器镜像的方式存储在磁盘上,通过…
2022-02-17 11:15 · Unreal
UE4 IO Store
在 UE5 中 PAK 打包时发现了每个 PrimaryAssetLabel 都会生成 3 个文件:.pak,.utoc,.ucas。 这对 Chunkloader 测试造成了影响,在 Mount 的时候将无法正确挂载,从存储服务器下载的 .pak 需要依赖 .utoc 及 .ucas 文件,否则我们需要将 .utoc 及 .ucas 文件上传到 OSS 进行完整下载和校验。 在 “Project Settings>Packaging” 有一个选项 “ Use Io Store” 导致了 .utoc 及 .ucas 文件的生成。 该选项到底有什么作用呢,引擎提示说是 “将所有包放入一个或多个…
2021-12-23 17:33 · Unreal
UE4 CryptoPP 5.6.5 加解密
Crypto++ 5.6.5 密码与偏移量: static SecByteBlock GetKey(std::string KeyStr) { SecByteBlock key(AES::MAX_KEYLENGTH); memset(key, 0x30, key.size()); KeyStr.size() <= AES::MAX_KEYLENGTH ? memcpy(key, KeyStr.c_str(), KeyStr.size()) : memcpy(key, KeyStr.c_str(), AES::MAX_KEYLENGTH); return key; } //convert st…
2021-12-16 10:38 · Unreal
Unreal Zero Iteration
WIndows 上的零迭代(Zero Iteration)可以与 Unreal 的 VR 预览模式一起,无需 Magic Leap 设备即可快速迭代和测试代码。它将模拟 Lumin SDK API 层进行渲染,并将结果流式输出到头戴设备(有设备),或与其他帧进行计算合成(没有设备)。 零迭代必须运行才能进入 VR 模式。它有两种操作模式: 模拟器:如果没有设备,零迭代可以将图形渲染到一个窗口,该窗口是虚拟房间 3D 几何图形之上的模拟 Lightwear 图形的复合材料。头部姿势、控制输入、手势和类似的感官输入是通过 GUI 模拟的。 设备:如果有设备,零迭代可以将渲染的帧流式传输到 Lig…
2021-11-16 14:58 · Unreal
UE4 C++ 与 Blueprint 之间的中文乱码问题
解决方式: 把当前 C++ 文件改为 utf-8 格式。 在 VS 的 Extensions 中搜索 Format ,找到合适的 Plugin 并安装,然后将文件保存为 UTF8。 可以看到 BP 中的 BlueprintCallable 与 Meta 中的中文在蓝图中没有乱码了。
2021-11-16 11:27 · Unreal
ue4 game project include plugin .h header
UE4 模块编程中,如何从项目中 include 模块 header 文件或者 CPP 文件呢? 其实问题也就是如何从一个 module 包含另一个 module 的 .h 文件? 请不要尝试使用以下方式(通过为文件添加显示路径强行包含): Plugins/[PluginName]/Source/[PluginName]/Classes 和文件本身的名称 这会导致无法找到 .generated 文件。如何配置游戏项目以包含来自位于其插件目录中的插件的头文件? 解决方式: 在 YourGameName.build.cs 文件中添加以下: PublicDependencyModuleNames.…
2021-08-17 18:25 · Unreal
UE4 C++ serialization and deserialization
对以下 JSON 文件进行读写操作(序列化与反序列化)。 { "nested": { "id": "i am nested id", "name": "this is the nested name" }, "foo": "i am test foo", "bar_arr": [ { "barfoo": "i am barfoo test" } ] } 定义好反序列化的文件对象结构: USTRUCT() struct FNested { GENERATED_USTRUCT_BODY() UPROPERTY() FString id; UPROPERTY() FString name; }; …
2021-08-12 11:03 · Unreal
UE4 FString Placeholder
UE4 C++ 编码中从变量构造一个字符串,会经常用到 FString::Printf 或 FString::Format 函数。比如向服务端发送一个带有多个参数的 URL 请求。 使用 FString::Printf()及 格式说明符。如 %s 在格式化字符串中放置一个字符串,%d 在格式化字符串中放置一个整数。不同类型的变量存在不同的格式说明符。 FString Name = "TEST"; int32 ID= 122413498; FString string = FString::Printf( TEXT( "Name = %s ID = %d" ), *Name, ID ); 使用…
2021-08-11 10:43 · Unreal
UE4 SVN/P4(Perforce) commit filter
UE4 的 SVN/P4 服务器目录只需保存 Config、Content(Collection、Developer 子目录可忽略)、Plugins、Source、.uproject 即可。 【SVN】 1、打开SVN客户端-----常规设置------全局忽略样式,替换: Binaries Intermediate Saved launcher.sln .vs DerivedDataCache Collections Developers *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo __pycache__ *.rej …
2021-02-08 14:42 · Unreal
Spawning randomly around edge of a circle and not in the center.
I am trying to randomly spawn around the edge of a circle and not in the center of the circle? I am currently spawning with the following: Random X spawn 100 to -100 Random Y spawn 100 to -100 How do I eliminate the center red area from the equation? That sounds more like a square than a circle. Yo…
2019-01-18 14:29 · Unreal
change delicate server max player numbers HOW-TOs
what is the maximum number of players UE4 can handle? I am hoping to start aims to support 24 players in UE4. My client transport messages several M per seconds per client which is syn to server. another application broadcast the udp message to every client at the same rate of tramission. Someone i…
2018-10-20 15:16 · Unreal
Digital Human & Photorealistic Character
作为Epic的角色探索的一部分,Epic从 照片真实感的角色(Photorealistic Character ) 半身像开始开发数字人类,已经进行了许多渲染改进,以开发逼真可信的角色。 在开发这些角色的同时,对皮肤、眼睛、照明和次表面散射(Subsurface Scattering)进行了以下渲染改进。 使用双贝克曼双瓣法(Double Beckman Dual Lobe method)添加了一个新的镜面反射模型(Specular model )。 利用背散射(Backscatter )进行地下剖面的光传输(Light Transmission)。 使用边界出血颜色(Boundary Bl…
2018-08-19 12:11 · Unreal
Multiplayers Level Streaming How-Tos
Travelling in multoplayer Seamless and non-seamless travel seamless travel is a non-blocking operation, while non-seamless will be a blocking call. When a client executes a non-seamless travel, the client will disconnect from the server and then re-connect to the same server, which will have the ne…
2018-08-09 14:07 · Unreal
Set Camera Fade do not work on Mobile devices
when i try to use player camera to set fade in/ out on PICO (mobile VR), it seem to not working. Set Manual Camera Fade, Set Camera Fade, Stop Camera Fade support Mobile HDR. if you're targeting Mobile devices, you need Mobile HDR enabled.
2018-07-27 09:53 · Unreal