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

Combat screen, disposition of troops is not maintained when a hero is attacked in a castle and the garrisoned troops are transferred to the hero's army #6740

Closed
2 tasks done
LeHerosInconnu opened this issue Mar 1, 2023 · 54 comments · Fixed by #6741
Labels
improvement New feature, request or improvement logic Things related to game logic
Milestone

Comments

@LeHerosInconnu
Copy link

Preliminary checks

Platform

Windows

Describe the bug

In fheroes2, the disposition of troops is not maintained when a hero is attacked in a castle and the garrisoned troops are transferred to the hero's army.
All troops of the same type are combined into one troop.
This worked properly before.

In fheroes2:

Broken siege troop disposition 001

Broken siege troop disposition 002

Save file

Here is the save file (just end the turn):
Auto troop broken 01.zip

Additional info

No response

@LeHerosInconnu LeHerosInconnu added the bug Something doesn't work label Mar 1, 2023
@oleg-derevenetz
Copy link
Collaborator

oleg-derevenetz commented Mar 1, 2023

IIRC there was a requirement "to automatically reinforce the hero's army by the best available troops" and this requirement is in some contradiction with the requirement "to maintain the order of troops". Suppose that we have 4 Titans in the garrison (each in a separate stack) and one Phoenix, and we want to reinforce the hero with one stack of Peasants. If we want to maintain the order of Titans (one Titan per slot), then we will not get Phoenix, because Titans are stronger, so they have the higher priority and they will occupy all available free slots in the hero's army.

@LeHerosInconnu
Copy link
Author

Hello @oleg-derevenetz,

IIRC there was a requirement "to automatically reinforce the hero's army by the best available troops" and this requirement is in some contradiction with the requirement "to maintain the order of troops". Suppose that we have 4 Titans in the garrison (each in a separate stack) and one Phoenix, and we want to reinforce the hero with one stack of Peasants. If we want to maintain the order of Titans (one Titan per slot), then we will not get Phoenix, because Titans are stronger, so they have the higher priority and they will occupy all available free slots in the hero's army.

This was done to bring back the way the original game worked and to improve it a bit: #1312, #1313. :)

@oleg-derevenetz
Copy link
Collaborator

This was done to bring back the way the original game worked and to improve it a bit: #1312, #1313. :)

Yes, but how about the situation when there is no slots for all the garrison troops in the hero's army, like I described in my previous message here? Could you please describe an algorithm which would suit all situations, especially ambiguous ones? What would we prefer - break the order of Titans or have an additional Phoenix?

@LeHerosInconnu
Copy link
Author

@oleg-derevenetz.

This was done to bring back the way the original game worked and to improve it a bit: #1312, #1313. :)

Yes, but how about the situation when there is no slots for all the garrison troops in the hero's army, like I described in my previous message here? Could you please describe an algorithm which would suit all situations, especially ambiguous ones? What would we prefer - break the order of Titans or have an additional Phoenix?

The player has to organize his troops in such a way that the desired garrisoned troops join the hero's army in case of an attack.
Related closed isuue: #6076.

It worked fine in a previous version, why was it changed?

@oleg-derevenetz
Copy link
Collaborator

The player has to organize his troops in such a way that the desired garrisoned troops join the hero's army in case of an attack.

This is not an answer to my question at all. In my question a hero has 4 free slots, how exactly 4 Titans and 1 Phoenix should join him?

Related closed isuue: #6076.
It worked fine in a previous version, why was it changed?

It was changed exactly in that PR that closed the #6076 to squeeze as much of most powerful garrison troops in the hero's army as possible. The order of defending hero's own troops is not changed, just as required in #6076, they are not squeezed, and I don't see how exactly that issue answers my question regarding Titans and Phoenix.

@LeHerosInconnu
Copy link
Author

LeHerosInconnu commented Mar 1, 2023

@oleg-derevenetz.

The player has to organize his troops in such a way that the desired garrisoned troops join the hero's army in case of an attack.

This is not an answer to my question at all. In my question a hero has 4 free slots, how exactly 4 Titans and 1 Phoenix should join him?

Related closed isuue: #6076.
It worked fine in a previous version, why was it changed?

It was changed exactly in that PR that closed the #6076 to squeeze as much of most powerful garrison troops in the hero's army as possible. The order of defending hero's own troops is not changed, just as required in #6076, they are not squeezed, and I don't see how exactly that issue answers my question regarding Titans and Phoenix.

I was writing the answer. :D

Here it is:
The positioning of the garrisoned troops is respected when transferring the troops to the hero's army, when possible.
Then, if there are still free slots in the hero's army, the troops in garrison are moved there, one by one.
Then, if there are troops of the same type in garrison as in the hero's army, the troops are combined in the hero's army.

