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

67 Commits

Author SHA1 Message Date
645b95ba02 Renamed LibClasses * VLC to GameLibrary * LIBRARY 2025-02-21 16:54:56 +00:00
6c4996ff54 AI will now devalue the usefulness of non-flying units when attacking defensive structures in order to prevent suiciding against castles 2025-02-09 17:33:39 +00:00
3479ec9651 Per-hero artifact scoring for NKAI
AI now has better (but not perfect) system for scoring artifacts.

All artifacts now have their base score, based on bonuses provided by
the artifact. For composite artifacts, AI will also consider bonuses
from its components.

When exploring, AI will now weight artifacts as min(base score, price /
5), meaning even artifacts that AI can't score will still have some
priority, if only to sell them or deny them to enemy

AI will now also consider what to equip when trading with heroes or on
the end of AI pass. When considering what to equip, hero will use base
score of an artifact, adjusted by how relevant particular bonus /
artifact for a hero. Some examples:
- Morale-bonusing artifacts have their score reduced based on percentage
of undeads in the army, all the way to 0 for undead-only troops
- Artifacts that give spells (books, hat) will have score reduced based
on how many of these spells are already known by hero
- Land movement artifacts have zero score while on water and vice versa
- Necromancy artifacts will have zero score if hero does not have
necromancy
- Archery artifacts are scaled by amount of ranged troops, and only used
if hero has archery skill

AI may still equip 'bad' artifact, however this should only happen if
hero has no other artifacts to equip into said slot.

TODO's for future PR's (although not sure if / when I will work on
these):
- avoid equipping duplicates of the same artifact. Most notably with
scrolls, but may happen with other misc artifacts or rings.

- consideration for various spell-immunity neclaces

- consideration for birectional artifacts, like Shackles of War, or some
Spheres - since these artifacts need consideration on what our expected
enemy is to correctly estimate whether

- equipping artifacts based on immediate need - for example, equipping
recovery artifacts before end of day, equipping legion pieces only in
town on day 7, preparing for strong / weak enemies (or even preparing
for specific enemy in advance)

- transferring resource-generating artifacts and such to scout heroes,
allowing main hero to focus on combat

- ensure that AI can equip combined artifacts even if non-primary slots
are in use - by considering whether score of combined artifact is higher
than score of all used slots
2025-01-18 13:14:24 +00:00
b25702f15e expose safeAttackRatio to AI config 2024-11-28 11:53:51 +00:00
a70f5de8c6 Merge remote-tracking branch 'upstream/develop' into develop 2024-11-07 14:35:13 +01:00
d3af9f1c67 Removed pointer to VLC entity from CStackBasicDescriptor 2024-10-30 16:47:02 +00:00
c98ac01e7a Replaced public artType member of ArtifactInstance with getter 2024-10-30 16:47:01 +00:00
08fbcd5239 TerrainTile now uses identifiers instead of pointers to VLC 2024-10-30 16:22:11 +00:00
5d6877e06d Merge remote-tracking branch 'upstream/develop' into develop 2024-10-20 00:49:17 +02:00
10ad0fc760 Split CHeroHandler.cpp/.h into 1 file per class
All parts of CHeroHandler.cpp are now in lib/entities/hero
Adjusted includes to use new paths
No functionality changes
2024-10-13 14:01:09 +00:00
065125e770 Merge remote-tracking branch 'upstream/develop' into develop 2024-09-10 14:57:27 +02:00
8225eb454e Added GameSettings to gamestate, potentially allowing to define game
settings per map (or in random map template)
2024-09-05 15:16:27 +00:00
fbe1e171fe Merge remote-tracking branch 'upstream/develop' into develop 2024-07-15 18:36:19 +02:00
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
6f5710e809 Merge pull request #4110 from vcmi/rewardables
NKAI: rewardables
2024-07-14 09:02:37 +03:00
6b8f94e6e7 Merge remote-tracking branch 'vcmi/master' into develop 2024-07-11 17:43:44 +00:00
1be36e1ad4 NKAI: rewardables 2024-07-07 21:58:39 +03:00
24b77b0972 Remove access to hero name translation 2024-07-03 17:01:38 +00:00
02e429e973 Fix typos using https://github.com/crate-ci/typos
Changes were reviewed manually
2024-06-24 03:47:19 +02:00
6e641dbdea #3824 - fix empty army with only commander issues 2024-04-26 23:18:20 +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
728f673763 NKAI: remove static ai field 2024-03-31 21:11:25 +03:00
d6f1a5c2b3 NKAI: parallel capture objects 2024-03-29 20:39:03 +02:00
35429eab52 NKAI: moddable configuration 2024-03-01 22:03:07 +02:00
d5c4478816 Remove most of non-const access to VLC entities 2024-01-19 13:54:49 +02:00
62cd8b12d4 Converted several namespace enums to enum class 2023-08-25 13:38:02 +03:00
17d3d663ee Converted creature ID and spell ID to new form 2023-08-25 13:38:02 +03:00
87957e74c1 Replaced boost::thread_specific_ptr with thread_local 2023-08-23 16:32:29 +03:00
3b238ff15e Fix weekly visitable check 2023-08-01 17:30:47 +03:00
9b5f6ec7cf CArtifact getters setters 2023-07-05 15:48:08 +03:00
85262cf4f5 Moved CGameState files into a separate directory 2023-06-26 17:15:59 +03:00
f7b27da00e Implemented support for "coast visitable" objects:
- objects marked as coast visitable can be visited from land even when
placed in water
- added isBlockedVisitable and isCoastVisitable method to
CGObjectInstance
- implemented json config for these properties in banks
2023-06-25 17:42:33 +03:00
0829593356 NKAI: composite pathfinder actions and fix for guarded bordergate 2023-05-07 09:15:37 +03:00
05eccbc2bb vcmi: split bonus to enumerator and HeroBonus.h 2023-05-03 18:01:06 +03:00
1b4d117790 deeper decoupling 2023-04-30 17:13:07 +04:00
e47bb3f1f9 Separate configuration and object 2023-04-30 00:59:02 +04:00
11b237a23c vcmi: massive refactoring v1 2023-04-05 22:33:12 +03:00
a0e9e01b48 Renamed & reorganized all game mechanics settings names 2023-03-16 18:11:35 +02:00
383387ef29 Integrated defaultMods into mod system 2023-03-16 17:55:09 +02:00
144ddba97d Replaced AI assertion failure with error in log 2023-03-07 00:06:58 +02:00
f8f6df02f3 Removed remaining hardcoded objects 2023-01-23 15:27:27 +02:00
fa6f7513e8 All heroes-related strings are passed through translator 2023-01-20 15:18:36 +02:00
e31beafa17 #1100 - fix visiting allied dwellings 2022-11-23 02:40:56 +04:00
e9c725181c NKAI: fix retreat logic 2022-10-15 15:15:12 +03:00
eeea01d778 NKAI: namespace 2022-10-04 08:40:14 +03:00
72feb538ce add explicit null pointer checks 2022-09-25 10:05:16 +03:00
c24fc89fe3 Lambda decltype on compile time instead of runtime 2022-09-14 12:08:20 +03:00
af6d666778 use high_resolution_clock instead of steady_clock 2021-11-23 11:56:06 +03:00
fc064b1c45 replace boost::chrono with std::chrono 2021-11-23 10:23:55 +03:00