找回密码
 立即注册
查看: 792|回复: 3

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

[复制链接]
发表于 2021-5-11 09:38 | 显示全部楼层 |阅读模式
这是先前文章的简化方案,作为没有任何编程基础的我,试错的过程是挺折腾的。所以这从零开始梳理了简化并正确的开发环境部署的设置,剔除了不必要的错误以及Bug隐患。
目标:配置属于个人电脑或小型工作室的UE4开发环境
软件&插件:
链接:https://pan.baidu.com/s/1usjaWhPvVA6zoiAJMYhevA
提取码:zcja
UnrealEngine
Perforce(P4V客户端,P4Admin本地管理) [Widows P4D客户端]
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/EpicGames
https://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安装目录下的注册器
  1. Launcher\Engine\Binaries\Win64
复制代码
将注册器拷贝到构建的虚幻引擎对应目录
  1. Engine\Binaries\Win64
复制代码
    开启引擎
建议发送到桌面快捷方式
  1. Engine\Binaries\Win64
复制代码
二 UnrealGameSync构建

  1. Engine\Source\Programs\UnrealGameSync\UnrealGameSyncLauncher\bin\x64\Release
复制代码
构建分发UGS分发版本
调试配置
SQL同步服务配置
这里我选择独立应用程序
可见Publish版本用于分发(这里公司用的更多的是通过网页端或者独立地SQL服务器进行软件版本同步,这里我使用的是独立的版本)
启动UnrealGameSync
  1. 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替换成你的项目名称
  1. //spec/... //JF-PC1/spec/...
  2. //spec/client/... //JF-PC1/spec/client/...
  3. //spec/depot/... //JF-PC1/spec/depot/...
  4. //spec/server/... //JF-PC1/spec/server/...
  5. //spec/user/... //JF-PC1/spec/user/...
  6. //depot/... //JF-PC1/...
  7. //depot/ArtSource/... //JF-PC1/ArtSource/...
  8. //depot/UnrealEngine/... //JF-PC1/UnrealEngine/...
  9. //depot/UE_4.26/... //JF-PC1/UE_4.26/...
  10. -//depot/UnrealEngine/.git/... //JF-PC1/UnrealEngine/.git/...
  11. -//depot/UnrealEngine/Engine/DerivedDataCache/... //JF-PC1/UnrealEngine/Engine/DerivedDataCache/...
  12. -//depot/UnrealEngine/FeaturePacks/... //JF-PC1/UnrealEngine/FeaturePacks/...
  13. -//depot/UnrealEngine/Samples/... //JF-PC1/UnrealEngine/Samples/...
  14. -//depot/UnrealEngine/Templates/... //JF-PC1/UnrealEngine/Templates/...
  15. -//depot/UnrealEngine/.gitattributes //JF-PC1/UnrealEngine/.gitattributes
  16. -//depot/UnrealEngine/.gitignore //JF-PC1/UnrealEngine/.gitignore
  17. -//depot/UnrealEngine/.tgitconfig //JF-PC1/UnrealEngine/.tgitconfig
  18. -//depot/UE_4.26/.git/... //JF-PC1/UE_4.26/.git/...
  19. -//depot/UE_4.26/Engine/DerivedDataCache/... //JF-PC1/UE_4.26/Engine/DerivedDataCache/...
  20. -//depot/UE_4.26/FeaturePacks/... //JF-PC1/UE_4.26/FeaturePacks/...
  21. -//depot/UE_4.26/Samples/... //JF-PC1/UE_4.26/Samples/...
  22. -//depot/UE_4.26/Templates/... //JF-PC1/UE_4.26/Templates/...
  23. -//depot/UE_4.26/.gitattributes //JF-PC1/UE_4.26/.gitattributes
  24. -//depot/UE_4.26/.gitignore //JF-PC1/UE_4.26/.gitignore
  25. -//depot/UE_4.26/.tgitconfig //JF-PC1/UE_4.26/.tgitconfig
  26. -//depot/ShowRoom/Build/... //JF-PC1/ShowRoom/Build/...
  27. -//depot/ShowRoom/Cooked/... //JF-PC1/ShowRoom/Cooked/...
  28. -//depot/ShowRoom/DerivedDataCache/... //JF-PC1/ShowRoom/DerivedDataCache/...
  29. -//depot/.../.vs/... //JF-PC1/.../.vs/...
  30. -//depot/.../EditorRuns/... //JF-PC1/.../EditorRuns/...
  31. -//depot/.../Intermediate/... //JF-PC1/.../Intermediate/...
  32. -//depot/.../Logs/... //JF-PC1/.../Logs/...
  33. -//depot/.../obj/... //JF-PC1/.../obj/...
  34. -//depot/.../Saved/... //JF-PC1/.../Saved/...
  35. -//depot/.../SwarmCache/... //JF-PC1/.../SwarmCache/...
  36. -//depot/.../*.blend1 //JF-PC1/.../*.blend1
  37. -//depot/.../*.csproj.references //JF-PC1/.../*.csproj.references
  38. -//depot/.../*.log //JF-PC1/.../*.log
  39. -//depot/.../*.obj //JF-PC1/.../*.obj
  40. -//depot/.../*.opendb //JF-PC1/.../*.opendb
  41. -//depot/.../*.opensdf //JF-PC1/.../*.opensdf
  42. -//depot/.../*.pdb //JF-PC1/.../*.pdb
  43. -//depot/.../*.sdf //JF-PC1/.../*.sdf
  44. -//depot/.../*.sln //JF-PC1/.../*.sln
  45. -//depot/.../*.suo //JF-PC1/.../*.suo
  46. -//depot/.../*.vcxproj.user //JF-PC1/.../*.vcxproj.user
  47. -//depot/.../*.vc.db //JF-PC1/.../*.vc.db
  48. -//depot/.../*Win64-Debug* //JF-PC1/.../*Win64-Debug*
