1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-27 00:41:08 +02:00
Commit Graph

121 Commits

Author SHA1 Message Date
ec9dbfd667 Remove excessive recomputations of tile owners 2025-01-08 20:07:42 +00:00
1caab5100a Try to reduce amount of time AI spends on pathfinding 2024-12-23 13:26:54 +00:00
eab6de4686 Fixed an issue that could cause the AI to skip almost their entire turn
If the best Task is to recruit a hero this now triggers pathfinding again as the newly bought hero may impair other heroe's paths.
2024-12-10 19:21:23 +01:00
71d9664295 Allow per-difficulty parameters for NKAI 2024-11-27 21:26:06 +00:00
a2904584d3 Update Nullkiller.cpp
Build and hire-tasks no longer eat into the pass-depth.
2024-09-29 02:01:09 +02:00
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
a329f607c9 Update Nullkiller.cpp
No more map-hack on 3rd difficulty-level. Only starting from the fourth.
2024-09-09 23:23:28 +02:00
f8e4aa1d25 Update Nullkiller.cpp
Use Enum for Gold.
2024-09-09 23:20:53 +02:00
099341e143 Update Nullkiller.cpp
Fixed incorrect trace-message at end of turn.
2024-09-06 22:10:14 +02:00
cf338e04ad Update Nullkiller.cpp
AI can now also buy resources that it has income for.
2024-09-06 21:40:23 +02:00
35d8705fea Update Nullkiller.cpp
prioOfTask-variable-usage bound to trace-level as otherwise a warning will ensue.
2024-09-06 17:20:12 +02:00
db2416cb6b Update Nullkiller.cpp
Readded prioOfTask because it's needed in trace-messages.
2024-09-05 23:41:05 +02:00
b32c9615ed Update Nullkiller.cpp
Removed unused variable.
2024-09-05 15:59:09 +02:00
db16a9d234 A bit of clean-up for merge
Set back trace level to 0
Removed EvaluationContexts that weren't used
Encapsulated many debug-messages behinde trace-levels
2024-09-04 16:41:47 +02:00
09badeb5be Enum for PriorityTiers
In order to not confuse PriorityTiers, especially after adding new ones, now using an enum to identify them.
2024-09-02 00:16:19 +02:00
c667ca46d1 Using correct priorityTier for Clusterization
Clusterizer now uses PriorityTier = 5 for evaluation, which is used to generate priority for guarded objects
2024-09-02 00:00:36 +02:00
7c6f96344a Update Nullkiller.cpp
Removed resetAiState from loop cause it has too many side-effects. Such as the loop going through all passes.
2024-09-01 19:33:43 +02:00
0e91f10bbc Update Nullkiller.cpp
ResetAIState so that units realize what they can do after unlocking a cluster.
2024-09-01 17:21:53 +02:00
56988e054a New priority
1. Take / kill what is reachable in same turn
2. Defend
3. Take / kill what is further away
2024-08-30 18:05:47 +02:00
05d948b582 Priorities
Swapped priority of attacking and defending.
Troop-delivery-missions will check safety of the delivering hero.
2024-08-30 16:46:36 +02:00
b8dacfc0be Update Nullkiller.cpp
Fixed trade no longer working and changed log-output.
2024-08-29 20:49:01 +02:00
b92862c04d New priorities
Added more priority-tiers
2024-08-24 14:55:26 +02:00
284f276108 Update Nullkiller.cpp
Don't trade away gold when the gold-pressure is high.
2024-08-18 09:47:37 +02:00
a79f76f32b Update Nullkiller.cpp
Fix issue with selling/buying the same resources back and forth. But probably leads to not using the market early on. (needs more testing)
2024-08-15 18:15:29 +02:00
ed059393ec No more prio 3 tasks
The AI no longer performs prio 3 tasks, when no prio 0-2 tasks were found.
2024-08-11 18:23:02 +02:00
ea4e412f9a Update Nullkiller.cpp
Only actual heroes and not nullptrs will exculde each other in comparison.
2024-08-07 01:37:15 +02:00
183ce82b99 Update Nullkiller.cpp
Readded prio-3 tasks for heroes when no prio 0-2 tasks were found. It's anything that doesn't lose more than the loss-threshold.
2024-07-25 21:48:44 +02:00
909c308614 Update Nullkiller.cpp
Removed unused variable.
2024-07-24 21:46:18 +02:00
8152b003fe Update Nullkiller.cpp
Fixed a bug that caused tasks that are generated with an initial priority not being executed.
Fixed an error-message wrongfully claiming a hero was locked by STARTUP, when infact the hero was locked by something else (usually a hero-chain).
Recruiting-heros is now handled alongside buying army and buildings.
2024-07-24 21:26:53 +02:00
ed82e2bf4a Warnings
Removed unused variable.
2024-07-20 21:02:39 +02:00
2d715f4d7e Trading logic
Added trading-logic to Nullkiller-AI.
The AI can now identify which resources it is lacking the most and buy them to fix softlocks in their build-order. It can also sell excess resources that it doesn't have a need for.
2024-07-19 15:21:56 +02:00
d4b4a6c4db Warnings
Commented out relics from debugging that were causing warnings for unused variables.
2024-07-15 19:57:33 +02:00
95ba57dfe2 No more Startup-behavior
Startup-behavior was messing with my intended logic. Mostly by getting excess heroes for no real purpose other than that it could.
This wasted a lot of money that could be better invested on subsequent turns.
I removed it and playing-strength actually went up.
2024-07-15 17:50:30 +02:00
102b537353 Recruit-behavior
Moved recruit-behavior back to tasks that plans get made for since otherwise it can mess up plans by blocking town-exits.
2024-07-12 23:33:58 +02:00
9456ab41da Priority-tier
Openmap is no longer tied to difficulty-level due to being configurable anyways.

