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

Completely wrong threat level displayed #3150

Open
krs0 opened this issue Nov 5, 2023 · 33 comments · May be fixed by #3192
Open

Completely wrong threat level displayed #3150

krs0 opened this issue Nov 5, 2023 · 33 comments · May be fixed by #3192
Labels

Comments

@krs0
Copy link
Collaborator

krs0 commented Nov 5, 2023

The following battle is more than challenging.
image

Thsi is AI result from battle
image

@krs0 krs0 added the bug label Nov 5, 2023
@DjWarmonger
Copy link
Member

By design, "challenging" should mean between 250% and 400% hero army strength (including hero primary skills). This looks like more than 400% to me, but then the code is very simple and not suspicous at all. Maybe off-by-one error, or just the numbers are correct?

@krs0
Copy link
Collaborator Author

krs0 commented Nov 5, 2023

"levels" :
            [
                "Effortless",
                "Very Weak",
                "Weak",
                "A bit weaker",
                "Equal",
                "A bit stronger",
                "Strong",
                "Very Strong",
                "Challenging",
                "Overpowering",
                "Deadly",
                "Impossible"
            ]
double ratio = (static_cast<double>(getArmyStrength()) / hero->getTotalStrength());
         if (ratio < 0.1)  choice = 0;
    else if (ratio < 0.25) choice = 1;
    else if (ratio < 0.6)  choice = 2;
    else if (ratio < 0.9)  choice = 3;
    else if (ratio < 1.1)  choice = 4;
    else if (ratio < 1.3)  choice = 5;
    else if (ratio < 1.8)  choice = 6;
    else if (ratio < 2.5)  choice = 7;
    else if (ratio < 4)    choice = 8;
    else if (ratio < 8)    choice = 9;
    else if (ratio < 20)   choice = 10;
    else                   choice = 11;

@krs0
Copy link
Collaborator Author

krs0 commented Nov 5, 2023

Right now, I would argue that this is confusing for players.
The example provided is deadly in 99% of scenarios.

So challenging level should be lowered a little.

From the upper part... top 4 levels could be replaced by 2 Overpowering and Impossible

@Alucard648
Copy link

How many Wyverns were actually in that stack? 20 can be beaten with good tactics and usage of Lv1-2 spells. 49 is definitely deadly, if not impossible. Save file, please.
Also threat level should be dependant on hero level and stats, on both sides. If the threat evaluation algorithm fails to calculate possible threat level, or could result in way too broad range of threat levels, such as between Equal to Deadly, in case of PvP encounters, just return Unknown threat level.

@krs0
Copy link
Collaborator Author

krs0 commented Nov 6, 2023

All in all, I think we are talking about a half-baked feature here. More consideration into those calculations needed.

In this case there were 21 Upgraded Wyverns. I had no spells.

We are not talking here about perfect spells and perfect gameplay.

(If I were a pro player, I would read the numbers anyway and know better than algorithm about my odds.)

We are talking about 99% of players, that will be misled that they stand a chance against those odds.

I would error on the side of cautious and change threat calculations to display these threats as more deadly

Also threat calculation should be improved to take into account more variables: like hero power or potential spell damage, etc.
.

@IvanSavenko
Copy link
Member

This is why I proposed 5 threat levels instead of this zoo. Very weak, weak, similar, strong, very strong. End.

  1. More clear names instead of "Strong" vs "Challenging" vs "Deadly" vs "Impossible"
  2. This is how this feature works in H4 and H5 (don't know about H6/H7)
  3. More friendly to casual players. Since this feature is useless to pro players anyway.

Or simply cut it out completely to prevent stuff like this.

@gamestales
Copy link
Contributor

Please keep it.
Comparing army strength should be available because of weaker players or those that do not remember all units.
Also, including hero strength would be wrong because one does not know the enemy hero.
If it is clear that only army is compared, then it should be ok.
Keeping many levels would help player decide. For example, he knows that with weak hero he can beat ai stroneger by 10%.

Maybe do as with quantity levels? Instead of few several pack - show, stronger by 10%, stronger by 20%.

@gamestales
Copy link
Contributor

gamestales commented Nov 9, 2023

Could it just show:
x% weaker
Equal Strength
x% stronger
?

@nullkiller
Copy link
Member

I agree that people might think that challenging is something hard but beatable. But it is not in most cases because enemy is way stronger in this case.

@gamestales
Copy link
Contributor

What was result after not accepting autocombat?

@krs0
Copy link
Collaborator Author

krs0 commented Nov 13, 2023

Managed to kill 5 iirc

@IvanSavenko
Copy link
Member

Checked H5. It uses 5 difficulty rankings:

  • Low: 0 - 17% enemy strength compared to hero strength
  • Moderate: 17% - 45%
  • Challenging: 45% - 100%
  • High: 100% - 280%
  • Deadly: 280%+

I used level 1 hero, but if his stats are also accounted for then values might be slightly off. I suspect that H5 uses some additional heuristics to account for hero strength, so actual thresholds are likely 20%/50%/100%/300%

Frankly I'd rather use this ranking unless somebody is planning to write phd thesis on determining 10 different threat rating names that are not ambiguous in all languages that vcmi supports. Extra bonus is that people familiar with H5 might recognize similar names.

@dydzio0614
Copy link
Member

dydzio0614 commented Nov 15, 2023

I personally like it detailed as it currently is, though naming is a bit unfortunate (challenging before high would make sense). We can also use new existing feature so threat levels have associated text color, going white-yellow-orange-red with different shades for every value

@IvanSavenko
Copy link
Member

Now good luck finding 10 distinct enough colors...

@dydzio0614
Copy link
Member

they will not be very distinct but we can use light and dark variant for each for these colours, making it almost 10 colors already. We can also group 5 colors and use them for pairs of threats

@IvanSavenko
Copy link
Member

So... 5 color options? 😛

BTW - this does NOT adresses core issue.

VCMI: Challenging: 250% - 400%
H5: Challenging: 45% - 100%

This battle is not "challenging". It is "impossible"
And yes - I checked math. 21 Wyvern Monarch vs army from screeenshot is ~400% threat. So works as expected. Right?

@IvanSavenko
Copy link
Member

Not a bad idea on colors though, e.g. blue/green/yellow/orange/red.
But core issue still remains - good luck finding 10 threat levels that would be clear to player in all languages that we support.

@dydzio0614
Copy link
Member

as I wrote - insert challenging before high

@dydzio0614
Copy link
Member

original H3 creature amount texts are also pretty arbitrary

@IvanSavenko
Copy link
Member

Possibly. Does not justifies adding/having another similar feature.

@dydzio0614
Copy link
Member

dydzio0614 commented Nov 15, 2023

well, for now the only real issue that got noticed is "challenging" word being misleading, and we talk about feature that already exists

@gamestales
Copy link
Contributor

gamestales commented Nov 15, 2023

AI value is very imprecise so it won't be useful to average player

We could have our own value system for units. But player that have no idea about units can check their value online.
Why not provide it to him?

top player can easily guess exact force composition based on memorized AI value's, leading to information reveal

The code uses average numbers for lots, pack etc...

@IvanSavenko
Copy link
Member

IvanSavenko commented Nov 15, 2023

The code uses average numbers for lots, pack etc...

It does? Well, in that case it even less useful.
Meaning that 49 Wyverns here would also be "Challenging" 🤣

(or "very strong' if we were to switch order. Yeah, definitely representative)

@gamestales
Copy link
Contributor

gamestales commented Nov 15, 2023

That is why exact percent would be useful - it represents actual user knowledge about the enemy.

It is VERY important, because player can not withdraw from battle, and it can actually decide his whole game.
Moreover, when new mod shows up player must memorize all new creatures.

I do not know if AI values for creatures is correct, but that is another issue (those vyverns are 263%)
I have experience with some returning or switching version players.
They behave like this - this have wings it flies, that has bow - it shoots. But how strong it is?

@gamestales
Copy link
Contributor

gamestales commented Nov 15, 2023

screen
I killed 7

@dydzio0614
Copy link
Member

dydzio0614 commented Nov 15, 2023

IMO if we go with % approach: calculace exact % for real unit value, not average

Then show min and max value for that unit range instead of % - so we enhance the words like "high (+0-50%)
@IvanSavenko what do you think? This is kinda how create range words got numerified in hota

@gamestales
Copy link
Contributor

I like the idea. That way there would be only 3 levels:
Weaker - when upperbound is less than player
Stronger - when lowerbound is stronger
Similar otherwise.

@IvanSavenko
Copy link
Member

IvanSavenko commented Nov 15, 2023

IMO if we go with % approach: calculace exact % for real unit value, not average

Or calculate it for range, not average.
20 Wyverns and 49 is very different threat level.

So makes sense to display it as such, e.g. "250%-400% stronger that our army"

@dydzio0614
Copy link
Member

calculating for range IMO makes sense depending on what design we take - currently by design we calculate threat based on exact unit count unless something changed and I missed that

@IvanSavenko
Copy link
Member

Not according to gamestales:

The code uses average numbers for lots, pack etc...

And if we do use exact unit count then displaying exact threat would be clear information reveal since all you need to do is get AI value of own army and multiply it by displayed threat level.

@gamestales
Copy link
Contributor

Dydzio is right, I was wrong. It uses the exact number of units.
I would recode it, so it returns ranges according to player knowledge.

@gamestales
Copy link
Contributor

So currently player can get the actual value by changing his army by unloading to city.

@nullkiller
Copy link
Member

Looks like the easiest solution here is to use a mod which will determine a list of treat levels like min%, max%, name. If the list is empty - no treat levels are shown. And put a few mods into vcmi extras where you can select one of them with the amount of levels you like the best. Otherwise this arguing will never end).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants