Latest Posts

Topic: Definition of player defeated

DragonAtma
Avatar
Joined: 2014-09-14, 01:54
Posts: 351
Ranking
Tribe Member
Posted at: 2021-01-28, 14:02

As someone who only plays Endless Game, I second going with a command like Player.mark_as_defeated() .

I also recommend being very careful about activating it, as it shouldn't be used unless the player both has absolutely no way of recovering and no way of attacking anyone. After all, even if someone is thoroughly hosed (e.g. the only buildings they have left are a tower and two fishing huts) they can still interfere by taking a l0ow-level military building from their conqueror, destroying some of the conqueror's other buildings.

You can also include that as a resign option, but it would certainly need an "Are you sure?" box or two. As for AI, I can see them clicking it if they decide they're hosed (e.g. no lumberjack huts and not enough wood to build one).

And no, forcing warehouse destruction is a bad idea; I've seen some spectacular comebacks in AI-only games. For example, the map I use the most is four squares (one per player) connected by another square at the center, making it easy to overextend. I've seen an AI lose half their starting square, only for the would-be-conqueror getting snipped off, so they eventually recover their whole starting square.


Top Quote
hessenfarmer
Avatar
Topic Opener
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2021-01-28, 15:02

DragonAtma wrote:

As someone who only plays Endless Game, I second going with a command like Player.mark_as_defeated() .

Now I am confused. What you named a command was suggested as c++ function that should replace the currently used see_all leaving the player as a real spectator without the chance to do anything in any case. I now managed this in lua as well. In our current routine to check for player defeated I simply destroy all his buildings and ships if he has lost all of his ports, warehouses and Headquarters. Which is the current definiton of defeated. This will be applied to all current win conditions that check for defeat regularly (which all of them do).

I also recommend being very careful about activating it, as it shouldn't be used unless the player both has absolutely no way of recovering and no way of attacking anyone. After all, even if someone is thoroughly hosed (e.g. the only buildings they have left are a tower and two fishing huts) they can still interfere by taking a l0ow-level military building from their conqueror, destroying some of the conqueror's other buildings.

But they can't win anymore, so it would only make sense in some corner cases in a team match. May be we need to disable the check for defeated players from woodgnome. As this could be won theoretically without having a warehouse left. Artifacts the same. In this case they would last 4h in any case. Without the possibility to win by defeating the enemy player.

You can also include that as a resign option, but it would certainly need an "Are you sure?" box or two. As for AI, I can see them clicking it if they decide they're hosed (e.g. no lumberjack huts and not enough wood to build one).

Well, resigning in Multiplayer is easily do be done by chat message. In Single player just end the game. And the reason for the Ai to resign would be the same as the current definition of having lost. (meaning no warehouse left)

And no, forcing warehouse destruction is a bad idea; I've seen some spectacular comebacks in AI-only games. For example, the map I use the most is four squares (one per player) connected by another square at the center, making it easy to overextend. I've seen an AI lose half their starting square, only for the would-be-conqueror getting snipped off, so they eventually recover their whole starting square.

Forcing warehouse destruction will be not the normal way but only in a special Win condition where the goal is to destroy other players Headquarters. (named HQ Hunter)

In fact without a ware house you can't build anything. So the decision was to declare a player defeated if he has no warehouse left. (this is pretty old c++ code where this is done). The problem is that this leaves 2 cornercases for resurrection:
1. a constructionsite of a warehouse with all wares and a builder present and a tool production with enough ressources to make new tools.
2. an expedition ship with additional workers and wares to build a new economy, maybe aided by other ships carrying basic wares to start from (will be a poor hamlet start then)

I consider the chance for them to occur and to generate a chance for winning as extremely low. So I just avoid them by destroying all buildings (including constructionsites) of a defeated player and sink all his ships.

Anyhow I will add a new Win condition where no check for defeat will take place (although the player keeps the property if he lost his all his warehouse types once). this would result in the possibility for full resurrection and it would be the responsability of the player(s) to decide about winning. This I can do completely in lua without changes to c++

Branch for testing will be ready this evening

Edited: 2021-01-28, 15:04

Top Quote
DragonAtma
Avatar
Joined: 2014-09-14, 01:54
Posts: 351
Ranking
Tribe Member
Posted at: 2021-01-28, 16:54

hessenfarmer wrote: Now I am confused. What you named a command was suggested as c++ function that should replace the currently used see_all leaving the player as a real spectator without the chance to do anything in any case. I now managed this in lua as well. In our current routine to check for player defeated I simply destroy all his buildings and ships if he has lost all of his ports, warehouses and Headquarters. Which is the current definiton of defeated. This will be applied to all current win conditions that check for defeat regularly (which all of them do).

