mypro334 发表于 2021-5-11 09:38

UnrealEnigne源码构建&Perforce&(UnrealGameSync)开发版本控制基础部署

这是先前文章的简化方案,作为没有任何编程基础的我,试错的过程是挺折腾的。所以这从零开始梳理了简化并正确的开发环境部署的设置,剔除了不必要的错误以及Bug隐患。
目标:配置属于个人电脑或小型工作室的UE4开发环境
软件&插件:
链接:https://pan.baidu.com/s/1usjaWhPvVA6zoiAJMYhevA
提取码:zcja
UnrealEngine
Perforce(P4V客户端,P4Admin本地管理)
Docker(这里我使用的是群晖NAS的Docker套件搭建Perforce服务端)
VisualStudio2019
这里非常感谢一下几篇文章作者
How to Setup a Perforce Workflow, Automate & Distribute Custom UE4 BuildsAn Unholy Alliance: Unreal Engine, GitHub & Perforce如何在群晖NAS上配置Perforce服务器并与本地虚幻引擎整合作为版本控制工具(一)安装篇_开发游戏的老王-CSDN博客如何在群晖NAS上配置Perforce服务器并与本地虚幻引擎整合作为版本控制工具(二)配置整合篇_开发游戏的老王-CSDN博客https://www.wisengineering.com/downloads/ManagingUE4Projects.pdf
UnrealEnigne源码构建
在GitHub创建账户
https://http://github.com/
转到您的Unrealengine账户,并将您的GitHub账户名称输入到个人信息页面的对应框中来进行关联。
Epic Games
登录UE4社区点击个人,点击连接,选择Gitgub账户

添加Github账户后,进入Github会收到加入EpicGames开发者组织的通知点击View invitation,出现如下图所示的界面,点击Join Epic Games

回到Epic Games Github 主界面后,多了两个UE4相关的仓库
https://http://github.com/EpicGameshttps://http://github.com/EpicGames/UnrealEngine/tree/4.26
这里我选择4.26版本,下载压缩包
下载ZIP文件(也可以使用VS或Git克隆到本地,以便于程序的进一步修改和迭代)

VisualStudio 2019安装&设置
Visual Studio 2019 Community
设置虚幻引擎的Visual Studio这里需要选择使用C++的游戏开发
勾选Unreal Engine安装程序
勾选适用于Unreal引擎的Andriod IDE支持
官方推荐配置:

这里我选择使用.NET桌面开发和使用C++的游戏开发并勾选相应的功能

安装Wix Toolset Visual Studio 2019 Extensions
一路点击下一步即可


UE4源代码编译
点击Setup.bat
点击GeneratProjectFiles文件生成.sln文件
打开UE4.sln

将UE4.sln拖入到VS2019中打开在解决方案管理器中选择Engine>uE4右击生成解决方案

注册源码引擎到EpicGames
经过上面的步骤,源码引擎已经构建成功,但是在对项目就行选择引擎版本的时候,发现并没有这个版本
这是因为,构建的引擎没有注册到EpicGames中
找到EpicGames安装目录下的注册器
Launcher\Engine\Binaries\Win64将注册器拷贝到构建的虚幻引擎对应目录
Engine\Binaries\Win64
开启引擎
建议发送到桌面快捷方式
Engine\Binaries\Win64二 UnrealGameSync构建


Engine\Source\Programs\UnrealGameSync\UnrealGameSyncLauncher\bin\x64\Release构建分发UGS分发版本
调试配置
SQL同步服务配置
这里我选择独立应用程序
可见Publish版本用于分发(这里公司用的更多的是通过网页端或者独立地SQL服务器进行软件版本同步,这里我使用的是独立的版本)
启动UnrealGameSync
UnrealEngine\Engine\Source\Programs\UnrealGameSync\UnrealGameSyncLauncher\bin\x64\Release三 Perforce设置
在此基础上我参考了下文完善了工作区结构部署调整
工作室推荐使用的方式是:
程序人员和美术人员应该有独立的新的开发分支,在Debug完成后再Merger到主干。以每个版本发布时间为里程碑,在版本发布前一到两周周左右进行新的Release发布分支的分流和调试,在分流完成后,相应版本资源的的任务流检索择应按照里程碑计划时间合理分配任务计划时间(这一点也是国内很多项目目前的痛点)
这里我针对个人工作环境分配以三个方面为主
ArtSource(美术资源:引擎中相应的美术资产应该统一从ArtSource仓库导入,这样美术人员可以集中在标准资产管线下的资产迭代,可以更加集中注意力于美术资产质量,所以前提是项目初期必须构建标准稳定的渲染和审核验收流程(这一点也是国内很多项目及经常返工,开发成本极高的原因))Engine(引擎路径,这里我用于个人使用则不需要太多的分流)Project(项目工程)
P4ExcludeList

