Commit Graph
100 Commits
Author SHA1 Message Date
ArseniyShestakov e3f2bb2c99 MXE support: avoid conflicts with some macros from headers 2015-12-22 01:59:51 +03:00
ArseniyShestakov 4124aacac8 CMake: add dbghelp to SYSTEM_LIBS for MiniDumpWriteDump. Fix issue 2312 2015-12-22 00:08:49 +03:00
ArseniyShestakov 48be566050 Dimension Door: fix movement points cost for expert level 2015-12-21 18:46:52 +03:00
ArseniyShestakov 87eaa78ffd Restore testing option changes overriten by merge 2015-12-19 12:12:35 +03:00
ArseniyShestakov b6176649ec CGMonolith: avoid crash when all exits are blocked by friendly heroes 2015-12-18 01:08:19 +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 9f565b81e9 CBankInfo: fix huge memory leak that appear in long run 2015-12-14 11:29:24 +03:00
ArseniyShestakov 1ec7d14637 Client: add command line options to simplify multi-instance testing
Use these when you need to run multiple instances of VCMI simultaneously.
--testingport is port used to start server. Override port number from configuration files.
--testingfileprefix is prefix for auto save filenames.
Both options has to be set in order to work.
2015-12-13 22:14:37 +03:00
ArseniyShestakov 8ebdbd048b Merge pull request #147 from vcmi/fix/bonusSystemCrashes
Attempt to fix crashes on save loading that occur within bonus system
2015-12-12 22:03:03 +03:00
ArseniyShestakov 59199ccdbd Bonus system: add treeHasChanged call where bonus objects changed 2015-12-11 16:13:18 +03:00
ArseniyShestakov 1730a31471 HeroBonus: get rid of code that used getBonusList 2015-12-11 16:01:51 +03:00
ArseniyShestakov 8fb5dacba2 CBonusSystemNode: get rid of non-const getBonusList 2015-12-11 15:02:36 +03:00
ArseniyShestakov 8792c23372 CPlayerInterface: if autoskip enabled dont center view on town / hero 2015-12-11 11:21:35 +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 975e049a3e SectorMap: disable knownSubterraneanGates support to avoid loops 2015-12-10 17:35:46 +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 5aadc1ed6f CasualtiesAfterBattle: dont remove catapult artifact. Fix 2346 issue 2015-12-10 13:31:03 +03:00
ArseniyShestakov d900e9bec2 CGameHandler: fix hero removal code on player loss. Fix issue 2347 2015-12-10 12:43:55 +03:00
ArseniyShestakov 9e6f836b25 VCAI::pickBestArtifacts: don't try to move catapult between heroes 2015-12-09 18:49:22 +03:00
ArseniyShestakov 2be6818e33 FoWChange::applyGs: correct copy-paste error. Fix issue 2345 2015-12-09 10:02:33 +03:00
ArseniyShestakov 1c0d4e3f6f Fix filenames in file headers 2015-12-08 09:53:14 +03:00
ArseniyShestakov 07807fb044 Client: slience visibility error on shipyard in non-coastal town 2015-12-08 07:33:13 +03:00
ArseniyShestakov cf4cb5c948 VCAI: silence callback on visibility check 2015-12-08 04:18:31 +03:00
ArseniyShestakov 03e9dd3bab Add hero gold cost to GameConstants 2015-12-07 00:13:58 +03:00
ArseniyShestakov 807fd6391b CAdvMapInt: block spellbook button when no hero selected 2015-12-06 03:12:39 +03:00
ArseniyShestakov e872b400b7 Comments save format backward compatability code as Ivan suggested
Also we should always handle RumorState::TYPE_NONE in getTavernRumor properly anyway.
2015-12-06 02:51:54 +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
ArseniyShestakov 7708810148 VCAI: don't serialize destinationTeleportPos to avoid crash
This won't affect AI functionality except if game saved while AI moving through teleporters.
Serialization for some reason don't work properly and cause save loading to fail.
2015-12-05 08:08:02 +03:00
ArseniyShestakov 360ebcce7e Merge pull request #145 from vcmi/feature/tavernRumors
Tavern rumors and Thieves Guild fixes
2015-12-05 03:13:25 +03:00
ArseniyShestakov 0a5e9c0fbe Merge pull request #144 from vcmi/fix/teleportMultiExitPoints
Support for exit selection between multiple teleport exit points
2015-12-05 03:12:17 +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 01c5bc25e5 Move TTeleportExitsList to CObjectHandler.h
Not a perfect solution, but this is the best location for now.
2015-12-05 01:14:03 +03:00
ArseniyShestakov c83f15e413 Merge branch 'develop' into feature/tavernRumors
Conflicts:
	lib/CGameState.h
2015-12-05 01:01:26 +03:00
ArseniyShestakov d856fde73f Rumors: use enum instead of magic numbers and avoid potential crash 2015-12-04 22:58:14 +03:00
ArseniyShestakov 82c4c2f859 Patrol: update changelog 2015-12-04 21:36:45 +03:00
ArseniyShestakov bdc369ffba Patrol: use manhattan distance for getting tiles in radius 2015-12-04 21:08:09 +03:00
ArseniyShestakov 2a63ba148a Thieves Guild: fix tavern map object, lvl 0 when no taverns owned
We also now check not number of towns, but only towns that has tavern built. Also according to original mechanics all taverns always display information based on your number of taverns and not number of taverns of object owner.
2015-12-04 18:38:57 +03:00
ArseniyShestakov 3b3c49420f Thieves Guild: correct number of taverns to access information 2015-12-04 17:52:30 +03:00
ArseniyShestakov eced16945e getVisibleTeleportObjects: use getObj as not verbose
We checking visibility in this function so there no need to send information about that into errorStream.
2015-12-04 05:43:55 +03:00
ArseniyShestakov 791d1e7ab4 VCAI: finish fixing of teleport probing for whirlpools 2015-12-04 05:30:43 +03:00
ArseniyShestakov 3800bd45b7 Movement: initialize destinationTeleportPos with invalid int3 position 2015-12-04 01:54:25 +03:00
ArseniyShestakov ee08749743 VCAI: more work on teleport exit probing 2015-12-03 21:18:40 +03:00
ArseniyShestakov 2f9ca778b2 VCAI: add channel probing support for teleporters with multiple exits 2015-12-03 17:20:03 +03:00
ArseniyShestakov eb9f29e368 VCAI: restoring teleport probing feature for updated mechanics 2015-12-02 19:26:24 +03:00
ArseniyShestakov b5100bee94 Teleport: rework code to support exit point selection for whirlpools 2015-12-02 17:56:26 +03:00
ArseniyShestakov a62ee65d72 Rumors: implement income checking via statsHLP::getIncome
This also fix income ranking in Thieves' Guild
2015-12-01 06:28:08 +03:00
ArseniyShestakov ffcc5ccdd2 Rumors: implement support for grail terrain rumor 2015-12-01 04:57:52 +03:00
ArseniyShestakov c5485ceede Rumors: update changelog 2015-12-01 02:23:43 +03:00
ArseniyShestakov 15273ac0f7 Rumors: avoid repeating of same rumor twice in a row
Multiple rumors of same type can go in a row, but not identical rumors.
2015-12-01 02:14:11 +03:00
ArseniyShestakov 98582d628c Rumors: move code into CGameState and add backward compatability 2015-12-01 00:44:58 +03:00
ArseniyShestakov 879eaa47f8 Rumors: client-side proof of concept implementation
Actually information about this week rumor should be stored in gamestate and updated weekly
2015-11-30 20:52:15 +03:00
ArseniyShestakov 6704ea0cff Rumors: rename getTavernGossip to getTavernRumor for consistency
Original game used "Rumors" and not "Gossips" and we already using rumor in CMap.
2015-11-30 17:51:28 +03:00
ArseniyShestakov f55bfe41d6 Digging: implement digging status on right click. Fix issue 401
This is also fix possibility to dig on some non-blockable objects like event.
2015-11-29 12:34:23 +03:00
ArseniyShestakov f940e3ed42 Fix issue 2239. Pillarbox when restored after alt-tab in fullscreen
This isn't best solution and all SDL-related code need refactoring, but it's works.
2015-11-29 01:56:18 +03:00
ArseniyShestakov ce5b7c73be CGEvent: avoid permanent event removal after visit. Fix issue 2339 2015-11-28 23:03:26 +03: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 56c6785bd0 Add backward compatability for patrol and bump save format version 2015-11-28 17:58:59 +03:00
ArseniyShestakov f6de3f94ca Teleports: use TTeleportExitsList typedef for exits list
There is several ideas that teleportation code have to be shared between object/spells and this way we can avoid changing showTeleportDialog declaration every time.
2015-11-28 02:41:30 +03:00
ArseniyShestakov d6a142ca3d CMapLoaderH3M: support for patrol initialPos in readHero 2015-11-27 11:34:03 +03:00
ArseniyShestakov 5d2e47faba CGHeroInstance::Patrol: add initialPos 2015-11-27 11:04:01 +03:00
ArseniyShestakov c45cd1f4c2 CGHeroInstance::getOutOffsets: temporary fix for boat summoning
Appropriate fix would require to get rid of convertPosition everywhere. Check issue 515 for more details.
2015-11-26 10:55:02 +03:00
ArseniyShestakov 64c6d3c950 CGCreature::takenAction: add neverFlee check. Fix issue 2242 2015-11-25 09:34:49 +03:00
ArseniyShestakov 3d8f67f864 getFreeTiles: filter ROCK tiles. Fix issue 1870 2015-11-25 09:12:09 +03:00
ArseniyShestakov 745ab7c7df One more fix for options 2015-11-25 07:40:35 +03:00
ArseniyShestakov 2276af70dc PreGame: avoid crashing on random map options
Options is still broken, but at least we shouldn't crash there.
2015-11-25 07:25:44 +03:00
ArseniyShestakov 0b9a9ab26d Add description of new pathfinder features into changelog 2015-11-24 13:36:51 +03:00
ArseniyShestakov a851062891 Merge pull request #133 from vcmi/feature/pathfinderLayers
Pathfinder layers and related changes: fly and water walking implemented
2015-11-24 13:09:06 +03:00
ArseniyShestakov ac57eaf61d Merge pull request #141 from vcmi/fix/oneWeekTurnsRemain
Bonus system: add turnsRemain support for ONE_WEEK duration
2015-11-24 13:08:03 +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 e1a360408d GameConstants: move operators into header and always inline them 2015-11-22 07:24:12 +03:00
ArseniyShestakov fc06db4c4f Move STRONG_INLINE define into Global.h 2015-11-22 07:14:52 +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 649ebfad2f TerrainTile::topVisitableObj: avoid costly vector copying 2015-11-22 05:34:37 +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 a375c86ea2 movementPointsAfterEmbark: get max move points from TurnInfo
Missed that when originally implemented TurnInfo.
Not pretties code, but boost performance a lot.
2015-11-21 12:46:59 +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 b48d65ad57 addNewBonus: add turnsRemain check for N_TURNS, N_DAYS and ONE_WEEK 2015-11-20 14:37:57 +03:00
ArseniyShestakov f99ffbd074 Bonus system: use duration helpers in selecters 2015-11-20 13:24:48 +03:00
ArseniyShestakov cb61572878 TurnInfo: add cache for bonuses selection 2015-11-20 12:28:35 +03:00
ArseniyShestakov 6d395bcba7 Bonus system: add turnsRemain support for ONE_WEEK duration 2015-11-20 12:11:35 +03:00
ArseniyShestakov d19cb5ce89 EPathfindingLayer: fix obvious layer over-allocation in CPathsInfo 2015-11-19 04:01:56 +03:00
ArseniyShestakov adeefe903a CGPathNode: apply suggested optimizations
Also make EPathfindingLayers ui8 too
2015-11-19 03:08:57 +03:00
ArseniyShestakov def0f0ef0a CTerrainRect::mouseMoved: don't pass curHoveredTile by reference
This does cause problems because curHoveredTile can change while reference still being used by CAdvMapInt::tileHovered.
2015-11-18 03:14:58 +03:00
ArseniyShestakov 7101083a24 CPathfinder: restore transit via garrisons 2015-11-18 00:07:25 +03:00
ArseniyShestakov 511bb54644 doMoveHero: only allow to stop at accessible or land/sail nodes 2015-11-17 17:46:26 +03:00
ArseniyShestakov ab9680a7d9 CPathfinder: handle event object properly everywhere
Also add forgoted check for AdvmapInterface to avoid possible crash.
2015-11-17 07:09:01 +03:00
ArseniyShestakov e9636a8d37 CPathfinder: add TODO and ideas for available options 2015-11-17 04:33:21 +03:00
ArseniyShestakov fe12b8f664 Pathfinding: re-introduce EAccessibility::FLYABLE
That let us get rid of really hacky code in initializeGraph and also fix flying over tiles that aren't visible.
2015-11-17 03:59:02 +03:00
ArseniyShestakov c2ba3e3faf CPathfinderHelper: very firts pass over getNeighbours 2015-11-17 02:41:31 +03:00
ArseniyShestakov 73d8687785 CPathfinder: add some comments and TODO for future changes 2015-11-17 01:38:13 +03:00