Skip to content
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

Smaller hit box for jungle grass #1980

Closed
MarkuBu opened this issue Dec 15, 2017 · 25 comments
Closed

Smaller hit box for jungle grass #1980

MarkuBu opened this issue Dec 15, 2017 · 25 comments

Comments

@MarkuBu
Copy link
Contributor

MarkuBu commented Dec 15, 2017

The hit box from jungle grass is too big. Every time you want to dig a node or punch a mob jungle grass is in the way.

I suggest to make the hit box smaller. Something like the size of a slab would be enough. A full size hit box is not necessary in this case

@ghost
Copy link

ghost commented Dec 15, 2017

+1 plantlikes should have 1/16-1/8 tall hitboxes

@benrob0329
Copy link
Member

But if you were actually trying to fight in tall grass, it would certainly get in the way.

@MarkuBu
Copy link
Contributor Author

MarkuBu commented Dec 15, 2017

Probably, but mobs can punch through the grass. You get killed while you fight against the flora

@paramat
Copy link
Contributor

paramat commented Dec 15, 2017

Good idea. There is a balance with a player trying to dig jungelgrass and not being able to find the selectionbox, and a balance with a box that is unintuitive.
Concerning digging a node, it's somewhat expected that a node gets in the way of digging other nodes, however, since grasses are not walkable, items can end up inside them and be difficult to pick up. Also being not walkable it is more reasonable to reach through one for something else, or punch a mob through them.

If the box is a low wide box items would be difficult to pick up items inside the grass, so maybe the box can be at a distance from the ground? Maybe the box can be tall and narrow to represent the stem and not the leaves? Then it remains quite intuitive and easily findable as you scan past it.

My first suggestion then is a tall narrow box separated from the ground?

Also we coud extend this suggestion to other grasses and plants.

@MarkuBu
Copy link
Contributor Author

MarkuBu commented Dec 16, 2017

I don't agree with a narrow box. That would be weired for me. Even more if the box doesn't touch the ground.

My "natural instinct" to dig a node like grass (even tall grass) is to punch on the ground where the node is placed, not in the air.

The box can be a bit smaller (x and z) than a full block, should on the ground and if pickup of dropped items is a problem (I would suggest to add auto pickup anyway) then make the box lower than the height of dropped items

Just look at the hitbox of wheat. I would recommend this box size for all plantlike nodes except they are smaller like flowers.

@paramat
Copy link
Contributor

paramat commented Dec 17, 2017

Reasonable suggestion, but a low box would then partially block you from digging the node below, which is what you want. If it's low and narrow it will be too small. A tall narrow box more closely matches the structure of the grass as it runs along the intersection of the 2 textures and the central 'stem'. However it shouldn't be too tall otherwise it could get in the way of combat.

@MarkuBu
Copy link
Contributor Author

MarkuBu commented Dec 17, 2017

Ehm, it's common that you have to remove plantlike nodes before you can remove the node below. In this case you have to change nearly all hitboxes from plantlike nodes, which would be rediculous. And the current box blocks you from digging the node below since years

@paramat
Copy link
Contributor

paramat commented Dec 17, 2017

Yeah, and digging the node below would drop the plant anyway, so not much issue. I agree the full size box is not good, and your suggestion has potential.

@ghost
Copy link

ghost commented Dec 19, 2017

Since nodes (and all of their boxes) are editable after the mod was loaded while still in mod loading state of the server it’s possible to use another mod to change the maximum height of grass nodeboxes to a configurable value :)

https://github.com/4w/redef/blob/master/redefinitions/grass_height.lua

@paramat
Copy link
Contributor

paramat commented Dec 20, 2017

I'm ok with a low flat box, perhaps identical to the one we use for grass_*:

	selection_box = {
		type = "fixed",
		fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -5 / 16, 6 / 16},

Crops in farming use:

		selection_box = {
			type = "fixed",
			fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},

But i prefer the box is not quite as wide as the node.
I can see that these boxes, and the dry grass box, are inconsistent, so how about we change all 4 to be identical low flat boxes? I suggest using the grass_* box for all, or maybe a little flatter if it helps picking up items.

