Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#4382 closed enhancement (fixed)

Defeat reason

Reported by: elexis Owned by: elexis
Priority: Nice to Have Milestone: Alpha 23
Component: UI & Simulation Keywords:
Cc: Patch: Phab:D762

Description (last modified by elexis)

Often players wonder why a player is being defeated.

For example the default conquest victory condition defeats players if they don't have a set of whitelisted units remaining (ConquestCritical class).

Since regicide is combined with conquest, players wonder why they are being defeated if they still have the hero.

Another example would be on survival of the fittest where players can become defeated by losing the civic center, or by losing the hero (if regicide is set).

A third example would be combining victory conditions #4014.

A new argument could be passed whenever SetState of Player.js is called (which is the function defeating players). It could be a translatable string (use markForTranslation) so that it would appear as follows:

  • Player X was defeated (lost hero) for regicide
  • Player X was defeated (lost all workers) for conquest*
  • Player X was defeated (lost civic center) for survival
  • Player X has won (wonder victory) for wonder games
  • Player X has won (allied victory) when last man standing is not enabled
  • Player X has won (last player alive) when the endgamemanager marks that player as won

[*] one can still survive on conquest with a dock only, but that detail must not necessarily be reflected in the string

formatDefeatMessage of messages.js is the place where the GUI interface message constructed in SetState is parsed into a chat message.

Change History (4)

comment:1 by elexis, 7 years ago

Description: modified (diff)
Keywords: simple removed
Milestone: BacklogWork In Progress
Patch: Phab:D762

comment:2 by elexis, 7 years ago

Owner: set to elexis
Resolution: fixed
Status: newclosed

In 19955:

Victory and defeat reason strings.

Clarify the victory / defeat reason by using a custom string for each defeat and victory reason.
Group chat notifications instead of posting one for each player.
This also slightly improves lobby performance upon win.

Differential Revision: https://code.wildfiregames.com/D762
Fixes #4382
Based on patch by: Angen

comment:3 by elexis, 7 years ago

Milestone: Work In ProgressAlpha 23

comment:4 by elexis, 7 years ago

In 20156:

Add two missing checks in the EndgameManager for players who already had won or were defeated in rP19955 as reported by fatherbushido, refs #4382.

Add a warning if a Trigger script (like the one on Treasure Islands, refs #4507) tries to marks a player as won who had already won or lost.
Merge a duplicate call in the Player component.

Note: See TracTickets for help on using tickets.