这里可以将JF-PC1替换成成你的工作区名称将UnrealEngine和UE_4.26替换成你的引擎目录名称将ShowRoom替换成你的项目名称
//spec/... //JF-PC1/spec/...
//spec/client/... //JF-PC1/spec/client/...
//spec/depot/... //JF-PC1/spec/depot/...
//spec/server/... //JF-PC1/spec/server/...
//spec/user/... //JF-PC1/spec/user/...
//depot/... //JF-PC1/...
//depot/ArtSource/... //JF-PC1/ArtSource/...
//depot/UnrealEngine/... //JF-PC1/UnrealEngine/...
//depot/UE_4.26/... //JF-PC1/UE_4.26/...
-//depot/UnrealEngine/.git/... //JF-PC1/UnrealEngine/.git/...
-//depot/UnrealEngine/Engine/DerivedDataCache/... //JF-PC1/UnrealEngine/Engine/DerivedDataCache/...
-//depot/UnrealEngine/FeaturePacks/... //JF-PC1/UnrealEngine/FeaturePacks/...
-//depot/UnrealEngine/Samples/... //JF-PC1/UnrealEngine/Samples/...
-//depot/UnrealEngine/Templates/... //JF-PC1/UnrealEngine/Templates/...
-//depot/UnrealEngine/.gitattributes //JF-PC1/UnrealEngine/.gitattributes
-//depot/UnrealEngine/.gitignore //JF-PC1/UnrealEngine/.gitignore
-//depot/UnrealEngine/.tgitconfig //JF-PC1/UnrealEngine/.tgitconfig
-//depot/UE_4.26/.git/... //JF-PC1/UE_4.26/.git/...
-//depot/UE_4.26/Engine/DerivedDataCache/... //JF-PC1/UE_4.26/Engine/DerivedDataCache/...
-//depot/UE_4.26/FeaturePacks/... //JF-PC1/UE_4.26/FeaturePacks/...
-//depot/UE_4.26/Samples/... //JF-PC1/UE_4.26/Samples/...
-//depot/UE_4.26/Templates/... //JF-PC1/UE_4.26/Templates/...
-//depot/UE_4.26/.gitattributes //JF-PC1/UE_4.26/.gitattributes
-//depot/UE_4.26/.gitignore //JF-PC1/UE_4.26/.gitignore
-//depot/UE_4.26/.tgitconfig //JF-PC1/UE_4.26/.tgitconfig
-//depot/ShowRoom/Build/... //JF-PC1/ShowRoom/Build/...
-//depot/ShowRoom/Cooked/... //JF-PC1/ShowRoom/Cooked/...
-//depot/ShowRoom/DerivedDataCache/... //JF-PC1/ShowRoom/DerivedDataCache/...
-//depot/.../.vs/... //JF-PC1/.../.vs/...
-//depot/.../EditorRuns/... //JF-PC1/.../EditorRuns/...
-//depot/.../Intermediate/... //JF-PC1/.../Intermediate/...
-//depot/.../Logs/... //JF-PC1/.../Logs/...
-//depot/.../obj/... //JF-PC1/.../obj/...
-//depot/.../Saved/... //JF-PC1/.../Saved/...
-//depot/.../SwarmCache/... //JF-PC1/.../SwarmCache/...
-//depot/.../*.blend1 //JF-PC1/.../*.blend1
-//depot/.../*.csproj.references //JF-PC1/.../*.csproj.references
-//depot/.../*.log //JF-PC1/.../*.log
-//depot/.../*.obj //JF-PC1/.../*.obj
-//depot/.../*.opendb //JF-PC1/.../*.opendb
-//depot/.../*.opensdf //JF-PC1/.../*.opensdf
-//depot/.../*.pdb //JF-PC1/.../*.pdb
-//depot/.../*.sdf //JF-PC1/.../*.sdf
-//depot/.../*.sln //JF-PC1/.../*.sln
-//depot/.../*.suo //JF-PC1/.../*.suo
-//depot/.../*.vcxproj.user //JF-PC1/.../*.vcxproj.user
-//depot/.../*.vc.db //JF-PC1/.../*.vc.db
-//depot/.../*Win64-Debug* //JF-PC1/.../*Win64-Debug*.p4ignore   
命令行:
p4 set P4IGNORE=.p4ignore
p4 ignores文件
# Ignore project files in the root
*.sln
!*\*.sln
.vs
*.suo
*.opensdf
*.sdf
*.pdb
*-Debug.dll
*.xcodeproj
.\Makefile
.\CMakeLists.txt
.\.ue4dependencies

