CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.57k stars 4.16k forks source link

Flashlights Automatically Turn Off/On #71955

Closed Holli-Git closed 4 months ago

Holli-Git commented 8 months ago

Is your feature request related to a problem? Please describe.

I tend to forget a lot of the time to turn my flashlight off once I'm done looting something in the dark, and then end up wasting all my battery.

Solution you would like.

When you enter a tile that's dark enough, your flashlight turns on. When you enter a tile thats bright (And not bright due to your flashlight) it turns off. Would probably work best if you had a button to toggle this behavior so night raiders aren't mucked over by this feature.

Describe alternatives you have considered.

Having the ability to keybind specific actions such as activating a flashlight.

Additional context

No response

fairyarmadillo commented 8 months ago

You can bind it in your inventory to a specific letter, then press a and that letter.

AnotherSeawhite commented 8 months ago

I have a bit of concern about this suggestion. Using the flashlight that's in your bag tends to use moves (action cost), and darkness can make huge difference in combat, which might lead to uncomfortable situations.

Activating the flashlight while wielding (or a headlamp), however, uses no (or very little) moves, but you could just turn the flashlight on by simply pressing A.

Holli-Git commented 8 months ago

You can bind it in your inventory to a specific letter, then press a and that letter.

I understand, but I'd still like to have it automatically turn on/off

Holli-Git commented 8 months ago

I have a bit of concern about this suggestion. Using the flashlight that's in your bag tends to use moves (action cost), and darkness can make huge difference in combat, which might lead to uncomfortable situations.

Activating the flashlight while wielding (or a headlamp), however, uses no (or very little) moves, but you could just turn the flashlight on by simply pressing A.

Ah yeah I see, and it doesn't give any sort of interrupt warning. Would something like a interruption message solve that issue?

fairyarmadillo commented 8 months ago

That would only make it clunkier. You're trying to reduce keypresses and creating more.

AnotherSeawhite commented 8 months ago

Good point, but it's kinda complicated.

Let's say you enter a room without light, and pretend there's a monster. If you have poor night vision (3x3 vision in pure darkness) you won't be able to spot the monster, and your character might proceed to turn the flashlight on. This results in the character not being able to act quickly.

The toggle for this feature could work, but to be honest i keep forgetting whether i have auto forage on or off but most of the time it may lead to a huge disadvantage and inconvenience.

IMO, I would rather keybind a on a flashlight so that I can tap a two times on my keyboard to turn on the flashlight.

fairyarmadillo commented 8 months ago

Yeah but which flashlight? How does the game know? The one on your headlamp? Your pocket flashlight? The underbarrel flashlight on your gun? Your flashlight CBM? The heavy-duty flashlight in your backpack? The one in the pocket of the dead zombie you're standing on top of?

Holli-Git commented 8 months ago

Yeah but which flashlight? How does the game know? The one on your headlamp? Your pocket flashlight? The underbarrel flashlight on your gun? Your flashlight CBM? The heavy-duty flashlight in your backpack? The one in the pocket of the dead zombie you're standing on top of?

I'd assume it to have an order of what to use based on activation time, but I'll be honest I have no clue how possible this would be in game

Rokharn commented 7 months ago

If flashlight will turns on automatically, than stealthy characters with night-vision of any kind will get huge disadvantage especially those using night vision devices. So this is pretty bad idea from the beginning. And this kind of characters still need flashlights for some actions like checking books, some urgent craft, fast illumination of a large area for one-two seconds, throwing a flashlight as bait or for shooting purposes and so on.

Plus, most of the times you may want to turn flashlight on BEFORE you go into dark area as well at least to prevent some surprises like hulk on the dark corner right next to you... And from the very beginning a flashlight can be a very bad idea in the middle of a city at night, especially at the beginning of the game. It's essentially a game over most of the times. Well, good luck going to sleep, putting out a flashlight can get tiring players very quickly. Moreover, in this case, all the flashlights on the world on loot will be lit, and as a result, the batteries will be chronically low with some other backfires like you won’t be able to store them together with batteries, because... they will always turn on for the night time.

So situations, where this auto function can be useful not worth it. Doing it manual not hard at all. And training a player's memory is always useful.

ilovehans10 commented 7 months ago

There are already togglable auto actions in the option menu (see auto-forage, auto-pulp, auto-pickup), and I think this makes for a good contender for that list. If you ask me, the options available should be as follows:

These would need better names and descriptions, but hopefully they get the point across. It might also be better to only have a toggle for the feature in the option menu, and the more complex features (like safe mode awareness and off only) being put in a separate menu.

As far as the question about which light would it choose, the answer that comes to mind for me would be to make an auto-light menu similar to the auto-pickup and safe mode menus. This menu would allow you to whitelist items that the game considers a flashlight that can be auto-toggled. The game would then go down the list, and the first item in the list that the player has on them with charges in it would be turned on automatically in darkness. This menu could also be the home of the extra options, as I mentioned before.

An added bonus to having a preferred light source menu would be that if a player tried to do an action that requires light in the dark, the "it's too dark to craft that" warning could be replaced with a prompt to turn on a light before crafting.

Montimorency commented 7 months ago

It sounds nice on paper, but there's such issues as whether the code will recognize that it may be dark on one square, but fully bright two squares adjacent, which is a common experience with ground-level navigation, but also with tall urban structures. If I'm creeping along the twilight zone to avoid enemy FOV, I neither want nor need a flashlight. If there are no enemies but I'm exploring some small or standard rooms at high noon, ditto.

There are more inappropriate than appropriate use cases.

I would almost always want. say, my flashlight or smartphone to turn off when I leave a basement or underground level, but in most other cases the auto-toggle would be a hindrance rather than a help. On the other hand, there is no situation in which I would want the game to force lights on for me. And having to monitor an auto-toggle game/menu option based on my activities would in every way, including code, be more cumbersome than simply remembering my current use actions and toggles at any given time myself.

Also, toggling battery devices always drains one power unit AFAIK, which is enough of a disincentive that I'm as semi-conscious of it during gameplay as I am of turning off electronics when I'm 'done' with them. Even if the latter is technically more of a wastage concern.

github-actions[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

cosmo-naut commented 5 months ago

I'd like to revisit the original problem: "I tend to forget a lot of the time to turn my flashlight off once I'm done looting something in the dark, and then end up wasting all my battery." This happened to me a lot until I managed to train myself out of it. Hell, it even still happens from time to time.

A lot of the conversation here seems to be focused on automatically turning flashlights on, which I don't think is relevant to the original problem. The OP has no issue forgetting to turn their flashlight on, they know when they are in darkness. The problem exists when they exit that dark basement and are standing in broad daylight. This is more pronounced on tilesets that don't update the character's sprite to show a flashlight effect.

Perhaps a less invasive solution could be a log message when you enter bright light with an active light source? "Your light source is ineffective in these brightly lit surroundings" I believe that this would give players the reminder they need to flick their torch off when they choose to do so, and should be minimal enough that those who are intentionally keeping it on can just ignore it.

github-actions[bot] commented 4 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

kevingranade commented 4 months ago

I don't think handholding the player to this extent is a good idea, this isn't even a matter of "it would be obvious IRL but it's not in the game", because once you leave a dark area it's not apparent that the light is on because it's washed out in sunlight. The fix is just remember to turn it off, possibly make the fact that you are carrying an activated light more visible in the side panel.