[Proposal] Adaptive HUD for Mobile and PC Devices with Tappable Functionality

Post Reply
nikusu
New member
Posts: 7
Joined: Fri Mar 08, 2024 13:42
In-game: Nyxous

[Proposal] Adaptive HUD for Mobile and PC Devices with Tappable Functionality

by nikusu » Post

[Proposal] Adaptive HUD for Mobile and PC Devices with Tappable Functionality

In Minetest, creating HUD elements that work seamlessly across both mobile and desktop platforms can be tricky, especially when you want them to be interactive on mobile devices. Inspired by the need for more flexible and responsive HUDs, I propose an adaptive HUD system that is tappable on mobile while still available on PC for reference and ease.

Key Features:

1. Device-Adaptive HUD Element Developers can register a single HUD element that behaves differently on mobile versus PC:

Code: Select all

minetest.register_hud({
    interactable_for_touchscreen = true, -- Enables tapping for mobile devices
    image = function()
        if mobile then
            return "hud_formobile.png" -- Tappable image for mobile
        else
            return "hud_fordesktop.png" -- Display-only image for PC
        end
    end
})
On mobile: The HUD element becomes tappable, allowing players to directly interact with it, e.g., to activate a skill or trigger an action.

On PC: The same HUD element is non-interactive but still displayed. This allows players to see the HUD for guidance or reference. While the interaction isn’t required, it’s useful to keep the same HUD for both platforms.



2. Why Include It on PC?

While mobile benefits from the tappable HUD, making it available on PC is also useful. Even though players don’t need to tap the screen, they still get visual cues and information. Plus, it’s easier for developers to manage one HUD for both platforms instead of building separate ones.



3. Customizable HUD Appearance

Developers can display different images based on the platform:

Mobile: A simplified, tappable button or icon for quick actions.

PC: A more detailed version of the same image, offering descriptions or tooltips to help players understand what the HUD represents without needing interaction.




4. Developer-Friendly and Consistent Design

Developers only need to create one adaptive HUD element, reducing the need for separate designs for mobile and PC. This ensures consistency across devices while allowing for different functionality (interaction on mobile, reference on PC).




Why This Feature Is Important:

Optimized for Mobile: On mobile, players can interact directly with the HUD by tapping the element to perform actions like activating skills.

Included on PC for Ease and Consistency: While the HUD isn’t tappable on PC, it’s still beneficial to include it for visual feedback and reference. It’s also easier for developers to handle one HUD element that works across both platforms.

Developer Efficiency: Building a single HUD for both mobile and PC saves time, ensures consistency, and maintains a unified design across platforms.


This system brings the tappable HUD functionality to mobile while keeping it available on PC for visual cues and reference. It’s inspired by similar systems in engines like Roblox Studio, giving Minetest developers a flexible, cross-platform solution.

User avatar
Blockhead
Moderator
Posts: 2021
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: [Proposal] Adaptive HUD for Mobile and PC Devices with Tappable Functionality

by Blockhead » Post

I support this proposal or similar ideas. it is a good way to support custom controls without additional keybinds, and works on all platforms. In my previous conception you would have it so that on PC, you would have a key to focus the HUD layer, then can click on images. On touchscreen you could just tap the HUD icons.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

Astrobe
Member
Posts: 619
Joined: Sun Apr 01, 2018 10:46

Re: [Proposal] Adaptive HUD for Mobile and PC Devices with Tappable Functionality

by Astrobe » Post

IMHO one doesn't make the same game for mobile or for PC; on the PC. It is the same chasm that exists between PC and console; that is, the keyboard+mouse combo is different from a game pad and different from a touchscreen. Certain game genres are only seriously considered only on PC, like RTS and FPS games. Conversely, some mobile games wouldn't make sense on PCs, because unlike game pads, touch screens (or graphic tablets) are uncommon.

AFAIC, I don't support mobile play at all because in my game fast pace and quick reaction are sometimes important; it has a focus on action which is not compatible with mobile gaming. I know other games tend to be more "lenient", though.

Also, you say that on PC these elements won't be interactive, which will lead programmers to develop an alternative way to trigger the functionality found on mobile, and this alternative method should not interfere with mobile controls. It seems that programmers might have to double the devs and tests anyway if they want to support both types of gameplay.

So, I'm not sure that making it available on the PC is worth the effort; that said, I don't know how much work it is, only you can tell. Just my two cents.
My game? It's Minefall.

nikusu
New member
Posts: 7
Joined: Fri Mar 08, 2024 13:42
In-game: Nyxous

Re: [Proposal] Adaptive HUD for Mobile and PC Devices with Tappable Functionality

by nikusu » Post

I mean sure i mean it will work, but it will not be the same way on Mobile because the one on Mobile is Interactable by touch, which should not be available on PC devices, so the useful way tl have it on PC, is either, or Probably use the HUD as a Keyboard trigger on PC, my original idea on PC is using the HUD on PC as a guide, but still create Separate trigger which could not make sense which will make the code longer.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests