- 先與sony的開發者關系部建立聯系,展示工作室/公司制作PSVR游戲的構想和計划以及制作實力,如果對方覺得你提供的信息具有說服力,則會提供開發者資格,和你簽署NDA,給你租借開發機和測試機(免費)。
- 安裝PS4 SDK
從官方提供的Playstation DevNet上下載PS4 SDK。因大陸可能牆了PS的IP,可以租用境外的服務器(該服務器ip必須告知sony的聯系人,列入其白名單)進行此操作,下載后安裝,有5個選項,Install SDK, Uninstall SDK, Switch SDK or Copy Samples, Download Files for Offline Installation, Configuration,選擇Download Files for Offline Installation.制作離線安裝包
進去以后選擇第一個選項Standalone Installer,選擇所有選項,設置好輸出位置,等待下載完成,就會生成一個離線安裝包,把這個安裝包放置到任何pc上都可以離線安裝PS4 SDK了。
- 連接硬件
連接好devkit/testkit,注意devkit有兩個網線接口,都要插上網線。
設置好devkit/testkit的ip地址,注意用於開發的PC和devkit要在同一個局域網 - 激活硬件
根據PS4 Dev net(需要從列入sony白名單的ip地址才能注冊和訪問)上的幫助文檔(Getting Started>Development Kit Setup Guid>Activation),先注冊開發機和測試機,Hardware>Active hardware,選擇所有的硬件,點下面的激活按鈕。獲取到一個注冊碼文件,將其名稱改一下(去掉后面的日期),拷貝到u盤根目錄,插在開發機/測試機的USB接口上(注意,devkit要插后方的usb接口)。在devkit上選擇”*Debug Settings>Activation>Activate from USB”,進行激活
最后在Neighbourhood(PS4SDK安裝時一起安裝的工具)里連接開發機,如果無法自動發現,就手動輸入ip地址進行添加。
- 獲取 UE4源碼
先在github獲取UE4的最新版源碼,過程比較容易,網上也有教程。 - 在PS4 Devnet上申請開發資格
在PS4 Dev net上的Development > Tools & Middleware,點擊最下方的Unreal Engine4 后面的Confirm developer status,如果提示沒有權限,就提交一個private support申請,讓sony的技術人員幫忙解決。
- 向Epic申請PS4的Console Source Code
在虛幻的如下頁面:
如果上述鏈接失效,先點擊該鏈接:
https://www.unrealengine.com/blog/playstation-4-and-xbox-one-now-supported
然后點擊Step2中提供的申請鏈接,打開的頁面如果並沒有任何表單,就換一個瀏覽器試試。表單的信息,公司名稱要和sony那邊注冊的信息保持一致,如果順利,很快epic就會回郵件與你聯系,要求通過網絡簽署一份nda協議,然后就會發一個ftp鏈接和賬戶密碼,下載與你的UE4源碼匹配的UE4PS4源碼。注意這些源碼是受到nda限制和保護的,不要與其他人分享。
- 編譯UE4的PS4版本
下載的UE4 source code 和 UE4 PS4 source code解壓在一起,先點擊setup.bat 進行設置,可能需要比較漫長的等待,安裝必要的環境。關於如何加快這個步驟,參考另外一篇.
[更新] 這里不需要按照PS4.pdf上的指導(上面說的太麻煩了),直接把UE4設置為啟動項目,確保Sulotion Configurations是Development Editor, Solution Platforms 是Win64,直接按F5(或者右鍵UE4>Debug>Start new instance)。等待大約四五十分鍾會全部Build完成。
- [踩坑更新] 上一步完成后再右鍵UnrealLightmass>Build,編譯Lightmass,不然后面沒法烘焙燈光貼圖!
-
編譯好的編輯器的exe文件在Engine\Binaries\Win64\UnrealEditor.exe,這就是以后做ps4開發要用到的特殊版本的ue了。
關於Build的Configuration可以參考官方文檔:https://docs.unrealengine.com/latest/INT/Programming/Development/BuildConfigurations/index.html -
創建測試工程,在PS4 devkit上測試
之后可以打開這個編輯器,創建新的測試工程,后面的步驟可以參考UE4PS4里提供的pdf指導文檔,但該指導文檔寫的比較離譜,很多都和現在的版本不一致,特別是cook 的過程寫的很復雜,其實不需要,直接可以在編輯器里點擊”Windows”菜單,Project Launcher,找到ps4,點擊后面的Launch,經過漫長的等待,游戲就會自動發送到Neighbourhood中默認的開發機上進行運行了。
關於如何在PS4上運行和測試,參考我的另外一篇文章:Best Practices For Running On the PS4 - PSVR的一些設置,直接參考Epic 論壇上的兩篇篇帖子
第一篇是設置頭盔的:
There are a few things to make sure in order to enable PSVR.
First: You should navigate to your projects Build\PS4 folder. There should be the file sce_sys\param.sfo. If it isn't there, you should copy the Build\PS4 folder from your engine (custom source build with PS4 files) over to your projects directory and remove the read only flags from the files. Open the param.sfo file using Sony's tool (PS4SDK\ORBIS\Tools\Publishing Tools\bin or something like that it is) and go to the "Peripherals etc" section. Make sure that you check one of the "Support / Require PSVR" options there and save the param.sfo file.
Second: Make sure that you enable the Morpheus plugin which you can find in the plugin list under Build-In \ Virtual Reality. Eventually restart the editor.
Third: Now that the plugin is activated, navigate to your project settings. Down below, you should see the category "Morpheus" in the left list. Select it, and check the "Enable Morpheus" option in the right list.
That's it! Launch your project and it should work (that worked for me on a blank project in 4.13).
第二篇是設置Move的:Check the following and Launch your game to PS4 then PS VR and Move Controllers should work.
1. Project Setting > Plugins > Morpheus > Enable Morpheus = true
2. Edit > Plugins > Virtual Reality > Morpheus > Enabled = true
3. Edit > Plugins > Input Devices > Move Controller Plugin > Enabled = true
4. For Move Controllers check here
https://docs.unrealengine.com/latest/INT/Platforms/VR/MotionController/index.html
-
在工程設置>General Settings里勾選上Start In VR
關於Rendering Path 和 抗鋸齒的組合,參考我的另外一篇文章 http://www.cnblogs.com/AnKen/p/6843007.html
在Unreal PS4論壇上也發了一個英文版本(僅有相關權限用戶可見),地址:https://forums.unrealengine.com/showthread.php?147275-Development-environment-setup-for-PS4-(and-PSVR)-step-by-step