New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dual wielding (revival) #14427
base: master
Are you sure you want to change the base?
Dual wielding (revival) #14427
Conversation
In my opinion, hardcoded dual wielding is too inflexible. The engine could support all kinds of different hands, and number of hands. Wouldn't it be way better to have a
Imagine for example a game in which you control a spaceship that can shoot. Another example would be playing as a creature which has 4 or more hands that all show an animation when digging something. (If necessary, dual wielding could then be easily implemented in builtin.) |
At the time we (coredevs) decided that this was nonsense and we'd rather have the incremental improvement of two hands than some theoretical many hands feature that isn't realistic to happen. Also, much of this PR concerns itself with how a second hand works for item interactions. A HUD element does not address that. |
Of course, you would need additional functions to handle how placing and digging works, e.g. -- Ether "wield_index" for using the wield index or a static position.
player:set_dig_source("main", "wield_index")
player:set_place_source("offhand", 1) (This would also be useful for the hotbar, and I think there are already 2 issues which can be solved by this.) Also, I found at least 5 other issues which could be solved by a wieldhand HUD element. (I don't want to link all the issues here.) Maybe I should make a PR myself to show that it is "realistic to happen", but first someone should review my hotbar HUD element PR. |
Let's not have this discussion again. While I agree in principle, I take a less flexible solution that works and - crucially - exists over a pie-in-sky perfect solution that we will likely never get, any day! We can make sure that we do add anything that cannot be extended in the future. |
"Multi-handedness" is too specific feature for me. Where would you want to use it? Do you want your character to be a octopus? Note besides the obscure usecases of it, that would also significantly harden the interaction mechanism with the world through the callbacks
Actually we made the same conclusion yesterday in Discord during the discussion on this PR. As Herowl suggested, it is necessary to add a new HUD type, say "mesh", allowing to render a mesh on the screen with some manipulation like screen-space positioning, rotatiting, scaling, affecting the lighting, animating and etc. And then dual wielding could be based off that. Also, as it was stated yesterday, it is necessary to do refactoring in the creating/handling wield nodes part. |
I really don't want to continue this discussion here, but also don't want to keep your questions unresponded.
Dual wielding is also a kind of "Multi-handedness" as you call it, and yes it is specific. Especially since IIRC the behavior of its current implementation is mainly designed to be applicable for a Minecraft clone (MineClone2).
I already gave two examples. Another example would be playing a machine which has 3 "hands", e.g. 2 drills and one gripper. An octopus would fit into the creatures example, and playing with 8 tentacles which show an animation when you dig something would probably look quite nice.
Breakages wouldn't be much different from dual wielding. The main problem is how the current wield hand is determined.
This way you can keep Then callbacks e.g. NOTE:
Too bad you can't link the discussion here such that anyone who isn't singed up for Discord can read it. Contradictory to what I previously wrote, I think for a HUD element for wield hands, it would probably be better to just have an inventory source and visuals which only/mostly depend on the itemstack. So it would be better to make the animation a part of the item definition. A separate element type "mesh" could then still be added. To conclude, just do what the cordevs say (not me) and pay attention to what has been discussed in the two previous PRs and the Issue. Also, it would be good if you try to not introduce too much hardcoded things that will be difficult to generalize at a later point. |
My two cents:
With that in mind, we might still opt for merging the "dual wielding" feature first, incurring some technical debt for when / if the HUD wield mesh feature is to be implemented, because (1) the dual wielding code is largely already there (2) we probably don't want to delay this "too much". |
Thanks @appgurueu
+1 on that. |
So from the whole discussion that was here and on Discord I can make the following conclusive points:
|
6a228fb
to
117d2bd
Compare
A following code testing the correct work of
|
Do we need to revive the revival? :) |
117d2bd
to
c2069aa
Compare
Yes. That has been revived also now. |
c2069aa
to
f3fd2f6
Compare
As it is been more than a month since the original PR (#11016) was closed for a reason of the long inactivity of the author and it has not been opened so far, I've decided to take over it. The original commit history and authors priority was taken into consideration.
To do
set/get_wielded_item()
when used insideon_place
/on_secondary_use
callbacks.offhand
list on default.is_offhand
parameter to end of the callbacks to distinguish the passed itemstacks from the main and offhand.How to test
Test the following code: