A player should be considered defeated in Autocrat after losing all warehouses, rather than all buildings

Bug #1198624 reported by cghislai
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Wishlist
Unassigned

Bug Description

Hi,

I suggest a new win condition in which a player lose when all her warehouses are destroyed, including headquarter of course.

description: updated
Revision history for this message
cghislai (charlyghislain) wrote :
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Hi, and thanks for your patch. :)

From the description this sounds rather similar to the existing Autocrat win condition. Could you expand a bit more on what the differences are?

Changed in widelands:
importance: Undecided → Wishlist
Revision history for this message
cghislai (charlyghislain) wrote :

It is like autocrat, but allows quicker game ending since only headquarters/warehouses have to be hunted down. IIRC, all buildings have to be destroyed to win autocrat.

I found myself several times in a situation where I did not have enough wares to build back an economy, but the game would continue for a fair amount of time until my opponent builds the required military buildings to annihilate me.

This situation is expected to be corrected by this new win condition. Actually even under autocrat, a players who loses headquarters and warehouses has little chance to survive imho.

I first thought on only including headquarters, then thought warehouses could be used to recover from an attack. With seafearing coming in, it was mandatory.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

I agree. It is also my experience that the winning player need to build extra military buildings to stomp out a few scattered houses of an enemy in order to claim victory, even though that enemy will in no way be able to retaliate at that point. This could also benefit from a quicker and clearer game ending.

In my opinion, I think it would be better to improve Autocrats than introducing a new win condition. It would address real issues in the existing win condition, and I also think it is better to have few, though distinctly unique win conditions than plenty which are more or less the same.

>I first thought on only including headquarters, then thought warehouses could be used to recover from an attack. With seafearing coming in, it was mandatory.

Do ports count as warehouses, or do you need to check for those seperately?

Revision history for this message
SirVer (sirver) wrote :

I agree with hjd that no new win conditions are needed. Instead, the old ones need to be reworked.

One could even go so far and change the definition of plr.defeated to be what you propose. This needs to be done in c++ though. I think this would be the ideal solution.

Revision history for this message
cghislai (charlyghislain) wrote :

Here is Sirver's suggestion implementation. I modified the message text to reflect changes.
Is the created bool going to leak?

Revision history for this message
SirVer (sirver) wrote :

Wow! THis is what I call really prompt delivery :)

Your work looks good to me. What do you mean with leak? The way you did it is absolutely correct, you return a bool on the Lua stack and tell Lua that your method returns one value. The interpreter will take care of the rest.

I applied your patch and modified the message a bit - it contained one typo. I also added you as Charly Ghislain (cghislai) to the list of contributors. Thanks for the contribution! If you are interested in doing more, we have plenty of things that need to get done - just let me know :).

Changed in widelands:
status: New → Fix Committed
milestone: none → build18-rc1
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Nice :)

I updated the title to reflect the actual change.

SirVer (or anyone): could you poke the translation templates to get the new string in? Thanks.

summary: - [Feature] new win condition : warehouses
+ A player is considered defeated in Autocrat after losing all warehouses,
+ rather than all buildings
summary: - A player is considered defeated in Autocrat after losing all warehouses,
- rather than all buildings
+ A player should be considered defeated in Autocrat after losing all
+ warehouses, rather than all buildings
Revision history for this message
SirVer (sirver) wrote :

done.

Revision history for this message
Nasenbaer (nasenbaer) wrote :

Sorry I am late for discussion - I had no internet for a week and did just read about the bug.

Generally I agree with the idea of the bug report. However there is one issue I see: it might be that a player is just about to complete the contruction of a warehouse + there are still enough wares around to rebuild the economy. Obviously in that case the player should get a chance - so I disagree with the current patch - if this was a merging request, it would get a "needs fixing" from me ;)

Changed in widelands:
status: Fix Committed → Confirmed
Revision history for this message
SirVer (sirver) wrote :

I disagree with you Peter. The loose condition "when you have no more warehouses and not the resources to build a new one" is harder to convey (and to check) for players, so it feels fishy. Also if your economy is big enough you will always have enough wares floating around to build another warehouse - but without a warehouse, your economy will collapse quickly.

If you really do not have a warehouse anymore you have lost for all scenarios that I can think off - I argue having this simple loosing condition is better than another conditional in it and having to hunt down all buildings of the other players. I do not even remember ever having played a game against a human where I had to destroy all of his warehouses - usually one of the player gives up earlier because something else is not going right for her and it is apparent who would win the game anyways. This is another support for my argument that simple is better (i.e. it will only matter against the CPU anyways).

 I say, let's keep the "no warehouses == loss" for now and reconsider your proposal if it ever feels weird in the game. What do you think?

Btw, we have to check the scenarios with this new condition - some of them might rely on the old behavior.

Changed in widelands:
status: Confirmed → Incomplete
Revision history for this message
Nasenbaer (nasenbaer) wrote :

I see your point SirVer :).

Well than let's go that way.

@cghislai: I am really sorry, that you've already spent time on the implementation proposed by me. :(

Changed in widelands:
status: Incomplete → Fix Committed
Revision history for this message
SirVer (sirver) wrote :

Released in build-18 rc1.

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.