1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00
Commit Graph

73 Commits

Author SHA1 Message Date
Dydzio
0cb6515ae8 VCAI tweaks (#311)
* Add extra priority support for town capture evaluation
* Improve building algorithm
* GatherArmy: check free gold instead of total for when hiring heroes
2017-07-15 01:15:08 +03:00
Arseniy Shestakov
f1e5797834 Code style: move or add licensing information on top of every file 2017-07-14 01:26:03 +03:00
DJWarmonger
5e8fe083f2 Normalized GatherArmy evaluation. 2017-06-16 21:14:24 +02:00
DjWarmonger
a86edca7d8 Fixed CID 1288882 2016-11-25 19:54:28 +01:00
AlexVinS
692d23e580 Fixed CID 1366376 2016-11-25 13:38:26 +03:00
AlexVinS
22884d9150 AI logging convert 1 2016-08-13 17:44:37 +03:00
Arseniy Shestakov
9fd1cff090 Refactoring: always use std prefix for shared_ptr, unique_ptr and make_shared
Long time ago it's was used without prefix to make future switch from boost to std version easier.
I discusses this with Ivan and decide to drop these using from Global.h now.

This change wouldn't break anything because there was already code with prefix for each of three cases.
2015-12-29 05:43:33 +03:00
Arseniy Shestakov
29a7934a99 Refactoring: avoid using namespace when it's not absolutely needed 2015-12-29 02:14:08 +03:00
Ivan Savenko
2e56b547ee replaced references to SectorMap with shared_ptr to avoid data races in AI code 2015-12-04 00:10:51 +02:00
Ivan Savenko
7b5a7f43ad Removed includes of CGameState from headers 2015-12-02 21:39:53 +02:00
ArseniyShestakov
2ef9d7c3ec Rename getCost back to getMovementCost
Initially wanter to name main class differently and back then getCost make sense.
Then renamed class to CPathfinderHelper, but forgot to rename function back.
2015-11-10 02:30:05 +03:00
ArseniyShestakov
b2e1ee5363 CGameState: move two pathfinding-related functions to CPathfinderHelper
Both getMovementCost and getNeighbours have nothing to do with gamestate.
2015-11-10 02:15:27 +03:00
DjWarmonger
1e36f3cecd Cache SectorMap where possible and update when necessary. 2015-10-26 16:38:17 +01:00
DjWarmonger
fe2a72f543 Minor optimization. 2015-08-31 10:08:50 +02:00
DjWarmonger
1c14dbf7b2 Cache SectorMaps to evaluate multiple goals -> huge performance boost 2015-08-31 08:25:33 +02:00
DjWarmonger
5b8180e327 Cleaning logs. 2014-12-25 12:58:15 +01:00
DjWarmonger
a823fae822 Fixed NaNs in FuzzyHelper::getTacticalAdvantage 2014-12-19 19:15:41 +01:00
DjWarmonger
cd060c00c5 Each fuzzy set of rules will use separate fuzzy engine. 2014-12-19 10:52:41 +01:00
DjWarmonger
a1e42caddd Banks won't use fuzzy engine at all, only center of mass. 2014-12-10 12:29:51 +01:00
DjWarmonger
7adb0fd600 Fuzzy engine fix by Jcrada. 2014-12-05 09:28:58 +01:00
DjWarmonger
6463c33c26 Rewrite / update terms for TacticalAdvantage. 2014-11-28 14:17:17 +01:00
DjWarmonger
9ca991282a Taken JCrada patch as it is. 2014-11-27 21:51:48 +01:00
DjWarmonger
b0cd4f4117 Added limits and assertions which show that fuzzy engine is completely bugged. 2014-11-22 18:57:17 +01:00
DjWarmonger
9eeea7299a - Removed unecessary includes
- Fixed town types configured from RMG templates
2014-10-31 17:09:34 +01:00
DjWarmonger
c87f2cdaaf Updated build for MSVS. Some compile fixes to FuzzyLite source. 2014-10-26 12:32:19 +01:00
jcrada
a4f98a9ebd Upgraded to FuzzyLite version 5.0 2014-10-25 16:13:20 +02:00
AlexVinS
66b022f93e initializer lists part1 2014-10-02 19:43:46 +04:00
Ivan Savenko
b67618ab53 First batch of AI fixes:
- wiped not actually used set/get selection
- replaced isReachable with VCAI::isAccessible
2014-09-21 17:03:20 +03:00
Ivan Savenko
6c0c03d74b Refactoing of pathfinder <-> client/AI interaction to remove dependency on selected hero
- finished removal of server-side setSelection
- disabled some broken code (AI & cheats). TODO: fix
2014-09-21 16:42:08 +03:00
Ivan Savenko
ab475195ac Banks now use new scheme as well
- Implemented Bank Constructor object.
- Merged Pyramid object into common Bank class. Banks can now grant
spells as part of their reward.
- Move bank config code to config/objects/creatureBanks.json. Note: WoG
banks are not updated yet, should be moved to WoG mod.
- Updated AI code so it can correctly evaluate bank danger (should be
generic enough for use with other objects)
- New files JsonRandom.* that contain routines for loading random
objects from Json (still WiP but should be stable)
2014-06-22 13:39:40 +03:00
Ivan Savenko
b2e8c92383 Cleanup:
- removed commented-out #includ'es
- renamed some files to match name of class
2014-06-05 20:26:50 +03:00
Ivan Savenko
652ceb2bde Finally shattered CObjectHandler.cpp into tiny bits
- This file is now split into multiple smaller files in mapObjects
directory
- CObjectHandler itself now contains only core classes (Handler itself,
CGObject and interfaces)
- Cleaned up excessive #include's through whole project
2014-06-05 19:52:14 +03:00
Ivan Savenko
0afdfa529c Moved all object-related files to lib/mapObjects directory.
Renamed some classes to more readable names
2014-06-05 14:19:47 +03:00
DjWarmonger
a64df5718f Some nontrivial optimizations based on profiling results:
- Movement bonuses will be calculated ONCE per pathfinder loop
- Goals will be sorted by hero to reduce number of calculatePaths calls
2014-03-31 14:26:09 +00:00
Ivan Savenko
9c0df68cb8 Fixing spelling mistakes. Patch from josch, fixes #1759 2014-03-23 12:59:03 +00:00
DjWarmonger
b0b0249524 - Implemented serialization of Goals. Loaded games work, at least.
- Attempts to add Subterranean Gates to SectorMap
- Extensive use of ClearWayTo goal.
2014-02-20 20:18:49 +00:00
DjWarmonger
a3cad2883f - Restored correct specialty serialization (#1599 and all its children)
- Fixed rare AI crash
- Fixed AI visiting some objects many times
- Some cleanup and refactoring
2014-02-17 17:28:39 +00:00
DjWarmonger
d8933b5c36 - AI will now use SectorMap to find a way to guarded / covered objects.
- Improvements to SectorMap needed for use of multiple heroes
2014-02-15 16:38:51 +00:00
DjWarmonger
d17b3a14bd - Significantly improved exploration algorithm
- Workaround to make AI gather army when exploration is not possible anymore
- Possibly fixed issue with AI not capturing guarded objects
2014-02-07 20:09:15 +00:00
DjWarmonger
a9b10c8099 - Changed aggregation method so now fuzzy engine takes all the factors into consideration
- Heroes now will use real path cost and their movement, which has numerous advantages:
* Actual movement cost is taken into consideration
* Groups of heroes will keep order
* Fastest heroes will be used for exploration first
2014-02-07 08:23:31 +00:00
DjWarmonger
54fbdfec5e - Finally fixed wander crash
- Smoothed values of terms to improve differentiation and stability
2014-02-06 06:05:45 +00:00
DjWarmonger
486cd4b001 - Fixed (common) issue when AI found neutral stacks infinitely strong
- Fixed non-fuzzy performance of some functions. Now AI really considers all options and uses multiple heroes, who don't spend their time wandering a lot.
2014-02-05 18:45:51 +00:00
beegee1
b8eddcd9a8 - Moved place bonus hero before normal random hero and starting hero placement -> same behaviour as in OH3
- Moved placing campaign heroes before random object generation -> same behaviour as in OH3
- Refactored pickHero into pickNextHeroType (hero generation sequence) and pickUnusedHeroTypeRandomly
- Added a SIGSEV violation handler to vcmiserver executable for logging stacktrace (for convenience only)
- Fixed Fuzzy.cpp and VCAI.h compilation on Clang
- Added a handleException function in addition to our macros (no use of macros, enables debugging support, does not re-throw, catches ...-case too)
2013-12-28 12:47:55 +00:00
DjWarmonger
9ec299931d - Fixed VisitHero goal. Now heroes can exchange armies again.
- AI should not get lazy in endgame.
- Removed unused code.
2013-12-27 13:20:40 +00:00
DjWarmonger
e5b011abe0 - Fixed heroes stalling. Locked heroes now try to decompose their goals exhaustively, which FINALLY works as intended.
- Fixed multiple issues with ClearWayTo goal.
2013-12-26 09:53:37 +00:00
DjWarmonger
603cbd8850 Experiment: goal values calculated by Fuzzy Helper will be stored in "priority" field and used in consecutive calculations. 2013-12-25 16:05:11 +00:00
DjWarmonger
aec04d920e Endless crusade against AI issues and loopholes!
- Fixed #1126
- ClearWayTo and GatherArmy goals will also consider multiple subgoals
- GatherArmy may include building dwellings in town (experimental)
2013-12-23 20:46:01 +00:00
DjWarmonger
473250e223 - Removed slow and buggy part of exploration code
- Various tweaks and performance improvements. remove_if on long vector is a bad idea.
2013-12-21 17:34:59 +00:00
DjWarmonger
bf3fe0e274 - Explore goal will also use fuzzy comparison
- Fixed AI afraid of town with Castle built: #1514, #1515, #1584
2013-12-20 16:49:51 +00:00
beegee1
68bdf71db6 - Fixed GCC compiler warnings
- Implemented move heroes to next scenario partially
2013-12-20 13:07:58 +00:00