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

16569 Commits

Author SHA1 Message Date
Dydzio
4b91d6e6b0 Change shortcuts to those that non-VCMI players are used to 2024-07-15 18:47:29 +02:00
Xilmi
fbe1e171fe Merge remote-tracking branch 'upstream/develop' into develop 2024-07-15 18:36:19 +02:00
Xilmi
4a552d411c Decisionmaking-changes
There's 3 new evaluation-contexts that are now taken into account:
Whether an action is building, whether an action involves sailing and the newly introduced threat.

The value-evaluation of creatures now also takes special resources into account.

No longer treating other AIs differently than players when it comes to how afraid we shall be of them.

The cost of buildings for decision-making now determines missing resources. Available resources are ignored when it comes to how they impact the cost. But missing-resources will heftily impact the assumed price by calculating their market-value. This shall encourage the AI to rather build what it currently can build instead of saving up for something that it lacking the special resources for.

AI is no longer willing to sacrifice more than 25% of their army for any attack except when it has no towns left.

Revamped the priority-tiers of AI decision-making.

Higest priority is conquering enemy towns and killing enemy heroes. However, the AI will no longer try to do so when the target is more than one turn away and protected by a nearby enemy-hero that could kill the one tasked with dealing with the target. Except when they have no towns left. Then they get desperate and try everything.

As a general rule of thumb one could say the AI will prioritize conquest over collecting freebies over investing army to get something that isn't a city. It's a bit more complex than that but this is roughly what can be expected. It will also highly value their own heroes safety during all this.
2024-07-15 18:12:52 +02:00
Xilmi
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
Xilmi
ce4905ac4c Ivan's fix to brown arrows after new turn
A fix Ivan posted about on Discord that takes care of a newly introduced bug in development-branch that you had to reselect your hero manually after a new turn because he would otherwise think he's still on last-turn when it came to executing planned movement.
2024-07-15 17:47:27 +02:00
Xilmi
f8f10adb2e Take magic-capability into account for overall strength-estimation of hero-lead-armies
The magic-strength of a hero now checks if the hero has a spellbook and at least one combat-spell.
The impact of knowledge and spellpower to the hero's magic-strength is now also depending on it's current and max mana-pool-size as an empty mana-pool does not exactly contribute well to fights.

Replaced every call of getFightingStrength() with getHeroStrength() which uses both the fightingStrength and the (reworked) magicStrength to guess how much stronger a hero-lead army is.
2024-07-15 17:42:02 +02:00
Xilmi
83ffbdff2b Fix for double army-loss
Fixed that army loss was taken into account both for the path and the target-object. In certain cases, like a hero defending a town, this could lead to armyloss being twice as high as it should be.
2024-07-15 17:35:54 +02:00
Xilmi
e2e3f9e638 Take hero-stats into account for attacking hero-defended entities
Instead of using just the strength of the raw army, the hero-stats are now taking into account for the generation of the danger-map.
2024-07-15 17:30:42 +02:00
Xilmi
48ecbd4cbf Threat in DangerHitMap
Added new value threat to DangerHitMapAnalayzer. The purpose is to allow decisions to be less binary around enemy heros.
2024-07-15 17:28:10 +02:00
Xilmi
53c51b4278 Allow all buildings
Added resource-silo and special buildings to things that AI can theoretically build.
2024-07-15 17:26:06 +02:00
Alexander Wilms
775b20bfe2 Remove .clangd config and add separate markdown file explaining some CMake options 2024-07-15 15:48:36 +02:00
Alexander Wilms
97c9cd483b Improve Linux developer documentation
* List CMake options in table
* Improve headline hierarchy
* Add .clangd config file so compile_commands.json gets found out-of-the-box
2024-07-15 15:47:37 +02:00
Ivan Savenko
04a81fee87 Reduce size of CGPathNode and AIPathNode 2024-07-15 07:49:04 +00:00
Ivan Savenko
c00a1e1b0c Fixed new issues detected by SonarCloud 2024-07-15 07:46:40 +00:00
Dydzio
6119898932 Add some useful comments 2024-07-15 09:39:22 +02:00
Laserlicht
6aa7c9ebf9
code review 2024-07-15 00:51:41 +02:00
Dydzio
3836f132d3 Fix alternative actions to support more than 2 actions + simplify logic 2024-07-15 00:41:05 +02:00
Alexander Wilms
f9de3b2ffd startExecutable(): Restore error handling 2024-07-14 21:04:36 +02:00
Alexander Wilms
875a8cc11a startExecutable(): Use QProcess::start() instead of QProcess::startDetached() to fix the missing prompt after quitting vcmiclient or vcmieditor
vcmilauncher is now hidden while the child process is running, since it doesn't get repainted.

