ue4 命令行编译 烘焙 打包 存档

首先是官方wiki的说明

How to package your game with commands

Jump to: navigation, search

Template:Rating This aims to be a quick guide on how to package and distribute your game.

Some points:

  • If you use unreferenced blueprints/objects, you should add them a) using command line or b) by creating a level with all the objects you need to publish in your game (not recomended)

  • Cooking is the proccess of removing unwanted files from your final build

  • You can choose to Pak (like zip) all your content into a single file

  • If you are building a dedicated server, you need to have the compiled version of Unreal or will not work.

  • You will find the RunUAT at UnrealEngine/Engine/Build/BatchFiles

  • Add the command -build if you're using Source Version from Github

  • If the -allmaps flag is used, [AllMaps] with valid +Map=\Game\Maps\Map.umap syntax should be added to DefaultEditor.ini

  • Specific maps can be built (must remove -allmaps flag) using the -maps=Map1+Map2+Map3

Compiling the client (With PAK files):

RunUAT BuildCookRun -project="full_project_path_and_project_name.uproject" -noP4 -platform=Win64 -clientconfig=Development -serverconfig=Development -cook -allmaps -build -stage -pak -archive -archivedirectory="Output Directory"

Cooking the client (With PAK files):

RunUAT BuildCookRun -project="full_project_path_and_project_name.uproject" -noP4 -platform=Win64 -clientconfig=Development -serverconfig=Development -cook -allmaps -NoCompile -stage -pak -archive -archivedirectory="Output Directory"

Compiling the dedicated server (With PAK files):

RunUAT BuildCookRun -project="full_project_path_and_project_name.uproject" -noP4 -platform=Win64 -clientconfig=Development -serverconfig=Development -cook -server -serverplatform=Win64 -noclient -build -stage -pak -archive -archivedirectory="Output Directory"

Cooking the dedicated server (With PAK files):

RunUAT BuildCookRun -project="full_project_path_and_project_name.uproject" -noP4 -platform=Win64 -clientconfig=Development -serverconfig=Development -cook -server -serverplatform=Win64 -noclient -NoCompile -stage -pak -archive -archivedirectory="Output Directory"

 

 

 

BuildCookRun 参数:

常用参数如下,详细参数见源文件 Engine\Source\Programs\AutomationTool\AutomationUtils\ProjectParams.cs,注意有些参数不能同时指定,具体见 ValidateAndLog 函数里的参数检查规则。Engine\Source\Programs\AutomationTool\AutomationUtils\Automation.cs 有一些全局参数定义

整体打包过程如下: Build -> Cook-> Stage -> Package -> Archive

基本设置

 

-project=Path

项目路径(必填)

-project=D:\Projects\MyProject.uproject

-project="F:/Unreal Projects/testChunk/testChunk.uproject"

-noP4(通常都带这个)

-nop4禁用Perforce功能(如果未在构建计算机上运行,则为默认值)

-targetplatform(或者-Platform)=PlatformName

目标平台,定义在枚举 UnrealTargetPlatform 中,包含 Win32/Win64/Mac/XboxOne/PS4/IOS/Android/HTML5/Linux/AllDesktop/TVOS/Switch

 

-targetplatform=Android

-pak

生成一个pak文件, 是否将资源文件打包到pak中,但是并不是说不指定这个命令行就不用pak,有些平台只能用pak(比如Android打包成apk),不管有没有这个参数,具体见各个平台对

-createreleaseversion=3.0

创建release版本3.0,版本信息用于dlc/补丁

-basedonreleaseversion=2.0

基于的版本版本信息用于dlc/补丁

-generatepatch

