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

372 Commits

Author SHA1 Message Date
ArseniyShestakov
12cf883740 VCAI: add all new movement code include teleports and transit support 2015-03-08 17:47:58 +03:00
ArseniyShestakov
665712c196 VCAI: add any newly found teleports to knownTeleportChannels
Now all new objects added to visitableObjs only using addVisitableObj so we can catch them for teleports handling.
I also simplified one of retreiveVisitableObjs functions because it's only used for inserting things into visitableObjs.
2015-03-08 17:38:09 +03:00
ArseniyShestakov
ab7ad4741a AIStatus: add teleport channel probing mode
When AI going through bidirectional teleport it's always getting list of all available exits.
If some of exits are invisible it's will attempt to visit each of them teleport probing begins.
2015-03-08 17:23:56 +03:00
ArseniyShestakov
25656aa586 Add showTeleportDialog everywhere except actual code for AI and player
Just like TeleportDialog it's based off showBlockingDialog, but as number of package is higher when possible showTeleportDialog will be after other dialogs handling code.
2015-03-08 16:52:50 +03:00
AlexVinS
f4c683cd5e Move VievXXX logic to server side (except expert ViewEarth) 2015-02-26 17:15:17 +03:00
AlexVinS
685deddac1 Start spell-relatet files reorganisation
* moved existing files to separate directory
-> todo: split mechanics
2015-02-26 08:39:48 +03:00
ArseniyShestakov
ea46be03f3 AI: check if hero killed while visiting object he stayed on
This is need to avoid crashes like one happen in 2084, but then game bahaviour incorrect.
I'm not exactly sure if this possible currently, but I can imaging this would happen if hero decide to attack bank while staying on it.
2015-02-22 20:56:50 +03:00
DjWarmonger
60932d9ed0 AI won't ignore owned objects taken by enemies. 2015-01-24 21:38:22 +01:00
DjWarmonger
5b8180e327 Cleaning logs. 2014-12-25 12:58:15 +01:00
DjWarmonger
7735e193f0 Merge branch 'develop' into experimental/serializerrefactoring 2014-12-22 19:17:40 +01:00
AlexVinS
3bca68fd2d Initial refactoring
* reduce registerTypes* templtates instantiation
2014-12-21 17:29:42 +03:00
DjWarmonger
da76a2f227 Fixed AI trying to visit tile already occupied by different hero, including #1902. 2014-12-21 14:50:26 +01:00
DjWarmonger
af02655b30 Fixed #1962 2014-12-21 11:33:53 +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
Mikhail Paulyshka
d0da88a515 define FL_CPP11 outside Fuzzylite source 2014-11-03 01:00:22 +03:00
Mikhail Paulyshka
941dcee0f5 Fix AI and VCAI CMakeLists.txt 2014-11-02 23:43:10 +03:00
DjWarmonger
9eeea7299a - Removed unecessary includes
- Fixed town types configured from RMG templates
2014-10-31 17:09:34 +01:00
AlexVinS
f16e859242 [C::B] update FL project 2 2014-10-27 15:17:40 +03: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
josch
fab31642d9 prepare for update to fuzzylite 5.0
- use system version of fuzzylite if available
 - adapt include paths
2014-10-25 16:00:44 +02:00
AlexVinS
66b022f93e initializer lists part1 2014-10-02 19:43:46 +04:00
DjWarmonger
95e442898e Fixed #1900 2014-10-01 13:26:04 +02:00
Ivan Savenko
33c0e24940 Fixes 1895 - Properly select upper army for recruitment 2014-09-23 14:28:55 +03:00
Ivan Savenko
4bb5784922 Fixing AI - dwelling visitation code should now work properly 2014-09-21 18:08:47 +03: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
78709e223b Breaking things - trying to remove server-side knowledge of selected objects 2014-09-19 00:18:49 +03:00
Ivan Savenko
b551bdb725 Final part of the merge
Merging VCMI Dirs refactoring + GUI refactoring with current develop
2014-09-04 20:59:07 +03:00
DjWarmonger
8b10f70afd Migrating to MSVS 2013, which allows to delete inttypes.h file. 2014-08-31 19:08:39 +02:00
Karol
1b6f2ea3b7 VCMIDirs update #5 fix
- Updated old OS detect macros.
- Fixed 1 misspell.
2014-08-26 12:19:04 +02:00
Michael Pavlyshko
f7d8faa540 install only .dll (without .dll.a) 2014-07-11 17:27:50 +03:00
AlexVinS
195eae48ca Merge branch 'develop' into SDL2
Conflicts:
	client/CPlayerInterface.cpp