Tasks are now in different priority-tiers. For now there's 2 tiers. One for regular tasks and one for tasks of the new "conquest"-type. Regular tasks will only be considered when no possible conquest-type tasks were found.

Recruit-hero-behavior is now evaluated before movement to make it more likely a new hero can exchange their stuff with others.
2024-07-12 17:39:52 +02:00
d4308c2ce4 Merge branch 'fixes_only' into develop 2024-07-07 22:52:03 +02:00
a72d23ed8d Debug-Info
Added some debug-info and non-fuzzy-specific-priority-cutoff.
2024-07-07 22:51:50 +02:00
734f815e67 Sorting tasks after buildPlan
Tasks need to be sorted again after buildPlan as otherwise the correct order isn't guaranteed. This led to inconsistent behavior by the AI.
2024-07-07 15:12:05 +02:00
02e429e973 Fix typos using https://github.com/crate-ci/typos
Changes were reviewed manually
2024-06-24 03:47:19 +02:00
b4c6906471 Merge branch 'vcmi/beta' into 'vcmi/develop' 2024-06-11 19:22:23 +00:00
b8beb4fb13 Fixes for various minor issues detected by Sonar Cloud 2024-06-01 11:48:30 +00:00
7bf047ff18 #4066 - fix exploration 2024-06-01 13:13:51 +03:00
820f0e0c1a NKAI: port exploration from VCAI 2024-05-20 23:50:13 +03:00
1388fb1493 NKAI: port exploration from VCAI 2024-05-20 22:43:23 +03:00
721b15d9de Merge branch 'vcmi/master' into 'vcmi/develop' 2024-05-17 08:26:37 +00:00
98afd43969 #3941 - recruit hero when no heroes 2024-05-12 21:10:31 +03:00
30e0a16ee9 Fix some 'new' issues reported by Sonar Cloud 2024-05-06 15:33:30 +00:00
afa766c763 #3824 - fix cluster unlock 2024-04-27 10:57:30 +03:00
3939c4b9d3 NKAI: stability fixes and regression 2024-04-20 14:32:58 +03:00
ed76d8a652 NKAI: allow multiple tasks to be executed from one calculation 2024-04-14 16:46:05 +03:00