[{"data":1,"prerenderedAt":153},["ShallowReactive",2],{"\u002F2015-08-01-ue4-package-logs-windows":3},{"id":4,"title":5,"body":6,"date":129,"description":12,"extension":130,"meta":131,"navigation":134,"path":146,"seo":147,"stem":148,"tags":149,"__hash__":152},"blogs\u002F_legacy\u002F2015\u002F2015-08-01-ue4-package-logs-windows.md","UE4游戏Package记录（Windows）",{"type":7,"value":8,"toc":121},"minimark",[9,13,16,19,23,26,37,40,43,46,49,52,55,58,87,90,93,96,99,102,107,110,113,118],[10,11,12],"p",{},"最近对UE4的Package功能进行了使用，整体而言打包功能比想象中复杂一些，限于设备原因只做了Windows和Android的打包。",[10,14,15],{},"当前使用的UE4版本为4.10.1。",[10,17,18],{},"面向Windows的打包相对简单，基本只要直接使用即可。",[20,21,22],"h2",{"id":22},"视频设定",[10,24,25],{},"主要的问题之一是，当前无法在引擎中对游戏的目标分辨率进行设置，在某些情况下会导致打包的效果和PIE的效果相差很大。不过引擎在C++中有提供接口来进行相关的控制，一般在GameMode的BeginPlay中直接调用就可以设置成功了。",[27,28,33],"pre",{"className":29,"code":31,"language":32},[30],"language-text","do{\n\n    if(GEngine == nullptr) break;\n\n    UGameUserSettings* Settings = GEngine->GameUserSettings;\n\n    if (Settings == nullptr) break;\n\n    int32 Width = 1920, Height = 1080;\n\n    Settings->RequestResolutionChange(Width, Height, EWindowMode::Type::Windowed, false);\n\n    Settings->ConfirmVideoMode();\n\n    \u002F\u002FSettings->RevertVideoMode(); \u002F\u002F 本操作可以取消分辨率更改\n\n    Settings->SetScreenResolution(Settings->GetLastConfirmedScreenResolution());\n\n    Settings->SetFullscreenMode(Settings->GetLastConfirmedFullscreenMode());\n\n    Settings->SaveSettings();\n\n     Settings->ScalabilityQuality.AntiAliasingQuality = 3;     \u002F\u002F Epic\n\n     Settings->ScalabilityQuality.ResolutionQuality = 3;     \u002F\u002F Epic\n\n    Settings->ApplyNonResolutionSettings();\n\n    Settings->SaveSettings();\n\n}while(false);\n","text",[34,35,31],"code",{"__ignoreMap":36},"",[10,38,39],{},"上面的ScalabilityQuality是可以在编辑器中进行设定的，对应关系如下",[10,41,42],{},"另外名为Screen Percentage的属性是在PostProcess的属性中进行设置的。以及，如果要修改抗锯齿的方式，也需要在PostProcess中进行。",[20,44,45],{"id":45},"运行黑屏",[10,47,48],{},"打包之后运行直接黑屏的话可能是由很多原因引起的，不过如果是在打包测试的过程中直接使用新项目，或者之前没有进行过设置变更的话，还是可能遇到。原因是没有对默认地图进行设置，主要表现是，完全的黑屏，但是调试输出却可以显示在屏幕上。",[10,50,51],{},"在【项目设置>>项目>>地图&模式】中进行修改即可。",[20,53,54],{"id":54},"莫名的链接错误",[10,56,57],{},"这个错误的出现几率比较低，而且链接错误有很大的可能性是其他原因引起的，所以排查起来很麻烦。如果之前都是正常的却突然出现类似这样的情况：",[59,60,61,69,72,75,78,81,84],"blockquote",{},[10,62,63,64,68],{},"MainFrameActions: 打包 (Windows (64位)): UnrealBuildTool: ",[65,66,67],"span",{},"1\u002F1"," Link Test_mp.exe",[10,70,71],{},"MainFrameActions: 打包 (Windows (64位)): UnrealBuildTool:      ڴ      F:\\Unreal\\Test_mp 4.10\\Binaries\\Win64\\Test_mp.lib  Ͷ    F:\\Unreal\\Test_mp 4.10\\Binaries\\Win64\\Test_mp.exp",[10,73,74],{},"MainFrameActions: 打包 (Windows (64位)): UnrealBuildTool: UELinkerFixups.cpp.obj : error LNK2019:  ޷        ⲿ     \"void __cdecl EmptyLinkFunctionForGeneratedCodeOnlineSubsystemSteam(void)\" (?EmptyLinkFunctionForGeneratedCodeOnlineSubsystemSteam@@YAXXZ)   ÷    ں    \"void __cdecl UELinkerFixups(void)\" (?UELinkerFixups@@YAXXZ)  б",[10,76,77],{},"MainFrameActions: 打包 (Windows (64位)): UnrealBuildTool: UELinkerFixups.cpp.obj : error LNK2019:  ޷        ⲿ     \"void __cdecl EmptyLinkFunctionForStaticInitializationUE4Game(void)\" (?EmptyLinkFunctionForStaticInitializationUE4Game@@YAXXZ)   ÷    ں    \"void __cdecl UELinkerFixups(void)\" (?UELinkerFixups@@YAXXZ)  б",[10,79,80],{},"MainFrameActions: 打包 (Windows (64位)): UnrealBuildTool: UELinkerFixups.cpp.obj : error LNK2019:  ޷        ⲿ     \"void __cdecl EmptyLinkFunctionForStaticInitializationOnlineSubsystemNull(void)\" (?EmptyLinkFunctionForStaticInitializationOnlineSubsystemNull@@YAXXZ)   ÷    ں    \"void __cdecl UELinkerFixups(void)\" (?UELinkerFixups@@YAXXZ)  б",[10,82,83],{},"MainFrameActions: 打包 (Windows (64位)): UnrealBuildTool: UELinkerFixups.cpp.obj : error LNK2019:  ޷        ⲿ     \"void __cdecl EmptyLinkFunctionForStaticInitializationOnlineSubsystemSteam(void)\" (?EmptyLinkFunctionForStaticInitializationOnlineSubsystemSteam@@YAXXZ)   ÷    ں    \"void __cdecl UELinkerFixups(void)\" (?UELinkerFixups@@YAXXZ)  б",[10,85,86],{},"MainFrameActions: 打包 (Windows (64位)): UnrealBuildTool: F:\\Unreal\\Test_mp 4.10\\Binaries\\Win64\\Test_mp.exe : fatal error LNK1120: 4    ޷        ⲿ",[10,88,89],{},"可以尝试在打包设定中勾选Full Rebuild",[10,91,92],{},"不过需要注意的是，如果使用的是源码版的引擎的话，会消耗大量的时间。",[20,94,95],{"id":95},"杂项记录",[10,97,98],{},"打包的过程中还遇到了一些其他的错误，这里姑且记录一下。",[10,100,101],{},"在打包完成之后运行游戏始终出现这样的错误：",[59,103,104],{},[10,105,106],{},"Windows 无法访问指定设备、路径或文件。您可能没有合适的权限访问这个项目。",[10,108,109],{},"最后解决办法是把安全软件给关掉，有的安全软件会在没有任何提示的情况下将文件给隔离\u002F删除掉。",[10,111,112],{},"还有一个错误是在Ship打包的时候，运行游戏出现错误：",[59,114,115],{},[10,116,117],{},"Failed to open descriptor file ‘..\u002F..\u002F..\u002FBlank-Win64-Shipping\u002FBlank-Win64-Shipping.uproject’",[10,119,120],{},"这个似乎是打包功能的Bug引起的，又或者就是这样的设定。总之将对应的文件名进行修改就可以了，修改运行文件本身的文件名也是可以的。",{"title":36,"searchDepth":122,"depth":123,"links":124},2,3,[125,126,127,128],{"id":22,"depth":122,"text":22},{"id":45,"depth":122,"text":45},{"id":54,"depth":122,"text":54},{"id":95,"depth":122,"text":95},"2015-08-01","md",{"layout":132,"status":133,"published":134,"author":135,"author_login":136,"author_email":137,"author_url":138,"wordpress_id":139,"wordpress_url":140,"date_gmt":141,"excerpt":142},"post","publish",true,{"display_name":136,"login":136,"email":137,"url":138},"chaoshikari","chaoshikari@gmail.com","\u002F",1469,"\u002F\u002F?p=1469","2015-08-01 11:45:05 +0000",{"type":7,"value":143},[144],[10,145,12],{},"\u002F2015-08-01-ue4-package-logs-windows",{"title":5,"description":12},"_legacy\u002F2015\u002F2015-08-01-ue4-package-logs-windows",[150,151],"UE4","Package","LXryStv443cfAY5PNs0jvzqSL3ss1urTELS9PdUjGKg",1788763180329]