Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add transient text notifications matching speech notifications #19872

Merged
merged 5 commits into from
Apr 30, 2022

Conversation

dragunoff
Copy link
Contributor

@dragunoff dragunoff commented Jan 9, 2022

This PR adds support for text notifications that display along all speech notifications. This is useful for players that don't have audio or whose hearing is impaired. The notifications are displayed in the new transients panel which also hosts the UI feedback notifications. There is an option under "Display" to toggle these notifications and they are enabled by default1.

The text notifications are added as fields to traits that make use of [NotificationReference]23. This is a different approach to my previous attempt where the notifications were transcriptions attached to the speech definitions (see #18929). This new approach results in more code but I think it's better by design because audio and text aren't the same thing - text might not be a direct transcription of the spoken words (e.g. faction announcers) or the audio notification might not even be speech (e.g. sound effects).

Screenshots

image

List of notifications

I have added all possible notifications to all mods in a TESTCASE commit. We should consider which texts are worthy of keeping. Some of them are backed by other visual cues (e.g. "Building.", "On hold.", "Cancelled", "Select target.", "Rally point established.") while others may be considered noise ("Unit ready.", "Unit lost.").

Here're all traits and my proposal on what notifications to include:

Common

Actors Traits Notifications Text
Classic Production Faciliites PrimaryBuilding SelectionTextNotification Primary building selected.
Production Faciliites RallyPoint TextNotification -
Structures RepairableBuilding RepairingTextNotification -
^DisableOnLowPowerOrPowerDown, ^DisableOnPowerDown ToggleConditionOnOrder EnabledTextNotification -
^DisableOnLowPowerOrPowerDown, ^DisableOnPowerDown ToggleConditionOnOrder DisabledTextNotification -
Various CrateAction TextNotification -
^GainsExperience GainsExperience LevelUpTextNotification Unit promoted.
Player BaseAttackNotifier TextNotification Base under attack.
Player BaseAttackNotifier AllyTextNotification Our ally is under attack.
Player MissionObjectives WinTextNotification -
Player MissionObjectives LoseTextNotification -
Player MissionObjectives LeaveTextNotification -
Player PlaceBeacon - -
Player PlaceBuilding NewOptionsTextNotification New construction options.
Player PlaceBuilding CannotPlaceTextNotification Cannot deploy here.
Player PlayerResources InsufficientFundsTextNotification Insufficient funds.
Player PlayerResources CashTickUpNotification -
Player PlayerResources CashTickDownNotification -
Player or production facilities ProductionQueue ReadyTextNotification Unit ready. / Construction complete.
Player or production facilities ProductionQueue BlockedTextNotification Unable to build more.
Player or production facilities ProductionQueue LimitedTextNotification Unable to comply. Building in progress.
Player or production facilities ProductionQueue QueuedTextNotification -
Player or production facilities ProductionQueue OnHoldTextNotification -
Player or production facilities ProductionQueue CancelledTextNotification -
Player ResourceStorageWarning TextNotification Silos needed.
Player PowerManager TextNotification Low power.
Buildings Sellable TextNotification -
Units ActorLostNotification TextNotification Unit lost.
Support powers SupportPower DetectedTextNotification -
Support powers SupportPower BeginChargeTextNotification -
Support powers SupportPower EndChargeTextNotification -
Support powers SupportPower SelectTargetTextNotification -
Support powers SupportPower InsufficientPowerTextNotification -
Support powers SupportPower LaunchTextNotification -
Support powers SupportPower IncomingTextNotification -
MCV Transforms TransformTextNotification -
MCV Transforms NoTransformTextNotification Cannot deploy here.
World StartGameNotification TextNotification -
World StartGameNotification LoadedTextNotification -
World StartGameNotification SavedTextNotification -
(unused) ProductionParadrop - -
(unused) GrantPrerequisiteChargeDrainPower - -

TD

Actors Traits Notifications Text
AFLD ProductionAirdrop ReadyTextNotification Reinforcements have arrived.
E6 RepairsBridges RepairTextNotification -
HPAD, FIX, RepairsUnits StartRepairingTextNotification Repairing.
HPAD, FIX RepairsUnits FinishRepairingTextNotification -
^Building ActorLostNotification TextNotification Structure lost.
^CivInfantry ActorLostNotification TextNotification Civillian killed.
HARV ActorLostNotification TextNotification Harvester lost.
^Building CaptureNotification TextNotification Building captured.
^Building CaptureNotification LoseTextNotification -
^TechBuilding CaptureNotification TextNotification Civilian building captured.
^TechBuilding CaptureNotification LoseTextNotification -
EYE IonCannonPower DetectedTextNotification -
EYE IonCannonPower BeginChargeTextNotification Ion cannon charging.
EYE IonCannonPower EndChargeTextNotification Ion cannon ready.
EYE IonCannonPower SelectTargetTextNotification Select target.
EYE IonCannonPower InsufficientPowerTextNotification Insufficient power.
EYE IonCannonPower LaunchTextNotification -
EYE IonCannonPower IncomingTextNotification -
HQ AirstrikePower DetectedTextNotification -
HQ AirstrikePower BeginChargeTextNotification -
HQ AirstrikePower EndChargeTextNotification Airstrike ready.
HQ AirstrikePower SelectTargetTextNotification Select target.
HQ AirstrikePower InsufficientPowerTextNotification Insufficient power.
HQ AirstrikePower LaunchTextNotification -
HQ AirstrikePower IncomingTextNotification Enemy planes approaching.
TMPL NukePower DetectedTextNotification -
TMPL NukePower BeginChargeTextNotification -
TMPL NukePower EndChargeTextNotification Nuclear weapon available.
TMPL NukePower SelectTargetTextNotification Select target.
TMPL NukePower InsufficientPowerTextNotification Insufficient power.
TMPL NukePower LaunchTextNotification Nuclear weapon launched.
TMPL NukePower IncomingTextNotification Nuclear warhead approaching.

RA

Actors Traits Notifications Text
PROC, SILO InfiltrateForCash InfiltratedTextNotification Credits stolen.
PROC, SILO InfiltrateForCash InfiltrationTextNotification -
DOME InfiltrateForExploration InfiltratedTextNotification -
DOME InfiltrateForExploration InfiltrationTextNotification -
^DisabledByPowerOutage InfiltrateForPowerOutage InfiltratedTextNotification -
^DisabledByPowerOutage InfiltrateForPowerOutage InfiltrationTextNotification -
Production Facilities InfiltrateForSupportPower InfiltratedTextNotification -
Production Facilities InfiltrateForSupportPower InfiltrationTextNotification -
Super Weapons InfiltrateForSupportPowerReset InfiltratedTextNotification -
Super Weapons InfiltrateForSupportPowerReset InfiltrationTextNotification -
SPY Infiltrates TextNotification Building infiltrated.
E6 RepairsBridges RepairTextNotification -
SYRD, SPEN, FIX RepairsUnits StartRepairingTextNotification Repairing.
SYRD, SPEN, FIX RepairsUnits FinishRepairingTextNotification -
Buildings ActorLostNotification TextNotification -
Naval units ActorLostNotification TextNotification Naval unit lost.
Air units ActorLostNotification TextNotification Airborne unit lost.
^Vehicle, ^NeutralPlane CaptureNotification TextNotification Unit stolen.
^Vehicle, ^NeutralPlane CaptureNotification LoseTextNotification Unit lost.
^BasicBuilding CaptureNotification TextNotification Structure captured.
^BasicBuilding CaptureNotification LoseTextNotification -
AFLD ParatroopersPower ReinforcementsArrivedTextNotification Reinforcements have arrived.
PDOX ChronoshiftPower DetectedTextNotification -
PDOX ChronoshiftPower BeginChargeTextNotification Chronosphere charging.
PDOX ChronoshiftPower EndChargeTextNotification Chronosphere ready.
PDOX ChronoshiftPower SelectTargetTextNotification Select target.
PDOX ChronoshiftPower InsufficientPowerTextNotification Insufficient power.
PDOX ChronoshiftPower LaunchTextNotification -
PDOX ChronoshiftPower IncomingTextNotification -
ATEK GpsPower DetectedTextNotification -
ATEK GpsPower BeginChargeTextNotification -
ATEK GpsPower EndChargeTextNotification -
ATEK GpsPower SelectTargetTextNotification -
ATEK GpsPower InsufficientPowerTextNotification -
ATEK GpsPower LaunchTextNotification Satellite launched.
ATEK GpsPower IncomingTextNotification -
powerproxy.parabombs AirstrikePower DetectedTextNotification -
powerproxy.parabombs AirstrikePower BeginChargeTextNotification -
powerproxy.parabombs AirstrikePower EndChargeTextNotification -
powerproxy.parabombs AirstrikePower SelectTargetTextNotification Select target.
powerproxy.parabombs AirstrikePower InsufficientPowerTextNotification -
powerproxy.parabombs AirstrikePower LaunchTextNotification -
powerproxy.parabombs AirstrikePower IncomingTextNotification -
AirstrikePower@spyplane AirstrikePower DetectedTextNotification -
AirstrikePower@spyplane AirstrikePower BeginChargeTextNotification -
AirstrikePower@spyplane AirstrikePower EndChargeTextNotification Spy plane ready.
AirstrikePower@spyplane AirstrikePower SelectTargetTextNotification Select target.
AirstrikePower@spyplane AirstrikePower InsufficientPowerTextNotification -
AirstrikePower@spyplane AirstrikePower LaunchTextNotification -
AirstrikePower@spyplane AirstrikePower IncomingTextNotification -
IRON GrantExternalConditionPower DetectedTextNotification -
IRON GrantExternalConditionPower BeginChargeTextNotification Iron curtain charging.
IRON GrantExternalConditionPower EndChargeTextNotification Iron curtain ready.
IRON GrantExternalConditionPower SelectTargetTextNotification Select target.
IRON GrantExternalConditionPower InsufficientPowerTextNotification Insufficient power.
IRON GrantExternalConditionPower LaunchTextNotification -
IRON GrantExternalConditionPower IncomingTextNotification -
MSLO NukePower DetectedTextNotification -
MSLO NukePower BeginChargeTextNotification A-bomb prepping.
MSLO NukePower EndChargeTextNotification A-bomb ready.
MSLO NukePower SelectTargetTextNotification Select target.
MSLO NukePower InsufficientPowerTextNotification Insufficient power.
MSLO NukePower LaunchTextNotification -
MSLO NukePower IncomingTextNotification A-bomb launch detected.
powerproxy.paratroopers ParatroopersPower DetectedTextNotification -
powerproxy.paratroopers ParatroopersPower BeginChargeTextNotification -
powerproxy.paratroopers ParatroopersPower EndChargeTextNotification -
powerproxy.paratroopers ParatroopersPower SelectTargetTextNotification Select target.
powerproxy.paratroopers ParatroopersPower InsufficientPowerTextNotification -
powerproxy.paratroopers ParatroopersPower LaunchTextNotification -
powerproxy.paratroopers ParatroopersPower IncomingTextNotification -
powerproxy.sonarpulse SpawnActorPower DetectedTextNotification -
powerproxy.sonarpulse SpawnActorPower BeginChargeTextNotification -
powerproxy.sonarpulse SpawnActorPower EndChargeTextNotification Sonar pulse ready.
powerproxy.sonarpulse SpawnActorPower SelectTargetTextNotification Select target.
powerproxy.sonarpulse SpawnActorPower InsufficientPowerTextNotification -
powerproxy.sonarpulse SpawnActorPower LaunchTextNotification -
powerproxy.sonarpulse SpawnActorPower IncomingTextNotification -

D2k

Actors Traits Notifications Text
starport ProductionAirdrop ReadyTextNotification Reinforcements have arrived.
Player HarvesterAttackNotifier TextNotification Harvester under attack.
Player ProductionQueue BlockedTextNotification No room for new unit.
repair_pad RepairsUnits StartRepairingTextNotification Repairing.
repair_pad RepairsUnits FinishRepairingTextNotification Unit repaired.
sandworm AnnounceOnSeen TextNotification Worm sign.
^Building CaptureNotification TextNotification Enemy building captured.
^Building CaptureNotification LoseTextNotification One of our buildings has been captured.
^Building ActorLostNotification TextNotification Building lost.
palace NukePower DetectedTextNotification -
palace NukePower BeginChargeTextNotification Death Hand missile prepping.
palace NukePower EndChargeTextNotification Death Hand missile ready.
palace NukePower SelectTargetTextNotification Select target.
palace NukePower InsufficientPowerTextNotification -
palace NukePower LaunchTextNotification -
palace NukePower IncomingTextNotification Missile launch detected.
sandworm AttackSwallow WormAttackTextNotification Worm attack.
high_tech_factory AirstrikePower DetectedTextNotification -
high_tech_factory AirstrikePower BeginChargeTextNotification -
high_tech_factory AirstrikePower EndChargeTextNotification Airstrike ready.
high_tech_factory AirstrikePower SelectTargetTextNotification Select target.
high_tech_factory AirstrikePower InsufficientPowerTextNotification -
high_tech_factory AirstrikePower LaunchTextNotification -
high_tech_factory AirstrikePower IncomingTextNotification -
ProduceActorPower@fremen ProduceActorPower EndChargeTextNotification Fremen ready.
ProduceActorPower@fremen ProduceActorPower ReadyTextNotification Reinforcements have arrived.
ProduceActorPower@fremen ProduceActorPower BlockedTextNotification No room for new unit.
ProduceActorPower@saboteur ProduceActorPower EndChargeTextNotification Saboteur ready.
ProduceActorPower@saboteur ProduceActorPower ReadyTextNotification Reinforcements have arrived.
ProduceActorPower@saboteur ProduceActorPower BlockedTextNotification No room for new unit.

TS

Actors Traits Notifications Text
CHAMSPY Infiltrates TextNotification Building infiltrated.
NARADR, GARADR InfiltrateForExploration -
Player HarvesterAttackNotifier TextNotification Harvester under attack.
ENGINEER RepairsBridges RepairTextNotification Bridge repaired.
GAHPAD, GADEPT, NAHPAD RepairsUnits StartRepairingTextNotification Repairing.
GAHPAD, GADEPT, NAHPAD RepairsUnits FinishRepairingTextNotification Unit repaired.
^Building, CAHOSP CaptureNotification TextNotification Building captured.
^Building, CAHOSP CaptureNotification LoseTextNotification -
Buildings ActorLostNotification TextNotification -
GAPLUG, NATMPL ProduceActorPower ReadyTextNotification -
GAPLUG, NATMPL ProduceActorPower BlockedTextNotification -
NAPULS AttackOrderPower EndChargeTextNotification EMP cannon ready.
NAPULS AttackOrderPower SelectTargetTextNotification Select target.
GAPLUG DropPodsPower DetectedTextNotification -
GAPLUG DropPodsPower BeginChargeTextNotification -
GAPLUG DropPodsPower EndChargeTextNotification -
GAPLUG DropPodsPower SelectTargetTextNotification Select target.
GAPLUG DropPodsPower InsufficientPowerTextNotification -
GAPLUG DropPodsPower LaunchTextNotification -
GAPLUG DropPodsPower IncomingTextNotification -
GAPLUG IonCannonPower DetectedTextNotification -
GAPLUG IonCannonPower BeginChargeTextNotification -
GAPLUG IonCannonPower EndChargeTextNotification Ion cannon ready.
GAPLUG IonCannonPower SelectTargetTextNotification Select target.
GAPLUG IonCannonPower InsufficientPowerTextNotification -
GAPLUG IonCannonPower LaunchTextNotification -
GAPLUG IonCannonPower IncomingTextNotification -
NAMISL NukePower DetectedTextNotification -
NAMISL NukePower BeginChargeTextNotification -
NAMISL NukePower EndChargeTextNotification Cluster missile ready.
NAMISL NukePower SelectTargetTextNotification Select target.
NAMISL NukePower InsufficientPowerTextNotification -
NAMISL NukePower LaunchTextNotification -
NAMISL NukePower IncomingTextNotification Missile launch detected.

Linked issues

Closes #3278
Closes #6400
Closes #6354
Closes #12209
Closes #12954
Related #19724

Footnotes

  1. I've changed the label of the UI feedback checkbox in settings to read "Show UI Feedback Notifications" (see https://github.com/OpenRA/OpenRA/pull/19677#discussion_r778010108).

  2. Text notifications for cash ticks not implemented because they are too frequent.

  3. Text notifications for beacons not implemented because I think this needs some more thought and is better left to a follow up.

@pchote pchote added this to the Next release milestone Jan 9, 2022
@dragunoff dragunoff force-pushed the feature/transient-notifications-events branch from 66f360c to 498772b Compare January 9, 2022 20:52
@MustaphaTR
Copy link
Member

Original D2k had a few text notifications for stuff they didn't have a sound notification for, i think those could be included here too: #12209

@dragunoff dragunoff force-pushed the feature/transient-notifications-events branch from 498772b to 078d4d0 Compare January 10, 2022 09:56
Comment on lines 49 to 70
{
Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", info.Notification, world.RenderPlayer == null ? null : world.RenderPlayer.Faction.InternalName);
TextNotificationsManager.AddTransientLine(info.TextNotification);
}
}