ipch\*

# Packaged engine builds
LocalBuilds\*

# DDC should never be checked in
Engine\DerivedDataCache\*
Templates\**\DerivedDataCache\*

# Engine intermediates & binaries
Engine\Intermediate\*
Engine\Plugins\**\Intermediate\*
Engine\Programs\**\Intermediate\*
Engine\Binaries*
Engine\Plugins\**\Binaries\*

# Feature Packs (they might get updated with langauge packs?)
FeaturePacks\*

# Samples & Templates
Templates\**\Intermediate\*
Templates\**\Saved\*
Samples\**\Intermediate\*

# C# Intermediate folders
Engine\Source\Programs\**\obj\*
Engine\Platforms\**\Programs\**\obj\*

# Saved folders for programs should not be checked in
Engine\Programs\**\Saved\*
Engine\Programs\UnrealBuildTool\*

# Ignore any saved local files
Engine\Saved\*

# Ignore any build receipts
Engine\Build\Receipts\*

# Ignore Unix backup files
*~

# Ignore Mac desktop services store files
.DS_Store

# Ignore crash reports
crashinfo--*

# Ignore linux project files
*.user
*.pro
*.pri
*.kdev4

#
# Setup.bat Ignores
#
# There already might be some files pushed into the repo that would otherwise be
# filtered: those are from the initial commit, coming directly from UE4-GitHub.
# After running Setup.bat, the folders below will be populated with ~46GB of
# files. Hence we'll be blanked ignoring some directories such as ThirdParty,
# Media, Content, etc. If we want to change anything in those blanked-ignored
# folders, we should unignore the specific thing we're adding.
#
.git\*
Samples\**\Content\*
Samples\**\Media\*
Templates\**\Content\*
Templates\**\Media\*
Templates\Media\*
Engine\Platforms\**\Content\*
Engine\Documentation\*
Engine\Extras\*
Engine\Content\*
Engine\Build\*
Engine\Source\ThirdParty\*
Engine\Source\Programs\*
Engine\Source\Developer\*
Engine\Plugins\*

# Specific files
Engine\Config\ShaderCategories.csv
.tgitconfig
.ue4dependencies

# After all this above, there's still a couple folders and files left that doesn't
# fit the filtering criteria above, so we handle them individually here.
Engine\Source\Runtime\Navmesh\RecastDemo*
Engine\Source\Runtime\Launch\Resources\Mac*
Engine\Source\Runtime\Launch\Resources\Linux*
Engine\Source\Runtime\Experimental\Voronoi\Private\voro++*

Engine\Source\Runtime\Apple\MetalRHI\Public\ue4_stdlib.metal
Engine\Source\Runtime\AVEncoder\Private\Microsoft\Windows\ThirdParty\NvEncoder\LicenseAgreement.pdf
Engine\Source\Runtime\Experimental\Chaos\.clang-format
Engine\Source\Runtime\TraceLog\Private\Trace\LZ4\Epic.patch
Templates\TemplateResources\Standard\*.FBX


