7dfb499edf
replace boost locks with std
2025-02-28 15:25:58 +01:00
f238d89601
NKAI - Prefer giving fast units to scouts
...
Nullkiller AI will now prefer giving its scout heroes faster units to
optimize their movement points on next turns.
Unit selection logic:
- AI prefers to give 'weak' units that won't affect army strength of main
hero. Unit is considered 'weak' if its level below 4 or if its AI value
is below 1% of total army strength. So AI can give high-tier unit to
scout, but only if main hero already has massive army.
- Within weak units, if hero is moving on terrain with penalty, AI will
always prefer units that are native to this terrain. So on snow AI will
always prefer unit from Tower even if its speed is lower than unit from
another faction.
- Within remaining candidates, AI will prefer unit that will give higher
movement points limit. This also means that in case of H3 rules, all
units with 11+ speed will be viewed as equally good
- If there are multiple units with same speed, AI will prefer unit with
lowest AI value
2025-02-11 16:37:54 +00:00
dea1eba20b
Rework and optimize turnInfo used by pathfinder
2025-01-04 15:09:50 +00:00
2ad9038709
AI can now disband units that block slots for buying better units
...
When the AI cannot buy units in a city because all slots are blocked and the units in the slot are cheaper than the units it wants to buy, the AI will now get rid of the units that block that slot in order to be able to buy the better units.
2024-12-12 20:06:33 +01:00
5d6877e06d
Merge remote-tracking branch 'upstream/develop' into develop
2024-10-20 00:49:17 +02:00
cee3521f57
Merge pull request #4770 from IvanSavenko/prison_fix
...
Fix for loading hero types / identities
2024-10-14 18:16:53 +03:00
31095248ab
Removed typeName and subtypeName properties from CGObjectInstance
2024-10-13 13:05:50 +00:00
a8e84c55f6
Fix some of the new warnings from sonarcloud
2024-10-11 10:45:29 +00: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
b8beb4fb13
Fixes for various minor issues detected by Sonar Cloud
2024-06-01 11:48:30 +00:00
6e641dbdea
#3824 - fix empty army with only commander issues
2024-04-26 23:18:20 +03:00
4c70abbeb5
Reduced usage of global variables - removed or made const / constexpr
2024-02-12 13:49:45 +02:00
d04241b10a
Code cleanup
2024-01-19 23:02:00 +02:00
d5c4478816
Remove most of non-const access to VLC entities
2024-01-19 13:54:49 +02:00
1b85abb508
Use auto instead of redundant type in initializations using new
...
grep -r --include \*.h --include \*.cpp "=" * | grep -v "auto\|int\|char\|bool\|float|\double\|for\|if\|googletest\|fuzzylite\|size_t\|using\|return\|{\|}\|= \"\|= tr(\|virtual\|void" | grep -Po ".*[^ ]+ [^ ]+ [^ ]*[ ]*=.*;" | grep -v "float\|nullptr" | grep "new" | grep -v "AI/FuzzyLite" | grep \( | grep "= new" > redundant_types.txt
import re
with open("redundant_types.txt") as f:
for line in f:
line = line.strip()
path = line.split(":", 1)[0]
original_code = line.split(":")[1].strip()
if "new " in original_code:
cpp_type = original_code.split(" ")[0]
if original_code.count(cpp_type) == 2:
print()
print(path)
print(original_code)
new_code = "auto "+" ".join(original_code.split(" ")[1:])
print(new_code)
with open(path, "r") as f:
filedata = f.read()
filedata = filedata.replace(original_code, new_code)
with open(path, "w") as f:
f.write(filedata)
2024-01-16 21:40:53 +00:00
5083100d3b
NKA: fix accessing removed hero and heroExchangeCount
2023-07-31 22:01:11 +03:00
08cfbe79cf
Added encapsulation for movement points access
2023-06-25 17:42:36 +03:00
bd4d2788ed
Split pathfinder into multiple smaller files
2023-06-21 13:46:09 +03:00
acac42291e
Remove excessive CMap.h includes
2023-05-31 23:18:38 +03:00
37027ad17f
Fix AI boat logic
2023-04-18 18:33:44 +04:00
11b237a23c
vcmi: massive refactoring v1
2023-04-05 22:33:12 +03:00
fa9e1d2d83
NKAI: fix crash
2023-03-12 16:31:15 +02:00
05a1d7c6e3
All text for factions/towns/building are passed through translator
2023-01-20 15:18:36 +02:00
fa6f7513e8
All heroes-related strings are passed through translator
2023-01-20 15:18:36 +02:00
eeea01d778
NKAI: namespace
2022-10-04 08:40:14 +03:00
2434fe3f6f
NK: fix AI speed
2022-10-01 13:49:27 +03:00
ff635edc0b
wrap all library code into namespace if VCMI_LIB_NAMESPACE is defined
...
preparation for having client and server in a single process
2022-09-24 15:55:21 +03:00
c9c79887a7
remove unused variables
2022-09-22 11:54:10 +03:00
aaa07e4d2e
New terrain support - part 1 ( #755 )
...
Initial support of new terrains
2022-09-11 11:31:26 +03:00
31c9d6e28d
Fix performance issue related to TurnInfo construction
2022-06-06 09:47:37 +03:00
70ed3f55a5
Nullkiller: replace a hack with temporary bonus node concept
2021-07-26 21:02:50 +03:00
3fa7e0976f
Nullkiller: update / fix build, core changes required for Nullkiller AI
2021-07-26 21:02:50 +03:00
b4241670ba
Nullkiller: rename VCAI to AIGateway
2021-07-26 21:02:50 +03:00
9a203b8af9
Nullkiller: parallel object clusterization, stabilization
2021-07-26 21:02:50 +03:00
66843b22d3
Nullkiller: async hero chain calculation
2021-07-26 21:02:50 +03:00
0265de77fa
Nullkiller: fix crash, refactor
2021-07-26 21:02:50 +03:00
fb3cda666f
Nullkiller: tbb and hero chain calculation optimization and parallel cpathfinder initialization
2021-07-26 21:02:50 +03:00
3d91f2e988
Fix defence crashes and hangs
2021-07-26 21:02:50 +03:00
3dc76cfe35
Nullkiller: fix crash when buy army through pathfinder
2021-07-26 21:02:50 +03:00
45942cfbbe
Nullkiller: stabilization, fix memory leaks
2021-07-26 21:02:50 +03:00
3822d788e8
Nullkiller: allow buy army through pathfinder
2021-07-26 21:02:50 +03:00
e385c83a88
Nullkiller - rewrite decomposition, decomposition cache, morale management
2021-07-26 21:02:50 +03:00
5bfe71c8f3
Nullkiller: small optimization of AIPathfinder for big maps
2021-07-26 21:02:50 +03:00
1806dd8447
Nullkiller: remove AIhelper + refactoring
2021-07-26 21:02:50 +03:00
cebb5b296b
Nullkiller: fix priorities after refactoring
2021-07-26 21:02:50 +03:00
8f8c5ca255
Nullkiller: initial decomposition
2021-07-26 21:02:50 +03:00
17a960e850
Nullkiller: gold preasure and turn variables for priority evaluation. Tweaking building behavior
2021-07-26 21:02:50 +03:00
37434dc4cf
AI: hero chain stabilisation
2021-07-26 21:02:50 +03:00
3ffcef30f6
AI: add army cost
2021-07-26 21:02:50 +03:00
f44eaf8132
AI: inefective chain cancellation
2021-07-26 21:02:50 +03:00