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
Michał W. Urbańczyk
93b8d2e59a
AI crash — do not modify container when iterating it.
2014-03-01 12:53:09 +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
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
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
DjWarmonger
5e58027496
Fix for rare crash in previous commit.
2014-02-05 09:04:09 +00:00
DjWarmonger
c708a631c1
- Improved AI logging messages
...
- Cut wandering time of AI
2014-02-04 21:49:04 +00:00
Ivan Savenko
3779a54ddd
- probably fixed 1671
...
- fixed missing loss condition in Birth of Barbarian
- fixed some bugs found by cppcheck
2014-01-30 11:08:37 +00:00
Ivan Savenko
2c4c964a45
Large rewrite of adventure map objects:
...
- replaced CDefObjInfo with ObjectTemplate class
- ObjectTempate is a direct member of objects instead of pointer with
shared ownership across CMap, handler and game objects
- simplified handling of objects that can change appearance (e.g. towns)
- all object queries regarding object appearance/blockmaps use h3m pos
instead of relative positions
- removed need of modhandler::reload
- cleanup of some old code
2014-01-02 23:48:38 +00:00
beegee1
5971ceaa7f
- Fixed hero / army strength handling
2013-12-31 16:11:18 +00:00
DjWarmonger
344783efb5
An attempt to handle spawning objects. However, on a day of double growth, when multiple monsters spawn, game freezes. Looks like engine issue, code is commented out.
2013-12-28 16:39:47 +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
7af9b0ea74
Replaced AI vectors by sets for both performance and safety.
2013-12-25 13:38:20 +00:00
DjWarmonger
a8539b2b28
- Fixes for Quest Guard and goal completion, in particular For Sale map ( #894 )
...
- Fixes for ally players handling by AI
2013-12-24 22:01:16 +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
362a54b4df
More fixes and tweaks for AI, including #1590 .
2013-12-21 21:31:28 +00:00
DjWarmonger
a6ce282f8a
Dramatically reduced exploration complexity. AI will check only nearby objects.
2013-12-21 19:17:27 +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
1b04f4fa9f
Hopefully fixed ALL the cases when hero could use invalid path, for good.
2013-12-20 10:15:29 +00:00
DjWarmonger
983c0496d0
Some work towards fuzzy goal comparison.
2013-12-19 20:21:21 +00:00
Ivan Savenko
881a7cf862
- added check to avoid recursion in AI town building code
...
- restored previously missing AI shield during AI turn
2013-12-19 17:29:35 +00:00
Ivan Savenko
ee1b0459e6
Extended building dependencies:
...
- buiding/structure lists must use object format. This may break some
outdated mods.
- generic support for logical expressions that consist from and/or/not
operators.
- string ID's for buidings are now actually used.
2013-12-02 11:58:02 +00:00
DjWarmonger
54c52869cf
- Fixed some more cases when heroes could block each other
...
- More generous checking of complete goals and their dependencies
2013-11-24 19:15:08 +00:00
DjWarmonger
b0bdfff117
Compile fixes, refactoring
2013-11-24 15:30:17 +00:00
DjWarmonger
74a1d09871
Fixed new issue with hero trying to visit himself.
2013-11-24 08:56:02 +00:00
DjWarmonger
cedb3ea82a
Some more logging for goal completion.
...
Stub of fuzzy goal selection.
2013-11-24 08:21:51 +00:00
DjWarmonger
0ab7b498f5
VCAI is now functional again!
...
Implemented Visitor pattern for double-dispatch (actually only goal type dispatch).
2013-11-23 18:16:25 +00:00
DjWarmonger
e6bb39d3a4
More work on VCAI Goals, still derived functions are not called :/
2013-11-23 12:30:10 +00:00
beegee1
3e4407593f
- Refactoring for checking victory/loss conditions (use enum class instead of magic numbers)
...
- Improved showing player lost message for one special case
2013-11-17 17:57:04 +00:00
DjWarmonger
900d7a03f0
Template magic. Implemented method chaining + clone pattern for Goals.
2013-11-15 17:30:16 +00:00
Ivan Savenko
3560bbb7f3
two patches/pull requests from janisozaur
...
- replace our custom bmap with std::map::at()
- compile fixes for editor
2013-11-12 10:45:42 +00:00
DjWarmonger
1657f124e1
- Compile fixes for MVS
...
- AI goals will now be handled by smart pointers
2013-11-09 21:29:46 +00:00
Ivan Savenko
55577d0ac4
- fixed missing DLL_LINKAGE
...
- use precalculated checksum for zip files
- UNUSED macro to silence some warnings
2013-11-09 13:49:36 +00:00
Ivan Savenko
ee6cdbeffe
went through the rest of cppcheck warnings, mostly harmless
2013-11-07 12:48:41 +00:00
Ivan Savenko
0e3eae3095
patch from KroArtem
2013-11-03 12:51:25 +00:00