發表文章

目前顯示的是有「Unreal」標籤的文章

[UE5.3] 渲染編譯加速 (Shader Compile speed up)

 摘要: 此方法適用於UE5,透過修改BaseEngine.ini的參數,來增加渲染編譯的執行程序數量(ShaderCompileWorker.exe),達到加速渲染編譯的效果。 以UE5.3為例BaseEngine.ini路徑為: C:\Program Files\Epic Games\UE_5.3\Engine\Config\BaseEngine.ini 修改「DevOptions.Shaders」分類裡的「PercentageUnusedShaderCompilingThreads」,預設值為50,意思是將保留50%的CPU資源剩下的來做渲染編譯,以32T的CPU來說,做渲染編譯時可以發現在工作管理員裡會有16個ShaderCompileWorker.exe執行程序,為提升資源充分利用可以將值修改為10或20,也就是將會使用90%或是80%的CPU資源,修改完後編譯執行程序將會提升到28個。 PercentageUnusedShaderCompilingThreads=10 若你發現修改此值沒有變化,要額外再修改「ShaderCompilerCoreCountThreshold」,預設值為12,意思是當你的CPU執行緒數量有12以上才會套用「PercentageUnusedShaderCompilingThreads」的效果,否則會以「NumUnusedShaderCompilingThreads」為主。 (可選)驗證方法: 由於UE會把編譯過的物件儲存快取(DDC, DerivedDataCache),所以測試方法為刪除DDC然後重啟專案,注意此步驟視電腦效能與專案規模有可能需要花費很多時間重建編譯。 UE預設DDC儲存路徑: C:\Users\User\AppData\Local\UnrealEngine\Common\DerivedDataCache #UE5.3 #ShaderCompileWorker #PercentageUnusedShaderCompilingThreads

[UE5.3] Jenkins主機搬移 疑難排解

 跑"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe" "%WORKSPACE%\xxx.sln" /t:build /p:Configuration="Development Editor";Platform=Win64;verbosity=diagnostic 出現找不到dotnet sdk的錯誤 本機解決方法 (因為裝了x86 & 64,預設讀x86) https://blog.csdn.net/Azurecorner/article/details/131920514 Jenkins解決方法 https://blog.cashwu.com/blog/jenkins-build-asp-net-core/ Jenkins>設定>全域屬性>新增>名稱:Path, 值:C:\Program Files\dotnet\ ------------- 跑"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe" "%WORKSPACE%\xxx.sln" /t:build /p:Configuration="Development Editor";Platform=Win64;verbosity=diagnostic 出現C:\Program Files\dotnet\sdk\8.0.200\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1004: 找不到資產檔案 'E:\UE_5.3\Engine\Source\Programs\UnrealBuildTool\obj\project.assets.json'。請執行 NuGet 套件還原,以產生此檔案。 [E:\UE_5.3\Engin...

UE Show Log VeryVerbose Level

Log Verbosity Levels Fatal Fatal level logs are always printed to console and log files and crashes even if logging is disabled. Error Error level logs are printed to console and log files. These appear red by default. Warning Warning level logs are printed to console and log files. These appear yellow by default. Display Display level logs are printed to console and log files. Log Log level logs are printed to log files but not to the in-game console. They can still be viewed in editor as they appear via the Output Log window. Verbose Verbose level logs are printed to log files but not the in-game console. This is usually used for detailed logging and debugging. VeryVerbose VeryVerbose level logs are printed to log files but not the in-game console. This is usually used for very detailed logging that would otherwise spam output. Log console command usage [cat] = a category for the command to operate on, or 'global' for all categories. [level] = verbosity level, one of: none, e...

UE Console Tips & Tricks

CE(Custom Event) // Level Blueprint Custom Event e.g. CE TestEvent (X=1.000000,Y=2.000000,Z=3.000000) KE(Kismet Event) // Blueprint Class Custom Event e.g.  KE * TestFunction KE BP_TestEvent_C TestFunction Console Tips & Tricks 【UE4】ConsoleCommand「CE,KE」について【★★☆】

[UE4.27] Fix Moire Effect

