BlueRoseNote/03-UnrealEngine/LevelScene/World Partition(世界分区).md

48 lines
2.8 KiB
Markdown
Raw Normal View History

2024-04-26 15:08:45 +08:00
---
title: World Partition(世界分区)
date: 2024-04-26 14:18:36
excerpt:
tags:
rating: ⭐
---
# 前言
文档地址: https://dev.epicgames.com/documentation/en-us/unreal-engine/world-partition-in-unreal-engine?application_version=5.3
- 知乎文章:
2024-04-27 12:19:36 +08:00
- UE5
- UE5 World Partition不完全指南:https://zhuanlan.zhihu.com/p/687020988
- UE4
- UE4旧版方案WorldComposition https://zhuanlan.zhihu.com/p/270172506
- UE4场景流送机制场景加载 https://zhuanlan.zhihu.com/p/269493281
- UE4场景流送机制LevelStreamingVolume&WorldComposition https://zhuanlan.zhihu.com/p/270172506
2024-04-26 15:08:45 +08:00
2024-04-27 12:19:36 +08:00
PS.可以使用Tools-Convert Level或者World Partition Convert Commandlet对普通关卡来进行转换。
## 调试命令
| | |
|---|---|
|**wp.Runtime.ToggleDrawRuntimeHash2D**|开关世界分区运行时哈希的2D调试显示。|
|**wp.Runtime.ToggleDrawRuntimeHash3D**|开关世界分区运行时哈希的3D调试显示。|
|**wp.Runtime.ShowRuntimeSpatialHashGridLevel**|选择在显示世界分区运行时哈希时显示的网格级别。|
|**wp.Runtime.ShowRuntimeSpatialHashGridLevelCount**|选择在显示世界分区运行时哈希时要显示多少个网格级别。|
|**wp.Runtime.ShowRuntimeSpatialHashGridIndex**|显示世界分区运行时哈希时,显示指定的网格。无效的索引将导致显示所有网格。|
|**wp.Runtime.RuntimeSpatialHashCellToSourceAngleContributionToCellImportance**|取0到1之间的值用于调节"流送源-单元网格"向量和"流送源-单元网格"向量之间的角度对单元网格重要性的贡献。该值越接近于0角度对重要性的贡献就越小。|
|**wp.Runtime.OverrideRuntimeSpatialHashLoadingRange**|设置运行时加载范围。接受以下参数:<br><br>- `-grid=[index]`:设置你想影响的运行时网格。<br>- `-range=[override_loading_range]`: 设置新的运行时加载范围|
|**wp.Runtime.MaxLoadingLevelStreamingCells**|限制并发加载的世界分区流单元的数量。|
|**wp.Runtime.HLOD 0**|使用 `wp.Runtime.HLOD` 显示没有HLOD的世界。|
# 关卡实例化
这2个选项在Actor右键菜单中ActorSelection
- **Level Instance**
- 可以将任意Actor塞进去
- 采用**OFPA**系统保存关卡信息
- **Packed Level Actor**
- 继承自Level Instance
- 将所选的Actor变为component在创建Level的同时创建一个Blueprint
- 内部Actor不再使用**OFPA**的方式同时意味着整个Packed Level Actor只会按整体流送
2024-06-13 19:01:58 +08:00
- 在Pack时只会打包场景资产类型功能性的蓝图会被排除
# 官方文档阅读笔记
## 将现有关卡转换为使用世界分区
 可以使用**工具Tools> 转换关卡Convert Level** 菜单选项或使用世界分区转换命令:
`UnrealEditor.exe 项目名称 -run=WorldPartitionConvertCommandlet Playground.umap -AllowCommandletRendering`