Cataclysm-dda: Alarms for things besides sleeping.

Created on 3 Apr 2019  路  8Comments  路  Source: CleverRaven/Cataclysm-DDA

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.

<Enhancement / Feature> Items / Item Actions / Item Qualities stale

Most helpful comment

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:

  • Set a once-off alarm (goes off in X hours/minutes)
  • Set a daily alarm (goes off at XX:XX every day)
  • Set alarm volume (including vibrate for smart-phones?)
  • View/Edit alarms (which would also allow cancellation)

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:

  • time alarm_time
  • bool does_repeat
  • int volume
  • int duration
  • Maybe<string> label

An alarm device would have the following fields鹿:

  • enum repeats(Always, Never, Configurable) - Clock radios always repeat, and will go off every day if not stopped. Egg timers never repeat. Smart phones let you choose.
  • bool can_label - Smart devices can have alarm labels. You can always use a permanent marker on your egg-timer if you want a dumb label. :)
  • int max_alarms = 1 - Maximum simultaneous alarms allowed on device.
  • enum volume(Fixed<volume>, Configurable<volume>) - Mechanical clocks have fixed volumes that can't be changed. Smart devices can be configured up to volume loud.
  • enum alarm_duration(Forever, Fixed<t>, Configurable<t>) - Forever alarms run until disabled/destroyed/out of batteries. Fixed alarms always run for 't' turns. Configurable alarms allow the player to decide how long to run for, up to a maximum of 't' turns.

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

All 8 comments

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.

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:

  • Set a once-off alarm (goes off in X hours/minutes)
  • Set a daily alarm (goes off at XX:XX every day)
  • Set alarm volume (including vibrate for smart-phones?)
  • View/Edit alarms (which would also allow cancellation)

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:

  • time alarm_time
  • bool does_repeat
  • int volume
  • int duration
  • Maybe<string> label

An alarm device would have the following fields鹿:

  • enum repeats(Always, Never, Configurable) - Clock radios always repeat, and will go off every day if not stopped. Egg timers never repeat. Smart phones let you choose.
  • bool can_label - Smart devices can have alarm labels. You can always use a permanent marker on your egg-timer if you want a dumb label. :)
  • int max_alarms = 1 - Maximum simultaneous alarms allowed on device.
  • enum volume(Fixed<volume>, Configurable<volume>) - Mechanical clocks have fixed volumes that can't be changed. Smart devices can be configured up to volume loud.
  • enum alarm_duration(Forever, Fixed<t>, Configurable<t>) - Forever alarms run until disabled/destroyed/out of batteries. Fixed alarms always run for 't' turns. Configurable alarms allow the player to decide how long to run for, up to a maximum of 't' turns.

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

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.

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

29519

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

@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?

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.

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

Was this page helpful?
0 / 5 - 0 ratings