1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-14 10:12:59 +02:00
Commit Graph

1977 Commits

Author SHA1 Message Date
Xilmi
cfe4d7592a Update DefenceBehavior.cpp
Heroes will no longer rush to defend towns that have a standing garrison that they can't merge their armies with.
2024-09-29 03:13:21 +02:00
Xilmi
a2904584d3 Update Nullkiller.cpp
Build and hire-tasks no longer eat into the pass-depth.
2024-09-29 02:01:09 +02:00
Xilmi
f7a961793a Update PriorityEvaluator.cpp
AI is more careful when gathering stuff near enemies.

The wasted movement-points are no longer considered when calculating which own city to fall back to when there's nothing better to do.
2024-09-29 01:23:13 +02:00
Xilmi
4a5ecdf25e Update Nullkiller.h
Removed pointless default-parameter.
2024-09-29 01:15:53 +02:00
Xilmi
769268cfe3 Eternal Garrison
Fixed an issue that caused heroes to stay garrisoned for ever when hero-cap was reached.
2024-09-29 01:15:09 +02:00
Xilmi
8d93c0c9c9 Update PriorityEvaluator.cpp
Removed workaround that was likely necessitated by other issues.
2024-09-27 23:03:35 +02:00
Xilmi
ea535b211a Update Nullkiller.h
Fixed issues caused by running buildPlan with wrong default-priority-tier.
2024-09-27 23:03:09 +02:00
Xilmi
0b016b9b14 Update RecruitHeroBehavior.cpp
If the AI is very rich it will buy more heroes even if it doesn't have a capitol.
2024-09-27 23:02:40 +02:00
Xilmi
3b7834495d Update PriorityEvaluator.cpp
Fix an issue that caused AI to take their hero's attributes into consideration twice when calculating how much army they think they'll lose.

Fixed an issue where offensive defending didn't take into consideration whether the hero would actually be strong enough to beat the enemy hero it was trying to dispatch.
2024-09-27 19:38:07 +02:00
Xilmi
e4ef95f8dd Revert dynamic maxWillingToLose
Out maxWillingToLose back to a static 25%.
Dynamic could become too suicidal or too passive. 25% is a good sweetspot.
2024-09-25 16:12:53 +02:00
Xilmi
1d831022e8 Merge remote-tracking branch 'upstream/develop' into develop 2024-09-25 14:08:34 +02:00
Xilmi
433c58f8b1 Workaround for previously masked issue
A recent fix made it so that towns that weren't supposed to be defended are now no longer defended.
This caused scouts with minimal army to also go after them in addition to the main-hero.
Problem is when two heroes go for the same town it's a massive waste of movement-points. So for the time being only main-heroes will go for faraway captures.
Better solution would be to memorize who was sent to attack what on the same turn and filter out tasks going for the same target.
2024-09-23 18:42:31 +02:00
Xilmi
d87f195bc7 Update AINodeStorage.cpp
Nodes along the path are now also considered for how dangerous it is.
2024-09-23 18:39:18 +02:00
Xilmi
71504a3140 Hire despite hero present
Only if both the garrison and the outside of a town are blocked are hires of heros being blocked.
2024-09-23 17:25:17 +02:00
Ivan Savenko
92c5fd4156
Merge pull request #4655 from IvanSavenko/bugfixing
Bugfixing
2024-09-23 18:01:27 +03:00
Xilmi
20f7751e16 Weekend-decisions
When attacking non-neutral towns that are far away, the AI now considers whether their attack would arrive in the same week. If it wouldn't, it means there's a high risk that newly bought troops might flip around who is stronger. So they now refrain from sending a hero towards an enemy town that is too far away.
2024-09-23 01:25:58 +02:00
Xilmi
9ef2c6f8a0 Merge remote-tracking branch 'upstream/develop' into develop 2024-09-22 23:43:29 +02:00
Ivan Savenko
76e3ca4afe Fix potential access to destroyed variable on stack 2024-09-22 20:32:20 +00:00
Andrii Danylchenko
894c88defc
Merge pull request #4612 from vcmi/nkai-treat-pandora-as-blocker
NKAI: pandora as blocker object
2024-09-22 15:30:17 +03:00
Xilmi
90d72a4458 Chase & FFA-changes
The AI should no longer chase enemy heroes that are not reachable in the same turn, when there's other options as this behavior was quite exploitable.

