-
Notifications
You must be signed in to change notification settings - Fork 793
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
improve dropping items #3489
base: master
Are you sure you want to change the base?
improve dropping items #3489
Conversation
827e689
to
d90f8ae
Compare
I tested but can't decide. What has always irritated me in general with this logic is the fact that if I aim at the top, then the item is dropped at the bottom. Or if I aim to the right, the item may end up on the left or on the right. The behavior is generally somewhat unpredictable. That was always kind of strange in this game. I think the best thing to do would be to drop the item where the mouse pointer is, paying attention to whether this tile is free. But I don't know if it's that easy to do. |
Then nothing would stop you from accidentally dropping your stuff in unreachable places. |
Yes, we should merge this PR quickly, because it is an improvement in any case. |
Dropping on the other side of walls is only possible if there's an unbroken line of items to the space. This could potentially be an unpathable line given the item adjacency check counts diagonals and player pathing requires clear spaces on both sides of a diagonal for it to be a valid path. Fixing that would be feasible by only checking orthogonal (non-diagonal) tiles in the item adjacency code. https://user-images.githubusercontent.com/357684/141664550-73450d0c-26f2-44d3-b233-313c6f328005.mp4 https://user-images.githubusercontent.com/357684/141664635-d4cb76f6-8c8c-4229-8fb0-930da72846b1.mp4 Edit: Actually, this is an incomplete fix as well. If an item is already on the ground on the other side of a wall the player will start dropping items there (which should eventually be reachable, but it will be non-obvious to the player). To do it properly we'd need to track which tiles are reachable with an unbroken chain from the starting point, requiring an additional data structure/different logic for finding the next tile to drop. |
b2f9b27
to
42e3466
Compare
|
@FitzRoyX how the hell do you drop items there in vanilla? These tiles aren't adjacent to character |
Oh my bad. I assumed devx was vanilla in this regard since it's based on RE code. Was this behavior already altered once before? |
yes ... that's exactly the point of this PR, to make the altered behavior usable (can't drop in unreachable places) |
Could have even tested in 1.3.0... |
@qndel, @AJenbo |
335b0b9 is not related to this PR |
That is clear. I'll put the comment there. |
@Chance4us what about this one? is it fine? |
Where do I have to look? Is there a new PR? I probably missed something, didn't I? |
This PR lol |
This more closely matches vanilla behaviour until more intelligent dropping item behaviour is implemented (see diasurgical#3489)
The aforementioned PR behaves almost like vanilla. You cannot drop more than 9 items. But the positioning is better. It feels very good. But if you want to drop more item, it won't be enough for us. |
Can we stop discussing other PRs here? Just tell me what you think about my one lol, I've changed it many times, have you tested the last version? Is it good? |
Just tested. Feels pretty good. |
Thanks :) |
This more closely matches vanilla behaviour until more intelligent dropping item behaviour is implemented (see #3489)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though this search needs to run twice each time an item is dropped, on my machine there's no noticeable lag. It'd be interesting seeing how this performs on handhelds/low power devices. I don't think it's a significant amount of extra work/space, the checkTiles array clocks in around 12kb and expected worst case for tilesToCheck seems to be around 40 queued positions after dropping a full inventory of gold.
Assuming no other surprising corner cases pop up like the stairs thing I reckon this is good after a rebase.
Source/inv.cpp
Outdated
if (dItem[startingPosition.x][startingPosition.y] == 0) | ||
return {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing I noticed while testing... This check stops the player dropping items inside houses (which is great :D), but also stops ctrl+click dropping items if you're standing on a tile above an object (something where IsItemBlockingObjectAtPosition
returns true). Relatively minor issue since the player can just move to a different tile, break/open the object, or drop with the mouse targeting a valid tile.
8effc04
to
3636df4
Compare
This reverts commit e633d7f.
3636df4
to
c9b9ffe
Compare
@Chance4us could you test again? :) |
Can confirm this fixes #4124 |
Of course I'll test soon |
The items almost always fall on the position where you aim the mouse pointer. It feels really intuitive. |
Allows dropping items further than only tiles adjacent to the character and prevents them from dropping in unreachable places.
@Chance4us can you test? : P
Resolves #3514 in a super ugly way 🙃
Fixes #4124