testserver y_bows cannot shoot iron golem properly #6118
Labels
No Label
1. kind/balancing
1. kind/breaking
1. kind/bug
1. kind/construction
1. kind/documentation
1. kind/enhancement
1. kind/griefing
1. kind/invalid
1. kind/meme
1. kind/node limit
1. kind/other
1. kind/protocol
2. prio/controversial
2. prio/critical
2. prio/elevated
2. prio/good first issue
2. prio/interesting
2. prio/low
3. source/art
3. source/client
3. source/engine
3. source/ingame
3. source/integration
3. source/lag
3. source/license
3. source/mod upstream
3. source/unknown
3. source/website
4. step/approved
4. step/at work
4. step/blocked
4. step/discussion
4. step/help wanted
4. step/needs confirmation
4. step/partially fixed
4. step/question
4. step/ready to deploy
4. step/ready to QA test
4. step/want approval
5. result/cannot reproduce
5. result/duplicate
5. result/fixed
5. result/maybe
5. result/wontfix
ugh/petz
ugh/QA main
ugh/QA NOK
ugh/QA OK
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: your-land/bugtracker#6118
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
For some reason, I cannot shoot the iron golem except when aiming for the feet. It does have a collision box, but it doesn't get hit anywhere but in a small area at the bottom of the model.
Could be an issue in the model or the collision box, not necessarily in y_bows.
Unfortunately I can't check whether x_bows can hit them, because they are currently broken, too.
verified that the arrow does go straight through them except for a small volume around the feet.
de04cacf7f/iron_golem.lua (L16)
the actual mobs seem to also have the proper collisionbox.
a lot of other mobs also let arrows pass through them. i thought it might correlate to
visual_size
but that doesn't seem to matter, or at least not in a linear way. simple raycasts seem to work fine, i'm not sure why the compound raycasts don't.increasing the step size from .01 to .1 fixes the collision for some reason. i can't even begin to understand why that would be. needs a lot more investigation.
Wat??
On second thought: WAT?!?
The step size is not some global or entity step, it's the height a mob will climb upwards, right?
I think flux means integration step (the width of blue bars):
kinda "how often measurement is taken" XD
I've tried re-centering golem's collision box:
collisionbox = {-0.7, -1.31, -0.7, 0.7, 1.39, 0.7},
seems to work better?
And this may be why:
e10d8080ba/src/serverenvironment.cpp (L1838)
this function is used when initializing raycast in
continueRaycast
call)e10d8080ba/src/environment.cpp (L131)
Note the length + 10:
Still don't have a clear picture in my head, but this is closest I could get to explanation...
So, when you make the step too short, golem is considered too far to add it to the list of possible collisions, because, again, not the collision box is considered, but the "position" of the entity (which is at the bottom of the golem)...
but it's not 10 nodes away, is it? or is this one of those places where everything is scaled by a factor of 10?
see the BS definition and comments: one block is 10 units in C++ side of things.
(at least, as far as I can see)
verified that increasing the value to 100 fixes the problem... so this is an engine issue :\
You could just clamp the minimum length of your ray to some "largest hitbox" size...
And using larger step is probably ok too?
upstream engine issue: https://github.com/minetest/minetest/issues/14337
tests show that the accuracy isn't great when lag, but it's acceptable given the alternative at the moment.
Then extending the ray length is the way. Set it to some minimal value, then while casting check if returned object is still within your required range and abort casting of it is not.
There's enough info returned:
i've increased the step size to 0.1s for the time being:
1cfdcfc890
This is basically what is happening, as I understand it:
The radius of green circles is the length of the raycast.
Note that "getObjectInRadius" with ray's length will never reach the box's center... And golem has it's "pos" at the bottom of the box, so it's even worse.
i had the same idea, but i haven't implemented it yet :)
upstream PR: https://github.com/minetest/minetest/pull/14339
note that because this will be in the engine at earliest at 5.9, we still need the workaround whosit described.
the maximum extent of all our collisionboxes is currently
{-4, -2.5, -4, 4, 9, 4}
(the steampunk blimp), so if we want to be safe, the minimum length of a raycast is 10.5 O_Oimplemented raycasts that enforce a minimum length and ignore anything beyond the specified stop point:
36e344d490
5366499fb4
Wait, they're using get_objects_inside_radius for raycasts?
Yes :3
ballistics 2024-02-04 on test:
I can headshot golems without problems... and ankleshot too.
Can also hit players.
engine PR has been merged, but it's irrelevant for the time being.
Is this a commit we may want to cherrypick?
only if we suspect (or better yet, determine) that the fix to ballistics is creating lag.
get_objects_in*
is not efficient, particularly when every object is calling it every step, but arrows are much more limited - there should only ever be a handful of those calls on any given server step.this is live