圖片
Cause: When the character moves, it overlaps with a specific material and causes afterimages Solve: Material > NormalMap(Texture).LevelOfDetail.MipGenSettings=Blur3 Or Anti-aliasing method: TAA > TSR

[UE4.26] File and Folder Management, Create, Find, Delete

DeleteFile bool UBPLibrary::DeleteFile(FString Path) { IPlatformFile& FileManager = FPlatformFileManager::Get().GetPlatformFile(); return FileManager.DeleteFile(*Path); } DeleteDirectory bool UBPLibrary::DeleteDirectory(FString Path) { IPlatformFile& FileManager = FPlatformFileManager::Get().GetPlatformFile(); return FileManager.DeleteDirectoryRecursively(*Path); } Reference Link:  File and Folder Management, Create, Find, Delete

[UE4] Find InputKey in Blueprint

Search > Nodes(Name=[keyName] ClassName=key) Reference: https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/Blueprints/Search/

[UE4] TortoiseSVN Diff & Merge - UE4 asset file

TortoiseSVN Diff - ue4 .uasset TortoiseSVN > Settings > Diff Viewer > Advanced... add... ${UE4_ENGINE_ROOT}\Engine\Binaries\Win64\UE4Editor.exe -diff %base %mine TortoiseSVN Merge - ue4 .uasset TortoiseSVN > Settings > Diff Viewer > Merge Tool > Advanced... add... ${UE4_ENGINE_ROOT}\Engine\Binaries\Win64\UE4Editor.exe -diff %theirs %mine %base %merged Ref: [UE4] 怎麼設定tortoisegit來diff uasse

UE Media - Electra Media Player

Electra Media Player UE Doc - Electra Media Player UE Doc - Play a Video Stream Introduction Protocol Apple HTTP Live Streaming Steams LIVE Video on demand (VOD) Codec H.264 / AVC (ISO/IEC 14496-10) AAC (ISO/IEC 14496-3) More Adaptive bitrate streaming MPEG-4 Steam Players / Validator

UE4 多國語言實作 (Localization)

圖片
 建立文本庫 (String Table) New Asset > Miscellaneous > String Table 新增欲翻譯之文本內容 啟用工具-Localization Dashboard Editor Preferences > Gemeral > Experimental > Tools > Localization Dashboard 開啟Localization Dashboard Window > Localization Dashboard 指定欲翻譯的文本 (Gather Text) 勾選 Gather from Packages 在Include Path Wildcards指定String Table存放的路徑 設定目標語言 (Cultures) 新增目標語言 Add New Culture - English 確認Culture - Chinese設定為Native 收集欲翻譯的文本內容 Gather Text 手動翻譯文本 針對Culture - English進行翻譯 (Edit translations for this culture) Count Words確認內容數量 編譯文本 Compile Text (文本從Untranslated轉移至Completed) Note: 文本內容 (en - Game - Translation Editor)需關閉視窗再打開內容才會更新 實作 在WidgetBlueprint新增Text元件,在Content.Text進階設定(向下箭頭)選擇String Table及指定的Key,即可呈現具有在地化功能的文字 或在Blueprint裡透過類型為Text的變數來進階指定具在地化功能的文字 驗證 Editor Preferences > General > Region & Language > Internationalization > Preview Game Language = English 在Standalone Game模式下運行測試 Note: 在非Standalone Game模式下,有些內容會無法正確在地化 Chinese English

UE4 渲染編譯(Shader Compile) 加速方法

圖片
前言 UE4的使用者們應該都曾有遇過等待大量的渲染編譯(Shader Compile)的困擾,這邊提供一個小技巧來提升渲染編譯的速度,那就是修改Windows工作管理員處理程序的「基本優先順序」。 方法 「基本優先順序」欄位預設是不顯示的,在工作管理員「詳細資料」頁籤裡,在上方欄位處點擊滑鼠右鍵可以透過「選取欄位」選項來新增顯示的欄位。 在UE4中負責處理渲染編譯的程序為ShaderCompileWorker.exe,但你沒有辦法直接在工作管理員裡透過修改優先順序的方式來改善渲染編譯速度,理由為UE4在處理每一個Shader時會重新運行ShaderCompileWorker.exe,並將優先順序預設設定為「在標準以下」,因此你可以觀察到ShaderCompileWorker.exe該程序PID(Process ID)一直不斷變換,且優先順序維持為在標準之下。 MSDN-SetPriorityClass 在不修改UE4原始碼的前提下,比較暴力的處理方式是寫一支程序不斷的去修改ShaderCompileWorker.exe的優先順序,可參考以下範例: GitHub-AdrianJMartin/FixUnrealShaderPriority 或是可以直接購買UE4 Plugin- Compiler Booster

