Cataclysm-dda: Cant safely aim at empty terrain

Created on 23 Sep 2017  路  6Comments  路  Source: CleverRaven/Cataclysm-DDA

Because you need to steady your aim to shoot accurately, and you cant steady your aim while aiming at nothing, all shots made with intent of hitting a piece of furniture or terrain are basically random unaimed shots.

Noticed this after almost killing myself with a fusion gun while trying to blow up some reinforced glass.

<Enhancement / Feature> <Suggestion / Discussion> Mechanics Change Aiming

Most helpful comment

I very much want this to be changed as well.

I would also like to see some way of targeting the same tile over and over without moving the cursor there every time, similar to how it auto-targets enemies over and over. This would help when I'm training by shooting at something other than an enemy.

All 6 comments

I very much want this to be changed as well.

I would also like to see some way of targeting the same tile over and over without moving the cursor there every time, similar to how it auto-targets enemies over and over. This would help when I'm training by shooting at something other than an enemy.

My thought is that the simplest thing to do is to make it such that hitting one of the "aimed" modes when terrain is highlighted just aims at that terrain, rather than doing nothing.

I'm new to the project though so I'm having some trouble implementing this. Having a creature target seems very baked into the aiming code. Any recommendations?

@kevingranade

I think you edited your post, it seems like you understand how it's working more or less so my explanation is redundant. I'll leave it for general knowledge though.

There's a member of player that tracks the current aim target, it currently must be a pointer to a creature.
When aim actions are taken, it first checks that you're still aiming at the last target aimed at, if not, it resets your recoil to RECOIL_MAX to represent changing your target, then applies the aim action. It's a bit complicated because you continue aiming at the same monster even if it moves.

This feature requires a change to the related code to set your aim point as coordinates instead of a creature. The simplest way to do this is to add another aim target that's a coordinate, and have the related code check both, it shouldn't be more than a half dozen places. The cleanest way to do this is to make an "aim target" class that encapsulates the distinction between aiming at a creature and aiming at terrain (keeping in mind it's not necessarily "The ground", it might be a wall or a vehicle.

It also requires a decision about what to do if a monster wanders into the square you're targeting. Does shooting with high aim into a square with a monster count as a aimed shot at the monster? I don't think it should, but completely resetting your aim also seems like an extreme approach.

Yes, I edited it after a few hours (before you replied though, I think). A lot of this stuff was still super useful.

re: the monster thing, I think it makes most sense to just shoot the terrain where the creature is standing. One can imagine situations where you'd really actually want to aim at furniture or something the creature is standing on. It seems odd to me that a player would desire that the target be switched to the creature, since they wanted to shoot the terrain.

On the other hand, one can imagine aiming at a doorway, waiting for a zombie to walk through it at which point you immediately shoot it. This would require a "pre aim" feature which feels like a separate thing.

Can you direct me to where I need to look for what happens when an aim button is first pressed? Like, where the aim target is actually assigned? It seems to me that tdata is the member you're referring to, but I can't find out how the targeting_data class stores the pointer to a monster.

When aim actions are taken, it first checks that you're still aiming at the last target aimed at, if not, it resets your recoil to RECOIL_MAX to represent changing your target, then applies the aim action.

It also requires a decision about what to do if a monster wanders into the square you're targeting. Does shooting with high aim into a square with a monster count as a aimed shot at the monster? I don't think it should, but completely resetting your aim also seems like an extreme approach.

Maybe the aim shouldn't be always reset to RECOIL_MAX on target change? Maybe a more tiered approach would be suitable - e.g. if the new target is in the same tile (e.g. switching from the floor to a monster), reset to 33% towards RECOIL_MAX; if the target is in a neighbouring square, reset to 66% of it; anywhere else it goes to 100%. We could then not count the shot aimed at floor as a shot aimed at a monster - the reasoning being, if I aimed at the ground next to monster's feet then I really want to shoot the ground; if I want to shoot the monster, I pay the slight (33%) penalty of adjusting my aim.

This really needs to be changed; there's no reason that I'd stop aiming and just stand down when a Smoker Zombie is barrelling towards me at full tilt, but a wisp of smoke obscured him for a split second and as such I can't pass turn/time until he shows up again, without wasting ammunition. Same goes for if I know there's (more of) a horde coming around a corner, but I've already killed all the currently visible zombies.

Was this page helpful?
0 / 5 - 0 ratings