Modding Guide

Modding ViewR into games that run Unity is quite simple but takes time. The mod uses Illusion Plugin Architecture to inject code into Unity to run, very similarly to how Beat Saber mods are made.

To start off with, the requirements that we've discovered are:

  • Unity must be in 64bit (discovered from Space Pirate Trainer, which is apparently 32bit) 
  • The game must be newer than Unity 5.5 (discovered from The Lab which runs 5.4)

Start by installing IPA in the game that you wish to mod. You can do this through the mod installer, or installing all the components manually.

Using the ViewR mod installer

Download the latest mod installer here.

To mod ViewR into a Unity game that we haven't added to our games list yet, click the add button and find your game, and click OK.

You should be able to see your game added to the list.

Then click patch and wait for the matrix to finish loading.

The installer will have placed a default viewrcamera.cfg and viewrplugin.cfg.

Setting Configs

Once IPA is installed, also download and place PressPToPause in the plugins folder. We'll use this to explore the Unity scene.

Once all the files are in the required places, run the game in --verbose mode.

This should launch the game with a console window (which is helpful but not necessary).

When the game has launched and VR is working, click on the game window and press x on your keyboard to dump the hierarchy to a file.

In the file, locate where the headset is. This is usually marked with <<<Camera.main>>> or the like.

Copy the names of the headset, and the play space GameObjects to the viewrcamera.cfg file. Also, find out which MonoBehaviours to add to the camerabehaviourfilter (this is mostly through trial and error, sometimes incredibly obvious).

Find out if the game uses SteamVR or UnityXR. This can usually be found by checking the attached scripts on the hmd object for scripts starting with SteamVR_*. UnityXR tends to be used for Unity games running unity 2017 and higher, you can find this at the top of the logs that are shown at the top of the --verbose console. Once you've figured that out, fill in the field in viewrplugin.cfg.

Find out if the game initializes VR later than when the game starts. This can usually be told from whether or not there's a VR hmd/play space when the first loaded scene is dumped.

Culling layer settings, regenerate camera, and allow hdr tend to be trial and error.

Once these settings have been set. ViewR should work with the game you've modded. (And ayy, it worked first try).

(I don't know if budget cuts actually got modded correctly, at this point I'm too tired to actually test it properly with a headset. I'll come back and fix this later if you guys tell me it's actually broken.)

Update: It worked! (first try!)

No comments:

Powered by Blogger.