Keep in mind that I only mentioned that command because Ektor mentioned it a few posts back. I do not know C++, nor do I know lua (I do know some python, but I don't think that's relevant). I don't play multiplayer, so I don't keep track of what see_all and such do; it's quite possibly the same thing (and, once someone resigns, they should not be able to un-resign).

But they can't win anymore, so it would only make sense in some corner cases in a team match. May be we need to disable the check for defeated players from woodgnome. As this could be won theoretically without having a warehouse left. Artifacts the same. In this case they would last 4h in any case. Without the possibility to win by defeating the enemy player.

Even if player A can't win and has no allies, they can still affect whether player B or player C wins, and may have a grudge against the player who took most of their land.

Well, resigning in Multiplayer is easily do be done by chat message. In Single player just end the game. And the reason for the Ai to resign would be the same as the current definition of having lost. (meaning no warehouse left)
It's also done by a lovely cat walking on the keyboard, which is why the "Are you sure?" needs to be there. face-wink.png

Forcing warehouse destruction will be not the normal way but only in a special Win condition where the goal is to destroy other players Headquarters. (named HQ Hunter)

Ah, that makes sense.

In fact without a ware house you can't build anything. So the decision was to declare a player defeated if he has no warehouse left. (this is pretty old c++ code where this is done). The problem is that this leaves 2 cornercases for resurrection:
1. a constructionsite of a warehouse with all wares and a builder present and a tool production with enough ressources to make new tools.
2. an expedition ship with additional workers and wares to build a new economy, maybe aided by other ships carrying basic wares to start from (will be a poor hamlet start then)

I consider the chance for them to occur and to generate a chance for winning as extremely low. So I just avoid them by destroying all buildings (including constructionsites) of a defeated player and sink all his ships.

"Extremely low" is not "zero", especially since a new player may have two hundred buildings but no warehouses (aside from their headquarters). Alternately, if player A snipes large player B's warehouse areas (the headquarters, plus enough scattered military buildings to wipe out their warehouses), B may still have a fully functional economy. This is especially important if a player C thinks this is a good time to invade A.

I do agree that the odds of this affecting the final winner in a one-on-one is slim, but that may change if there's a third person -- and the larger the "dead" player's forces, the more they may affect things.


Top Quote
hessenfarmer
Avatar
Topic Opener
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2021-01-28, 18:21

DragonAtma wrote:

Even if player A can't win and has no allies, they can still affect whether player B or player C wins, and may have a grudge against the player who took most of their land.

That may be the case. However the question is should we allow this. For me this discussion is not so much related to what a player can do possibly but to the rules to apply to a game. From this point of view if we stick to our definition who can't win anymore has lost, we shouldn't allow such behaviour. I personally don't know any game where this is possible.

Well, resigning in Multiplayer is easily do be done by chat message. In Single player just end the game. And the reason for the Ai to resign would be the same as the current definition of having lost. (meaning no warehouse left)
It's also done by a lovely cat walking on the keyboard, which is why the "Are you sure?" needs to be there. face-wink.png

Well. A cat can't write a chat message "hey guys I have lost and resign" And the end game button has already a are you sure question. only thing is that in multiplayer you have to agree not just quit as this would end the game for all I think. But this is a question independent of the Win condition.

"Extremely low" is not "zero", especially since a new player may have two hundred buildings but no warehouses (aside from their headquarters). Alternately, if player A snipes large player B's warehouse areas (the headquarters, plus enough scattered military buildings to wipe out their warehouses), B may still have a fully functional economy. This is especially important if a player C thinks this is a good time to invade A.

As the HQ normally is the heart of your territory there should not be much left ofg an economy if a player manages to conquer enough land to get close to the HQ. For new players they might consider building a warehouse next time if they have lost by this once. And even if he has still a working and big economy, he might not avoid the unevitable, as he can't build another warehouse if he has no constructionsite in the above mentioned state. So for me it would be better to have a clear rule and to ensure this rule is valid all the time by excluding the above mentioned corner cases.
For other purposes I'll just create the additional Win condition with no rules at all. Allowing for full resurrrection in the above corner cases.


Top Quote
hessenfarmer
Avatar
Topic Opener
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2021-01-30, 21:54

maybe it is easier to just test it.
here is the Pull Request
https://github.com/widelands/widelands/pull/4648


Top Quote