fheroes2 icon indicating copy to clipboard operation
fheroes2 copied to clipboard

Improved Artifact's Evaluation

Open felix642 opened this issue 2 years ago • 4 comments

closes #4226.

Improved the getArtifactValue() function based on what @LeHerosInconnu said in #4226.

Artifacts value is based on multiple factors : +1 per skill level +1 per spell tier

The other effects add +1 to the value based on the weakest artifact.

For example, Gold Income gives +1 per 800 gold/day

felix642 avatar May 10 '22 02:05 felix642

The original range of values was [0;5] while we have [-2;26]. This will definitely change AI behavior in general. Also ENDLESS_BAG_GOLD and ENDLESS_PURSE_GOLD have values of 0 which shouldn't be the case. We need to switch from int to double as a first step so that some artifacts will have more than 0 values. Then update BagArtifacts::getArtifactValue() method to return double as well.

@ihhub, do you think we should normalize the values between something like [-5, 5] ?

felix642 avatar May 23 '22 15:05 felix642

The original range of values was [0;5] while we have [-2;26]. This will definitely change AI behavior in general. Also ENDLESS_BAG_GOLD and ENDLESS_PURSE_GOLD have values of 0 which shouldn't be the case. We need to switch from int to double as a first step so that some artifacts will have more than 0 values. Then update BagArtifacts::getArtifactValue() method to return double as well.

@ihhub, do you think we should normalize the values between something like [-5, 5] ?

No we shouldn't. The negative effect of artifacts is not that big as a positive. Let's do step by step. We will reach the ideal state eventually :)

ihhub avatar May 24 '22 14:05 ihhub

The original range of values was [0;5] while we have [-2;26]. This will definitely change AI behavior in general. Also ENDLESS_BAG_GOLD and ENDLESS_PURSE_GOLD have values of 0 which shouldn't be the case. We need to switch from int to double as a first step so that some artifacts will have more than 0 values. Then update BagArtifacts::getArtifactValue() method to return double as well.

@ihhub, do you think we should normalize the values between something like [-5, 5] ?

No we shouldn't. The negative effect of artifacts is not that big as a positive. Let's do step by step. We will reach the ideal state eventually :)

Don't worry about normalizing ultimate artifacts since they are never placed on the map. I think AI should be ok even without additional changes.

idshibanov avatar May 28 '22 04:05 idshibanov

Hi @ihhub, sorry for the delay I forgot I had an open PR..

I added the required logic for the missing artifacts.

felix642 avatar Aug 07 '22 19:08 felix642

Hi @felix642 , could you please update your branch from master branch as we made a lot of changes and on Visual Studio it's impossible to test without rerunning all scripts?

ihhub avatar Aug 08 '22 12:08 ihhub

@felix642 , thank you so much for this improvement!

ihhub avatar Aug 31 '22 14:08 ihhub