alvr-org / ALVR

Stream VR games from your PC to your headset via Wi-Fi
MIT License
5.3k stars 475 forks source link

Add presets for game/setup compatibility #487

Open zarik5 opened 3 years ago

zarik5 commented 3 years ago

Brief explanation on how settings work

ALVR settings are defined by the server. The server defines all metadata (like position, min/max value, control type) and the dashboard generates the user interface accordingly. The "true" settings are only the advanced settings. Basic settings (represented by a placeholder on the server) are completely managed by the dashboard and they just modify other advanced settings. session.json and the presets work only with advanced settings. The settings in session.json have a code name, but usually it's not too difficult to identify which entry correspond to which setting in the dashboard, especially since they are laid in the same order.

How to create a preset

You need to work with JSON files. Currently the ALVR dashboard cannot help you but it's not too difficult once you try. First you prepare the settings in the ALVR dashboard with the desired values. Then you copy session.json file into the presets folder and rename it. Open the file and remove all entries unrelated to the preset you want to create. You probably want to remove "setupWizard", "locale", "openvrConfig" and "clientConnections". At the top level there should be only "sessionSettings". Inside sessionSettings you remove all settings branches unrelated to your preset. It's important to keep the correct structure for the settings you want to keep. The final file should be valid JSON (remember to remove the trailing comma for entries inside curly brackets). To test your preset import it in ALVR with the apposite button in the Settings tab. Check that it doesn't give you any error and verify that all settings have been set the intended way. You can find examples in server_release_template/presets. When your preset is ready you can put it in that same folder and submit a pull request.

JackWolfard commented 2 years ago

I noticed the presets were moved to alvr/xtask/resources/presets but haven't been modified since they were created. Is this still an issue which needs help?

zarik5 commented 2 years ago

Currently there is not much to tweak for specific games compatibility. Although ALVR has many settings there is not much to do to solve compatibility problems with games or hardware. The current settings system is still a bit limited but once we get to the dashboard rewrite we are going to support much more advanced presets (ie a full blown scripting language, and the dashboard will even use it internally to generate basic settings).