I’ve made a similar request in the past, but I’m coming back with a more refined request.
Sometimes it can be very useful to tell what type of device a user is on (such as console, PC, mobile…). However, there is currently no way to explicitly check and see what device the user is on. And so game devs are forced to do hacky tricks to figure out what device the user might be on. I emphasize “might” because it is not a guarantee and there are holes in the logic.
These enums would best reflect the configuration options that users get when configuring their games on the website. If a user can select the device from there, then it makes sense that such device information should also be available in-game.
This would also help a lot when dynamically configuring a game within different environments. For instance, on XBox, there should be no keyboard controls showing. Currently, the way to do this is to check to see if a gamepad is connected and keyboard isn’t, and then hide/show the appropriate UI control elements. See the holes in that logic though? What if I want desktop users to still use gamepads but also have keyboard controls too? Also, what if the desktop user just happened to not have his keyboard hooked up yet? Now I have to listen for peripheral changes just to properly configure my UI on the fly. It would be so much easier just to have a simple property exposing the device type.
Share your thoughts!