UE4專案移植Quest 疑難排解

 錯誤訊息 [ERROR: System.ArgumentException] ERROR: System.ArgumentException: Attempt to construct staged filesystem reference from absolute path (/Plugins/Online/Android/OnlineSubsystemGooglePlay/Content/Localization/OnlineSubsystemGooglePlay/OnlineSubsystemGooglePlay.locmeta). Staged paths are always relative to the staging root. 發生原因 建置android裝置途中中斷 解決方法 USB連結裝置與電腦,至該目錄刪除專案打包檔 UE4 AnswerHub ------------------------------ 錯誤訊息 [Failed to execute aapt] UEDeployAndroid.FilterStdOutErr: C:\Users\Derek\.gradle\caches\transforms-1\files-1.1\support-compat-27.1.0.aar\e9475617cc1bb21389c6ffa636e0fedb\res\values\values.xml:20:5-70: AAPT: error: resource android:attr/fontStyle not found. 情況說明 com.android.support:  包含在AndroidSDK裡的支持庫,支持特定Android平台版本的功能集 com.android.support:support-compat:27.1.0:  Support Library 27.1.0版本裡的v4兼容庫,為許多框架api提供兼容性包裝 gradle:  開源的建構自動化工具 // android support在sdkVersion:28之後重構為 androidx Android Developers : Support Library Packages 發生原因 查看Quest Android...

在UE4 BP中實作多機率選擇觸發功能

圖片
參考這篇文章做法 C++ function for picking from a list where each element has a distinct probability BlueprintFunctionLibrary.PickProbabilities() // 多機率觸發,每個機率值域0-1,在陣列越前面優先權越高。 藍圖線上預覽 實際應用範例 - AI機率狀態變換 藍圖線上預覽

Subversion (SVN) 淺談

SVN簡介 SVN = 版本控制 + 備份伺服器 簡單的說,您可以把SVN當成您的備份伺服器,更好的是,他可以幫您記住每次上傳到這個伺服器的檔案內容。並且自動的賦予每次的變更一個版本。 TortoiseSVN--SVN簡介 --- 基本功能操作 Checkout - 把主機上的檔案或是程式碼取出存到用戶端的電腦裡,建立連動 Update - 更新,下載最新的版本到用戶電腦裡,若資料跟主機一樣新,就不會異動 Commit - 將用戶端的變更上傳至主機 Branch/tag - 用於平行開發分支版本或是將版本定版 Switch - 切換版本 Subversion(SVN)概念與工具介紹 SVN中檢出(check out)、匯出(export)、匯入(import)、add(新增)、update(更新)的區別 --- SVN應用 SVN Repository 基本結構 trunk - 主開發目錄 (僅合併不開發) branches - 分支開發目錄 tags - 可用穩定版本 (唯讀) SVN 初始化流程 創建 repository 加入成員、設定權限 建立基本結構目錄 trunk, branches, tags 設定 properties SVN 開發流程 在開發分支(branch)上持續開發 階段開發結束將branch進度合併至trunk 將trunk發布為穩定版本(tag) 建立新的開發分支或原開發分支繼續開發 持續1~4階段循環至專案結束 SVN 使用案例 - 團隊工具庫 (以UE4為例) TeamTools trunk branches 4.25-dev 4.26-dev tags 4.25-release-1.0.20 4.25-release-1.1.35 4.26-release-2.0.52 // 由於開發專案時,工具也處於持續開發中的狀態,所以在專案使用以外部連結(external)方式指定專案開發版本(4.x-dev),除非必要(在舊版本重大除錯更新),否則新功能僅在最新開發版本(4.latest)上追加。 // 避免專案開發中需要隨著工具版本更新而重設工具版控路徑的麻煩,dev版本合併trunk後不刪除,唯有公開發布團隊外使用時才需建立tag穩定版本 SVN 使用案例 - 專案開發 (以UE4為例) MyProject trunk bran...

