Comments (8)
green hero Atlas leaves the castle and goes back
Atlas attacks Vampires for experience. There is nothing strange in this behavior.
Please note also strange behaviour of red hero Kilburn - his fog also should be discovered at that point.
But it's not (at least, not enough). He goes to take the ore mine near the Hillstone, but then he sees the Dawn with decent army and decides that his castle is in danger.
Atlas leaves its castle to visit Demon cave that is long time empty and I bet he should know it.
That's not really the case. Atlas leaves his castle to try to capture Blackburn, and his path is just paved through the empty Demon Cave. But visiting this object (in fact, any object) forces him to stop and re-assess his targets, and he decides to go back to his castle.
from fheroes2.
green hero Atlas leaves the castle and goes back
Atlas attacks Vampires for experience. There is nothing strange in this behavior.
I see! Somehow I missed that there is Vampires stack there.
Please note also strange behaviour of red hero Kilburn - his fog also should be discovered at that point.
But it's not (at least, not enough). He goes to take the ore mine near the Hillstone, but then he sees the Dawn with decent army and decides that his castle is in danger.
Got it!
Atlas leaves its castle to visit Demon cave that is long time empty and I bet he should know it.
That's not really the case. Atlas leaves his castle to try to capture Blackburn, and his path is just paved through the empty Demon Cave. But visiting this object (in fact, any object) forces him to stop and re-assess his targets, and he decides to go back to his castle.
Thank you for the clarifications. In general, maybe it's possible to make AI not recalculate priorities if the game state remains unchanged after the event: declined demon cave used just for a passage, text message event, event deducing resources when there is nothing to deduce, passing through a well having already maximum spell points, passing through the observartion tower visited before etc. Otherwise it creates an impression that AI visits the same object multiple times, going to it and then returning back to defend the castle. Also it would save some processor time.
from fheroes2.
if the game state remains unchanged
In fact, the state of the game does not remain unchanged - hero is in a different place now, so the distances between him and other objects on the map have changed, and the evaluation of objects is always scaled depending on the distance from the hero to these objects, for some objects their value decreases slower with the distance to them, and for some objects their value decreases faster. Evaluating an object is a bit complicated.
from fheroes2.
if the game state remains unchanged
In fact, the state of the game does not remain unchanged - hero is in a different place now, so the distances between him and other objects on the map have changed, and the evaluation of objects is always scaled depending on the distance from the hero to these objects, for some objects their value decreases slower with the distance to them, and for some objects their value decreases faster. Evaluating an object is a bit complicated.
Yes, I saw that non-linear distance penalty. In principle, we can imagine a situation when a hero made just one step outside a castle returns back if we force recalculation for some reason. But the "ideal" target choosing algorithm should be invariant to the hero position until the hero still on the originally selected path to the target. I think the omission of the unnecessary prority recalculation can at least improve the current "non-ideal" solver.
from fheroes2.
if the game state remains unchanged
In fact, the state of the game does not remain unchanged - hero is in a different place now, so the distances between him and other objects on the map have changed, and the evaluation of objects is always scaled depending on the distance from the hero to these objects, for some objects their value decreases slower with the distance to them, and for some objects their value decreases faster. Evaluating an object is a bit complicated.
What if we interpret distance as "pathLength - heroMovePointsRemaining". Then that factor becomes invariant till the hero is on the path during the same turn. Recalculation then should not change the target (at least due to distance change, the castle defense factor of course would still play a role...).
from fheroes2.
What if we interpret distance as "pathLength - heroMovePointsRemaining". Then that factor becomes invariant till the hero is on the path during the same turn. Recalculation then should not change the target.
There is no recalculation while the hero moves. But when he interacts with an "action object", he automatically stops and then recalculates his targets, because during such an interaction his army can decrease (due to a battle) or increase (due to hiring new creatures), he can get additional stats, additional mana, and so on. The path he takes can pass right through objects (it doesn't matter if they are empty or not), through wandering monsters or even enemy heroes - as long as the AI pathfinder believes that this hero is strong enough for this. There are many different parameters besides distance alone. If the hero went to a guarded enemy castle through an object/monsters/hero that he should go through with a fight (and win according to the pathfinder estimation), but if the fight was in fact not so successful, and the hero lost too much army, then there may not be any point in going to this castle at all, but maybe there is some another castle (a little less developed and a little further away but worse guarded), then the target can be changed to that castle. Here we can either come up with some other evaluation method or make sure that the hero does not stop at empty objects, which looks more like a temporary patch, rather than a normal solution.
from fheroes2.
Seems like the hero returned to the castle from daemon's cave because AI "thinks" that there is some threat close enough to the caslte, right? And if the hero would continue moving, he would be too far to protect it? The question is: why the AI couldn't predict it before he sent the hero outside of the castle? I mean that if there was no Daemon cave which forced the AI to recalculate threats, he could make wrong decision by sending hero somewhere when he was needed to protect the castle. So seems like it could be better if AI could predict changing of situation for every position of planned hero's move (during one turn, of course, when no external curcumstances were changed). Of course, it should be more resource-consuming, but who cares? :) At the time AI "thinking" is extremely fast even on my ancient low-end tablet, so we have some power reserve.
from fheroes2.
In fact, this issue does not contain any bugs, but boils down to a vague wish for more efficient AI functioning without any specific technical proposals. It is difficult to regard this even as a request for improvement, but for now let's reclassify it this way.
from fheroes2.
Related Issues (20)
- The AI tries to kite/move away its archers from creatures it can't escape from HOT 2
- The AI should preemptively kite creatures to avoid getting hit
- Make special signs like ! ? have embedded whitespace for French
- Hero's troops are not displayed in Kingdom Overview if Hero is bought in a castle other than an open one
- 1280x720 blurry hard to read text HOT 2
- Вылетает игра HOT 13
- Game crashes with failed AI assertion HOT 4
- Conflicting hotkey-mapping and hotkey-functions HOT 2
- Crash report from discord HOT 4
- Battle AI underestimates the value of anti-magic on bone dragons, casts haste instead
- Meeting screen, morale and luck sprites, sprites of the hero on the right side are not correctly centered horizontally related to the portrait frame and the screen frame
- Core dump on opening the map
- Window elements do not disappear instantly HOT 1
- File options menu disappears on cancelling load game dialog
- Castle construction screen, cliff nest has glowing pixel HOT 1
- Adventure map, Witch's Hut, right-click information window, a line with brackets and no text is displayed below the secondary skill line when the selected hero does not have the secondary skill of the witch's hut HOT 1
- Improve AI ghosts' target priorities
- Make the world map EXIT button size adaptable HOT 1
- Use the large EXIT button on the puzzle map rather than the small EXIT button HOT 1
- Eagle Eye skill description misunderstanding HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fheroes2.