GodotVR / godot_openxr_vendors

Godot 4 wrapper for OpenXR vendors loaders and extensions
MIT License
82 stars 17 forks source link

Add settings for HTC #148

Closed BastiaanOlij closed 1 month ago

BastiaanOlij commented 1 month ago

This adds a number of setting for HTC to the export profiles:

image

I've added a subsection for HTC here under a header for Khronos as we'll be adding settings for other platforms in a similar fashion as more and more headsets support the Khronos loader.

Also in the case of HTC these settings are simply No/Yes, not None,Optional,Required. Unlike with Meta, HTC doesn't gate functionality on these feature flags, these feature flags are purely used by the store to inform the user what features the game makes use of.

BastiaanOlij commented 1 month ago

We do gate the eye tracking feature on Android and don't enable it unless the feature flag is there and permission is given. I've added the feature flag support here, but I'm missing the permission part.

@m4gr3d is this a matter of implementing supportsFeature for Khronos and just returning true on the feature tag and not checking permission? And how are we going to deal with this long term as multiple headsets use the Khronos loader but only some require permission, and each of those have their own permission string?

@Malcolmnixon can you do some more testing here seeing you have the eye tracker?

m4gr3d commented 1 month ago

We do gate the eye tracking feature on Android and don't enable it unless the feature flag is there and permission is given. I've added the feature flag support here, but I'm missing the permission part.

@m4gr3d is this a matter of implementing supportsFeature for Khronos and just returning true on the feature tag and not checking permission?

Yes that's correct.

And how are we going to deal with this long term as multiple headsets use the Khronos loader but only some require permission, and each of those have their own permission string?

We'll need to check the Android build configs at runtime which provide information on the headset brand and manufacturer. Depending on these values, we can select the correct permission string or omit permission checking as done here.

BastiaanOlij commented 1 month ago

Yes that's correct.

Cool, I'll add that tomorrow.

We'll need to check the Android build configs...

Here is an interesting thought, with the likelihood of stores making apps available on multiple devices, how can we build a single APP that deals with the permission differences of different devices?

I'm assuming that as Horizon OS becomes available on other devices, it's the OS that dictates the permissions so we can have a build config for Horizon OS, but there is no guarantee we can make the assumption for other stores.

I don't think this is up to us to solve btw, we'll just have to wait and see what happens and hope that decisions made within the OpenXR WG and decisions made by vendors are going to improve this situation, but I do envision a future where we upload an APK to a store with no clue what Android devices it ends up running on.

dsnopek commented 1 month ago

I do envision a future where we upload an APK to a store with no clue what Android devices it ends up running on.

Stores frequently also require using a particular platform SDK library to check the user's entitlement when the apps starts up, and sometimes these SDK's have licenses that disallow distributing them with your game when NOT acquired via the store in question. This sort of licensing could prevent making a single APK that is able to work for multiple stores.

BastiaanOlij commented 1 month ago

The one exception being the permission for eye tracking, however, I don't have the eye tracking accessory, so I can't test that.

Malcolm should be able to test that, but important here is that on HTC there is no permission, but we require one because other platforms require one. That is still an issue to solve long term as I think Magic Leap requires a permission here, and definately Meta does and I think they now officially support the Khronos loader.

So long term we're going to need to have a discussion on how we're going to enhance this code so we somehow magically know if the device our app gets installed on, requires a permission check, and which permission check that is. Especially in the scenario where our users deploy on say, itch.io, and we have no idea what devices our app end up being run on (possibly a device that didn't even exist when our app was written).