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

109 Commits

Author SHA1 Message Date
Andrii Danylchenko
8fee46de7c AI: town portal support 2019-01-17 10:40:23 +03:00
DJWarmonger
f4a8a1294e Optimizations based on MSVS profiler. 2018-12-16 15:46:48 +01:00
Andrii Danylchenko
72aff02418 AI pathfinding: buy boat 2018-10-21 14:17:55 +03:00
Andrii Danylchenko
cbaa834589 AI pathfinding: bug fix after refactoring 2018-10-10 14:51:57 +03:00
Andrii Danylchenko
f327c46fa3 AI pathfinding: rename and add const to functions 2018-10-07 14:51:27 +03:00
Andrii Danylchenko
49c872e4ec AI: replace SectorMap with new PathfinderManager 2018-10-06 16:35:31 +03:00
Andrii Danylchenko
eb17313f7f AI: pathfinder extensibility - add one more rule for movement to destination and some refactoring 2018-09-23 15:26:53 +03:00
Andrii Danylchenko
7150fc9f71 AI: pathfinder api supports configuration 2018-09-23 15:26:53 +03:00
Andrii Danylchenko
9ab44b950a AI: pathfinder rework, rules refactored a bit. 2018-09-23 15:26:53 +03:00
Andrii Danylchenko
24221f3fb4 AI: move teleportation handling to pathfinder helper and neighbour finder 2018-09-23 15:26:53 +03:00
Andrii Danylchenko
6ac987794c AI: first rule extracted for pathfinder 2018-09-23 15:26:53 +03:00
Andrii Danylchenko
9af0032f84 AI: try to add some pathfinder extensibility. Extracted neighbour nodes finder 2018-09-23 15:26:53 +03:00
Ivan Romanov
eea50a044c Hide "this statement may fall through" warnings 2018-02-10 22:27:00 +05:00
Arseniy Shestakov
e9bfbb70c1 Ambient sounds: implement chebyshev distance for getTilesInRange 2018-01-02 09:48:17 +01:00
AlexVinS
143ff682bc Logging cleanup 2017-08-10 21:59:55 +03:00
AlexVinS
61e241308d Logging cleanup 2017-08-10 19:52:05 +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
AlexVinS
3216422307 Fixed a few CWE-457 2016-11-27 22:07:01 +03:00
Vadim Markovtsev
2c1dddde33 Fix memory problems with BonusList
Bonus * -> std::shared_ptr<Bonus>

This cures the following problems:

1) Memory corruption at exit. Some Bonus-es were deleted twice (mods?).
2) Memory leaks. Some Bonuses were not deleted.
3) Reduce the number of "Orphaned child" messages.

Valgrind reports 0 leaked memory now and no invalid reads/writes.
2016-09-29 15:08:00 +02:00
Arseniy Shestakov
b0045fa357 Fix TurnInfo memory leaks 2016-08-16 15:47:21 +03:00
Arseniy Shestakov
b4a35f9c62 CPathfinderHelper: fix memory leak 2016-08-16 14:59:16 +03:00
Arseniy Shestakov
30189a386f CPathfinder: fix and improve sail-land transition checks 2016-02-26 21:43:43 +03:00
AlexVinS
6e205a58b4 Merge remote-tracking branch 'remotes/origin/develop' into feature/VCMIMapFormat1
Conflicts:
	lib/VCMI_lib.cbp
	lib/filesystem/CZipLoader.cpp
	lib/filesystem/CZipLoader.h
	lib/mapObjects/CGTownInstance.cpp
2016-02-04 10:27:51 +03:00
Vadim Markovtsev
3926920103 Rename radious -> radius
There is no such English word, "radious"
Some files get new lines in the end - BSD sed bug + best practices
2016-01-31 18:01:58 +03:00
AlexVinS
37d0dad70a Merge branch 'develop' into feature/VCMIMapFormat1
Conflicts:
	lib/CArtHandler.cpp
2016-01-01 20:28:52 +03:00
ArseniyShestakov
9490a5d66d CPathfinder: deny transit to land blockvis objs from water layer
When hero is in water walking layer he can only exit to accessible or visitable land tiles, but not objects that have blocking visit and leave hero standing on water.
This is different than default flying behaviour because hero in air layer can only transit into accessible land layer without any blocking or visitable objects on them.
2015-12-16 20:14:36 +03:00
ArseniyShestakov
bf9ac7318a CPathfinder: change cost calculation sequence for embark / disembark
With old embark cost calculation pathfinder may end up thinking that hero can embark/disembark while have less movement points than base movement cost is. Now hero would be only able to embark / disembark if we have enough movement points to step on that tile. This rule is also valid for situation when hero have Admiral's Hat as in H3 even if hero don't have embark penalty he still use move points for embark and disembark.

Problem was found as it's was causing infitite loop in AI. Server of course rejected attempt to embark with less than 100 movement points while pathfinder tell AI that it's can still embark with 93 movement points.
2015-12-15 20:08:52 +03:00
ArseniyShestakov
2724a67a27 CPathfinder: add border gate support and use passableFor 2015-12-14 14:33:50 +03:00
ArseniyShestakov
ab92123da3 CPathfinder: improve support for visits and battles in teleports
Related movement code for client and AI is plumbed as well. Though at moment code still not finished because it's not teleport hero to the exit tile if he won battle.
2015-12-11 09:42:30 +03:00
ArseniyShestakov
a430769b44 CPathfinder: fix possible crash when using invisible teleport exit
This one is similar with FoW bug when hero was covered by FoW while one tile around wasn't.
2015-12-11 04:10:30 +03:00
ArseniyShestakov
c3e5231146 CPathfinder: avoid pathing through hero standing on Subterranean Gate
Subterranean Gates unlike Monolith allow to visit hero standing on other exit. So of course pathfinder allowed that, but it's also allowed future movement through that hero which caused infinite loop for AI.
2015-12-10 16:51:19 +03:00
ArseniyShestakov
05a34fb417 Use "Favorable" instead of "Favourable" everywhere for consistency
Original game of course used american english version so we stick to it.
2015-12-06 02:23:41 +03:00
AlexVinS
947edc0693 Merge branch 'develop' into feature/VCMIMapFormat1 2015-12-05 13:04:04 +03:00
AlexVinS
6552acdff6 Check coastal tile OTF 2015-12-05 12:36:29 +03:00
ArseniyShestakov
9e7e5b81e4 Merge pull request #143 from vcmi/feature/patrolSupport
Patrol support for AI heroes
2015-12-05 03:11:07 +03:00
ArseniyShestakov
82ce58eceb CPathfinder::initializePatrol: don't pass valid PlayerColor
It's break getTilesInRange with mode 0 and we don't really need to check visibility anyway.
2015-12-05 01:45:10 +03:00
ArseniyShestakov
bdc369ffba Patrol: use manhattan distance for getting tiles in radius 2015-12-04 21:08:09 +03:00
Ivan Savenko
7b5a7f43ad Removed includes of CGameState from headers 2015-12-02 21:39:53 +02:00
ArseniyShestakov
6bb205b15b CPathfinder: patrol support using getTilesInRange
For now we use getTilesInRange which isn't really correct for patrol, but good enough for first version.
2015-11-28 20:34:50 +03:00
ArseniyShestakov
df4515901d CPathfinder: fix special movement boundary check
Forgot to fix it for water walking after fe12b8f664
2015-11-23 14:11:08 +03:00
ArseniyShestakov
f4c06660e4 CPathfinder::evaluateAccessibility: apply more optimizations 2015-11-22 21:31:47 +03:00
ArseniyShestakov
2632389aaf CPathfinder: bring FoW reference back to avoid performance loss
This one is revert 148355908d
2015-11-22 21:06:37 +03:00
ArseniyShestakov
6dacb84404 CPathfinder::addNeighbours: avoid allocating new vector each time 2015-11-22 07:32:33 +03:00
ArseniyShestakov
5a87f58e09 CPathfinder: optimize checks order in calculatePaths 2015-11-22 06:23:54 +03:00
ArseniyShestakov
8217eb3a82 CPathfinder: split isLayerTransitionPossible into two functions
This way we can avoid usage of getNode for layers that clearly can't be used.
2015-11-22 06:16:16 +03:00
ArseniyShestakov
a1fe2ebc44 Pathfinding: restore gamestate usage to avoid overhead
Also when possible pass TerrainTile pointers to getMovementCost instead of using getTile.
2015-11-21 14:31:30 +03:00
ArseniyShestakov
438a444443 CGHeroInstance: move native terrain check into getNativeTerrain
That make it easier to use that code independently in TurnInfo
2015-11-21 13:32:45 +03:00
ArseniyShestakov
5ae6225ebc TurnInfo: implement internal bonus cache for most used bonuses
Bonus system even with caching add too big overhead so we'll only use it once for these bonuses.
Still I'm like it to be transparent for external code so it's a bit hacky code.
2015-11-21 10:00:09 +03:00
ArseniyShestakov
e91d79414b PathfinderOptions: use settings and move all defaults into schema 2015-11-21 00:32:23 +03:00
ArseniyShestakov
cb61572878 TurnInfo: add cache for bonuses selection 2015-11-20 12:28:35 +03:00