void INotifyGameLoaded.GameLoaded(World world)
{
if (!world.IsReplay)
{
Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", info.LoadedNotification, world.RenderPlayer == null ? null : world.RenderPlayer.Faction.InternalName);
TextNotificationsManager.AddTransientLine(info.LoadedTextNotification);
}
}

void INotifyGameSaved.GameSaved(World world)
{
if (!world.IsReplay)
{
Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", info.SavedNotification, world.RenderPlayer == null ? null : world.RenderPlayer.Faction.InternalName);
TextNotificationsManager.AddTransientLine(info.SavedTextNotification);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason these don't display in RA and TS 🤷

@dragunoff dragunoff force-pushed the feature/transient-notifications-events branch from 078d4d0 to 72d3afa Compare January 11, 2022 10:23
@dragunoff
Copy link
Contributor Author

Update:

@dragunoff
Copy link
Contributor Author

Update:

  • Added "Select target." notification for support powers
  • Added "Unit promoted." notification for leveling up
  • Added "Primary building selected." notification
  • Added notifications to a couple of places that I had missed
  • Added a commit with the notifications proposed in the PR description (see table)
  • Split the rest of the notifications to a TESTCASE commit

The TESTCASE commit is there only to make sure all notifications are working. The proposed notifications are implemented in the commit before that one.

Reviews are welcome.

@dragunoff dragunoff force-pushed the feature/transient-notifications-events branch from 72d3afa to fb041da Compare February 11, 2022 11:23
@dragunoff dragunoff marked this pull request as ready for review February 11, 2022 11:24
Width: PARENT_RIGHT
Height: 20
Font: Regular
Text: UI Feedback in Transients Panel
Text: Show Transient Notifications
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure the average user will understand what Transient Notifications are. I didn't anyways.
Perhaps 'Show Speech Notifications as Text'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that "transient notifications" is not quite clear but that's what they are. And there isn't a 1:1 mapping between speech and text notifications. Perhaps adding a tooltip that explains what the setting does? Or another variant for the label?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a tooltip would do the job.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dragunoff this is still open.(?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

So something like this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So something like this?

I think that covers it.

@abcdefg30
Copy link
Member

About #19872 (comment): We should decide what to do for spectators in regards to notifications. That will also resolve #19662 (comment).

@dragunoff dragunoff force-pushed the feature/transient-notifications-events branch from fb041da to cc7b7ad Compare February 13, 2022 15:49
@dragunoff
Copy link
Contributor Author

Update: addressed formatting nits and #19872 (comment)

@abcdefg30
Copy link
Member

About #19872 (comment): We should decide what to do for spectators in regards to notifications. That will also resolve #19662 (comment).

For the record: We agreed on Discord to simply not have notifications for spectators for the moment.

@Smittytron
Copy link
Member

Do we want to leave this checked as a default setting?

@Smittytron
Copy link
Member

TS needs the text to be a bit higher above the command bar.

ts-2022-02-19T205529253Z

@dragunoff
Copy link
Contributor Author

Do we want to leave this checked as a default setting?

I think it's a good default so better leave it checked. We can adjust if we get feedback from playetests.

@dragunoff dragunoff force-pushed the feature/transient-notifications-events branch from cc7b7ad to bfb640d Compare February 22, 2022 17:23
@dragunoff
Copy link
Contributor Author

Update:

@Smittytron
Copy link
Member

I assume this would be a followup, but what's the feasibility of exposing this to work with PlaySpeechNotification from .lua scripts?

@dragunoff
Copy link
Contributor Author

I assume this would be a followup, but what's the feasibility of exposing this to work with PlaySpeechNotification from .lua scripts?

Exposing the transients tray to custom messages from lua is something that had not crossed my mind but is actually a good idea. Support for that should come as a separate method though (e.g. DisplayTransientMessage) because text and speech notifications are not coupled (this is a key point in the current PR). I can take on it in a follow up - do we have a use case in the existing missions?

@abcdefg30
Copy link
Member

There are several speech notifications that are played directly and not via a trait. Those would need some sort of way to get transient messages. (The originals also send the current objective as transient message from time to time, but I don't think we have to necessarily redo that.)

@dragunoff dragunoff mentioned this pull request Mar 28, 2022
12 tasks
@dragunoff dragunoff force-pushed the feature/transient-notifications-events branch from bfb640d to 5cf70d3 Compare April 8, 2022 14:18
@dragunoff
Copy link
Contributor Author

Rebased.

Mailaender
Mailaender previously approved these changes Apr 14, 2022
Copy link
Member

@Mailaender Mailaender left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as promised.

Copy link
Member

@pchote pchote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No objection to the code changes, but see my comment below re inserting actor names and translations. I generally agree with @penev92's concern about the proliferation of trait fields, but I think that is a more general problem than just this PR and should not be solved here.

I only very briefly looked ingame - are others happy enough with the implementation for the testcase commit to be removed?

OpenRA.Game/TextNotificationsManager.cs Outdated Show resolved Hide resolved
mods/cnc/chrome/settings-display.yaml Outdated Show resolved Hide resolved
@dragunoff
Copy link
Contributor Author

Update: rebased and addressed comments by @pchote

  • removed stray private
  • changed settings checkbox to read "Show Game Event Notifications"

@pchote pchote force-pushed the feature/transient-notifications-events branch from ccf42b7 to a327182 Compare April 30, 2022 11:20
@pchote
Copy link
Member

pchote commented Apr 30, 2022

Force pushed to remove the testcase commit.

@pchote pchote merged commit bc676fb into OpenRA:bleed Apr 30, 2022
@pchote
Copy link
Member

pchote commented Apr 30, 2022

https://github.com/OpenRA/OpenRA/wiki/Changelog-(bleed)/_compare/30571a4c08ebf08198a6f66b59690637a06228f4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants