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

16190 Commits

Author SHA1 Message Date
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
Xilmi
073c5bee45 Spellcasting fixes
Allowed the AI to cast spells that are aimed at a location instead of a unit. For example meteor shower.
Fixed an issue that caused the AI to not kill unit-stacks with spells due to only considering stacks where at least one unit survives in it's score-calculations.
2024-07-10 02:40:42 +02:00
Xilmi
13bbb573bd 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-09 22:55:39 +02:00
Xilmi
3367298a2a Merge remote-tracking branch 'upstream/develop' into develop 2024-07-09 16:25:27 +02:00
Ivan Savenko
719f920914
Merge pull request #4235 from kaja47/patch-1
reorder fields to shrink struct TerrainTile from 96 to 80 bytes
2024-07-08 17:59:29 +03:00
Xilmi
94e5b5519c Fixed AI constantly visiting towns thinking they can get a huge upgrade
Due to morale-considerations the AI sometimes calculated that their strongest army after doing an exchange had slightly lower total value than the army they used before.
But by using unsigned "slightly lower" became near infinite.
So they constantly wanted to upgrade their army because they considered it more useful than anything else.
Changing the unsigned into signed fixes this.
2024-07-08 16:53:14 +02:00
Xilmi
d4308c2ce4 Merge branch 'fixes_only' into develop 2024-07-07 22:52:03 +02:00
Xilmi
a72d23ed8d Debug-Info
Added some debug-info and non-fuzzy-specific-priority-cutoff.
2024-07-07 22:51:50 +02:00
Xilmi
7b407b6432 AI-variant without fuzzy-logic
It is now possible to switch to an AI-variant that uses hand-written heuristics for decision-making rather than the FuzzyLite-engine. This is configurable in nkai-settings.json via the new parameter "useFuzzy".
2024-07-07 22:44:52 +02:00
Xilmi
aa891cb8b1 Armycost
Added new method to retrieve the cost of an army to be used for AI-decision-making.
2024-07-07 22:38:37 +02:00
Xilmi
e0a81b3e69 Fixed AI-exploration-data being lost after loading savegame
The information of whether objects like a redwood-observatory or subterranian gates have been interacted with by the AI will now be retrieved from the game-state instead of using an AI-internal memory that won't survive loading a save-game.
2024-07-07 22:08:19 +02:00
Xilmi
54c6d99de3 Using only one bucket
Nullkiller suggested that this change would help to further fix inconsistent behavior by the AI. I tested it and it did indeed fix different orders of how AI does things.

"Important to make count 1 to not relay on object addresses
They are source of random" - Nullkiller
2024-07-07 15:17:38 +02:00
Xilmi
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
K
d3c198678c
reorder fields to shrink struct TerrainTile from 96 to 80 bytes
When I was playing a very large map, computer's turn took up to 2 minutes and that give me time to fire up perf and profile the code while waiting.

I noticed that 1.7% of time was spent in function CPathfinderHelper::getNeighbors and half of that on a single load from an array backing multi_array of TerrainTiles. That signals the CMap::terrain is too big to fit in CPU caches.

This patch reorders fields in TerrainTile struct, shrinking it from 96 bytes to 80 bytes and hopefully helping to keep more tiles in the cache and speeding things up a little bit.
2024-07-07 12:53:29 +00:00
Ivan Savenko
f414336243
Merge pull request #4231 from Xilmi/develop
Crash fix
2024-07-06 19:16:41 +03:00
Xilmi
cf0d08555b Crash fix
Fixed a crash that could occur when closing the game.
2024-07-06 15:34:36 +02:00
Ivan Savenko
1b10aaa493
Merge pull request #4195 from Alexander-Wilms/fix-issues-introduced-by-fixing-typos
Fix issues introduced by fixing typos
2024-07-03 13:27:55 +03:00
Alexander Wilms
31e1d39f92 Fix issues introduced by fixing typos 2024-06-27 08:38:04 +00:00
Ivan Savenko
8444f7b330
Merge pull request #4185 from Alexander-Wilms/typo
Fix typos
2024-06-26 13:54:21 +03:00
Alexander Wilms
02e429e973 Fix typos using https://github.com/crate-ci/typos
Changes were reviewed manually
2024-06-24 03:47:19 +02:00
Alexander Wilms
820b1b446e Fix typo: TowmPortalFinder -> TownPortalFinder 2024-06-23 22:40:15 +02:00
Ivan Savenko
3bea383b59 Merge branch 'vcmi/beta' into 'vcmi/develop' 2024-06-21 12:58:36 +00:00
Ivan Savenko
c328007687
Merge pull request #4173 from vcmi/master
Merge master -> beta
2024-06-21 14:47:41 +03:00
Ivan Savenko
099a491762
Merge pull request #4170 from IvanSavenko/remove_storage_permission
Remove storage permissions
2024-06-21 01:15:25 +03:00
Ivan Savenko
bdd9ae5268 Remove excessive auto-generated permissions by Qt 2024-06-20 18:41:06 +00:00
Ivan Savenko
ed685184e4 Updated path to JNI libraries 2024-06-20 17:10:11 +00:00
Ivan Savenko
afc0c8fb5c Update path to JNI upload 2024-06-20 17:07:48 +00:00
Ivan Savenko
13de373def Add signing password to build step 2024-06-20 15:49:01 +00:00
Ivan Savenko
dcc9c03237 Add java setup to fix aab generation 2024-06-20 14:43:45 +00:00
Ivan Savenko
8e82764270 Fix aab generation CI 2024-06-20 13:12:58 +00:00
Ivan Savenko
2ff08b42fa Fix aab generation CI 2024-06-20 13:08:45 +00:00
Ivan Savenko
48f32aa5e2
Merge pull request #4168 from vcmi/beta
Merge beta -> master
2024-06-20 14:19:47 +03:00
Ivan Savenko
650dfcbed8
Merge pull request #4166 from IvanSavenko/release_153
Preparation for 1.5.3 release
2024-06-20 14:07:44 +03:00
Ivan Savenko
0d3408ee68 Add better runtime error on invalid building ID 2024-06-20 10:08:49 +00:00
Ivan Savenko
f0ad2e042e Add download counter for 1.5.3 2024-06-19 20:17:05 +00:00
Ivan Savenko
a9dae99a75 Final changelog update 2024-06-19 20:14:46 +00:00
altiereslima
edf10d8174 Update Portuguese Translation (#4121)
* Update Portuguese Translation
2024-06-19 20:00:25 +00:00
Ivan Savenko
8c63a3e4de Running out of timer during battle will no longer force retreat 2024-06-19 19:59:06 +00:00
Ivan Savenko
cfcecbf630 Fix documentation to match actual behavior 2024-06-19 19:59:06 +00:00
Ivan Savenko
4e9feca8d4 Validate mod.json as json5 instead of strict json since Android launcher
no longer exists
2024-06-19 19:59:06 +00:00
Ivan Savenko
2b7131cfea Show error message if vcmi unable to access data directory instead of
silent crash
2024-06-19 19:59:06 +00:00
Ivan Savenko
0e4be8c776 Fix crash on sieging Citadel or Castle 2024-06-19 19:59:06 +00:00
Ivan Savenko
7fa45f5f89
Merge pull request #4132 from IvanSavenko/launcher_msvc_rcc
Try to enable AUTO_RCC on msvc
2024-06-19 22:58:41 +03:00
Ivan Savenko
7fccfb66de Try to enable AUTO_RCC on msvc 2024-06-19 18:39:27 +00:00
Ivan Savenko
11a9faddb9
Merge pull request #4094 from IvanSavenko/changelog_153
[1.5.3] Changelog
2024-06-19 21:33:24 +03:00
Ivan Savenko
c7aeea2c58 Added changelog for 1.5.3 2024-06-19 18:31:21 +00:00
Ivan Savenko
85d170af70
Merge pull request #4163 from godric3/fix-serialization-of-subtype-to-include-mod-id
fix CGObjectInstance `subTypeName` to include mod id
2024-06-19 21:29:06 +03:00
Ivan Savenko
a9cf322f61
Merge pull request #4161 from vcmi/fix-4142
#4142 - sometimes Battle AI wants to attack unit which is behind a lo…
2024-06-19 21:28:58 +03:00
altiereslima
c8aeee764b
Update Portuguese Translation (#4121)
* Update Portuguese Translation
2024-06-19 21:28:46 +03:00