Edit:
I will post screenshots. :)

@oleg-derevenetz
Copy link
Collaborator

OK, so we should retain the order of Titans from my example and do not join the garrison's Phoenix, even if we could if we squeeze the garrison's Titans into a single stack, right?

@LeHerosInconnu
Copy link
Author

LeHerosInconnu commented Mar 1, 2023

@oleg-derevenetz.

OK, so we should retain the order of Titans from my example and do not join the garrison's Phoenix, even if we could if we squeeze the garrison's Titans into a single stack, right?

Yes, it should be clearer with examples:

This:
Garisson to hero 001
Should give this:
Garisson to hero 002

This:
Garisson to hero 003
Should give this:
Garisson to hero 004

This:
Garisson to hero 005
Should give this:
Garisson to hero 006

This:
Garisson to hero 007
Should give this:
Garisson to hero 008

This:
Garisson to hero 009
Should give this:
Garisson to hero 010

This:
Garisson to hero 011
Should give this:
Garisson to hero 012

This:
Garisson to hero 013
Should give this:
Garisson to hero 014

Edit;
This:
Garisson to hero 015
Should give this:
Garisson to hero 016

In this example, the position of the troops in relation to the hexes will also be kept on the battlefield.
The phoenix will be in the first position in the first hex from the top of the screen.
There will be no troops in the second position, in the third hex from the top of the screen.
The peasants will be in the third position, in the fifth hex from the top of the screen.
There will be no troops in the fourth position, in the seventh hex from the top of the screen.
The titans will be in the fifth position, in the ninth hex from the top of the screen.
Garisson to hero 017

@oleg-derevenetz
Copy link
Collaborator

oleg-derevenetz commented Mar 1, 2023

@LeHerosInconnu in your examples the value of troops didn't taken into account. Titans have higher value, so there will be no room for Phoenix in any case, right? Or we should not take into account the strength/value of garrison's troops, but only the order of them? Currently it is taken into account.

@LeHerosInconnu
Copy link
Author

@oleg-derevenetz.

@LeHerosInconnu in your examples the value of troops didn't taken into account. Titans have higher value, so there will be no room for Phoenix in any case, right? Or we should not take into account the strength/value of garrison's troops, but only the order of them? Currently it is taken into account.

Only the order must be taken into account.
This is intentional.
Maybe I want to preserve some troops.
Or the morale of the army would be negative.
Or there may be several combats in a row, and I want to save a strong troop for the second combat.
Or I want to preserve a fast troop for after the combat.
Etc.

@oleg-derevenetz
Copy link
Collaborator

Only the order must be taken into account.
This is intentional.

In #6076 there was a proposal to join the strongest troops from the garrison, literally. There is a contradiction. Hi @Branikolog @ihhub @zenseii @Districh-ru what is your opinion regarding this? Doesn't it look like a micromanagement and won't it cause the whining like "I lost my castle because strongest troops from the garrison were not joined to the hero's army, although they could"?

@LeHerosInconnu
Copy link
Author

LeHerosInconnu commented Mar 1, 2023

Here is my point:
The hero's army should not be reorganized, but supplemented by garrisoned troops.
If there is no free space, no garrisoned troops should be transferred.
The only exception is if the garrisoned troop is already present in the hero's army.

Edit:
This:
Garisson to hero 018
Should give this:
Garisson to hero 019

This:
Garisson to hero 020
Should give this:
Garisson to hero 021

Edit:
In original game:

2023-03-01.15-27-13.mp4

In fheroes2:

2023-03-01.15-25-20.mp4

@oleg-derevenetz
Copy link
Collaborator

This:
Garisson to hero 015
Should give this:
Garisson to hero 016

This is not how it works in the original game:

DOSBox.0.74-2.1.Cpu.speed_.max.100.cycles.Frameskip.0.Program_.HEROES2.2023-03-01.18-49-33.mp4

@LeHerosInconnu
Copy link
Author

@oleg-derevenetz.

This:
Garisson to hero 015
Should give this:
Garisson to hero 016

This is not how it works in the original game:

DOSBox.0.74-2.1.Cpu.speed_.max.100.cycles.Frameskip.0.Program_.HEROES2.2023-03-01.18-49-33.mp4

Yes, that's right, it's part of that enhancement: #1313. :)

@Branikolog
Copy link
Collaborator