#
# PLUGINS
#
# Plugins that come with Setup.bat are ignored above altogether, so we un-ignore
# the custom plugins we want to ship with the customized UE4.
!Engine\Plugins\Marketplace*
!Engine\Plugins\Runtime\HoudiniEngine*
# ... but keep ignoring their Build & Intermediate
Engine\Plugins\Marketplace\**\Intermediate\*
Engine\Plugins\Marketplace\**\Binaries\*
Engine\Plugins\Runtime\**\Intermediate\*
Engine\Plugins\Runtime\**\Binaries\*

#
# PackageEngine.bat Ignores
#
# Packaging the engine will generate some .ini files which are safe to ignore
#
Samples\**\Saved\*P4 TypeMap
# The form data below was edited by Jeff
# Perforce File Type Mapping Specifications.
#
#TypeMap:        a list of filetype mappings; one per line.
#                Each line has two elements:
#
#                Filetype: The filetype to use on 'p4 add'.
#
#                Path:   File pattern which will use this filetype.
#
# See 'p4 help typemap' for more information.

TypeMap:
        text //....asp
        text //....cnf
        text //....css
        text //....htm
        text //....html
        text //....inc
        text //....js
        text+w //....log
        text+w //....ini
        text+w //....pdm
        binary+Fl //....zip
        binary+Fl //....bz2
        binary+Fl //....rar
        binary+Fl //....gz
        binary+Fl //....avi
        binary+Fl //....jpg
        binary+Fl //....jpeg
        binary+Fl //....mpg
        binary+Fl //....gif
        binary+Fl //....tif
        binary+Fl //....mov
        binary+Fl //....jar
        binary+l //....ico
        binary+l //....exp
        binary+l //....btr
        binary+l //....bmp
        binary+l //....doc
        binary+l //....dot
        binary+l //....xls
        binary+l //....ppt
        binary+l //....pdf
        binary+l //....tar
        binary+l //....exe
        binary+l //....dll
        binary+l //....lib
        binary+l //....bin
        binary+l //....class
        binary+l //....war
        binary+l //....ear
        binary+l //....so
        binary+l //....rpt
        binary+l //....cfm
        binary+l //....ma
        binary+l //....mb
        binary+l //....pac
        binary+l //....m4a
        binary+l //....mp4
        binary+l //....aac
        binary+l //....wma
        binary+l //....docx
        binary+l //....pptx
        binary+l //....xlsx
        binary+l //....png
        binary+l //....raw
        binary+l //....odt
        binary+l //....ods
        binary+l //....odg
        binary+l //....odp
        binary+l //....otg
        binary+l //....ots
        binary+l //....ott
        binary+l //....psd
        binary+l //....sxw
        binary+S2w //....exe
        binary+S2w //....dll
        binary+S2w //....lib
        binary+S2w //....app
        binary+S2w //....dylib
        binary+S2w //....stub
        binary+S2w //....ipa
        binary //....bmp
        text //....ini
        text //....config
        text //....cpp
        text //....h
        text //....c
        text //....cs
        text //....m
        text //....mm
        text //....py
        binary+l //....uasset
        binary+l //....umap
        binary+l //....upk
        binary+l //....udk
        binary+w //....exe
        binary+w //....dll
        binary+w //....lib
        binary+w //....app
        binary+w //....dylib
        binary+w //....stub
        binary+w //....ipa
        binary //....bmp
        text //....ini
        text+w //....config
        text //....cpp
        text //....h
        text //....c
        text //....cs
        text //....m
        text //....mm
        text //....py
        binary+l //....uasset
        binary+l //....umap
        binary+l //....upk
        binary+l //....udk
        binary+l //....ubulk
        text //....ignoreUE4连接Perforce源码引擎
这里UGS报错,需要对.uproject文件进行设置
在注册表编辑器中设置相应的工作区的DepotPath:
将引擎和工程文件递交到Perforce服务器P4ignore将帮助你过滤掉不必要的文件
上传成功后,打开UnrealGameSync就可指认工程路径,并加以同步控制了
谢谢观看!

mypro334 发表于 2021-5-11 09:48

牛逼![赞同]

franciscochonge 发表于 2021-5-11 09:55

太强了波波

TheLudGamer 发表于 2021-5-11 10:00

谢谢[大笑]
页: [1]
查看完整版本: UnrealEnigne源码构建&Perforce&(UnrealGameSync)开发版本控制基础部署