Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#4323 closed defect (fixed)

[PATCH] Don't flag the player as won on scenario maps without enemies

Reported by: mimo Owned by: Vladislav Belov
Priority: Should Have Milestone: Alpha 22
Component: Maps Keywords: patch
Cc: Patch:

Description (last modified by Imarok)

When starting the Trade Demo map, the game immediately says that we've win and ask if we want to leave. This kind of map, useful either for debug purpose or for beginners who want to learn some aspect of the game, which have "None" victory conditions should never be stopped by such test (I suppose there is a test checking if the player have some enemies left).

Attachments (2)

4323_endless.patch (592 bytes ) - added by Vladislav Belov 7 years ago.
Nobody should win if it's the endless game
4323_endless.2.patch (1003 bytes ) - added by Vladislav Belov 7 years ago.
Nobody should win if it's the endless game

Download all attachments as: .zip

Change History (11)

comment:1 by elexis, 7 years ago

Component: UI & SimulationMaps
Keywords: simple added
Priority: Should HaveNice to Have
Summary: Irrelevant victory condition in demo mapsDon't flag the player as won on scenario maps without enemies

The code responsible for flagging the last remaining player as a winner is not a victory condition but the EndGameManager. Before r18342 it would flag the remaining allies as a winner, but only there was a diplomacy change or defeat after the first turn.

So if we want to disable the winning of players without enemies on some maps, these maps should specify a new boolean which if set, hides the gamesetup option 'last man standing' and disable the AlliedVictoryCheck entirely.

comment:2 by Imarok, 7 years ago

Description: modified (diff)

by Vladislav Belov, 7 years ago

Attachment: 4323_endless.patch added

Nobody should win if it's the endless game

comment:3 by Vladislav Belov, 7 years ago

Keywords: patch rfc added
Milestone: BacklogAlpha 22
Owner: set to Vladislav Belov
Priority: Nice to HaveShould Have
Status: newassigned
Summary: Don't flag the player as won on scenario maps without enemies[PATCH] Don't flag the player as won on scenario maps without enemies

by Vladislav Belov, 7 years ago

Attachment: 4323_endless.2.patch added

Nobody should win if it's the endless game

comment:4 by scythetwirler, 7 years ago

Milestone: Alpha 22Work In Progress

SubmittingPatches We changed the protocol for milestone :)

comment:5 by elexis, 7 years ago

Moving to the new WIP milestone.

comment:6 by leper, 7 years ago

Resolution: fixed
Status: assignedclosed

In 19105:

Stop marking the player as won on endless games. Patch by Vladislav. Fixes #4323.

comment:7 by leper, 7 years ago

Keywords: rfc simple removed
Milestone: Work In ProgressAlpha 22

Thanks.

comment:8 by elexis, 7 years ago

On 2016-11-23 between 16:16 and 18:56 there was a partially conclusive discussion about the patch.

The EndGameManager sets either the last remaining player or last remaining team as won. Being the last one remaining sounds pretty much like Conquest mode, so considering #4014 the logic could be moved to that gamemode.

Eventually after #4014, Regicide and Wonder victory should have their Conquest inheritance stripped. So if conquest mode is disabled but regicide enabled, players can still survive even if they only have the hero remaining and lost all workers (has been requested multiple times as counterintuitive). Wondermode without conquest means that a game can only be won by building a wonder (even if all enemies are annihilated).

Does that sound reasonable? Vladislav proposed that we could move the "last remaining wins" logic to a new TriggerScript and allow this independently of Conquest if I understood correctly.

comment:9 by leper, 7 years ago

Sounds like a good idea. I mostly committed this because it was needed to test a few things (and arguably not wrong).

Yes, we should move the allied victory check to a trigger script as that is where it belongs. Not loading/enabling that leads to last man standing behaviour. Also not loading a script results in an endless game, since nothing can (should) mark a player as won or defeated.

One would have to think about whether different victory conditions are combined with OR or AND (the latter might be nice in a few cases, but that should probably go into a new/custom trigger script (else Conquest+Wonder would require one to destroy the other player and build a wonder)). Actually I'm not sure if there is a case where AND makes sense.

Note: See TracTickets for help on using tickets.