Mais conteúdo relacionado Semelhante a 「Press Button, Drink Coffee」 UE4における ビルドパイプラインとメンテナンスの全体像 (20) Mais de エピック・ゲームズ・ジャパン Epic Games Japan (20) 「Press Button, Drink Coffee」 UE4における ビルドパイプラインとメンテナンスの全体像2. #UE4 | @UNREALENGINE
自己紹介
Axel Riffard アクセル リファール
Epic Games Japan / Support Engineer
● Twitter : @AxRiff
● 趣味はPerfume、ベイスターズ、ウイスキー
● 今プレイしてるゲーム: Control (Remedy大好き)
9. #UE4 | @UNREALENGINE
● 更新したら、ローカルでエラーが出ていてビルド出来ない
● そのエラーを解決しようとしたら、遡りづらい
● 喧嘩したり、チーム内のコミュニケーションが複雑になる
● コミットすることでビルドを壊すかどうか不安になる
● ゲームのビルドを作ろうとしたら、時間かかって、その間は仕事できない
どうしてこんな恐ろしいことが起きるのか
26. #UE4 | @UNREALENGINE
ビルドマシン - MacOS
Macでコンパイルの分散が出来ないので、
シェーダーのコンパイルを考えると、
できるだけCPUのコアを多く。そろそろ発売するMacプロがいいかもしれない。
予算があまりなければ、個人的には6コアのMacミニで行けると思います。
37. #UE4 | @UNREALENGINE
BuildGraph
<Agent Name="Default Agent" Type="CompileWin64">
<!-- Update the engine version files -->
<Node Name="Update Version Files">
<SetVersion Change="$(Change)" Branch="$(EscapedBranch)" Licensee="$(Licensee)" If="$(Versioned)"/>
</Node>
<!-- Compile the tool executables -->
<Node Name="Compile Tools Win64" Requires="Update Version Files" Produces="#ToolBinaries">
<Compile Target="UnrealHeaderTool" Platform="Win64" Configuration="Development" Tag="#ToolBinaries"/>
</Node>
<!-- Compile the editor executable -->
<Node Name="Compile $(EditorTarget) Win64" Requires="Compile Tools Win64" Produces="#EditorBinaries">
<Compile Target="$(EditorTarget)" Platform="Win64" Configuration="Development" Tag="#EditorBinaries"/>
</Node>
<!-- Compile the game targets -->
<Property Name="GameBinaries" Value=""/>
<ForEach Name="GameTarget" Values="$(GameTargets)">
<ForEach Name="TargetPlatform" Values="$(TargetPlatforms)">
<Node Name="Compile $(GameTarget) $(TargetPlatform)" Requires="Compile Tools Win64" Produces="#GameBinaries_$(GameTarget)_$(TargetPlatform)">
<Compile Target="$(GameTarget)" Platform="$(TargetPlatform)" Configuration="Development" Tag="#GameBinaries_$(GameTarget)_$(TargetPlatform)"/>
</Node>
<Property Name="GameBinaries" Value="$(GameBinaries)#GameBinaries_$(GameTarget)_$(TargetPlatform);"/>
</ForEach>
</ForEach>
</Agent>
38. #UE4 | @UNREALENGINE
BuildGraph
<Agent Name="Default Agent" Type="CompileWin64">
<!-- Update the engine version files -->
<Node Name="Update Version Files">
<SetVersion Change="$(Change)" Branch="$(EscapedBranch)" Licensee="$(Licensee)" If="$(Versioned)"/>
</Node>
<!-- Compile the tool executables -->
<Node Name="Compile Tools Win64" Requires="Update Version Files" Produces="#ToolBinaries">
<Compile Target="UnrealHeaderTool" Platform="Win64" Configuration="Development" Tag="#ToolBinaries"/>
</Node>
<!-- Compile the editor executable -->
<Node Name="Compile $(EditorTarget) Win64" Requires="Compile Tools Win64" Produces="#EditorBinaries">
<Compile Target="$(EditorTarget)" Platform="Win64" Configuration="Development" Tag="#EditorBinaries"/>
</Node>
<!-- Compile the game targets -->
<Property Name="GameBinaries" Value=""/>
<ForEach Name="GameTarget" Values="$(GameTargets)">
<ForEach Name="TargetPlatform" Values="$(TargetPlatforms)">
<Node Name="Compile $(GameTarget) $(TargetPlatform)" Requires="Compile Tools Win64"
Produces="#GameBinaries_$(GameTarget)_$(TargetPlatform)">
<Compile Target="$(GameTarget)" Platform="$(TargetPlatform)"
Configuration="Development" Tag="#GameBinaries_$(GameTarget)_$(TargetPlatform)"/>
</Node>
<Property Name="GameBinaries" Value="$(GameBinaries)#GameBinaries_$(GameTarget)_$(TargetPlatform);"/>
</ForEach>
</ForEach>
</Agent>
<Agent Name="Default Agent" Type="CompileWin64">
39. #UE4 | @UNREALENGINE
BuildGraph
<Agent Name="Default Agent" Type="CompileWin64">
<!-- Update the engine version files -->
<Node Name="Update Version Files">
<SetVersion Change="$(Change)" Branch="$(EscapedBranch)" Licensee="$(Licensee)" If="$(Versioned)"/>
</Node>
<!-- Compile the tool executables -->
<Node Name="Compile Tools Win64" Requires="Update Version Files" Produces="#ToolBinaries">
<Compile Target="UnrealHeaderTool" Platform="Win64" Configuration="Development" Tag="#ToolBinaries"/>
</Node>
<!-- Compile the editor executable -->
<Node Name="Compile $(EditorTarget) Win64" Requires="Compile Tools Win64" Produces="#EditorBinaries">
<Compile Target="$(EditorTarget)" Platform="Win64" Configuration="Development" Tag="#EditorBinaries"/>
</Node>
<!-- Compile the game targets -->
<Property Name="GameBinaries" Value=""/>
<ForEach Name="GameTarget" Values="$(GameTargets)">
<ForEach Name="TargetPlatform" Values="$(TargetPlatforms)">
<Node Name="Compile $(GameTarget) $(TargetPlatform)" Requires="Compile Tools Win64"
Produces="#GameBinaries_$(GameTarget)_$(TargetPlatform)">
<Compile Target="$(GameTarget)" Platform="$(TargetPlatform)"
Configuration="Development" Tag="#GameBinaries_$(GameTarget)_$(TargetPlatform)"/>
</Node>
<Property Name="GameBinaries" Value="$(GameBinaries)#GameBinaries_$(GameTarget)_$(TargetPlatform);"/>
</ForEach>
</ForEach>
</Agent>
<!-- Update the engine version files -->
<Node Name="Update Version Files">
<SetVersion Change="$(Change)" Branch="$(EscapedBranch)"
Licensee="$(Licensee)" If="$(Versioned)"/>
</Node>
40. #UE4 | @UNREALENGINE
BuildGraph
<Agent Name="Default Agent" Type="CompileWin64">
<!-- Update the engine version files -->
<Node Name="Update Version Files">
<SetVersion Change="$(Change)" Branch="$(EscapedBranch)" Licensee="$(Licensee)" If="$(Versioned)"/>
</Node>
<!-- Compile the tool executables -->
<Node Name="Compile Tools Win64" Requires="Update Version Files" Produces="#ToolBinaries">
<Compile Target="UnrealHeaderTool" Platform="Win64" Configuration="Development" Tag="#ToolBinaries"/>
</Node>
<!-- Compile the editor executable -->
<Node Name="Compile $(EditorTarget) Win64" Requires="Compile Tools Win64" Produces="#EditorBinaries">
<Compile Target="$(EditorTarget)" Platform="Win64" Configuration="Development" Tag="#EditorBinaries"/>
</Node>
<!-- Compile the game targets -->
<Property Name="GameBinaries" Value=""/>
<ForEach Name="GameTarget" Values="$(GameTargets)">
<ForEach Name="TargetPlatform" Values="$(TargetPlatforms)">
<Node Name="Compile $(GameTarget) $(TargetPlatform)" Requires="Compile Tools Win64"
Produces="#GameBinaries_$(GameTarget)_$(TargetPlatform)">
<Compile Target="$(GameTarget)" Platform="$(TargetPlatform)"
Configuration="Development" Tag="#GameBinaries_$(GameTarget)_$(TargetPlatform)"/>
</Node>
<Property Name="GameBinaries" Value="$(GameBinaries)#GameBinaries_$(GameTarget)_$(TargetPlatform);"/>
</ForEach>
</ForEach>
</Agent>
<!-- Compile the tool executables -->
<Node Name="Compile Tools Win64" Requires="Update Version Files"
Produces="#ToolBinaries">
<Compile Target="UnrealHeaderTool" Platform="Win64"
Configuration="Development" Tag="#ToolBinaries"/>
</Node>
41. #UE4 | @UNREALENGINE
BuildGraph
<Agent Name="Default Agent" Type="CompileWin64">
<!-- Update the engine version files -->
<Node Name="Update Version Files">
<SetVersion Change="$(Change)" Branch="$(EscapedBranch)" Licensee="$(Licensee)" If="$(Versioned)"/>
</Node>
<!-- Compile the tool executables -->
<Node Name="Compile Tools Win64" Requires="Update Version Files" Produces="#ToolBinaries">
<Compile Target="UnrealHeaderTool" Platform="Win64" Configuration="Development" Tag="#ToolBinaries"/>
</Node>
<!-- Compile the editor executable -->
<Node Name="Compile $(EditorTarget) Win64" Requires="Compile Tools Win64" Produces="#EditorBinaries">
<Compile Target="$(EditorTarget)" Platform="Win64" Configuration="Development" Tag="#EditorBinaries"/>
</Node>
<!-- Compile the game targets -->
<Property Name="GameBinaries" Value=""/>
<ForEach Name="GameTarget" Values="$(GameTargets)">
<ForEach Name="TargetPlatform" Values="$(TargetPlatforms)">
<Node Name="Compile $(GameTarget) $(TargetPlatform)" Requires="Compile Tools Win64"
Produces="#GameBinaries_$(GameTarget)_$(TargetPlatform)">
<Compile Target="$(GameTarget)" Platform="$(TargetPlatform)"
Configuration="Development" Tag="#GameBinaries_$(GameTarget)_$(TargetPlatform)"/>
</Node>
<Property Name="GameBinaries" Value="$(GameBinaries)#GameBinaries_$(GameTarget)_$(TargetPlatform);"/>
</ForEach>
</ForEach>
</Agent>
<!-- Compile the editor executable -->
<Node Name="Compile $(EditorTarget) Win64" Requires="Compile Tools Win64"
Produces="#EditorBinaries">
<Compile Target="$(EditorTarget)" Platform="Win64"
Configuration="Development" Tag="#EditorBinaries"/>
</Node>
42. #UE4 | @UNREALENGINE
BuildGraph
<Agent Name="Default Agent" Type="CompileWin64">
<!-- Update the engine version files -->
<Node Name="Update Version Files">
<SetVersion Change="$(Change)" Branch="$(EscapedBranch)" Licensee="$(Licensee)" If="$(Versioned)"/>
</Node>
<!-- Compile the tool executables -->
<Node Name="Compile Tools Win64" Requires="Update Version Files" Produces="#ToolBinaries">
<Compile Target="UnrealHeaderTool" Platform="Win64" Configuration="Development" Tag="#ToolBinaries"/>
</Node>
<!-- Compile the editor executable -->
<Node Name="Compile $(EditorTarget) Win64" Requires="Compile Tools Win64" Produces="#EditorBinaries">
<Compile Target="$(EditorTarget)" Platform="Win64" Configuration="Development" Tag="#EditorBinaries"/>
</Node>
<!-- Compile the game targets -->
<Property Name="GameBinaries" Value=""/>
<ForEach Name="GameTarget" Values="$(GameTargets)">
<ForEach Name="TargetPlatform" Values="$(TargetPlatforms)">
<Node Name="Compile $(GameTarget) $(TargetPlatform)" Requires="Compile Tools Win64"
Produces="#GameBinaries_$(GameTarget)_$(TargetPlatform)">
<Compile Target="$(GameTarget)" Platform="$(TargetPlatform)"
Configuration="Development" Tag="#GameBinaries_$(GameTarget)_$(TargetPlatform)"/>
</Node>
<Property Name="GameBinaries" Value="$(GameBinaries)#GameBinaries_$(GameTarget)_$(TargetPlatform);"/>
</ForEach>
</ForEach>
</Agent>
<!-- Compile the game targets -->
<Property Name="GameBinaries" Value=""/>
<ForEach Name="GameTarget" Values="$(GameTargets)">
<ForEach Name="TargetPlatform" Values="$(TargetPlatforms)">
<Node Name="Compile $(GameTarget) $(TargetPlatform)"
Requires="Compile Tools Win64"
Produces="#GameBinaries_$(GameTarget)_$(TargetPlatform)">
<Compile Target="$(GameTarget)" Platform="$(TargetPlatform)"
Configuration="Development"
Tag="#GameBinaries_$(GameTarget)_$(TargetPlatform)"/>
</Node>
<Property Name="GameBinaries"
Value="$(GameBinaries)#GameBinaries_$(GameTarget)_$(TargetPlatform);"/>
</ForEach>
</ForEach>
44. #UE4 | @UNREALENGINE
InstalledBuild
● 皆様の会社のアンリアルランチャーだと思って下さい
● エンジンを提供するためエピックが作ったBuildGraphのスクリプト
Engine/Build/InstalledEngineBuild.xml
● デザイナーとアーティストに優しい
● エンジンビルドのみ。プロジェクトをビルドしない
45. #UE4 | @UNREALENGINE
Installed Build
Installed Buildの主なステップ
1. Update Version File
2. Compile UnrealHeaderTool Win64
3. Compile UE4Editor Win64
4. Compile UE4Game Win64
5. Compile UE4Game (Platform)
6. Build Tools Win64
7. Build Tools CS
8. Make Feature Packs
9. Build DDC Win64
53. #UE4 | @UNREALENGINE
BuildCookRun, BuildGraph, InstalledBuild
● 状況によって、一番合ってるやり方が変わる
● 個人的に、ゲーム開発の場合は、柔軟性と変更可能な技術が重要かと思うか
ら、BuildCookRunが一番仕事しやすい
● これから紹介するコマンドラインでBuildCookRunで実行する。でも全ての
コマンドがBuildGraphでもできる
69. #UE4 | @UNREALENGINE
Nightly Build
● 毎晩走らせるパッケージ
● Development、Test(プロファイルとるため)、そしてShipping (販売版に近い
バージョン)、ターゲットごとに作る
時間がかかっても大丈夫なので、クリーン、フルリビルドがおすすめ
71. #UE4 | @UNREALENGINE
ビルドコマンド
%ENGINE_ROOT%/Engine/Build/BatchFiles/RunUAT.bat BuildCookRun -
project=%GAME_SUB_PATH%/%GAME_NAME%.uproject -noP4 -
platform=%ENGINE_PLATFORM_TARGET% -
clientconfig=%ENGINE_COMPILATION_TARGET% -cook -allmaps -build -stage
-pak -archive -archivedirectory=%TEMP_DIR%
ENGINE_ROOT=PathToYourEngine
GAME_SUB_PATH=PathToYourProject
GAME_NAME=UprojectFileWithoutTheExtension
ENGINE_COMPILATION_TARGET=Development|Shipping|etc
ENGINE_PLATFORM_TARGET=Win64|etc
81. #UE4 | @UNREALENGINE
ビルドコマンド
Engine/Build/BatchFiles/RunUAT.bat BuildCookRun
-project=GamePath/GameName.uproject
-noP4
-platform=Win64
-clientconfig=Development
-cook
-allmaps
-build
-stage
-pak
-archive
-archivedirectory=C:/TempDirectory/
各ファイル全てをコピーする代わりに、全アセットを単一「.pak」フ
ァイルに格納する。プロジェクトにたくさんのアセットファイルがあ
る場合、Pak ファイルを使用した方が配布が容易になる場合がある。
84. #UE4 | @UNREALENGINE
ビルドコマンド
robocopy %ARCHIVE_DIR%/latest %ARCHIVE_DIR%/%ENGINE_PLATF
ORM_TARGET%/archive /E /IS /MOV
set PATH=%PATH%;C:/Program Files/7-Zip/
7z.exe a -tzip -mmt -
mx1 %ARCHIVE_DIR%/latest/%BUILD_NUMBER%.zip %TEMP_DIR%/
exit 0
88. #UE4 | @UNREALENGINE
Incremental Build
● 手動起動
● 「ごめん、一時間後パブリッシャー/社長に会議でビルドを見せなきゃいけな
いから、何とかして」というときに
● Nightly Buildと違って、時間がないから…
● -partialgcを付ける
● クリーンビルドじゃなくてもいい
89. #UE4 | @UNREALENGINE
Incremental Build フロー
Jenkins Build
Send to
DevKit
Update
Notify
開発機までの接続は、各メーカーのSDKを確認してください。
また、エディターからdeployするときにエンジン内でも同じことするので、
/Engine/Source/Programs/AutomationTool/PlatformName/PlatformNamePlatfo
rm.Automation.csを見てね
99. #UE4 | @UNREALENGINE
Shared DDC
Derived Data Cache (DDC) は、エンジンとターゲットプラットフォームが使
用するフォーマットでアセットのバージョンを保存する機能
簡単にいうと、みんなが利用しているアセットをキャッシュする
103. #UE4 | @UNREALENGINE
Shared DDC
https://docs.unrealengine.com/en-
US/Engine/Basics/DerivedDataCache/index.html
BaseEngine.ini
[InstalledDerivedDataBackendGraph]
MinimumDaysToKeepFile=7
Root=(Type=KeyLength, Length=120, Inner=AsyncPut)
AsyncPut=(Type=AsyncPut, Inner=Hierarchy)
Hierarchy=(Type=Hierarchical, Inner=Boot, Inner=Pak, Inner=EnginePak, Inner=Local, Inner=Shared)
Boot=(Type=Boot, Filename=%GAMEDIR%DerivedDataCache/Boot.ddc, MaxCacheSize=256)
Local=(Type=FileSystem, ReadOnly=false, Clean=false, Flush=false, PurgeTransient=true, DeleteUnused=true,
UnusedFileAge=17, FoldersToClean=-1, Path=../../../Engine/DerivedDataCache)
Shared=(Type=FileSystem, ReadOnly=false, Clean=false, Flush=false, DeleteUnused=true, UnusedFileAge=19,
FoldersToClean=-1, Path=//mystudio.net/DDC, EnvPathOverride=UE-SharedDataCachePath)
AltShared=(Type=FileSystem, ReadOnly=true, Clean=false, Flush=false, DeleteUnused=true, UnusedFileAge=19,
FoldersToClean=-1, Path=//mystudio.net/DDC2, EnvPathOverride=UE-SharedDataCachePath2)
Pak=(Type=ReadPak, Filename=%GAMEDIR%DerivedDataCache/DDC.ddp)
EnginePak=(Type=ReadPak, Filename=../../../Engine/DerivedDataCache/DDC.ddp)
105. #UE4 | @UNREALENGINE
Shared DDC
// Flush and Clean argument DerivedDataBackends.cpp:553
if( bFlush )
{
IFileManager::Get().DeleteDirectory( *(Path / TEXT(“”)), false, true );
}
else if( bClean )
{
DeleteOldFiles( *Path );
}
/** Delete the old files in a directory **/
void DeleteOldFiles(const TCHAR* Directory)
{
float MinimumDaysToKeepFile = 7;
GConfig->GetFloat( *GraphName, TEXT("MinimumDaysToKeepFile"), MinimumDaysToKeepFile, GEngineIni );
check(MinimumDaysToKeepFile > 0.0f); // sanity
//@todo
}
113. #UE4 | @UNREALENGINE
Lighting Build - Swarm
Swarmは、UE4の高品質なスタティック グローバル イ
ルミネーション ソルバである Unreal のライトマスを
含むタスク分散システム
Coordinatorは、ジェンキンスマスターでいいと思う
https://wiki.unrealengine.com/Swarm_Agent_Trou
bleshooting
114. #UE4 | @UNREALENGINE
Lighting Build - Swarm
Engine/Binaries/DotNET/SwarmCoordinator.exe
Engine/Binaries/DotNET/SwarmAgent.exe
Startupに追加する :
ショートカットを作成して、
%APPDATA%/Microsoft/Windows/Start Menu/Programs/Startupまでコピーする
116. #UE4 | @UNREALENGINE
Redirectors
● Redirectorは、UE4 でアセットを移動したり名前の変更をするとき、変更先を検
出するためのもので、元の位置に‘Redirector’が残される
● 残し方によっては、バグりやすくなるから、綺麗にする必要がある
● 大体、月一回でいいと思います。危ないとき(エンジンのマージあと、アルファ版
かベータ版のリリースの後)、週一回にしましょう!
https://docs.unrealengine.com/en-US/Engine/Basics/Redirectors/index.html
123. #UE4 | @UNREALENGINE
Custom Launch Profile
そしてエディターのLaunchボタンの右の三角形
をクリック、
Project LauncherのCustom Launch Profileが
追加されたファイルを編集する
プロファイルはプロジェクト側ではなく、
/Engine/Programs/UnrealFrontend/Profiles
に保存される
プロファイルからBuildのステップを外してパソ
コンに繋がっているデバイスにdeployしたら、
誰でもいつでも、VisualStudioを持たずに、タ
ーゲットプラットフォームでプレイが出来る
125. #UE4 | @UNREALENGINE
バージョン管理しすてむ
● エピックはPerforceを使用しているため、使ったらエピック環境に一番近く
なるが、有料ソフトウエアである
● SVNがちょっとだけ遅いかもしれないが、長く使われていて頼れる
● GITは無料で、モバイルとソシャゲで良く使われている
SVNとPerforceはエディターでサポートします!GITにも対応しているけど、ま
だExperimental!