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

58 Commits

Author SHA1 Message Date
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
DjWarmonger
6b3ca831c1 - Conquer goal will not use fuzzy logic as well. AI should play more aggresively.
- Removed unused code.
2013-12-20 13:01:44 +00:00
DjWarmonger
d085f8eee8 First implementation of fuzzy logic in VisitTile goal. 2013-12-20 09:43:12 +00:00
DjWarmonger
983c0496d0 Some work towards fuzzy goal comparison. 2013-12-19 20:21:21 +00:00
DjWarmonger
2f698acf98 Compile fix - template specialization is defined before generic template. 2013-11-30 07:52:08 +00:00
DjWarmonger
8be4ca03c8 Uncommented Fuzzy code. Please let me know if it compiles on other platforms. 2013-11-25 11:55:48 +00:00
DjWarmonger
cedb3ea82a Some more logging for goal completion.
Stub of fuzzy goal selection.
2013-11-24 08:21:51 +00:00
Ivan Savenko
ee6cdbeffe went through the rest of cppcheck warnings, mostly harmless 2013-11-07 12:48:41 +00:00
Ivan Savenko
f82122d9be second part of c++11 update. gcc 4.5 and VS 2010 are no longer supported
- BOOST_FOREACH -> for
- replaced several boost classes with std (e.g. unordered)
- removed gcc-4.5 workarounds
- ran clang c++11 migration tool to detect some cases:
- - pointer initialized with "0" to nullptr
- - replace for with iterators with range-based for
- - use auto in some situations (type name specified twice, avoid long iterators type names)
2013-06-29 13:05:48 +00:00
beegee1
abf96a5b66 - Integrated the logging API into the AI subprojects - Added macros for tracing the control flow - Added methods isDebug/TraceEnabled for performance-critical sections 2013-04-10 16:28:14 +00:00
Ivan Savenko
a138db7c9e - removed lib headers from PCH
- fixed #1062
- correct terrain penalty check
2012-09-06 10:39:48 +00:00
Michał W. Urbańczyk
838c226a31 Compile fix. 2012-08-30 15:37:43 +00:00
Ivan Savenko
faaf799d95 - fixed some extra warnings. Mostly harmless.
NOTE: Please check changes in BattleState.cpp and GameHandler.cpp for possible bugs
2012-05-28 19:29:32 +00:00
Ivan Savenko
f2f39f1497 - makefiles for fuzzylite (#911)
- fixes for gcc compilation
- fixed #908
2012-03-12 20:11:46 +00:00
Michał W. Urbańczyk
59681be0a4 Fixed #906. 2012-03-10 19:14:45 +00:00
Michał W. Urbańczyk
0ef1085555 Changes around FuzzyLite library based on patch by q4a.
http://forum.vcmi.eu/viewtopic.php?p=6592#6592
2012-03-06 16:28:32 +00:00