Vivecraft / VivecraftMod

An experimental port of Vivecraft to Forge/Fabric
Other
162 stars 33 forks source link

Option to only enable weapon collusion for swords? #249

Open kevina opened 5 months ago

kevina commented 5 months ago

Room scale weapon collusion can be dangerous, if you move you arms suddenly you can accidentally hit things. Normally it's easy to fix, but could be dangerous if you hit a villager's iron golem or a zombified piglin.

I only ever really use it in a fight, and not for mining (although fun at first, it quickly becomes very tedious).

Would you be open to add an option to only use it for swords?

I had a patch for 1.16 and the change was fairly simple. For weapon collisions the options become: Off, Weapons, Survival, On. Weapons for now will just include swords.

If interested I can redo the patch, I will base it on #221.

fayer3 commented 5 months ago

asking for clarifications, with only weapon collissions for swords you mean only hitting mobs with the arms(no blocks), or only swords can do damage?

kevina commented 5 months ago

only swords can do damage

fayer3 commented 5 months ago

so no hands, tools or other stuff can hit entities?

kevina commented 5 months ago

Correct, and you also can't hit blocks. I admit it is a bit of a hack, but easy to understand and implement.

Here is the patch I had for 1.16: https://github.com/kevina/Vivecraft_116/commit/31f0a8db75a145e80d2e3d9d387b0dbb3954cd2a

fayer3 commented 5 months ago

would it be bad for other stuff to hit entities?

fayer3 commented 5 months ago

hm, maybe if someone wants to pet their pet

kevina commented 5 months ago

would it be bad for other stuff to hit entities?

You could hit a villager by accident if you move suddenly while trying to trade (has happened to me, not so bad unless you end up killing the villager), you could hit a villagers iron golmen (bad), or a zombified piglin (really bad).

As far as blocks go, you could knock an item out from it's item frame, mess up a fragile redstone build, etc.

I admit this is less of a problem for me now that I am using the index controllers, but it was a serious problem when I used the HTC Vive controllers as they had a longer reach. It has been a while, but I believe with the HTC Vive your arm is the controller and so it sticks out a bit more than your actual arm. With the index this is less of a problem as your arm doesn't stick out past your real arm. I don't know how the quest controllers are mapped and how much of a problem this is with them.

fayer3 commented 5 months ago

shouldn't be, the item should always be at your hand

kevina commented 5 months ago

All I remember is back when I played 1.16 with the HTC Vive controllers I was constantly hitting things. What I do remember for sure was the pickaxe stuck straight out (and likely other items) from the arm, rather than at an angle, which could of contributed. I would need to go back to using the HTC Vive controllers to give you more information.

fayer3 commented 5 months ago

the hands are alligened with the vive handle yeah, as is the tool, that is intended grafik

kevina commented 5 months ago

And from that picture, it should also be obvious that when you hold the controller normally, your arm does stick out a bit past your hand. The combination of the two make it very easy to accidentally hit things.

Person Holding Vive Controller

fayer3 commented 5 months ago

that shouldn't matter much, but I get your concerns. index should be similar though

kevina commented 5 months ago

I think that the fact the the tool is at an angle from you in game arm make it a bit harder to accidentally hit something. I still did it a few times, but it not nearly as frequent with the index controller.

fayer3 commented 5 months ago

is the angle differnet? I don't have indexcontrollers to check, could you take a screenshot like I made to compare?

kevina commented 5 months ago

Yes. I try and do that the next I am in VR. How did you take the screenshot?

fayer3 commented 5 months ago

when you open the steamvr menu, it will show the controller on top, I then took a screenshot of steamvrs mirror window

kevina commented 5 months ago

vlcsnap-2024-02-17-17h15m48s565-fix

fayer3 commented 5 months ago

hm, so the hand sticks out the same. the angle is probably different, because the grip and point vector are diffrent, whereas on the vive they are the same

kevina commented 5 months ago

Yeah. I am not sure what it is exactly that makes a difference as far as reach and hitting things. All I know it is seams be less of a problem for me with the index controllers.

kevina commented 5 months ago

If you look closely it seams the actual hand (or front part) of the arm for the HTC Vive is longer. My Vive controllers are charging but I plan to revisit this later.

fayer3 commented 5 months ago

eh, the index finger is roughly at the second hand pixel for both