Oculus Quest with Virtual Desktop

圖片
  摘要: Oculus Quest結合Virtual Desktop(以下稱VD)軟體,可實現遠端無線高品質VR體驗。 Virtual Desktop Virtual Desktop VR Patch for Quest Oculus Quest play Steam VR games with Virtual Desktop --- Virtual Desktop - PC desktop & VR games PC端與Quest各自安裝VD軟體,PC端輸入Quest使用者ID後自動搜索配對,連線速度很快,且可網際網路連線不需要在同一網域。不過連線安全性有疑慮,自動連線無其他安全驗證方式。 VR體驗感很好,透過VR裝置上的鏡頭做室內3D空間定位,不須額外架設感應基地台,無線VR行動自由,還有穿透模式(不用取下VR裝置透過攝影機畫面看到外面實景),藉由VD畫面串流體驗高品質內容,以Wi-Fi 5連線低延遲,輸入方面除了VR控制器還有手勢辨識,可支援Oculus/Steam的VR遊戲,唯一需要注意VR裝置電量使用情形連續使用約1~2小時。 Desktop mode video bitrate : ~32 Mbps VR mode video bitrate : ~93 Mbps // 中文路徑可能造成SideQuest無法正常安裝Virtual Desktop VR Patch // 欲執行Steam或Oculus平台上的VR遊戲時,必須處於已登入的狀態 // Quest以手機無線基地台方式連線時,無法正常與VD連線 // 網際網路連線環境需開啟UPnP功能或是設定Port forwarding --- Virtual Desktop - My UE4Game 正常流程執行UE4Game時會發生無法順利連結VR模式的問題(無法全螢幕運行、VR控制器無法正常運作),需要執行以下程式開啟「Auto-inject」模式。 // 與VD中斷連線後將會關閉自動注入(auto-inject) RunMyUE4Game.vbs Set WinScriptHost = CreateObject("WScript.Shell") Return = WinScriptHost.Run("Powershell.exe -File "...

[UE4] 自動存檔與備份設定

C:\Program Files\Epic Games\UE_[Version]\Engine\Config BaseEditorPerProjectUserSettings.ini [/Script/UnrealEd.EditorLoadingSavingSettings] ; True if we should automatically load a default level at start up LoadLevelAtStartup=ProjectDefault ; True if we should automatically reimport textures when a change to source content is detected bAutoReimportTextures=False bAutoReimportCSV=False ; Whether to mark blueprints dirty if they are automatically migrated during loads bDirtyMigratedBlueprints=False ; Whether to automatically save after a time interval bAutoSaveEnable=True ; Whether to automatically save maps during an autosave bAutoSaveMaps=True ; Whether to automatically save content packages during an autosave bAutoSaveContent=True ; The time interval after which to save AutoSaveTimeMinutes=10 ; The minimum number of seconds to wait after the last user interactions (with the editor) before auto-save can trigger. AutoSaveInteractionDelayInSeconds=15 ; The number of seconds warning befo...

UE4 Installer (Advance Installer)

圖片
The following three solutions are currently known: Visual Studio Installer Projects (Setup Project) // Not easy to set up for UE4 Advanced Installer  // Business software recommended Wix  // Free software recommended ------------------------------ Advance Installer general set up License - Freeware Product Details . Name Product Details . Version Product Details . Publisher Product Details . Control Panel icon Files and Folders . Application Folder Files and Folders . StartMenu . Programs Files and Folders . Desktop Builds . Package Type (Single MSI) Builds . Output Dialog . LicenseAgreementDlg (optional) License - Professional (additional) Builds . Package Type (EXE setup with resources) Builds . EXE icon Builds . Archive . CAB (Multiple volumes) Themes . Classic . classic Dialogs . ExitDialog . Launch Application // .cab cannot exceed 2GB // .exe cannot exceed 4GB // .ico 256x256 pixels // dialog  500x316 pixels // banner 500 x59 pixels Trick: User Interface....