生成补丁(应不与createreleaseversion 一起使用。

-UTF8Output

log,控制台窗口等输出使用UTF8编码

-p4

-p4启用Perforce功能(如果在构建计算机上运行,则为默认值)

-servertargetplatform (或者-ServerPlatform)=PlatformName

Dedicated Server 目标平台,定义同上

 

 

-clean

(在构建之前擦除intermediate文件夹)重新完整构建

-signpak=keys

sign the generated pak file with the specified key, i.e.

                                       -signpak=C:\Encryption.keys. Also implies -signedpak.

-SignPak=C:\Encryption.keys 或者 -signpak=0x…..: 指定加密pak文件密钥内容或者密钥文件路径,密钥内容以 0x 开头,同时 -SignedPak 参数也生效

-signed

游戏应该使用加密的pak文件

-skippak

不生成pak,使用上一次的构建的pak文件,包含-Pak

-CrashReporter

构建CrashReporter

Build相关参数

 

-build

执行编译过程

-clientconfig=Development

客户端编译的构建配置DebugGame/Development/Shipping

-serverconfig=Development

服务器编译的构建配置DebugGame/Development/Shipping

-NoCompile

跳过编译(纯蓝图项目)

-SkipBuildClient

不编译客户端

-SkipBuildEditor

不编译编辑器

-noxge

不执行并行编译

-ForceDebugInfo

在非Debug版本中加入调试信息Forces debug info even in development builds

Cook 相关参数

 

-cook,

使用Cooked资源

-CookFlavor=

-CookFlavor=Multi/ATC/DXT/ETC1/ETC2/PVRTC/ASTC: 指定Android Cook格式

-MapsToCook=

-MapsToCook=map1+map2+map3: 指定要cook的关卡,多个之间用+号连接

-Compressed

: 压缩

-UnversionedCookedContent

不包含版本号

-SkipCookingEditorContent

 在烘焙时跳过/Engine/Editor文件夹中的内容(Skips content under /Engine/Editor when cooking)

不cook引擎编辑器使用到的资源

-CookAll

烘培content文件夹中的所有东西

-CookMapsOnly

只cook关卡和关卡引用到的资源,只会在同时指定了-CookAll时生效

-manifests

在cooking data时生成 流安装(streaming install) manifests

-createchunkinstall

在cooking data时生成流安装(streaming install)数据, 需要 -stage和-manifests

-skipcook

跳过cook阶段,使用上一次Cook好的资源,同时包含了 -Cook 参数

-CookOutputDir=path

-CookOutputDir=C:\cooked: 指定cook结果保存目录,默认在Project/Saved/Cooked(使用UAT cook)和Project/Saved/EditorCooked(使用editor cook)

-CookInEditor

使用editor进行cook而不是UAT

-ue4exe=ExecutableName

-ue4exe="D:\Program Files\Epic Games\UE_4.22\Engine\Binaries\Win64\UE4Editor-Cmd.exe"

 

指定ue4 Editor 的可执行文件路径

-IgnoreCookErrors

忽略cook 错误

-CookPartialgc

 cook阶段磁盘空间不够不要清理所有资源

-AdditionalCookerOptions

-AdditionalCookerOptions=xxx: 额外的传给cooker进程的命令行

-FastCook

开启FastCook,如果项目支持的话

-NumCookersToSpawn

指定cooker进程的数量

-iterativecooking(或者-iterate)

迭代烘培

-EncryptIniFiles:

加密ini文件,只在指定了加密密钥和使用pak文件时候有效

-EncryptEverything

加密所有的文件,只在指定了加密密钥和使用pak文件时候有效

-EncryptPakIndex

加密pak索引,只在指定了加密密钥和使用pak文件时候有效

Stage相关参数

 

-stage

保存构建过程中的中间结果

-stagingdirectory=Path

-StagingDirectory=C:\xxxx: 构建过程中中间结果保存目录,默认在ProjectPath\Saved\StagedBuilds

-skipstage

不保存构造过程中的中间结果,使用上一次的结果,这个命令行同时包含了 -Stage

-nodebuginfo

不拷贝调试信息文件到Stage目录,也就是最终打出来的包中不包含调试信息

-nocleanstage

 新构建不会清理之前StagingDirectory中的文件, 如果指定了-clean则一定会清理掉

-StageCommandline=

-StageCommandline=xxxx: 放在UE4CommandLine.txt中的一系列命令行,打出来的包在运行时会从这个文件中读取命令行并执行

Package相关参数

 

-package

执行打包  Andorid->apk, iOS->ipa

-distribution

打的包是发布版本,在Android和iOS上会禁掉Debugable属性

-prereqs

指定打包游戏是否包含先决条件的安装文件(例如支持平台上的操作系统可发布组件)

-applocaldir

指定是否在游戏可执行文件中包含先決条件。

-AdditionalPackageOptions

给平台打包器的额外参数(extra options to pass to the platform's packager)

Archive相关参数

 

-archive

将构建结果归档

-archivedirectory=Path

归档目录,默认为ProjectPath\ArchivedBuilds

-bundlename

部署到移动设备上时使用的使用的绑定名称 string to use as the bundle name when deploying to mobile device

-createappbundle

When archiving for Mac, set this to true to package it in a .app bundle instead

当目标平台是Mac时,指定这个参数可以归档成一个 .app 文件而不是一堆散文件

Run相关参数

 

-run

构建之后运行游戏

-cookonthefly

使用在服务器上提供的cook过的资源进行游戏

-Cookontheflystreaming

同上,但是不缓存资源到本地

-fileserver

使用UnrealFileServer上的cook过的资源数据

-dedicatedserver(或者-server)

构建 cook 并运行客户端和服务器

-client

build, cook and run a client and a server, uses client target configuration

-noclient

do not run the client, just run the server

-logwindow

为客户端创建log窗口

-map

指定游戏运行的关卡

-device

Devices to run the game on

-serverdevice

Device to run the server on

-skipserver

Skip starting the server

-AdditionalServerMapParams

Additional server map params, i.e ?param=value

-numclients=n

Start extra clients, n should be 2 or more

-addcmdline

Additional command line arguments for the program

-servercmdline

Additional command line arguments for the program

-clientcmdline

Override command line arguments to pass to the client

Deploy相关参数

 

-deploy

部署

-DeployFolder=

部署路径

Other

 

-destsample

Destination Sample name(目标样本名称)

-foreigndest

Foreign Destination

-foreign

Generate a foreign uproject from blankproject and use that

-foreigncode

Generate a foreign code uproject from platformergame and use that

-skipcookonthefly

在cookonthefly构建中,仅用于将信息传递给包装步骤

-unattended

assumes no operator is present, always terminates without waiting for something.

-prepak

试图避免cooking,而是从网络中提取pak文件,包含了-pak和-skipcook。

-separatedebuginfo

output debug info to a separate directory

-MapFile

generates a *.map file

-Prebuilt

this is a prebuilt cooked and packaged build

-getfile

download file from target after successful run

-IgnoreLightMapErrors

是否应将Light Map错误视为关键错误

-archivemetadata

Archive extra metadata files in addition to the build (e.g. build.properties)

存档除了构建之外的额外元数据文件(例如build.properties)

-cmdline

命令行写入 stage 文件夹中的  UE4CommandLine.txt

-nullrhi

add -nullrhi to the client commandlines

-fakeclient

adds ?fake to the server URL

-editortest

rather than running a client, run the editor instead

-RunAutomationTests

when running -editortest or a client, run all automation tests, not compatible with -server

-Crash=index

when running -editortest or a client, adds commands like debug crash, debug rendercrash, etc based on index

-deviceuser

Linux username for unattended key genereation

-devicepass

Linux password

-RunTimeoutSeconds

timeout to wait after we lunch the game

-SpecifiedArchitecture

Determine a specific Minimum OS

-UbtArgs

extra options to pass to ubt

-MapsToRebuildLightMaps

List of maps that need light maps rebuilding

-MapsToRebuildHLODMaps

List of maps that need HLOD rebuilding

-ForceMonolithic

Toggle to combined the result into one executable

-ForceNonUnity

Toggle to disable the unity build system

-ForceUnity

Toggle to force enable the unity build system

-Licensee

If set, this build is being compiled by a licensee

-NoSign

Skips signing of code/content files.

 

 

 

 

  • 2
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
UE4 Hololens打包是指使用Unreal Engine 4(UE4)开发应用程序,并将其打包为适用于Hololens设备的应用程序。为了实现这一目标,可以参考以下步骤: 1. 首先,确保你已经安装了UE4和Hololens开发所需的软件和工具。你可以参考引用\[1\]中的链接,了解如何在UE4中设置Hololens开发环境。 2. 在UE4中创建你的应用程序。你可以使用UE4的虚幻编辑器来设计和构建你的应用程序。确保你的应用程序适配Hololens设备的特性和功能。 3. 在打包之前,你可能需要在UE4中配置Hololens相机。你可以参考引用\[2\]中的链接,了解如何在UE4中设置Hololens相机。 4. 打开UE4打包设置,并选择Hololens作为目标平台。根据你的需求,选择适当的打包选项和设置。 5. 运行打包过程,等待打包完成。这可能需要一些时间,具体取决于你的应用程序的大小和复杂性。 6. 打包完成后,你将得到一个Hololens应用程序的安装包。你可以将该安装包部署到Hololens设备上进行测试和使用。 总结起来,UE4 Hololens打包是通过使用UE4开发应用程序,并将其打包为适用于Hololens设备的应用程序。你可以参考引用\[1\]和引用\[2\]中的链接,了解更多关于UE4 Hololens开发和打包的详细信息。此外,引用\[3\]中的GitHub链接提供了一套组件和功能,可以加速使用UE4开发混合现实应用程序。 #### 引用[.reference_title] - *1* *2* *3* [UE4 Hololens2代开发打包安装教程总结](https://blog.csdn.net/qq_21153225/article/details/117930690)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值