Ivan Savenko
e829d723b2
Replace global bonus tree change counter with per-node counter
2025-01-12 12:23:07 +00:00
Ivan Savenko
1c6fbe4200
Reduce excessive NKAI logging
2025-01-12 12:21:10 +00:00
Ivan Savenko
3d1bf03a25
Fix potential concurrent access
2025-01-12 11:06:00 +00:00
Ivan Savenko
5cff9af236
Reduce BattleAI logging
2025-01-10 19:45:35 +00:00
Ivan Savenko
40bff74195
Use small vector for unit list
2025-01-10 18:58:46 +00:00
Ivan Savenko
797b62fd46
Try to implement lazy evaluation for reachability map
2025-01-10 17:43:45 +00:00
Ivan Savenko
2d5b5d94e7
Optimize computation of reachability map
2025-01-10 15:38:28 +00:00
Ivan Savenko
a44bbf4527
Merge pull request #5044 from MichalZr6/battle_hex_array
...
New container for BattleHexes. Refactors aiming for quick-battle better performance.
2025-01-10 15:32:05 +02:00
Ivan Savenko
ca21adc93f
Merge pull request #5227 from kambala-decapitator/cmake-improvements
...
CMake improvements
2025-01-10 15:24:44 +02:00
Ivan Savenko
ec9dbfd667
Remove excessive recomputations of tile owners
2025-01-08 20:07:42 +00:00
Ivan Savenko
82e8db3037
Do not compute threats that are too far away to be useful
2025-01-08 20:07:42 +00:00
Andrey Filipenkov
2ec518fdf0
[cmake] link NKAI to TBB
2025-01-08 15:37:17 +03:00
Andrey Filipenkov
db5d77362a
[fuzzylite] force C++14 standard
...
doesn't build under C++17 due to using removed symbols
2025-01-08 15:22:21 +03:00
MichalZr6
dbe82b94f6
Changes following review:
...
- shared_ptr for destructibleEnemyTurns instead of raw pointer
- drop implicit int conversion for BattleHex class
and implement toInt() instead
- implement necessary operators in BattleHex
- adjust code to work properly with JSON serializer
2025-01-08 07:24:43 +01:00
Ivan Savenko
9f1cd69480
Fix visualization of AI object graph
2025-01-07 14:06:09 +00:00
MichalZr6
dad6437661
Refactor BattleHex, remake the use of precomputed neighbouring tiles containers.
...
- Moved short, frequently used functions to the BattleHex header for inlining
- Made BattleHex a class with a private hex value
- Moved getClosestTile implementation back to BattleHex
- Enabled access to static precomputed data in BattleHexArray via BattleHex
(note: circular dependency prevented static precomputed containers being directly placed in BattleHex)
2025-01-06 23:28:46 +01:00
MichalZr6
ac8104d56d
SonarCloud recomendations.
...
Code review follow-up:
- Replace std::vector with boost::small_vector
- Rename function merge to insert
2025-01-06 23:28:45 +01:00
MichalZr6
44a645b5e0
use bitset for presenceFlags and steady_clock for measurments
2025-01-06 23:28:45 +01:00
MichalZr6
fb9a3da651
Unit.cpp refactor and some other minor changes
2025-01-06 23:28:44 +01:00
MichalZr6
8c3a417527
Cleanup
2025-01-06 23:18:20 +01:00
MichalZr6
5f799d41b3
Use cached neighbouring tiles where possible
2025-01-06 23:18:19 +01:00
MichalZr6
a99274d72e
BattleHexArray - new container for BattleHexes
2025-01-06 23:18:18 +01:00
Ivan Savenko
3d3dd70a11
Simplify code, fix AI not building dwelling upgrades
2025-01-06 18:59:37 +00:00
Ivan Savenko
8468469976
Fixes for AI town building logic
...
- Fixes AI not considering non-built dwellings
- AI will now skip evaluation of towns in which construction today is no
longer possible
2025-01-06 16:20:53 +00:00
Ivan Savenko
c3952b31f1
Merge pull request #5158 from IvanSavenko/bonus_caching
...
[1.6.3] Bonus caching improvements
2025-01-06 14:38:34 +02:00
Ivan Savenko
f6f99d2384
Correctly initialize graph cost in turns instead of default 255 turns
2025-01-05 18:05:28 +00:00
Ivan Savenko
78fc6d0e41
Remove unused code
2025-01-04 15:09:50 +00:00
Ivan Savenko
dea1eba20b
Rework and optimize turnInfo used by pathfinder
2025-01-04 15:09:50 +00:00
Ivan Savenko
9f4e92b5f6
Fix computation of spell value when attacker can't reach enemies behind
...
walls in siege combat
2025-01-04 14:01:40 +00:00
Ivan Savenko
c4623aad0f
Backported fix for BattleAI not casting spells that would kill entire
...
unit
2025-01-04 12:23:36 +00:00
Ivan Savenko
f9ce95756f
Fix potentially infinite attempts to upgrade units by AI
2024-12-31 13:27:12 +00:00
MichalZr6
4e9f052e98
Fix creature upgrades in Fort and town's dwellings
2024-12-30 01:14:57 +01:00
Ivan Savenko
65fc50d33b
Simplified building ID logic
...
- Replaced overcomplicated and broken math on dwelling ID's with fixed
enum
- Fixed broken 2nd upgrades and 8th dwelling
- Removed no longer used enumeration values from building ID's
2024-12-25 19:16:21 +00:00
Ivan Savenko
1caab5100a
Try to reduce amount of time AI spends on pathfinding
2024-12-23 13:26:54 +00:00
Ivan Savenko
95a07ee5cb
Use bonus system cache whenever possible
2024-12-21 18:47:11 +00:00
Ivan Savenko
0e1f8f99bc
Reduce excessive logging
2024-12-21 14:43:08 +00:00
Ivan Savenko
ab45c58e26
Use small_vector for bonus list to reduce allocations
2024-12-21 14:43:08 +00:00
Ivan Savenko
c401eca7c4
Merge pull request #5105 from Xilmi/develop
...
AI is now able to deal with Coven and Factory special building-behavior's.
2024-12-21 15:57:50 +02:00
MichalZr6
f893c80192
Move UpgradeInfo class to header and source files
2024-12-19 14:13:09 +01:00
MichalZr6
af9445c16f
Fixes following review
2024-12-17 22:34:06 +01:00
MichalZr6
d8d3948ac3
Fix AI to use hillFort all available upgrades. UpgradeInfo refactor.
2024-12-17 22:34:06 +01:00
Xilmi
a2827bf6f0
Merge remote-tracking branch 'upstream/beta' into develop
2024-12-17 12:08:36 +01:00
Xilmi
64ad060846
Update RecruitHeroBehavior.cpp
...
closestThreat was supposed to be < 1, not < 0
2024-12-17 12:03:46 +01:00
Xilmi
aff73b6e65
Be less wasteful with hiring heroes
...
When an enemy is near our city that currently has a hero hiding in it, we don't buy a hero without army as that one would be forced to wait outside and likely be killed.
2024-12-17 12:02:58 +01:00
Xilmi
99fcf136ec
Nullkiller AI is now also capable of upgrading dwellings a second time if that's possible
2024-12-16 23:45:21 +01:00
Xilmi
9012560e38
Fix for AI not recognizing 2nd T7-building of Factory as dwelling
...
This lead to it being built dead-last in the build-order instead of the AI trying to go for it quite early.
2024-12-16 17:19:07 +01:00
Ivan Savenko
bb7cf3ffbf
Use existing callback method instead of custom one in AI
2024-12-14 14:53:34 +00:00
Xilmi
5ff834aac2
Remove debug-outputs
...
Debug-outputs removed
2024-12-13 22:13:27 +01:00
Xilmi
33f5b473b3
Defender should not run off for troop-delivery
...
Fixed a rare case in which a town-defender could become an indirect part of a troop-delivery-task by doing a sub-task like capturing a shipyard that takes less than 1 turn but leaves him out in the open.
2024-12-13 21:50:45 +01:00
Xilmi
79fb5faa2e
Fixed a freeze
...
It was happening when all slots were full but no unit even needed disbanding because the unit to be bought is part of the units that are inside of the existing slots.
(This commit contains excessive debugging but I don't want to remove it just yet incase another issue pops up.)
2024-12-13 12:23:13 +01:00