2014-07-02 17:15:12 +04:00
Ivan Savenko
1157111fcf More bugfixing:
- Fixed compile in VCAI (precompiled headers should not include VCMI headers)
- Fixed crash on visiting observatories, including shroud of darkness
2014-06-29 17:23:06 +03:00
Haryaalcar
88122ee253 another build fix:
Undefined symbols for architecture x86_64:
  "operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, EVictoryLossCheckResult const&)
2014-06-26 02:19:10 +03:00
Ivan Savenko
32240da34e Reduced number of #include's in headers. May break compilation on Win
since some net packs now need DLL_LINKAGE
2014-06-25 17:11:07 +03:00
Ivan Savenko
a0689fa377 Refactoring of hoverText from objects:
- removed hoverText field
- split getHoverText() method into 3:
- - getObjectName() for generic name
- - getHoverText(Player) for player-specific text
- - getHoverText(Hero) for hero-specific strings
2014-06-24 20:39:47 +03:00
AlexVinS
3b8d0e44d4 Merge branch 'develop' into SDL2 2014-06-24 14:09:44 +04:00
DjWarmonger
3ac306f501 Merge pull request #19 from vcmi/feature/mapObjects
Feature/map objects
2014-06-22 14:49:42 +02: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
DjWarmonger
5c431da0f9 Merge branch 'develop' of https://github.com/vcmi/vcmi into RMG 2014-06-15 10:01:18 +02:00
AlexVinS
56c74bc46a +More build target to support both SDL1 and SDL2 builds 2014-06-13 07:55:48 +04:00
AlexVinS
bbd0312b45 Tweak configuration 2014-06-13 07:55:47 +04:00
Haryaalcar
2ee139977f crash in VCAI::completeGoal() fixed 2014-06-09 11:24:17 +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
DjWarmonger
e54c816c92 Treasure piles can now cover several tiles. 2014-06-05 17:19:11 +02: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
Ivan Savenko
32b6568b65 Merged changes from upstream and fixed compilation caused by API changes 2014-06-03 22:45:18 +03:00
DjWarmonger
aee748d8d6 - Added monoliths between remote zones
- Fixed land connections between zones, now they're generated correctly.
2014-06-01 12:02:43 +02:00
DjWarmonger
8c24ea0bfb Introduced 3-value logic for free, blocked and possibly occupied tiles. Refactoring. 2014-05-30 16:50:06 +02:00
Ivan Savenko
1d17d60449 gcc update:
- removed support for 4.6
- compilation fixes for 4.7
2014-05-29 13:42:05 +03:00
Ivan Savenko
7f276185bd Moving files:
- new config for objects (config/objects/generic.json)
- renamed lib/CDefObjectHandler to lib/CObjectClassesHandler
2014-05-24 02:07:54 +03:00
DjWarmonger
6658e173f1 - Possible fix for #1769
- Fixed all possible (even unexpected) crashes when AI looses active hero
2014-05-18 13:13:31 +02:00
Ilya Zhuravlev
db7cd79cf7 Android port.
Conflicts:
	lib/vcmi_endian.h
2014-05-16 23:24:29 +04:00
DjWarmonger
fb5152254d Merge branch 'develop' of git://github.com/Macron1Robot/vcmi into WarmysBackup
Conflicts:
	client/CKingdomInterface.cpp
2014-05-02 12:03:02 +02:00
Macron1Robot
21c2efbc64 Update VCAI.cpp
Deleted commented text and optimized estimateIncome
2014-04-28 10:33:42 +04:00
Macron1Robot
ede9818b38 Update VCAI.cpp
corrected typo
2014-04-28 08:26:21 +04:00
Macron1Robot
8ec7a9b919 Moved "max heroes on map per player", "max heroes available for player" to "defaultMods.json" 2014-04-27 10:43:46 +04:00
Macron1Robot
907caedb13 Added "produce" section in "building" structure. Changed dailyIncome. 2014-04-26 18:23:35 +04:00
Macron1Robot
b7b890acff Added "tavernVideo","guildBackground" to "faction" JSON config and schema. If "primaryResource" is set to "gold", silo will generate 500 gold per day 2014-04-24 23:36:18 +04:00
DjWarmonger
9e7013de77 Backup for my own MVS project configuration 2014-04-24 21:07:43 +02:00
Ivan Savenko
43ba3d30ea Breaking things - first commit towards configurable object(s).
- New files: lib/CObjectWithReward.h/cpp
- Classes that will be replaced by configurable object are now in this
fil

Status: far from functional, currently at "it compiles" point, some
essential pieces are still missing.
2014-04-06 23:14:26 +03:00
DjWarmonger
2da3d7d7c3 Removed AI bottleneck on water-based maps. 2014-04-03 09:57:44 +00:00
DjWarmonger
30b79588db - Moved gameState::guardingCreaturePosition() to CMap so it doesn't need to be recalculated many times for every player.
- Some optimizations with local cb pinter in VCAI.
2014-04-01 11:53:28 +00: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
DjWarmonger
8683c8c0eb - Added and improved some propagators, including Crystal Dragons ability (#1232)
- Minor refactoring in AI
2014-03-29 21:39:19 +00:00
Ivan Savenko
771c1ce255 - some effords to get rid of bottlenecks in AI code
- fixes, probably partially #1577
- enabled code for reading map object templates from json, still not
used
- disabled PCH for launcher due to speed issues.
2014-03-23 16:36:16 +00:00
DjWarmonger
441e4b2cb2 Improvements for AI speed (#1760)
AI heroes will be excluded from exploration if:
- There is no clear way to next exploration point or
- There is no possible exploration point at all
AI heroes will be erased from the list above if:
- FoW changes
- New object is added
- To prevent lock, primary hero will be erased at the start of each turn
2014-03-23 16:00:43 +00:00
Ivan Savenko
9c0df68cb8 Fixing spelling mistakes. Patch from josch, fixes #1759 2014-03-23 12:59:03 +00:00
beegee1
fe1b16a7ec Some preparation towards mantis #1743:
- refactored CRandomGenerator (added util methods, improved method names)
- usages of std::minstd_ran are replaced by CRandomGenerator (not in entire code base, C rand() usages are still not replaced)
- refactored getArtSync method of CArtHandler -> now named pickRandomArtifact
- fixed some compiler warnings
- updated source code URL in VCMI spec
2014-03-17 19:51:07 +00:00
alexvins
4203d69525 Part 2 of new spell configuration
1) spell handler refactored to support modding in general way
2) imunnity icons moved to WoG as they depends on wog`s graphics
3) introduced new class template for handlers (todo: use this in other handlers)
4) save format changed
5) introduced "absolute immunity" - unaffected by "the Orb" etc. (todo: use it in config)
6) new format documented on wiki, added json schema.

* more split of registertypes - fixes 32 mingw build
2014-03-07 13:21:09 +00:00
Michał W. Urbańczyk
93b8d2e59a AI crash — do not modify container when iterating it. 2014-03-01 12:53:09 +00:00
DjWarmonger
d049abe644 Fixed typo #1732. 2014-02-26 17:29:21 +00:00
DjWarmonger
8ce6659633 Important fix for unreserving objects. 2014-02-23 20:37:33 +00:00
DjWarmonger
94c8f01732 Commiting some minor tweaks before next dev version. 2014-02-23 16:55:42 +00:00
Michał W. Urbańczyk
458ba47965 Compile fix for non-msvc, as per https://github.com/vcmi/vcmi/pull/8 2014-02-21 12:27:56 +00:00
DjWarmonger
15edeb231b Fixed two heroes getting stuck on both sides of gate. 2014-02-21 09:32:24 +00:00
DjWarmonger
1196eb5d81 AI can finally clear Subterranean Gate with guard on the other side :) 2014-02-21 07:48:38 +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
8683b982c7 - A simple method to break loop in goal decomposition (which consumed time)
- Finally corrected canGetArmy conditions (which also consumed time)
- Removed some unused code, general cleaning
2014-02-19 16:23:47 +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
6ee823298a - Various improvements for exploration
* Heroes will try to use SectorMap if there are no accessible tiles
* Remove some loopholes and pitfalls when all the ways are blocked
* Fixed AI not conquering some (reserved) objects
Still missing: SectorMap does not use Subterranean Gates :(

- Improvements for army exchange
* Fixed exchange condition
* Bidirectional exchange is possible
2014-02-17 07:36:03 +00:00
DjWarmonger
afacb40f5a - Fixed secondary heroes stalking main hero
- Fixed exotic crash when all nearby tiles are occupied
2014-02-15 21:32:49 +00:00
DjWarmonger
b368e565ab - fixed #1714
- Performance improvements, refactoring
2014-02-15 19:39:03 +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
e459984897 Cleanup in AI. 2014-02-15 08:10:06 +00:00
Ivan Savenko
7f07a30d7d More fixes for map-specific crashes, fixes #1427 and #733
- if special victory condition is present AND there is only one player
normal victory condition will be disabled
- added new triggered condition, constant value
- if target of CONTROL/DESTROY condition is removed from map, triggered
condition will be replaced with constant
- fixed randomization of armies with random stacks
2014-02-09 12:10:02 +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
beegee1
95034b9fa0 - Updated PCH to use our StdInc.h as the prefix header (not generated one from cotire) -> no exclude headers from ffmpeg/etc... statements required
- Fixed compilation error (VCAI ResourceSet logging)
2014-02-05 20:25:36 +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
DjWarmonger
5e58027496 Fix for rare crash in previous commit. 2014-02-05 09:04:09 +00:00