Hi, @oleg-derevenetz and @LeHerosInconnu !
I'm afraid of making this logic overcomplicated, actually.
But proposed by @LeHerosInconnu behaviour seems quite straightforward. On each end turn a player would arrange troops in city garrison according to free slots in visiting hero army without any obscurity.
I'm only concerning about adding troops to the hero army without maintaining the order in a case, there're some free slots left or same type troops present in hero and city garrison armies.
As @LeHerosInconnu stated before, there could be the cases, when player wants some of his troops not to be included in the upcoming fight. Because of morale issues or simply to save some troops for next fights.
I personally prefer to always maintain troops disposition, to make logic 100% clear and to be able to avoid unwanted creatures from joining the upcoming battle.

@LeHerosInconnu
Copy link
Author

LeHerosInconnu commented Mar 2, 2023

Hello @Branikolog,

Hi, @oleg-derevenetz and @LeHerosInconnu ! I'm afraid of making this logic overcomplicated, actually. But proposed by @LeHerosInconnu behaviour seems quite straightforward. On each end turn a player would arrange troops in city garrison according to free slots in visiting hero army without any obscurity. I'm only concerning about adding troops to the hero army without maintaining the order in a case, there're some free slots left or same type troops present in hero and city garrison armies. As @LeHerosInconnu stated before, there could be the cases, when player wants some of his troops not to be included in the upcoming fight. Because of morale issues or simply to save some troops for next fights. I personally prefer to always maintain troops disposition, to make logic 100% clear and to be able to avoid unwanted creatures from joining the upcoming battle.

Yes, the disposition of the troops in the hero's army is never changed.
Only free slots are filled, and then if there are still troops in the garrison of the same type they are added.

Some examples:
This:
Garisson to hero 022
Give this:
Garisson to hero 023

This:
Garisson to hero 024
Give this:
Garisson to hero 025

This:
Garisson to hero 026
Give this:
Garisson to hero 027

@Branikolog
Copy link
Collaborator

Branikolog commented Mar 2, 2023

Hi, @LeHerosInconnu

and then if there are still troops in the garrison of the same type they are added.

What about the cases (second pair of screenshots from your message above), when you want to save a few titans knowing, that AI would demolish them with strong magic? With your proposed logic, all titans would be stacked in your defending army.
I propose to combine stacks only in a case you've placed them one above another. This would make the logic 100% predictable (since it's not obvious which stack of titans in hero army would be complemented).
Siege arrangement
I mean, I can hardly imagine the case, when hero has stack of some troops in his army and the same type of troops in garrison... He would definitely combine all troops of the same type and place them in his army, unless he wants not to use the part of them in castle defending.
Look at my example: I want to save some phoenixes for future fights, but to have a speed advantage (don't count cavalry here :) ) I want them to stay out of battle. If I want to have them in my army I would definitely place all of them into my hero army.
I also believe, this logic is much easier to implement, rather than adding same type troops to the hero army after straight vertical transferring occurred.
image
Players simply need to place needed troops above free slots in hero army. The only purpose of this situation is when player want to get some extra movement points. So I see no reason to split the stack he has in his army and place a half in city garrison despite of the "safe place" case, I mention above.
So I'm proposing to make maximum simple logic: move garrison troops into hero free slots directly as on my screenshot for all cases.

@oleg-derevenetz
Copy link
Collaborator

oleg-derevenetz commented Mar 2, 2023

Hi @Branikolog

So I'm proposing to make maximum simple logic: move garrison troops into hero free slots directly as on my screenshot for all cases.

While @LeHerosInconnu's proposal differs from the OG behavior just in few details, this proposal differs cardinally, which may be totally unexpected for former OG players.

@Branikolog
Copy link
Collaborator

Branikolog commented Mar 2, 2023

@oleg-derevenetz

this proposal differs cardinally, which may be totally unexpected for former OG players.

Well... Cardinally... Cannot say it is really that much... 😅
The only difference is that I propose not to combine troops of the same type...
I just believe it will operate more intuitive, predictable and at the same time not so really complex from the logic point.
Also, I think my proposal avoids the issue, when player wants to save a few troops preventing them from the fight.
Let me explain my vision...
The desposition issue occurs mostly in the cases, when hero is refreshing in the castle and at the same time takes away slow troops to "speed up" up to the next turn.
So we usually place the slowest troops in city garrison. So, to be prepared for the upcoming battle we simply have to place the troops we want above the empty places in hero army. Sometimes, we have two troops of the same time (I often split shooters into two stacks). So, if we hold two separate stacks inside city garrison they would be placed in two needed slots in the potential battle.
image
Which was not the case with the former logic.
Here's the expected disposition of troops:
image

But the logic kindly proposed by @LeHerosInconnu has one flaw (in my personal opinion).
If the city garrison has several stacks of the same type they would be combied into the most left stack in hero army (the stacks that couldn't be moved according to troops disposition of hero army), which is not so intuitive in my opinion (why exactly the left stack, but not the right or the closest to the initial stack?) Here's the example below.
image
Into this:
image
For this situation I have a question, why do player placed several stacks above? He wants two stacks to be included into the upcoming battle, right? Why couldn't he combine three into two stacks then? What's the purpose?
The same question I have in the situation when hero has already one stack of that type in his army.
image

It has no sense: player woudn't get more movement points on the next turn. So why can't he place all troops (centaurs in my particular example) in the way he want them to appear in battle, since they are already in his army?
So if player wants some troops to be added to his army for the next battle (and the same type troops are already in his army), he can simply combine and place them as needed. I think there's no need to have the logic that makes that automatically.
But at the same time, if player, wants to save a few centaurs in garrison for the next day (since they all can die during castle defending) he can simply place needed amount of troops above the busy slot of hero army, and the stack won't participate in the battle.
So my proposal adds more tactical features, being more intuitive and demonstrative, than forced transferring of all troops of the same type from garrison into unexpected hero slot.
With my proposal I can achieve both outcomes: have two stacks of centaurs in hero army in castle defending (by making manually two stacks in garrison above the empty slots) and also I can have two stacks of centurs in defending battle and save 1 stack for the future day.
While the logic of @LeHerosInconnu cannot provide that and automatically adds the third stack into hero army. This logic is useful for the cases, when player forgot to rearrange his troops before he finishes the turn. Well, everyone makes mistakes, but the game shouldn't help with fixing tactical ones. :)
So we have two points:

  • a little more manual-like approach, but with the ability to "save" troops
  • the more automated approach for the players, who loves to forget rearranging troops before the potential battle :)

I'm not strictly against the @LeHerosInconnu 's proposal, I just think there exists more simple and demonstrative solution.

P.S. Sorry for such a huge message. :)

