CleverRaven / Cataclysm-DDA

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

Alarms for things besides sleeping. #29247

Closed curstwist closed 5 years ago

curstwist commented 5 years ago

Is your feature request related to a problem? Please describe.
Medicine and infection management idea (with other great uses).

Describe the solution you'd like
Make watches and smartphones have alarms that can be set besides for sleeping. Bonus content: make smartphones have optional vibrate instead of sound for alarms.

Describe alternatives you've considered
NPCs reminding you or other non-watch alarms would be welcome too.

Additional context
Currently (as far as I know) we can only set alarms when going to sleep. It would be great if we could have more control and set them for things like "time to take antibiotics" or "you're gonna die from that infection in 8 hours" preferably with the ability to name and save alarms, and set them to repeat.

In the future they could also be used to meet backup with NPCs you send to loot part of a town. the "meet me back here in 2 hours" alarm.

Credit to gimlet on discord for the idea.

Rail-Runner commented 5 years ago

Might be better to not limit it to electronic measures and just implement some functionality for character's memory. You write down a message, specify some time point or delay or period, and then at the specified time it is displayed like "You remember: [message]", possibly asking whether the character should interrupt their action too or not, if they're doing something like that. Possibly with some time innaccuracy if player character doesn't have a watch or similar, or possibly a small chance of forgetting it and not displaying the message if you really want to simulate that.

pjf commented 5 years ago

Was browsing issues and had a number of thoughts about alarms, so I'm sharing them here. These should all be considered suggestions and inspirations on how rich alarms might work.

Player visible behaviour

An action menu on an alarm-capable item that includes:

Some alarm items may support only a subset of these. For example, a standard mechanical alarm clock only supports a single daily alarm, and no alteration of volume. An egg-timer only supports a single once-off alarm. Alarms may consume batteries while chiming.

An item that is actively alarming should have a single option which is to 'stop alarm'. Players holding or adjacent to an alarm that goes off should be given the immediate option to disable the alarm (which takes one turn).

Alarms would have a 'duration' after which they stop on their own. Smart alarms (eg: on a phone) may allow these to be set. Others (such as mechanical clocks) may simply run for a set duration if unattended.

Alarm-capable items have great potential for things like a clock next to your bed to wake you up at the same time every day, but also as a distraction for zombies (set alarm clock, place where you want zombies to be, head around the corner and wait for it to go off).

Internal considerations

I'm not yet familiar with the CDDA codebase, and my C++ is a bit rusty, so consider this to be pseudocode.

Internally, it feels like an individual alarm structure would need the folllowing fields:

An alarm device would have the following fields¹:

Again this is all intended as a starting point and items for consideration, and should not be considered prescriptive at all. :)

glenmack commented 5 years ago

I would just add to pjf's comments that some of the code for timing these things probably already exists. The wait menu has wait until dawn/dusk, a feature I would like to see added to the alarm system (wake at dawn/dusk, for day/night raids) I intend to look into adding this for watch alarms at some point, if someone doesn't implement all of these good suggestions this first.

esotericist commented 5 years ago

I completely failed to notice this feature request, and independently worked on it here:

29519

pjf commented 5 years ago

@esotericist : You rock! Thank you for making alarms even better!

esotericist commented 5 years ago

@pjf No problem. I saw the writing on the wall with regards to craft times with the new crafting system, so it seemed obvious we needed an escape valve.

@curstwist Because I submitted the PR before I knew about this issue, my PR wasn't flagged as closing this PR. Do you think this adequately addresses your goal for the time being? Or are you wanting to hold out for the extended stuff you mentioned?

stale[bot] commented 5 years 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.

kevingranade commented 5 years ago

I'm going to call this addressed, if you think any additional features are necessary please open a new issue.