复制代码
.p4ignore     
命令行:
  1. p4 set P4IGNORE=.p4ignore
  2. p4 ignores
复制代码
文件
  1. # Ignore project files in the root
  2. *.sln
  3. !*\*.sln
  4. .vs
  5. *.suo
  6. *.opensdf
  7. *.sdf
  8. *.pdb
  9. *-Debug.dll
  10. *.xcodeproj
  11. .\Makefile
  12. .\CMakeLists.txt
  13. .\.ue4dependencies
  14. ipch\*
  15. # Packaged engine builds
  16. LocalBuilds\*
  17. # DDC should never be checked in
  18. Engine\DerivedDataCache\*
  19. Templates\**\DerivedDataCache\*
  20. # Engine intermediates & binaries
  21. Engine\Intermediate\*
  22. Engine\Plugins\**\Intermediate\*
  23. Engine\Programs\**\Intermediate\*
  24. Engine\Binaries*
  25. Engine\Plugins\**\Binaries\*
  26. # Feature Packs (they might get updated with langauge packs?)
  27. FeaturePacks\*
  28. # Samples & Templates
  29. Templates\**\Intermediate\*
  30. Templates\**\Saved\*
  31. Samples\**\Intermediate\*
  32. # C# Intermediate folders
  33. Engine\Source\Programs\**\obj\*
  34. Engine\Platforms\**\Programs\**\obj\*
  35. # Saved folders for programs should not be checked in
  36. Engine\Programs\**\Saved\*
  37. Engine\Programs\UnrealBuildTool\*
  38. # Ignore any saved local files
  39. Engine\Saved\*
  40. # Ignore any build receipts
  41. Engine\Build\Receipts\*
  42. # Ignore Unix backup files
  43. *~
  44. # Ignore Mac desktop services store files
  45. .DS_Store
  46. # Ignore crash reports
  47. crashinfo--*
  48. # Ignore linux project files
  49. *.user
  50. *.pro
  51. *.pri
  52. *.kdev4
  53. #
  54. # Setup.bat Ignores
  55. #
  56. # There already might be some files pushed into the repo that would otherwise be
  57. # filtered: those are from the initial commit, coming directly from UE4-GitHub.
  58. # After running Setup.bat, the folders below will be populated with ~46GB of
  59. # files. Hence we'll be blanked ignoring some directories such as ThirdParty,
  60. # Media, Content, etc. If we want to change anything in those blanked-ignored
  61. # folders, we should unignore the specific thing we're adding.
  62. #
  63. .git\*
  64. Samples\**\Content\*
  65. Samples\**\Media\*
  66. Templates\**\Content\*
  67. Templates\**\Media\*
  68. Templates\Media\*
  69. Engine\Platforms\**\Content\*
  70. Engine\Documentation\*
  71. Engine\Extras\*
  72. Engine\Content\*
  73. Engine\Build\*
  74. Engine\Source\ThirdParty\*
  75. Engine\Source\Programs\*
  76. Engine\Source\Developer\*
  77. Engine\Plugins\*
  78. # Specific files
  79. Engine\Config\ShaderCategories.csv
  80. .tgitconfig
  81. .ue4dependencies
  82. # After all this above, there's still a couple folders and files left that doesn't
  83. # fit the filtering criteria above, so we handle them individually here.
  84. Engine\Source\Runtime\Navmesh\RecastDemo*
  85. Engine\Source\Runtime\Launch\Resources\Mac*
  86. Engine\Source\Runtime\Launch\Resources\Linux*
  87. Engine\Source\Runtime\Experimental\Voronoi\Private\voro++*
  88. Engine\Source\Runtime\Apple\MetalRHI\Public\ue4_stdlib.metal
  89. Engine\Source\Runtime\AVEncoder\Private\Microsoft\Windows\ThirdParty\NvEncoder\LicenseAgreement.pdf
  90. Engine\Source\Runtime\Experimental\Chaos\.clang-format
  91. Engine\Source\Runtime\TraceLog\Private\Trace\LZ4\Epic.patch
  92. Templates\TemplateResources\Standard\*.FBX
  93. #
  94. # PLUGINS
  95. #
  96. # Plugins that come with Setup.bat are ignored above altogether, so we un-ignore
  97. # the custom plugins we want to ship with the customized UE4.
  98. !Engine\Plugins\Marketplace*
  99. !Engine\Plugins\Runtime\HoudiniEngine*
  100. # ... but keep ignoring their Build & Intermediate
  101. Engine\Plugins\Marketplace\**\Intermediate\*
  102. Engine\Plugins\Marketplace\**\Binaries\*
  103. Engine\Plugins\Runtime\**\Intermediate\*
  104. Engine\Plugins\Runtime\**\Binaries\*
  105. #
  106. # PackageEngine.bat Ignores
  107. #
  108. # Packaging the engine will generate some .ini files which are safe to ignore
  109. #
  110. Samples\**\Saved\*
复制代码
P4 TypeMap
  1. # The form data below was edited by Jeff
  2. # Perforce File Type Mapping Specifications.
  3. #
  4. #  TypeMap:        a list of filetype mappings; one per line.
  5. #                Each line has two elements:
  6. #
  7. #                  Filetype: The filetype to use on 'p4 add'.
  8. #
  9. #                  Path:     File pattern which will use this filetype.
  10. #
  11. # See 'p4 help typemap' for more information.
  12. TypeMap:
  13.         text //....asp
  14.         text //....cnf
  15.         text //....css
  16.         text //....htm
  17.         text //....html
  18.         text //....inc
  19.         text //....js
  20.         text+w //....log
  21.         text+w //....ini
  22.         text+w //....pdm
  23.         binary+Fl //....zip
  24.         binary+Fl //....bz2
  25.         binary+Fl //....rar
  26.         binary+Fl //....gz
  27.         binary+Fl //....avi
  28.         binary+Fl //....jpg
  29.         binary+Fl //....jpeg
  30.         binary+Fl //....mpg
  31.         binary+Fl //....gif
  32.         binary+Fl //....tif
  33.         binary+Fl //....mov
  34.         binary+Fl //....jar
  35.         binary+l //....ico
  36.         binary+l //....exp
  37.         binary+l //....btr
  38.         binary+l //....bmp
  39.         binary+l //....doc
  40.         binary+l //....dot
  41.         binary+l //....xls
  42.         binary+l //....ppt
  43.         binary+l //....pdf
  44.         binary+l //....tar
  45.         binary+l //....exe
  46.         binary+l //....dll
  47.         binary+l //....lib
  48.         binary+l //....bin
  49.         binary+l //....class
  50.         binary+l //....war
  51.         binary+l //....ear
  52.         binary+l //....so
  53.         binary+l //....rpt
  54.         binary+l //....cfm
  55.         binary+l //....ma
  56.         binary+l //....mb
  57.         binary+l //....pac
  58.         binary+l //....m4a
  59.         binary+l //....mp4
  60.         binary+l //....aac
  61.         binary+l //....wma
  62.         binary+l //....docx
  63.         binary+l //....pptx
  64.         binary+l //....xlsx
  65.         binary+l //....png
  66.         binary+l //....raw
  67.         binary+l //....odt
  68.         binary+l //....ods
  69.         binary+l //....odg
  70.         binary+l //....odp
  71.         binary+l //....otg
  72.         binary+l //....ots
  73.         binary+l //....ott
  74.         binary+l //....psd
  75.         binary+l //....sxw
  76.         binary+S2w //....exe
  77.         binary+S2w //....dll
  78.         binary+S2w //....lib
  79.         binary+S2w //....app
  80.         binary+S2w //....dylib
  81.         binary+S2w //....stub
  82.         binary+S2w //....ipa
  83.         binary //....bmp
  84.         text //....ini
  85.         text //....config
  86.         text //....cpp
  87.         text //....h
  88.         text //....c
  89.         text //....cs
  90.         text //....m
  91.         text //....mm
  92.         text //....py
  93.         binary+l //....uasset
  94.         binary+l //....umap
  95.         binary+l //....upk
  96.         binary+l //....udk
  97.         binary+w //....exe
  98.         binary+w //....dll
  99.         binary+w //....lib
  100.         binary+w //....app
  101.         binary+w //....dylib
  102.         binary+w //....stub
  103.         binary+w //....ipa
  104.         binary //....bmp
  105.         text //....ini
  106.         text+w //....config
  107.         text //....cpp
  108.         text //....h
  109.         text //....c
  110.         text //....cs
  111.         text //....m
  112.         text //....mm
  113.         text //....py
  114.         binary+l //....uasset
  115.         binary+l //....umap
  116.         binary+l //....upk
  117.         binary+l //....udk
  118.         binary+l //....ubulk
  119.         text //....ignore
复制代码
UE4连接Perforce源码引擎
这里UGS报错,需要对.uproject文件进行设置
在注册表编辑器中设置相应的工作区的DepotPath:
将引擎和工程文件递交到Perforce服务器P4ignore将帮助你过滤掉不必要的文件
上传成功后,打开UnrealGameSync就可指认工程路径,并加以同步控制了
谢谢观看!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
 楼主| 发表于 2021-5-11 09:48 | 显示全部楼层
牛逼![赞同]
发表于 2021-5-11 09:55 | 显示全部楼层
太强了波波
发表于 2021-5-11 10:00 | 显示全部楼层
谢谢[大笑]
懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Unity开发者联盟 ( 粤ICP备20003399号 )

GMT+8, 2024-11-22 23:51 , Processed in 0.094820 second(s), 26 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表