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
Ivan Savenko
faa7cbff18
Fixed gcc/clang warnings
2015-12-04 01:17:43 +02:00
Ivan Savenko
f02e553b70
Fixed another uninitialized field possiblity causing issues with StupidAI
2015-12-04 00:11:44 +02:00
Ivan Savenko
90dfe3e782
reduced visibility for members of Mine and Dwellings
2015-12-02 22:34:13 +02:00
Ivan Savenko
7189a12df2
removed few more includes from headers
2015-12-02 22:10:46 +02:00
Ivan Savenko
7b5a7f43ad
Removed includes of CGameState from headers
2015-12-02 21:39:53 +02:00
Ivan Savenko
c3ce4b25df
Removed all #include's of CMap.h from headers.
...
To all - please, avoid #include's in headers as much as possible
This kills incremental build compile times
2015-12-02 21:05:10 +02:00
Ivan Savenko
bef7048460
minimized visibility of members of teleportation-related classes
2015-12-02 21:01:43 +02:00
Ivan Savenko
f9d9a38e53
Fixed gcc warnings
2015-12-02 20:59:38 +02: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
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
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
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
DjWarmonger
45d183289d
Merge pull request #142 from edeksumo/Fix-Defence-Ani
...
Fix crash
2015-11-24 21:37:32 +01:00
edeksumo
aab5a05036
Fix crash during auto battle
2015-11-24 20:55:11 +01: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
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
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
7101083a24
CPathfinder: restore transit via garrisons
2015-11-18 00:07:25 +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
ArseniyShestakov
578aa2acd4
Pathfinding: don't use gamestate directly as it's not needed
2015-11-16 21:22:11 +03:00
ArseniyShestakov
d524b4eabe
CPathfinder: get rid of addNeighbours coord argument
2015-11-16 19:54:17 +03:00
ArseniyShestakov
8f72d73241
CPathfinder: update teleport code and use TurnInfo for whirlpools
2015-11-16 19:14:18 +03:00
ArseniyShestakov
0949283cb9
Pathfinding: pass PathfinderOptions to helper and avoid changing them
...
Original idea behind options is that options should only be set on pathfinder object creation (or via some special method in case pathfinder become persistent).
2015-11-16 18:43:02 +03:00
ArseniyShestakov
3185b64fb0
CPathfinder: rename cObj and dObjt to ctObj and dtObj
...
This way it's more clear that it's pointer to object on tile and not path node.
It's important because air layer nodes don't have visitable objects while tile under them can have one.
2015-11-16 17:41:23 +03:00
ArseniyShestakov
6dd9572644
CPathfinder: cleanup checks for source node visitable object
2015-11-16 17:36:58 +03:00
ArseniyShestakov
aa59ad05ed
CPathfinder: don't access map->guardingCreaturePositions directly
2015-11-13 23:32:52 +03:00
ArseniyShestakov
324cf5490c
CPathfinder: fix movement into guardian tile
2015-11-13 23:07:56 +03:00
ArseniyShestakov
0be9d21132
CPathfinder: add rule that hero in boat can't visit empty boats
2015-11-13 10:28:44 +03:00
ArseniyShestakov
d2baa5b0d0
Pathfinding: move isLayerAvailable into TurnInfo
2015-11-12 14:40:56 +03:00
ArseniyShestakov
abc4ea272f
TurnInfo: store all bonuses and use TileInfo for everything
...
Currently this going to break ONE_WEEK bonuses because those don't work with CWillLastDays selector.
2015-11-12 14:30:29 +03:00
ArseniyShestakov
9ed9d94009
TurnInfo: first step towards better abstraction
2015-11-12 05:20:32 +03:00
ArseniyShestakov
4e11d81673
CGWhirlpool: fix random exit chooser
2015-11-12 01:23:27 +03:00
ArseniyShestakov
942c0cd718
CPathfinder: improve support for whirlpools
2015-11-12 01:16:06 +03:00
ArseniyShestakov
d76b2b7ca8
CPathsInfo: rework nodes multi_array allocation
2015-11-12 00:05:20 +03:00
ArseniyShestakov
09473f6648
CPathfinder: move embark special case to isMovementToDestPossible
2015-11-11 22:29:20 +03:00
ArseniyShestakov
46b923713b
Pathfinding: rework isLayerTransitionPossible and fix formatting
2015-11-11 22:08:15 +03:00
ArseniyShestakov
f1311abd0b
CPathfinder: move node action code into getDestAction
2015-11-11 19:51:08 +03:00
DjWarmonger
5fadb239f2
Merge pull request #134 from edeksumo/Fix-Defence-Ani
...
Let's try this.
2015-11-11 09:43:51 +01:00
ArseniyShestakov
4aaf6191a5
CPathfinder: implemented originalMovementRules option
2015-11-10 21:07:27 +03:00
ArseniyShestakov
2b6851b3d2
Pathfinding: use unique_ptr for hlp and fix few rules
2015-11-10 19:15:59 +03:00
ArseniyShestakov
9a63735c24
CPathfinderHelper: implement TurnInfo to avoid bonus re-checking
...
TurnInfo contain information about what movement-related bonuses and MP hero going to have on certain turn.
This way we can collect this information once for each turn so it's huge performance boost.
2015-11-10 14:26:45 +03:00
ArseniyShestakov
2ef9d7c3ec
Rename getCost back to getMovementCost
...
Initially wanter to name main class differently and back then getCost make sense.
Then renamed class to CPathfinderHelper, but forgot to rename function back.
2015-11-10 02:30:05 +03:00
ArseniyShestakov
b2e1ee5363
CGameState: move two pathfinding-related functions to CPathfinderHelper
...
Both getMovementCost and getNeighbours have nothing to do with gamestate.
2015-11-10 02:15:27 +03:00
ArseniyShestakov
d3c8ca7c1c
Pathfinding: implement duration checking for fly and water walking
...
Now pathfinder take into account different bonuses for different tuns. So if you only have FLYING_MOVEMENT bonus from Fly spell for one turn then pathfinder will only let you use air layer within one turn only.
That work for cost calculations too. Let's say you have two bonuses:
- FLYING_MOVEMENT with 20% penalty for next 2 turns
- FLYING_MOVEMENT with 40% penalty for 5 turns
Now pathfinder using correct penalty for each turn so movements in air layer going to be more expensive on 3-5 turns.
2015-11-09 19:57:26 +03:00
ArseniyShestakov
5106738160
Merge branch 'develop' into feature/pathfinderLayers
2015-11-09 19:20:13 +03:00
ArseniyShestakov
96897acc46
CWillLastDays: add condition for permanent durations
...
Accidentally missed them in pull request
2015-11-09 19:05:22 +03:00
ArseniyShestakov
7f0b0bd1b5
Bonus system: use updateBonuses in battleTurnPasseed
2015-11-09 15:48:07 +03:00
ArseniyShestakov
ee1c5e452f
Bonus system: add CWillLastDays selector
2015-11-09 15:01:58 +03:00
ArseniyShestakov
5bfbd8526b
Bonus system: fix N_DAYS bonus duration
2015-11-09 14:18:36 +03:00
ArseniyShestakov
45e4cf354e
Revert "Pathfinding: do path calculation in separate thread"
...
This reverts commit f376b27999
.
2015-11-09 09:35:56 +03:00
ArseniyShestakov
f376b27999
Pathfinding: do path calculation in separate thread
2015-11-08 19:19:48 +03:00
ArseniyShestakov
9cf35d1bfd
CPathfinder: support for Castle Gate
...
No support for client / server implemented yet.
2015-11-08 10:06:24 +03:00
ArseniyShestakov
be37e1cd8b
CPathfinder: add const to appropriate methods
2015-11-08 08:39:00 +03:00
ArseniyShestakov
f590b364c5
Pathfinder: shorten EPathfindingLayer to ELayer
2015-11-08 08:27:51 +03:00
ArseniyShestakov
4af9c7c29d
CPathfinder: add one turn boundary for flying and water walking
...
Now when oneTurnSpecialLayersLimit is enabled hero won't be able to stop on blocked or water tiles between turns.
It's default H3 mechanics so it's enabled by default.
2015-11-08 07:44:00 +03:00
ArseniyShestakov
2fb73c55e1
CPathfinder: use node action in isMovementAfterDestPossible checks
2015-11-08 04:41:06 +03:00
ArseniyShestakov
4973a1ec90
CGPathNode: get rid of land member as it's now obsolete
...
CTerrainRect::showPath behaviour changed so it's will only add cross path graphics on embark/disembark and path ending.
We want continuous paths for flying and water walking even when land<-> water transition occur.
2015-11-08 04:01:58 +03:00
ArseniyShestakov
160fa38254
Client: change cursor using node action information of pathfinder
2015-11-08 03:10:48 +03:00
edeksumo
ba1062ed3c
Formating2
...
Change ani to anim
2015-11-07 23:30:01 +01:00
ArseniyShestakov
82048cbf2d
Pathfinder: implement new feature - node action
...
No action going to simplify isMovementAfterDestPossible and should be as well useful for cost calculations.
It's can be also used by client interface to show appropriate cursors and path.
2015-11-08 00:26:41 +03:00
ArseniyShestakov
bd8eec7fb8
CGPathNode: move resetting code into separate function
2015-11-07 22:16:45 +03:00
ArseniyShestakov
d8a612f5d6
CPathsInfo: use boost::multi_array for storing graph of nodes
2015-11-07 22:02:57 +03:00
ArseniyShestakov
3f2cdf3137
CPathfinder: implement priority queue and node locking
2015-11-07 21:11:07 +03:00
ArseniyShestakov
7eebcb9d60
Artifacts: replace few more ints by ArtifactID
2015-11-07 11:46:58 +03:00