@oleg-derevenetz
Copy link
Collaborator

@Branikolog

The only difference is that I propose not to combine troops of the same type...

What you are proposing is literally "only those stacks that occupy the same position in the hero's army and in the garrison can be combined". The problem here is that this mechanic is not present in any of the popular games of the HoMM series. For example, in HoTA the logic is the same:

castle

turns into

battle

i.e. Griffins reinforce the hero's army anyway, despite the fact that the corresponding (2nd) slot in the hero's army is already occupied. IIRC in HoMM V mechanics is the same. That's what HoMM players expect in general, this is what they are used to and the behavior they are counting on. The introduction of radically different mechanics can be inconvenient and certainly at least raise questions.

@oleg-derevenetz
Copy link
Collaborator

oleg-derevenetz commented Mar 2, 2023

BTW in HoTA value of a unit is taken into account when choosing a priority for reinforcement, i.e. this:

castle

is turned into this:

battle

Champions are the most powerful units, so they are primarily considered for reinforcement, despite the fact that they are the last in order. Then go the Zealots (level 5) and then there is no space left for Crusaders (level 4), i.e. everything works just like it works now in fheroes2. And that's how most of HoMM ordinary players expect this to work in fheroes2, because that's how it works everywhere.

@Branikolog
Copy link
Collaborator

Branikolog commented Mar 2, 2023

@oleg-derevenetz
True!
But I sometimes notice on H3 treams, that players experience some issues with this original logic: they sometimes have to delete troops, that unwanted for the upcoming battle.
Also, I want to note, that H2 has already slightly different from H3 logic for troops disposition, since H2 maintain troops disposition according to the slots they occupy in hero army. I mean In H2 you can place troops into 1 and 5 slots and in the battle they'd appear in upper and bottom corner of the battlefield. While in H3 they would be placed in the cetral area, no matter what slots they were placed initially in hero army.
In your example with my proposed logic I can place griffins in the last slot and have them in battle or I can leave them as now and play battle without griffins.
For me, as 20+ years active H3 player, this seems quite intuitive and I can use to it easily. This feature can be useful in many situations allowing to place troops as I wish.

At your last screenshot what's the point of having 2 champions and 3 zealots in different stacks? I can combine and place them above 6th and 7th slots and be sure, I'd have them in battle. Or place Crusaders there leving champions and zealots above the busy slots and leaving them out of battle. Isn't it more convenient?

@Branikolog
Copy link
Collaborator

this mechanic is not present in any of the popular games of the HoMM series

So, I consider this as a huge improvement in army arrangement logic. It's demonstrative and allows me 100% control the result army disposition.

@oleg-derevenetz
Copy link
Collaborator

I reconsidering this issue as a request for improvement, because it seems that the logic currently implemented is in fact the "correct" one in the sense that it matches the logic of HoMM series games.

