PSVita Game Porting

English, For russian scroll lower

To start porting, you need:

First, install you need to install Unity stuff. I won't go deep into that, but there is a great tutor on how to do it by VitaHEX.
Then, you need to get the source code of your game. For this, you need the game itself (duh) and AssetRipper linked upper in the guide. Open AssetRipper and select C# Language Version to C# 4. Then go to File - Open Folder (Open File if using Android Game) - Locate your game folder(apk). After that, wait for some time.

CAUTION!!! The PC can lag during the process, cause the entire RAM is used. I do not recommend using the PC, while the decompilation goes on.

After that, go to Export - Export all files - Navigate to any folder on your PC. Then, open Unity and press the OPEN button. Then navigate to the folder you selected while exporting. It will have a folder with name of the game you decompile (If decompiling a mobile game it will be just AssetRipperExport123456789). Select it. It can say that it was made on an older/newer version of Unity, ignore that and press REIMPORT. It'll load the project. It'll have 999+ errors, that's OK.

If you forgot to change the CSharp language to 4, I have an application, that can show most of the newer C# errors. https://github.com/BurAndBY/Ungrader

You need to fix all those errors. Now you need to modify player controller to work with PSVita. You need to search for scripts with Input.GetKey in it. For that you need dnSpy. Open Assembly-CSharp.dll in dnSpy, Press Ctrl + F and search for Input.GetKey
Now remap that to PSVita keys. Cheatsheet to all keys:
× - KeyCode.JoystickButton0
○ - KeyCode.JoystickButton1
□ - KeyCode.JoystickButton2
△ - KeyCode.JoystickButton3
L - KeyCode.JoystickButton4
R - KeyCode.JoystickButton5
Select - KeyCode.JoystickButton6
Start - KeyCode.JoystickButton7
↑ - KeyCode.JoystickButton8
→ - KeyCode.JoystickButton9
↓ - KeyCode.JoystickButton10
← - KeyCode.JoystickButton11
If Input.GetKey structure looks like this - > Input.GetKey("Some Random Key Name"), then you need an edited InputManager.
A great InputManager is made by PSVita Forever discord and you can download it in the resources-central channel (You need to join the server at the first hyperlink before downloading)
After that go to File - Build Settings - PSVita - Switch Platform. And the magic Build button. Select any folder, that is NOT your project folder. I recommend making another folder for all your builds, so the structure will be like this

C:/Users/User/Documents/PSV_Builds/mygamename_0/

After the build is finished, put the UnityTools in PSV_Builds folder and drag the build folder (mygamename_0) onto the UnityTools exe. This will result the folder being deleted and the VPK created. Now you can put the VPK onto the vita and install it as usually.

И наконец-то русский

Это руководство работает только с играми Mono, IL2CPP намного сложнее и не рекомендуется для новичков.

Чтобы начать портирование, вам понадобятся:

Сначала нужно установить Unity. Я не буду углубляться в это, но есть отличный тутор по тому, как это сделать от VitaHEX.
Затем, вам нужно получить исходный код вашей игры. Для этого вам понадобится сама игра (duh) и программа AssetRipper, ссылка на которую приведена выше в руководстве. Откройте AssetRipper и выберите версию языка C# на C# 4. Затем перейдите в меню File - Open Folder (Открыть файл, если используется Android Game) - найдите папку с вашей игрой(apk). После этого подождите некоторое время.

ВНИМАНИЕ!!! ПК может лагать во время процесса, так как используется вся оперативная память. Я не рекомендую использовать ПК, пока идет декомпиляция.

После этого перейдите в Экспорт - Экспорт всех файлов - Перейдите в любую папку на вашем ПК. Затем откройте Unity и нажмите кнопку OPEN. Затем перейдите в папку, которую вы выбрали при экспорте. В ней будет папка с названием игры, которую вы декомпилируете (Если декомпилируется мобильная игра, то это будет просто AssetRipperExport123456789). Выберите ее. Он может сказать, что он был сделан на более старой или новой версии Unity, проигнорируйте это и нажмите REIMPORT. Проект загрузится. В нем будет 999+ ошибок, это нормально. Вам нужно исправить все эти ошибки. Теперь вам нужно модифицировать контроллер плеера для работы с PSVita. Вам нужно найти скрипты, в которых есть Input.GetKey. Для этого вам понадобится dnSpy. Откройте Assembly-CSharp.dll в dnSpy, нажмите Ctrl + F и найдите Input.GetKey
Теперь переназначьте его на клавиши PSVita. Чит-лист на все клавиши:
× - KeyCode.JoystickButton0
○ - KeyCode.JoystickButton1
□ - KeyCode.JoystickButton2
△ - KeyCode.JoystickButton3
L - KeyCode.JoystickButton4
R - KeyCode.JoystickButton5
Select - KeyCode.JoystickButton6
Start - KeyCode.JoystickButton7
↑ - KeyCode.JoystickButton8
→ - KeyCode.JoystickButton9
↓ - KeyCode.JoystickButton10
← - KeyCode.JoystickButton11
Если структура Input.GetKey выглядит следующим образом - > Input.GetKey("Some Random Key Name"), то вам нужен отредактированный InputManager.
Отличный InputManager сделан PSVita Forever Discord и вы можете скачать его в resources-central channel (Вам нужно присоединиться к серверу по первой гиперссылке перед скачиванием).
После этого зайдите в File - Build Settings - PSVita - Switch Platform. И волшебная кнопка Build. Выберите любую папку, которая НЕ является папкой вашего проекта. Я рекомендую сделать еще одну папку для всех ваших сборок, так что структура будет выглядеть следующим образом

C:/Users/User/Documents/PSV_Builds/mygamename_0/

После завершения сборки поместите UnityTools в папку PSV_Builds и перетащите папку сборки (mygamename_0) в папку UnityTools exe. В результате папка будет удалена, а VPK создан. Теперь вы можете поместить VPK на vita и установить его как обычно.

Edit
Pub: 13 Feb 2022 12:26 UTC
Edit: 13 Feb 2022 14:33 UTC
Views: 3436