-
Notifications
You must be signed in to change notification settings - Fork 823
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
[Issue Report]: Possible collision issues with trap arrows #6669
Comments
So what's going on there is, opening the chest calls We have it on the to-do list already to fix RNG. But someone should probably fix elemental arrow damage from traps. |
Could it have something to do with the distance penalty to chance to hit? His description of the distance being a determining factor of if it hits you or not sounds to me like it's an intended mechanic. He's using a plate armor, which I'm assuming is Naj's Light Plate. So I'd assume he has 50 AC at bare minimum. For the sake of trying to get accurate math, I'd assume has a 3 AC thinking cap and at least 30 dexterity. So let's say his final "armor" value is 59. the arrow was even missing him 1 square away. It's hard to tell exactly how many frames passed between the arrow coming out of the chest and it colliding. Can we say 5 frames? So that math would be: Let's say for when he's far away from the chest, it takes 1 second for the arrow to reach him: |
Aren't you missing the point? Opening the chest resets RNG state, and the arrow burns random numbers every game tick. So regardless of all the math you've done, the result is entirely deterministic and dependent on the number of game ticks until the arrow reaches the player. Never mind that the arrow misses him 100% of the time at point blank in the video.
EDIT: I think I was remembering a different save file. |
I guess I am missing the point because I don't understand |
Hm, okay. Let's say the arrow moves at one tile per game tick and burns one random number per game tick. The following scenarios detail how RNG is used in each game tick after the chest is open. If you are standing next to the chest:
If you are standing one tile away:
If you are standing two tiles away:
And so on. Now, if the sequence of random numbers produce these outcomes...
You can see how the player would only be hit by the arrow if they stood one tile away from the chest, but not if they stood next to the chest or two tiles away. Because the object seed is used to overwrite RNG state when the chest is opened, it is impossible to change this outcome. The chest will always function this way no matter how you try to manipulate the RNG before opening the chest. |
Is that a problem ?? Or is they issue that they all have seed zero and so behave the same ? |
I do think it's a problem that seeding the RNG to generate items has unintended side effects. I also think it's a problem that trap arrows recompute damage every frame for no reason. That the arrow consistently hits or misses based on distance isn't necessarily a problem, though. It just highlights the underlying issues in a noticeable and unintuitive way. |
So we can close this one right ? |
It's not fixed yet, but we can close it I guess. I'll put out a fix similar to #6831 eventually regardless. That said, this is still lurking in the codebase. devilutionX/Source/missiles.cpp Lines 2790 to 2791 in 0f90d5b
It appears to be fixed in #6373, but that would need to be rebased again. |
Operating System
Windows x64
DevilutionX version
1.5.1
Describe
A trap arrow from a chest never hits the player if the chest is opened up close. It also almost never hits the player from a distance with telekinesis, and whether it hits you or not seems to depend on the distance you are from the chest.
traparrowsg.mp4
To Reproduce
Load save from silent arrow issue
Open chest at various distances
Expected Behavior
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: