Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd blind throwing #26949
Conversation
This comment has been minimized.
This comment has been minimized.
|
What happens if player chooses to blind throw from the position he is standing now? Will penalties to aiming be applied in this case?
Can't say for others, but for me it's good.
Honestly I don't like this much distance (on the keyboard) between regular throw and blind throw. If anything, I'd prefer using
Sound like OK for me, but I guess more tests are needed. |
This comment has been minimized.
This comment has been minimized.
|
Peek throwing doesn't feel like it would require it's own keybinding since it's very situational. |
This comment has been minimized.
This comment has been minimized.
Hatfish
commented
Dec 5, 2018
|
Could it be made a toggleable option from the throw screen? |
This comment has been minimized.
This comment has been minimized.
I like this! Throwing from the peek view would be the best. |
This comment has been minimized.
This comment has been minimized.
This was my original line of thinking until I saw the peek implementation, which actually just prompts for a peek location, charges the moves, moves the player to that location, calls the same Because
I wasn't quite sure how to trigger the throw in a way that meets the above criteria without hacking up |
This comment has been minimized.
This comment has been minimized.
I took a look at this and think I have a path forward that isn't too distasteful which gives us blind throwing as an action triggered from within the peeking action while maintaining my requirements above, so I'll implement it tonight. |
This comment has been minimized.
This comment has been minimized.
HotSake
commented
Dec 5, 2018
|
Since it's closely related, any chance blind firing can be implemented at the same time? |
This comment has been minimized.
This comment has been minimized.
I'd prefer to keep this limited in scope and do something like that in a follow up, but yes, I have also considered blind firing and will try to ensure that the approach I take doesn't preclude it. |
ralreegorganon
force-pushed the
ralreegorganon:blind-throw
branch
2 times, most recently
from
021b42e
to
e9529a3
Dec 6, 2018
This comment has been minimized.
This comment has been minimized.
|
I've updated this as described above to now be triggered from with the X peek action. I updated OP based on the changes/summary of feedback, but I'll repeat it here too: My original CR items:
Feedback so far seems to be that this is ok.
Based on feedback, I've moved this into a hotkey triggered from the existing peek action. I'd have preferred to take t since it would be consistent with throwing normally, but t within the LOOK keybindings is currently taken by the
My refactor from the original implementation to now trigging this from within the existing peek action means that it always is going to burn at least the move cost for peeking, but can burn additional time if necessary. I left the quadrupling of normal throwing dispersion in here as my baseline penalty. |
ralreegorganon
changed the title
[WIP] [CR] Add blind throwing
Add blind throwing
Dec 6, 2018
This comment has been minimized.
This comment has been minimized.
|
A nice addition would be to ask if you would like to pull the pin before throwing a grenade. If the thing you want to throw is already in your hand you should not spend the two turns first going back out of peek and then back into blind throwing. This leaves you with only one turn remaining after throwing an active emp grenade or none if it wasn't wielded first. |
BevapDin
reviewed
Dec 6, 2018
src/game.cpp Outdated
BevapDin
reviewed
Dec 6, 2018
| } | ||
|
|
||
| cata::optional<tripoint> game::look_around( catacurses::window w_info, tripoint ¢er, | ||
| const tripoint start_point, bool has_first_point, bool select_zone ) | ||
| const tripoint start_point, bool has_first_point, bool select_zone, | ||
| cata::optional<peek_action_opt> &peek_action ) |
This comment has been minimized.
This comment has been minimized.
BevapDin
Dec 6, 2018
Contributor
Please don't make output reference parameters. The return value is for the output of the function, parameters are for the input. Make a new type containing the position and the action and return that (wrapped into optional).
This comment has been minimized.
This comment has been minimized.
ralreegorganon
Dec 6, 2018
Author
Contributor
I updated this to return a new type and axed the output reference parameter as suggested. However, I made the return type non-optional, but the members of that new type (position and action) both are--it seemed more obtuse to work with if the return type was also wrapped in optional, since it should always be returning that object, but different properties may or may not be set depending on the path through the function. Does that make sense?
ralreegorganon
force-pushed the
ralreegorganon:blind-throw
branch
2 times, most recently
from
00c76ec
to
25b5474
Dec 6, 2018
This comment has been minimized.
This comment has been minimized.
This seems like a useful addition, but I think would basically be an enhancement to the throwing action in general. #24561 discusses it. Ideally, that work is done independently and this just benefits from it. Right now, I think if you want to blind toss a grenade around a corner your best bet is to wield the grenade, activate the grenade, peek, and then blind throw, and as you mention that's going to cost you the two turns that peeking takes. As it stands right now, because I moved the blind throw to be chained off the peek, the only way I see to make it not burn the two turns on an active grenade would be to put the move point deduction ( This would have the side effect of making it so that creatures would move after the player finished taking a look/throwing, rather than before. I don't know that it'd be wrong, but I think it would be unexpected given current behavior where I know that when I exit the peek, everything is in the state I just saw. If my peek revealed a monster right around the corner, I know I can start running immediately and the distance between us will be what I just saw. If the move point deduction comes after the peek, then I may exit the peek only to be attacked because the monster advanced around the corner and attacked me while I was exiting the peek. ...and you'd still have some potential blast radius problems if you're trying to toss an active grenade and run away, the difference being that you'd spend the time "exiting" the peek in the same spot you threw it from rather than spending the time "entering" the peek with an active grenade in your hand. Thoughts? My inclination is just to wait for #24561 to be tackled... |
ralreegorganon
force-pushed the
ralreegorganon:blind-throw
branch
from
25b5474
to
5794a09
Dec 6, 2018
This comment has been minimized.
This comment has been minimized.
|
I'm totally okay with this so long as it's not necessarily something one would use for say, throwing weapons at monsters, but rather, making sure an explosive or molotov arrives roughly where you want it as opposed to direct hits. |
This comment has been minimized.
This comment has been minimized.
|
Mind you, this could be useful to expand on suppressive fire, blind-firing so that we at least have some semblance of the ability to use cover against missile weapons and NPCs with them, hopefully with NPCs able to do the same. |
This comment has been minimized.
This comment has been minimized.
|
This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there: https://discourse.cataclysmdda.org/t/pks-rebalancing-unofficial-patch/16060/103 |
This comment has been minimized.
This comment has been minimized.
The main issue with suppressive fire is people's reaction to it, unless there are enemies that take cover when fired at, it's not going to do anything. |
This comment has been minimized.
This comment has been minimized.
|
While testing this, I hit 't' (lower case) more times than I can count, resulting in standing around spending turns with an armed grenade in my hands. I'd generally agree that avoiding changing keybinds around is a good idea, but this is a very high stakes mistake to make. Also the menu could use a prompt that throwing is now an option in the peek menu, hardly anyone is going to know about this otherwise. |
ralreegorganon
force-pushed the
ralreegorganon:blind-throw
branch
from
5794a09
to
ad4d104
Dec 7, 2018
This comment has been minimized.
This comment has been minimized.
Agreed on both counts. I've swapped this to t and moved the |
ralreegorganon
force-pushed the
ralreegorganon:blind-throw
branch
from
ad4d104
to
c4a3d78
Dec 7, 2018
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Confirmed. I bet it's because we have our user-keybindings (./config/keybindings.json) which the game created when it didn't exist the first time, which specified that travel was t. Then, in my update here, I defined that travel was T and blind throw was t (./data/raw/keybindings.json). When the game runs, it sees that it doesn't have a keybinding for Any idea if we've got a mechanism for migrating keybindings, or another alternative approach that might be reasonable? I did make the observation that if I change the order in which the actions are registered within the |
This comment has been minimized.
This comment has been minimized.
HotSake
commented
Dec 9, 2018
•
|
Sounds like the code that is adding a keybind from defaults should necessarily check if that key is already bound, and leave it unbound if so. But that's for a separate PR, I'd think. |
This comment has been minimized.
This comment has been minimized.
|
@kevingranade The "Travel to" event is only added to the input context when So while you set up zones, the game does not know about the throwing event (and in turn does not know that "t" is already bound to it) and lets you bind "t" to "travel". In theory you could bind "t" to yet another event when you just enter the normal look around command (not peeking and not setting up zones). |
BevapDin
closed this
Dec 9, 2018
BevapDin
reopened this
Dec 9, 2018
ralreegorganon
force-pushed the
ralreegorganon:blind-throw
branch
from
c4a3d78
to
71afc8e
Dec 10, 2018
ralreegorganon
force-pushed the
ralreegorganon:blind-throw
branch
from
71afc8e
to
aaf6422
Dec 10, 2018
This comment has been minimized.
This comment has been minimized.
travel_to is added unless we're setting up zones:
So in the case where we're peeking, both travel and throw get registered. I went ahead and swapped the order that the events get registered, so in the case where someone had previously default keybindings for travel in the look menu (t), and when they updated the game they retained their custom keybindings, it will now throw instead of travel when they press t. Anyone who has a fresh set of default keybindings won't have this problem. |


ralreegorganon commentedDec 5, 2018
•
edited
Summary
SUMMARY: Features "Add blind throwing"
Purpose of change
Add a new variation on throwing, a "blind throw" which can be used to throw around obstacles (e.g. corners) in exchange for an additional move cost and dispersion penalty.
Describe the solution
The blind throw is initiated by first peeking [X] and then pressing the hotkey to blind throw [t]. You are then prompted to select which item to throw using the normal menu for this selection. Note that the moves spent peeking at the target location and wielding the throwable item (if necessary) are spent while in the original location.
Then, you are presented with a blind throwing target selection menu, which takes into account the dispersion penalty that will be applied. Note the Blind throwing rock in the targeting menu and the terrible chance to hit...but I am targeting something that was untargetable around the corner in the previous screenshot.
For comparison, here's the normal targeting menu and chance to hit if I just moved into the space and attempted to throw the rock normally.
After selecting the target, the player is then returned to their original position while the projectile is thrown from the blind throw position with its appropriate penalties.
I've flagged this as [WIP] [CR] as I'm looking for feedback on some specific things, in addition to the usual code review:
Feedback so far seems to be that this is ok.
I picked q as the keybinding for this--we're somewhat running out of space on the keyboard, but it seems worth giving a default binding to, q was open, and its proximity to Q (suicide) makes a certain sort of morbid sense to me because a character with low throwing skill attempting to blind throw an explosive around a corner might as well just hit Q. Is there a better key? Should it not be bound by default?Based on feedback, I've moved this into a hotkey triggered from the existing peek action.
I'd have preferred to take t since it would be consistent with throwing normally, but t within the LOOK keybindings is currently taken by theAfter review, I've swapped this so t is now blind throw when peeking, and T is now the travel key.travel to locationand I'm reluctant to change existing hotkeys, so instead I took T.I went with the same move cost as peeking and quadrupled the normal throwing dispersion as the initial cost/penalty for this. I touch on my rationale some in the comments here, but I'd be interested in hearing other thoughts.My refactor from the original implementation to now trigging this from within the existing peek action means that it always is going to burn at least the move cost for peeking, but can burn additional time if necessary. I left the quadrupling of normal throwing dispersion in here as my baseline penalty.