@oleg-derevenetz oleg-derevenetz added improvement New feature, request or improvement and removed bug Something doesn't work labels Mar 2, 2023
@Branikolog
Copy link
Collaborator

The last case @oleg-derevenetz showed on screenshots, in my personal point is an example of complex and non-intuitive logic. Why were crusaders placed into the central slot? Why were archers combined in that way? What if we had champions and some comparable troop? Who would be placed higher in those two free slots? No matter what player would be doing, he can't change those troops arrangement, that would be transferred from garrison to hero army up to the next battle (with the prioritization by creature strength). Unless he deletes stronger troops for sure. I was always struggling in H3 with castle defending troops disposition. Even pro players sometimes make mistakes here and prefer deleting everything unwanted, rather than risking of bad disposition made by algorithms or lower morale due to some unwanted troops joined the battle.

Here's one more point for not auto combining garrison troops with hero army:
Let's say we have a hero with strong magic so we're going to defend counting only on magic skills.
image
Not to loose all magi (in a case enemy attacks first) I can place them in garrison above and use my strong magic to demolish enemy after 1 stack of magi perishes.
If I want to have all magi in the upcoming battle, I can simply put them in hero army or above the empty slots in city garrison and will be 100% sure, they participate in the battle.
This logic suits H2 well, since in H2 troops are placed on battlefield according to their arrangement in army slots, while in H3 they're moved to the central area.

Sorry for being so annoying here. :)

@oleg-derevenetz
Copy link
Collaborator

@Branikolog

Let's say we have a hero with strong magic so we're going to defend counting only on magic skills.
image
Not to loose all magi (in a case enemy attacks first) I can place them in garrison above and use my strong magic to demolish enemy after 1 stack of magi perishes.

In this case even with your own latest logic the stack of Magi from the garrison will be merged into the guest hero army.

@Branikolog
Copy link
Collaborator

@oleg-derevenetz

In this case even with your own latest logic the stack of Magi from the garrison will be merged into the guest hero army.

I'm proposing not to merge same type creatures at all. Only move troops directly downwards into free slots in hero army. That's the point. Simple, demonstrative, making the outcome 100% predictable and providing more tactical possibilities.

@oleg-derevenetz
Copy link
Collaborator

@Branikolog

I'm proposing not to merge same type creatures at all. Only move troops directly downwards into free slots in hero army.

#6740 (comment):

I propose to combine stacks only in a case you've placed them one above another.

And the behavior "not to merge anything" is even further from the original game.

@zenseii
Copy link
Collaborator

zenseii commented Mar 3, 2023

@oleg-derevenetz

In this case even with your own latest logic the stack of Magi from the garrison will be merged into the guest hero army.

I'm proposing not to merge same type creatures at all. Only move troops directly downwards into free slots in hero army. That's the point. Simple, demonstrative, making the outcome 100% predictable and providing more tactical possibilities.

I understand the reasoning. This exact case requires several things to happen at once:

  1. You don't have money to buy a cheap halfling that you could use to block the Magi from joining. Or there are no creatures available to buy.
  2. Either you don't have the money to buy a hero that you could leave cheap creatures behind from to block the Magi from joining, or the enemy has blocked you inside so that you can't leave momentarily to hire a second hero.

So, yes this could happen, but the question is how often would it happen. Yes, this is obviously a conscious choice to not have all magi in the battle because if not then they would just be in the hero army and not the garrison before getting attacked.

@Branikolog
Copy link
Collaborator

@oleg-derevenetz

And the behavior "not to merge anything" is even further from the original game.

Sorry for that. :)
While writing those poems above I came to conclusion, that even more radical changes would be more effective. :)

Hi, @zenseii !

So, yes this could happen, but the question is how often would it happen. Yes, this is obviously a conscious choice to not have all magi in the battle because if not then they would just be in the hero army and not the garrison before getting attacked.

True, but with my proposal we can do this while with auto-merging - we cannot. And again, it's not really obvious to the majority of players, which stack of the hero army will be reinforced from the garrison with this logic.
All the cases, when hero and garrison have same type creatures could be adjusted with several clicks by player himself. But in a case auto-merge will be implemented, there could be situations, when we cannot prevent some troops from joining the battle (which is actually one of the annoying cases in H3).

@oleg-derevenetz
Copy link
Collaborator

While writing those poems above I came to conclusion, that even more radical changes would be more effective. :)

Then we need an opinion from @LeHerosInconnu.

@LeHerosInconnu
Copy link
Author

Hello everyone,

While writing those poems above I came to conclusion, that even more radical changes would be more effective. :)

Then we need an opinion from @LeHerosInconnu.

This functionality is certainly also applied to the AI when one of its heroes is attacked in a castle with garrisoned troops?