The AI should now take their overall strength into account when deciding whether to attack or not.
Previously it would attack as long as their assumed army-loss was at most 25%.
Now that is 50% times the ratio of their power compared to the total power of everyone.
2024-09-22 13:06:07 +02:00
Xilmi
d679ee72b9 Merge remote-tracking branch 'upstream/develop' into develop 2024-09-22 12:21:20 +02:00
Andrii Danylchenko
ce0f51672a NKAI: replace hardcoded pandora with more flexible solution 2024-09-20 16:05:57 +03:00
Ivan Savenko
6832a5c4be
Merge pull request #4599 from MichalZr6/fix_hero_access_check
Fix error "hero access check" flooding console during quick-battle
2024-09-20 13:01:49 +03:00
Ivan Savenko
c7fc6a4c2e
Merge pull request #4625 from IvanSavenko/fix_doublevisit
Fix crash on AI double-visiting a town with new hero
2024-09-20 11:50:47 +03:00
Laserlicht
a1384bf47f defending, when not possible to attack invincible 2024-09-19 20:54:50 +02:00
Ivan Savenko
bbeaf0ad01 NKAI: Do not visit town on recruiting hero
Currently this may lead to a case where player have received a query
(such as levelup query from Battle Academy in Dungeon), but still
attempts to move
2024-09-19 16:44:48 +00:00
Andrii Danylchenko
ec6c84b0e0 NKAI: pandora as blocker object 2024-09-17 15:25:13 +03:00
Xilmi
1495ec56f6 Update AINodeStorage.cpp
The node of a disembark-action can no longer be part of a hero-chain since sea-to-land-trade isn't possible and landing first eats up all movement-points.
2024-09-15 20:46:17 +02:00
MichalZr6
cb9070fb5b Fix unnecesarry error log in console from CBattleInfoEssentials::battleGetFightingHero 2024-09-15 08:51:05 +02:00
Xilmi
c88165f900 Update PriorityEvaluator.cpp
Whirlpools are no longer explorePriority 1 as the AI would then try out all of it's 5 entries on both sides.
2024-09-14 13:41:14 +02:00
Xilmi
22222f0fba Priorization-improvements
Manarecoveryreward now uses float instead of unsigned int in order to avoid extremely high instead of negative scores when the hero has more mana than his mana-limit for example due to mana-vortex.

Moved upgrading armies to a lower priority tier as otherwise the AI would go back to their cities all the time even though there were plenty of other things to do.

Improved exploration logic by putting different kinds of exploration to different priority-tiers.
Looking at the other side of a portal has high priority, visiting an observatory has medium priority and scouting by visiting nearby tiles has low priority.
2024-09-14 02:58:23 +02:00
Xilmi
9b9a50c0ae Update StayAtTown.cpp
Showing mana-limit too for Stay At Town.
2024-09-14 02:51:33 +02:00
Xilmi
ab441d8e67 Update PriorityEvaluator.cpp
AI now should no longer ignore spell-scrolls and artifacts of the treasure-class.
2024-09-13 23:06:49 +02:00
Xilmi
af2df5763f Update PriorityEvaluator.cpp
Only if there is a high gold-pressure a buildings' cost will deter from its score.
2024-09-12 22:53:45 +02:00
Xilmi
ab64edf7dd Update RecruitHero.cpp
Remove code that, according to Ivan shouldn't do anything but cause errors.
No noticable regressing in playing-strength was observed.
2024-09-12 20:08:07 +02:00
Xilmi
5ed888b284 Update BuyArmyBehavior.cpp
Accomplish the same but with simpler code.
2024-09-12 20:07:22 +02:00
Xilmi
a1a03d4b74 Merge remote-tracking branch 'upstream/develop' into develop 2024-09-12 14:54:39 +02:00
Ivan Savenko
29f393e024 Removed hardcoded checks for map objects in favor of analyzing
rewardable object content
2024-09-12 12:11:18 +00:00
Ivan Savenko
39a2c29c97 Removed creatureBank flag from battle, battles now receive BattleLayout
struct that defines how units are placed in combat
2024-09-12 12:11:18 +00:00
Ivan Savenko
503b87561e Converted all h3 banks to rewardable, remove most of hardcoded checks 2024-09-12 12:11:18 +00:00
Ivan Savenko
785036836c Rewardable objects may now define guards. Converted Crypt to rewardable. 2024-09-12 12:10:40 +00:00
Ivan Savenko
48b0a222a0
Merge pull request #4570 from kdmcser/crash_fix
fix Ballista Bank Mod auto combat crash
2024-09-12 14:16:41 +03:00
Xilmi
d4fd4ed670 Update BattleEvaluator.cpp
Make sure trace-message doesn't crash from accessing invalid element.
2024-09-11 16:05:53 +02:00
kdmcser
312403962b
Update BattleExchangeVariant.cpp
fix.compile error
2024-09-11 11:39:03 +08:00
Xilmi
aefe2fda36 Update BuildingBehavior.cpp
No longer rush a fort in a threatened town.
2024-09-10 23:42:51 +02:00
kdmcser
bb759dc2b8 fix compile error 2024-09-11 01:43:30 +08:00
Xilmi
065125e770 Merge remote-tracking branch 'upstream/develop' into develop 2024-09-10 14:57:27 +02:00
kdmcser
58cdbccf21
Update AI/BattleAI/BattleExchangeVariant.cpp
Co-authored-by: Ivan Savenko <saven.ivan@gmail.com>
2024-09-10 15:29:11 +08:00
Xilmi
df119370c7 Exploration
Slightly adjust the value of exploring within the hunter-gather-prirority.
2024-09-10 00:23:17 +02:00
Xilmi
37f9f93948 Update RecruitHeroBehavior.cpp
Modified how to score what hero to hire to make it more likely to rehire fled heroes with high levels when the army-gain from the hero would be rather insignificant.
2024-09-09 23:38:28 +02:00