На данной странице описан процесс сборки обычной версии игры с типом target — Game.
О targets подробнее здесь. На текущий момент эта информация пока что не нужна.
Команда Automation Tool (UAT) для сборки игры называется BuildCookRun. Узнать параметры BuildCookRun можно с помощью флага -help:
C:\>"C:\Epic Games\UE Binary\UE_4.26\Engine\Build\BatchFiles\RunUAT.bat"BuildCookRun-helpRunningAutomationTool...Parsingcommandline:BuildCookRun-helpBuildCookRunHelp:Builds/Cooks/Runsaproject.Fornon-uprojectsprojecttargetsarediscoveredbycompilingtargetrulefilesfoundintheprojectfolder.If-mapisnotspecified,thecommandlooksforDefaultMapentryintheprojectsDefaultEngine.iniandifnotfound,inBaseEngine.ini.IfnoDefaultMapcanbefound,thecommandfallsbackto/Engine/Maps/Entry.Parameters: -project=PathProjectpath (required), i.e: -project=QAGame, -project=Samples\BlackJack\BlackJack.uproject, -project=D:\Projects\MyProject.uproject-destsampleDestinationSamplename-foreigndestForeignDestination -targetplatform=PlatformNametargetplatformforbuilding,cookinganddeployment (also -Platform) -servertargetplatform=PlatformNametargetplatformforbuilding,cookinganddeploymentofthededicatedserver (also -ServerPlatform)-foreignGenerateaforeignuprojectfromblankprojectandusethat-foreigncodeGenerateaforeigncodeuprojectfromplatformergameandusethat-CrashReportertrueifweshouldbuildcrashreporter-cook,-cookontheflyDeterminesifthebuildisgoingtousecookeddata-skipcookuseacookedbuild,butweassumethecookeddataisuptodateandwhereitbelongs,implies-cook-skipcookontheflyinacookontheflybuild,usedsolelytopassinformationtothepackagestep-cleanwipeintermediatefoldersbeforebuilding-unattendedassumesnooperatorispresent,alwaysterminateswithoutwaitingforsomething.-pakgenerateapakfile-iostoregenerateI/Ostorecontainerfile(s) -signpak=keyssignthegeneratedpakfilewiththespecifiedkey,i.e.-signpak=C:\Encryption.keys.Alsoimplies-signedpak.-prepakattempttoavoidcookingandinsteadpullpakfilesfromthenetwork,impliespakandskipcook-signedthegameshouldexpecttouseasignedpakfile.-PakAlignForMemoryMappingThegamewillbesetupformemorymappingbulkdata.-skippakuseapakfile,butassumeitisalreadybuilt,impliespak-skipiostoreoverridethe-iostorecommandlineoptiontonotrunit-stageputthisbuildinastagedirectory-skipstageusesastagedirectory,butassumeseverythingisalreadythere,implies-stage-manifestsgeneratestreaminginstallmanifestswhencookingdata-createchunkinstallgeneratestreaminginstalldatafrommanifestwhencookingdata,requires-stage&-manifests-archiveputthisbuildinanarchivedirectory-buildTrueifbuildstepshouldbeexecuted-noxgeTrueifXGEshouldNOTbeusedforbuilding-CookPartialgcwhilecookingcleanuppackagesaswearedonewiththemratherthencleaningeverythingupwhenwerunoutofspace-CookInEditorDidwecookintheeditorinsteadofinUAT-IgnoreCookErrorsIgnorescookerrorsandcontinueswithpackagingetc-nodebuginfodonotcopydebugfilestothestage-separatedebuginfooutputdebuginfotoaseparatedirectory-MapFilegeneratesa*.mapfile-nocleanstageskipcleaningthestagedirectory-runrunthegameafteritisbuilt (including server,if-server)-cookontheflyruntheclientwithcookeddataprovidedbycookontheflyserver-Cookontheflystreamingruntheclientinstreamingcookontheflymode (dont cachefileslocallyinsteadforceregetfromservereachfileload)-fileserverruntheclientwithcookeddataprovidedbyUnrealFileServer-dedicatedserverbuild,cookandrunbothaclientandaserver (also -server)-clientbuild,cookandrunaclientandaserver,usesclienttargetconfiguration-noclientdonotruntheclient,justruntheserver-logwindowcreatealogwindowfortheclient-packagepackagetheprojectforthetargetplatform-skippackageSkipspackagingtheprojectforthetargetplatform-distributionpackagefordistributiontheproject-prereqsstageprerequisitesalongwiththeproject-applocaldirlocationofprerequisitesforapplocaldeployment-Prebuiltthisisaprebuiltcookedandpackagedbuild-AdditionalPackageOptionsextraoptionstopasstotheplatform's packager -deploy deploy the project for the target platform -getfile download file from target after successful run -IgnoreLightMapErrors Whether Light Map errors should be treated as critical -stagingdirectory=Path Directory to copy the builds to, i.e. -stagingdirectory=C:\Stage -ue4exe=ExecutableName Name of the UE4 Editor executable, i.e. -ue4exe=UE4Editor.exe -archivedirectory=Path Directory to archive the builds to, i.e. -archivedirectory=C:\Archive -archivemetadata Archive extra metadata files in addition to the build (e.g. build.properties) -createappbundle When archiving for Mac, set this to true to package it in a .app bundle instead of normal loose files -iterativecooking Uses the iterative cooking, command line: -iterativecooking or -iterate -CookMapsOnly Cook only maps this only affects usage of -cookall the flag -CookAll Cook all the things in the content directory for this project -SkipCookingEditorContent Skips content under /Engine/Editor when cooking -FastCook Uses fast cook path if supported by target -cmdline command line to put into the stage in UE4CommandLine.txt -bundlename string to use as the bundle name when deploying to mobile device -map map to run the game with -AdditionalServerMapParams Additional server map params, i.e ?param=value -device Devices to run the game on -serverdevice Device to run the server on -skipserver Skip starting the server -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 -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 -ForceDebugInfo Forces debug info even in development builds -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.AutomationTool exiting with ExitCode=0 (Success)
Основные параметры BuildCookRun для сборки игры
Параметр
Описание
project
путь до файла .uproject
platform
платформа (Win64, Linux, Mac, Android, ...)
configuration
конфигурация (Development, Debug, Shipping)
archivedirectory
директория архивации (в ней окажется финальный билд)
stagingdirectory
директория для stage фазы
build
компиляция проекта, на данной стадии создается исполняемый файл
cook
подготовка контента под целевую платформу
stage
указываем флаг, если нужно переносить файлы в отдельную директорию стейджинга (stagingdirectory)
package
упаковка под платформу (под Windows для C++ проектов данная команда делает НИЧЕГО, для блюпринт проектов добавляет ico файл для exe файла. Основную работу данная команда делает при сборке под IOS, Android и других специфичных платформ)
archive
архивирование — перенос финальной сборки в директорию archivedirectory
Данную команду можно вызвать как из командной строки, так и создать специальный .bat файл package_game.bat и поместить в файл код, который находится выше.
Все пути рекомендую обрамлять в кавычки " ". Иначе пути будут обрезаться по первому пробелу.
символ ^ позволяет переносить строчку в .bat файлах.