Fixes #2574
2024-07-14 21:04:36 +02:00
Andrii Danylchenko
58add0e182
Add docs for Nullkiller AI 2024-07-14 17:45:41 +03:00
Andrii Danylchenko
a4b6fc75dd BattleAI: fix moving to unreachable in case of back-to-back 2-hex 2024-07-14 11:46:45 +03:00
Andrii Danylchenko
6f5710e809
Merge pull request #4110 from vcmi/rewardables
NKAI: rewardables
2024-07-14 09:02:37 +03:00
Xilmi
d878d0ce18 Avoid being killed
Heroes with conquest-tasks will only endanger themselves to be killed when they can execute a conquest in the same turn.

Heroes with other tasks will dismiss any tasks except of defending when they'd be within one turn of an enemy hero that could kill them.
2024-07-12 23:36:41 +02:00
Xilmi
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
Xilmi
a821978d4e Merge remote-tracking branch 'upstream/develop' into develop 2024-07-12 17:43:04 +02:00
Xilmi
92bed2305e priority-tiers
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.

Slightly reworked scoring heuristics.
2024-07-12 17:41:46 +02:00
Xilmi
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
Xilmi
638c1350b8 Path-safety
No longer excluding paths for exposing a hero to an enemy in the behaviors. There definitely are reasons for doing something anyways, even if threatened. The logic for that should be done in the PriorityEvaluator.
2024-07-12 15:43:40 +02:00
Xilmi
663ca23f6f Army-hiring
Supressing hiring army on turn one seems just bad. Starting the main-hero as strong as possible seems like a good idea to me and hiring the available troops outright will help achieve that goal.

However, if there's a hero for hire, who has army with him that is a better deal, we hire that one first.
2024-07-12 15:41:55 +02:00
Xilmi
fdaac9d3c3 Hero-hiring
When we have no hero, we will definitely want to hire one.
We will also want to hire heroes who already pay for more than themselves by coming with an army that has more value than the hero costs.
2024-07-12 15:39:50 +02:00
Xilmi
3fed58c47b Gold-pressure 2024-07-12 15:36:29 +02:00
Simeon Manolov
d997d18438
remove debug line 2024-07-12 15:41:07 +03:00
Simeon Manolov
4be7adbf0a
add missing include 2024-07-12 15:26:31 +03:00
Simeon Manolov
5b6bc10131
Code review 2024-07-12 14:54:28 +03:00
Ivan Savenko
74723bf77e
Merge pull request #4254 from smanolloff/fix-battle-queue
Fix battle turn order for current turn
2024-07-12 14:45:15 +03:00
Simeon Manolov
941cd6768f
Fix battle turn order for current turn 2024-07-12 11:39:57 +03:00
altiereslima
39516b275e Update Portuguese Translation 2024-07-11 19:11:54 -03:00
Simeon Manolov
9d73b50979
Bind server to a randomly assigned port 2024-07-12 01:06:36 +03:00
Ivan Savenko
6b8f94e6e7 Merge remote-tracking branch 'vcmi/master' into develop 2024-07-11 17:43:44 +00:00
Ivan Savenko
286a70c007
Merge pull request #4250 from vcmi/beta
Merge beta -> master
2024-07-11 15:13:26 +03:00
Ivan Savenko
006fadb82c
Merge pull request #4247 from IvanSavenko/release_154
Preparations for release 1.5.4
2024-07-11 11:45:27 +03:00
Ivan Savenko
143fcb7907
Merge pull request #4249 from kambala-decapitator/install-file-async
call Install From File button handler asynchronously
2024-07-11 11:45:18 +03:00
Ivan Savenko
fd297f08e2 Add quick workaround for loading identifiers from difficulty bonuses 2024-07-10 22:33:09 +00:00
Andrey Filipenkov
98cda246a2 [launcher] call Install From File button handler asynchronously 2024-07-10 21:41:26 +03:00
Ivan Savenko
b2729f2661 Updated changelog 2024-07-10 14:41:19 +00:00
Xilmi
98415e98da Spellcasting-bug-fix
Fixed a bug that prevented the AI from using spells when attacking an enemy settlement that has towers.
The bug was caused by noticing how greatly effective spells would be against towers but not being able to actually target them.
By skipping invalid targets, this no longer is an issue.
2024-07-10 14:36:35 +00:00
Ivan Savenko
92d32c4573 Add downloads counter for 1.5.4. Remove some older ones since they won't
fit into a single row
2024-07-10 14:36:24 +00:00
Ivan Savenko
ef68bd7ac0 Show message to player and close game if creature battle animation is
missing (demo assets usage?)
2024-07-10 14:36:24 +00:00
Ivan Savenko
bd10f2d939 Updated Ukrainian translation 2024-07-10 14:36:24 +00:00
Ivan Savenko
dbc227da04 Fix incorrect tooltip when right-clicking Witch Hut if selected hero
already has this skill
2024-07-10 14:36:24 +00:00