If this is changed, a specific operation will be needed so that the AI is not penalized.
The current modified operation would do for now, namely: The disposition of the troops in the hero's army is never changed. Only free slots are filled, and then if there are still troops in the garrison of the same type they are added.
Or something more advanced to always have the most "promising" army, but adapted during the AI turn, not at the beginning of the combat against the AI.

The @Branikolog modification proposal (the disposition of the troops in the hero's army is never changed, only free slots are filled), although interesting (I would eventually agree for this mode of operation, but only for the human player), will not be able to cover all cases (including those already exposed by @zenseii).
Another example (not necessarily with these creatures):

Garisson to hero 030

A solution could be to keep the current modified operation for the AI and for the human player, AND to allow the human player to decide for each garrisoned troop if it should join the hero's army in case of an attack.

This could be done by adding, for example, a small on/off icon on the graphic of each garrisoned troop that allows or not that troop to join the hero's army in case of an attack.

But I can already see an outcry appearing: :D
This adds micromanagement...
It's not good to give the player too much choice...
We don't have the graphics...
It will clutter the GUI...
New players won't understand anything...
Etc.

I had already thought about this problem and there will be a solution to this in my mod, the troops to be kept can be transferred to the hero and/or garrison extended inventories: #2995.
And no need to reorganize the hero's army to get the highest movement speed on the adventure map: #2979.

But you will tell me that these are too radical changes compared to the original game. 👀 👓 :D

@oleg-derevenetz
Copy link
Collaborator

oleg-derevenetz commented Mar 3, 2023

This functionality is certainly also applied to the AI when one of its heroes is attacked in a castle with garrisoned troops?

Yes, there is no difference.

This could be done by adding, for example, a small on/off icon on the graphic of each garrisoned troop that allows or not that troop to join the hero's army in case of an attack.

But I can already see an outcry appearing: :D
This adds micromanagement...
It's not good to give the player too much choice...
We don't have the graphics...
It will clutter the GUI...
New players won't understand anything...
Etc.

And, in addition to all of the above, all these "small on/off icons" are completely inconvenient on smaller touch screens - for example, on Android phones or game consoles.

@LeHerosInconnu
Copy link
Author

Hello @oleg-derevenetz,

This could be done by adding, for example, a small on/off icon on the graphic of each garrisoned troop that allows or not that troop to join the hero's army in case of an attack.
But I can already see an outcry appearing: :D
This adds micromanagement...
It's not good to give the player too much choice...
We don't have the graphics...
It will clutter the GUI...
New players won't understand anything...
Etc.

And, in addition to all of the above, all these "small on/off icons" are completely inconvenient on smaller touch screens - for example, on Android phones or game consoles.

Yes, for the touch screens I had thought of another way of working, for example, by "clicking" on the graphic of a troop it opens a window with several different big buttons allowing different actions.

@oleg-derevenetz
Copy link
Collaborator

Yes, for the touch screens I had thought of another way of working, for example, by "clicking" on the graphic of a troop it opens a window with several different big buttons allowing different actions.

Not particularly elegant. It looks like clogging up the original rather convenient, intuitive and elegant UI with extra windows. Many games developed by amateurs who do not have a game designer in the team suffer from the overcomplicated UI. Yes, having too much choice can sometimes be bad.

@LeHerosInconnu
Copy link
Author

It can be done this way:
For touch screens, a left "click" on the captain or blazon graphic opens a window with all troops in garrison (image is for axplanation only);
Garisson to hero 030 a01
By default all troops in garrison are transferable.
A left click on a troop changes its status to non-transferable, another click on the same troop changes it back to transferable.
The small icon is updated to indicate the troop's status to the player.
When all troops are set, the player presses an "OKAY" button to validate, there is also a "CANCEL" button to cancel the changes.
For screens like on PC, the same operation can be used (useful also for high resolutions), and the player can also click directly on the small icon to adjust the setting more quickly.

@LeHerosInconnu
Copy link
Author

@oleg-derevenetz.

Yes, for the touch screens I had thought of another way of working, for example, by "clicking" on the graphic of a troop it opens a window with several different big buttons allowing different actions.

Not particularly elegant. It looks like clogging up the original rather convenient, intuitive and elegant UI with extra windows. Many games developed by amateurs who do not have a game designer in the team suffer from the overcomplicated UI. Yes, having too much choice can sometimes be bad.

I'm trying to find a solution for GUIs that are limited by their use.
Can there be a short right click on the touch screens?
Can there be an extended right-click with a duration on the touch screens?
Can there be an extended right-click with no time limit on the touchscreens?
Can there be an extended left click with a duration on the touch screens?
Can there be an extended left click with no time limit on the touch screens?
What else?

@oleg-derevenetz
Copy link
Collaborator

oleg-derevenetz commented Mar 3, 2023

I'm trying to find a solution for GUIs that are limited by their use.

Maybe this functionality just doesn't need to be added?

Can there be a short right click on the touch screens?
Can there be an extended right-click with a duration on the touch screens?
Can there be an extended right-click with no time limit on the touchscreens?
Can there be an extended left click with a duration on the touch screens?
Can there be an extended left click with no time limit on the touch screens?

It depends on touchscreen. Some touchscreens allow basic gestures or, say, distinguish the force of pressing, but I wouldn't use it unless absolutely necessary. It may turn out to be non-portable.

@LeHerosInconnu
Copy link
Author

LeHerosInconnu commented Mar 3, 2023

@oleg-derevenetz.

I'm trying to find a solution for GUIs that are limited by their use.

Maybe this functionality just doesn't need to be added?

Yes, we can fuck break the heart of the players (less "pictorial", but more poetic) :) on the touch screens. :D
After all, it's a PC game, they have only to play on PC.

Can there be a short right click on the touch screens?
Can there be an extended right-click with a duration on the touch screens?
Can there be an extended right-click with no time limit on the touchscreens?
Can there be an extended left click with a duration on the touch screens?
Can there be an extended left click with no time limit on the touch screens?

It depends on touchscreen. Some touchscreens allow basic gestures or, say, distinguish the force of pressing, but I wouldn't use it unless absolutely necessary. It may turn out to be non-portable.

Okay, I see, there are possibilities but not everything is standard.

@LeHerosInconnu
Copy link
Author

LeHerosInconnu commented Mar 3, 2023

What we can do for now:

For the AI:
The disposition of the troops in the hero's army is never changed.
Only free slots are filled, and then if there are still troops in the garrison of the same type they are added.
Edit:
Later we could add something more advanced to always have the most "promising" army, but adapted during the AI turn, not at the beginning of the combat against the AI.
Edit 2:
This means:
When an AI hero goes to spend the night in a castle, his army is reorganized with the garrisoned army to have the best possible army (also taking into account morale, etc.), this during the AI's turn.
When the AI hero leaves the castle the next turn, the armies are reorganized so that the original castle defense is not too reduced, or regains its original defense.

For the human player:
The disposition of the troops in the hero's army is never changed.
Only free slots are filled.
Edit:
Or eventually, for the human player, garrisoned troops are never transferred (can be an option).

@zenseii
Copy link
Collaborator

zenseii commented Mar 3, 2023

Yes, we can fuck the players on the touch screens. :D

Hi, @LeHerosInconnu, I'm sure you said this jokingly, but it's probably best if we avoid such strong language.

This discussion is starting to derail a bit and all points that can be made, have been made. We should just make a decision on the question:

Should the same type of troops be transferred to the hero army right before a siege or should they not.

I think they shouldn't.

@LeHerosInconnu
Copy link
Author

Hello @zenseii,

Yes, we can fuck the players on the touch screens. :D

Hi, @LeHerosInconnu, I'm sure you said this jokingly, but it's probably best if we avoid such strong language.

Yes, it was a joke, maybe a little rough it is true, but I didn't find how to write it in a more "correct" but still "pictorial" way in English.

This discussion is starting to derail a bit and all points that can be made, have been made. We should just make a decision on the question:

Should the same type of troops be transferred to the hero army right before a siege or should they not.

I think they shouldn't.

Personally, for the human player, to take into account the majority of cases, I think that garrisoned troops are never transferred could be the default operation (with or without option).
This is a big change from the original game, but if a choice has to be made, it seems to me the most appropriate for the majority of possible cases.

For the AI player, I think we should make it better as explained above.

@oleg-derevenetz
Copy link
Collaborator

Personally, for the human player, to take into account the majority of cases, I think that garrisoned troops are never transferred could be the default operation (with or without option).

This will certainly break the "speed up" logic that is commonly used by players.

@LeHerosInconnu
Copy link
Author

@oleg-derevenetz.

Personally, for the human player, to take into account the majority of cases, I think that garrisoned troops are never transferred could be the default operation (with or without option).

This will certainly break the "speed up" logic that is commonly used by players.

The player will have to choose between hero speed and castle defense.
I don't find this too inconvenient.
Or maybe it should be eventually an option.

Or else, the default could be:
The disposition of the troops in the hero's army is never changed.
Only free slots are filled.
I can agree with both possibilities.

@Districh-ru
Copy link
Collaborator

Hello everybody!

Should the same type of troops be transferred to the hero army right before a siege or should they not.

I think they shouldn't.

I agree with @zenseii.
For me the logic proposed by @Branikolog is more clear (only move troops to the free slots) for human player and the player will always predict the result and reorganize the castle garrison in the way he wants. I mostly do the prepare for castle defense myself without relying on some non-configurable logic.
The position of existing hero's troops should not be changed in any way. We should not combine hero's troops as they were split by player for a reason.
Troops from castle might be added to the same troops in hero's army or not - this can be discussed. But IMHO it is better to not move them. Because if we decide to add troops to hero's troops and if the same troop was splitted into several stacks we should decide were to put the castle troop: to the first/center/last stack, or split castle troops and join them to all existing stacks of the same troop in hero's army.

But for AI player we might help him to reorganize troops for castle defense. The logic initially proposed by @LeHerosInconnu mostly suits for this case. But we will have different logic for human and AI player defense, which will confuse the players. We could also on hero visit reorganize the castle troops by adding them to the same troops of hero's army and place others above the free stacks of hero's army. And use the same logic as for human player. And when leaving the castle the troops might be returned back to the castle (and this is a different part of the logic :) ).

@LeHerosInconnu
Copy link
Author

Hello @Districh-ru,

Hello everybody!

Should the same type of troops be transferred to the hero army right before a siege or should they not.
I think they shouldn't.

I agree with @zenseii. For me the logic proposed by @Branikolog is more clear (only move troops to the free slots) for human player and the player will always predict the result and reorganize the castle garrison in the way he wants. I mostly do the prepare for castle defense myself without relying on some non-configurable logic. The position of existing hero's troops should not be changed in any way. We should not combine hero's troops as they were split by player for a reason. Troops from castle might be added to the same troops in hero's army or not - this can be discussed. But IMHO it is better to not move them. Because if we decide to add troops to hero's troops and if the same troop was splitted into several stacks we should decide were to put the castle troop: to the first/center/last stack, or split castle troops and join them to all existing stacks of the same troop in hero's army.

But for AI player we might help him to reorganize troops for castle defense. The logic initially proposed by @LeHerosInconnu mostly suits for this case. But we will have different logic for human and AI player defense, which will confuse the players. We could also on hero visit reorganize the castle troops by adding them to the same troops of hero's army and place others above the free stacks of hero's army. And use the same logic as for human player. And when leaving the castle the troops might be returned back to the castle (and this is a different part of the logic :) ).

The @Branikolog proposal has been implemented: #6741.
And I made a proposal for the AI functioning: #6755. :)

@Branikolog
Copy link
Collaborator

I'm also curious, if AI will considers only the army of a defending hero. I hope he doesn't consider those troops, who are in garrison, but won't join the battle in a case of siege.

@oleg-derevenetz
Copy link
Collaborator

oleg-derevenetz commented Mar 9, 2023

I'm also curious, if AI will considers only the army of a defending hero.

No.

I hope he doesn't consider those troops, who are in garrison, but won't join the battle in a case of siege.

For AI, the logic is the same as the default logic in OG and other games of HoMM series - troops will be moved from the garrison (most powerful stacks first), and also stacks will be merged if necessary - both in garrison and in the hero's army.

@Branikolog
Copy link
Collaborator

Hi, @oleg-derevenetz !
I was talking about the estimation of player's forces.
Since we're going to change the way player's troops and garrison army merge in a case of siege, I'm afraid AI would consider the defending threat using the old logic (or even simple sum of all troops in a castle: player+garrison) instead of new logic, where garrison army is transferred to corresponding player's free slots without even merging the same type creatures.

@oleg-derevenetz
Copy link
Collaborator

@Branikolog No, it doesn't work this way. The estimation of castle garrison strength is performed as-if the castle would be actually attacked, and temporary fake army is created for the guest hero (if any) and then the garrison joins this army using general rules for this hero (and these rules depend on whether this hero is controlled by a human or AI), and then the strength of a resulting combined army is used.

@Branikolog
Copy link
Collaborator

@oleg-derevenetz

@Branikolog No, it doesn't work this way. The estimation of castle garrison strength is performed as-if the castle would be actually attacked, and temporary fake army is created for the guest hero (if any) and then the garrison joins this army using general rules for this hero (and these rules depend on whether this hero is controlled by a human or AI), and then the strength of a resulting combined army is used.

Glad to hear that everything is ok!
I had just heard some player's opinions, that AI is scared to attack castles. I was worried whether the estimation of defending castle hero worked correctly.

@oleg-derevenetz
Copy link
Collaborator

@Branikolog AI is scared to attack castles because it should have significant advantage over castle troops, and also there are coefficients that increase the castle troops' strength if castle has towers and moat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement New feature, request or improvement logic Things related to game logic
Projects
None yet
5 participants