@paramat
Copy link
Contributor

paramat commented Dec 20, 2017

And for dry shrub too, any others?

@Ezhh
Copy link
Contributor

Ezhh commented Dec 21, 2017

Why would you use the normal grass box for jungle grass? Normal grass is meant to be low and easy to walk over, while jungle grass is meant to be dense and tall and should therefore present more of an issue when you are trying to move through it. I agree that the current height of the selection box could be reduced, but please don't take away what's unique about jungle grass. The texture is so much larger than normal grass for a reason.

@MarkuBu
Copy link
Contributor Author

MarkuBu commented Dec 21, 2017

I think we agree that the current hitbox is much to big. It might be difficult to find the right balance.

Maybe one node high? Probably 80% of the width?

@Ezhh
Copy link
Contributor

Ezhh commented Dec 21, 2017

That would be reasonable and better than the current box.

@paramat
Copy link
Contributor

paramat commented Dec 21, 2017

Ezhh good point, so you're saying that junglegrass should be somewhat obstructive due to it's height and thickness.
I'm ok with 1 node high.
Then all others (grass, dry grass, crops, dry shrub) have the same low flat box?

@Ezhh
Copy link
Contributor

Ezhh commented Dec 21, 2017

Haven't looked at the others yet, but have never had a problem with them myself. Do they need changing?

I'd be happy to make a PR for the jungle grass if it's helpful.

@paramat
Copy link
Contributor

paramat commented Dec 21, 2017

Grass is different to dry grass (and the selectionbox for height 1 is different to that of heights 2,3,4,5), and crops (like wheat) different again, maybe these can all be identical. Crops have a full width box, i think it should be -6/16 to 6/16 like the others.
Dry shrub can perhaps remain unchanged due to it being a shrub and therefore more sturdy.

A PR is welcome, i expect other devs will support this.

@MarkuBu
Copy link
Contributor Author

MarkuBu commented Dec 21, 2017

I'm no sure if it is a good idea to make the crops hitbox smaller. Players walk over their fields while punching on the ground to harvest the crops. If the hitbox is smaller you may miss a lot of the crops.

It is already a little bit difficult to harvest in a straight line because walking speed and punch speed don't match exactly. With smaller hitboxes this would be more difficult (and annoying if you have to stop over and over again to harvest missed crops)

@Ezhh
Copy link
Contributor

Ezhh commented Dec 21, 2017

I think it's fine for grass and dry grass to have different heights. The textures are of a different height (check _5 for each of them to really see it) as well, so it makes sense.

I also don't really see why crops wouldn't have full width boxes. You are growing crops specifically to be able to easily harvest them, whereas grass is something you might want to dig round. Different in-game purpose should justify a different approach, so unless someone actually complains about crop selection boxes, I wouldn't change the width of them.

@paramat
Copy link
Contributor

paramat commented Dec 21, 2017

Ok. Yes when i coded the selectionboxes for grasses i matched them to the texture heights as closely as possible.
So just a change for junglegrass is ok with me.

@MarkuBu
Copy link
Contributor Author

MarkuBu commented Dec 21, 2017

Matching to the texture size doesn't necessarily makes sense because a lot of people play with different textures.

For example the jungle grass of Pixel Perfection is smaller than the default and the selection box is taller than the texture

@Ezhh
Copy link
Contributor

Ezhh commented Dec 21, 2017

Surely the selection box should be designed based on the default textures. If someone wants to use a texture pack that's their choice, but the default game shouldn't be expected to account for large variations in texture packs.

@paramat Thank you. Expect a PR within the next couple of days (when I'm next home).

@MarkuBu
Copy link
Contributor Author

MarkuBu commented Dec 21, 2017

See #6815

@paramat
Copy link
Contributor

paramat commented Dec 24, 2017

#1995 merged. Good suggestion.

@paramat paramat closed this as completed Dec 24, 2017
@MarkuBu
Copy link
Contributor Author

MarkuBu commented Dec 24, 2017

Hitbox is much better now. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants