fheroes2
fheroes2 copied to clipboard
Improved Artifact's Evaluation
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
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] ?
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 :)
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.
Hi @ihhub, sorry for the delay I forgot I had an open PR..
I added the required logic for the missing artifacts.
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?
@felix642 , thank you so much for this improvement!