Open FilipLundby opened 2 years ago
Please support this. Adding multiplayer UI is a headache in Godot. Not only is the UI no configurable to what focus input it takes but if we want to emulate multiple cursors we have to attach a area2d to both and mouse and control and making the control's style react to things like button presses is a pain and very hacky
Device number seems like a good way to handle this, if it were added to core.
SubViewport
nodes can have a parameter called "Focus Device" or something similar that the user can use to select which device they'd like the Control to receive focus from, similar to in the Input Mapper:
Device number seems like a good way to handle this, if it were added to core.
Currently the first connected controller has an ID of 0. Keyboard also has an ID of 0. Simply distinguishing focus events by IDs is not a good idea, unless there is some other way to distinguish between different devices with the same ID.
Is this dead? I'm concerned because I thought this would be possible in Godot by default and was shocked to learn that it wasn't, which effectively kills my project. I'd take absolutely anything that would allow this to work even in the most janky, workaround ways. Is there anything at all I could do to even emulate this feature, or is local co-op simply not recommended for Godot?
I strongly believe this should live. I'm not too experienced but want to see into if this can be a reality. If not, we should raise more attention to it. I wonder could we have seperate root control nodes have seperate focus points?
There's a pull request you can test if you need this feature right now.
There's a pull request you can test if you need this feature right now.
Thank you. I'll definitely need to check this out in the coming days.
Also there is another pull request open, that implements this feature in a different way.
There's a pull request you can test if you need this feature right now.
I like the way this is looking to be implemented, but there's 0 Checks. Going by the Testing Pull Requests page, I cannot proceed as one of the first steps is to go into Checks and then Artifacts. However, no Checks, and I can't see anything about Artifacts anywhere (I'd imagine because there's 0 Checks).
Apologies for derailing the topic at hand.
I like the way this is looking to be implemented, but there's 0 Checks
I see 13 checks on https://github.com/godotengine/godot/pull/79480/checks.
That's a different pull request. I'm guessing the other has 0 because it's not approved yet.
Thank you for the help.
EDIT: Looks like it just got approved and that's exactly how it works. I apologize for spamming up the thread. That was me not knowing how Github works. Thanks again.
Would love to see multi-focus implemented. Majorly struggling to find a way to do local multiplayer UI. Currently using the Multiplayer Input asset to handle my gameplay controls, but at a loss for how to handle UI, especially with being limited to one focus target.
A potential solution would be to create a new control node called like Multi-Input Container or something. Put all the UI for a specific player under that. When grab_focus is called on any node beneath the Multi-Input Container, it will only release focus from any other node under the Multi-Input Container. Then, to handle the input, have the Multi-Input have an array of all Input Actions it will allow down the tree. The list could then be updated at runtime as new players join and add their Actions. It would work seamlessly now without having to restructure the entire Input Map system, though a cleaner handling of multiplayer down the road would benefit from a rework of the Input Map.
I'm still new at Godot so I'm unaware if this is an implementation that is achievable now. If it is, I'd love guidance.
Also if this proposal is dead, let me know and I'll create a new request.
@RudyFisher7 Please don't bump issues without contributing significant new information. Use the :+1: reaction button on the first post instead.
Describe the project you are working on
Local multiplayer / split screen / couch co-op. I want to allow each player to buy stuff in a shop simultaneously. However I would also imagine this becoming an issue if your game started with a character selection, e.g. Mario Kart, Street Fighter or Tekken.
Describe the problem or limitation you are having in your project
grab_focus()
can only be set for one UI element. The next player grabbing the focus will hijack it from the previous player.Describe the feature / enhancement and how it helps to overcome the problem or limitation
Allow each player control specific parts of the UI.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
An idea for a solution could be viewports - it seems that organicpencil on the Godot Forums solved this quite easily - though this requires rebuilding the engine: https://godotforums.org/d/20415-how-can-one-implement-splitscreen-ui-in-such-a-way-that-players-cannot-control-each-others-ui/2
Also related #29989
If this enhancement will not be used often, can it be worked around with a few lines of script?
I am honestly not sure.
Is there a reason why this should be core and not an add-on in the asset library?
Local multiplayer are common genre, which probably never goes out of fashion. This would spare a lot of headaches for anyone creating such type of game.
Edit: updated link to forum post (it was broken) and added screenshot.