1
0
forked from 0ad/0ad
Commit Graph

6250 Commits

Author SHA1 Message Date
780a1de136 Don't comment out code. Refs #3486.
This was SVN commit r17400.
2015-12-07 12:27:52 +00:00
8af675e207 Don't emit sounds when selecting dead animals. Patch by Stan. Fixes #3486.
This was SVN commit r17399.
2015-12-07 00:21:24 +00:00
987a7028bd Implements relative templates. Fixes #2936. Thanks to leper, wraitii, historicbruno and everyone else that helped.
This was SVN commit r17386.
2015-12-05 17:02:25 +00:00
71b0d9c052 Update atlas with the new map_sizes.json format. Refs #3355.
This was SVN commit r17379.
2015-12-04 16:37:30 +00:00
2e69872b11 Remove debug parser from replay menu. Refs #3440
This was SVN commit r17367.
2015-12-03 03:12:43 +00:00
5b2738b0cb Doubles size of sound card string buffers, for users with many sound devices present. Fixes #3660
This was SVN commit r17365.
2015-12-02 22:41:17 +00:00
02c065e2c9 Removes the unused "gone" presence state from the lobby. Refs #3383.
This was SVN commit r17358.
2015-12-02 14:41:32 +00:00
a1e57aaeaf Replay menu cleanups. Fixes #3440.
Hides the summary-button in the replaymenu in case the summary wasn't
saved.
Corrects the timestamp for incompatible replays.
Remove unused UNUSED from header files.
Use string8() instead of OsString().
Mention a reported compiler warning.
Use const& instead of a copy in StartVisualReplay().

This was SVN commit r17356.
2015-12-02 13:53:44 +00:00
0a8fc4bb08 improve pathFinder by optimizing the DistanceToSquare computation, refs #3588
This was SVN commit r17350.
2015-12-01 19:01:41 +00:00
418318ea88 Properly read preferglsl in user config files.
This was SVN commit r17347.
2015-12-01 09:00:12 +00:00
6f09803e8c TerrainTextureManager file loading rewrite. Fixes #3358.
Add directory callback to vfs::ForEachFile.
Each terrain directory should now have a terrains.xml file,
as using the previous terrains.xml file is unlikely to be what was
intended.

This was SVN commit r17341.
2015-11-30 20:12:12 +00:00
fa9c8e061b Enable GLSL by default on OpenGL 3+.
This doesn't override any user setting, it just changes the default when
no preferglsl setting is specified.

Fixes #3641.
Refs #145.

This was SVN commit r17338.
2015-11-30 10:51:02 +00:00
700859b2c3 Move the playerdefaults to the settings directory. Refs #3355
This was SVN commit r17332.
2015-11-30 01:33:59 +00:00
61e5e92b14 Update/revamp my template analyzer tool.
Remove the useless "fancy" data in favor of a simpler visualization of
templates, adding an in-place tool to filter and sort (for convenience).

This was SVN commit r17331.
2015-11-29 19:19:20 +00:00
814cdd9524 Tie tangent generation with preferGLSL setting for convenience since that setting was not really useful. Fixes #2506 . Patch by fabio.
This was SVN commit r17325.
2015-11-29 15:44:22 +00:00
7de746cc58 Visual replay code cleanup. Refs #3440.
Moves StartVisualReplay() from JSInterface_VisualReplay.cpp to
VisualReplay.cpp, so that the former doesn't define any logic.
Uses replayFile.string8() instead of
utf8_from_wstring(replayFile.string()).
SAFE_DELETE instead of delete.
Fixes a compiler warning in getReplayDuration().

This was SVN commit r17314.
2015-11-29 00:23:18 +00:00
be9b6fa59c improves performance of hierarchical pathFinder, refs #3588
This was SVN commit r17310.
2015-11-28 13:06:44 +00:00
432df9b38e Use two range based for loops to fix two TODOs.
This was SVN commit r17303.
2015-11-28 08:27:42 +00:00
9a40d1284e Update version numbers. Switch lobby room.
This was SVN commit r17299.
2015-11-28 08:27:33 +00:00
082af749f0 Actually remove all unlisted translations.
This was SVN commit r17298.
2015-11-21 20:00:20 +00:00
229e850dba Fix a compiler warning.
This was SVN commit r17296.
2015-11-20 20:42:45 +00:00
fc6af83c2a cleanup 5b335442fb
This was SVN commit r17294.
2015-11-20 19:47:08 +00:00
5b335442fb fix a bug in the HierarchicalPathfinder revealed by changes in 9b0ed97d05, patch by wraitii
This was SVN commit r17293.
2015-11-20 19:45:48 +00:00
ee8f9516eb Update translations to be included in the release.
This was SVN commit r17290.
2015-11-19 23:09:49 +00:00
0b2da13dea never edit a patch before commiting !
This was SVN commit r17287.
2015-11-19 22:17:00 +00:00
9b0ed97d05 fixes and performance improvements in hierarchical pathfinder, fixes #3621
This was SVN commit r17284.
2015-11-19 22:02:25 +00:00
9e35f7d68b The over-rasterization of obstructions introduced in [17161] could in very rare cases lead to an OOS in the passability grid. Fixes #3612.
This was SVN commit r17278.
2015-11-16 22:03:10 +00:00
9819b23529 I should not commit half-finished debug code.
This was SVN commit r17276.
2015-11-16 18:48:05 +00:00
70164a02c4 Handle double-clicks on list elements better. Patch by elexis.
Fixes #3574

This was SVN commit r17274.
2015-11-16 18:23:21 +00:00
39f572af88 Stop processing turns after a replay finishes. Patch by elexis. Fixes #3581
The animations continue because we currently have no easy way to stop
interpolating. My suggestion would be to implement a network
synchronised pause and use something like that.

This was SVN commit r17265.
2015-11-15 15:08:46 +00:00
6b8dc7684a Return in case we do not have any available JS timer slots instead of accessing OOB memory.
This was SVN commit r17263.
2015-11-15 01:09:35 +00:00
f1f0fa1f8f Fix a typo. Thanks stan for noticing.
This was SVN commit r17260.
2015-11-14 21:46:05 +00:00
3760891131 Fix the precedent fix. It turns out the code behaves in much weirder ways than I expected.
This was SVN commit r17255.
2015-11-14 19:03:20 +00:00
e7fb75a680 Initialize new variables correctly.
This was SVN commit r17247.
2015-11-12 23:07:54 +00:00
e9271025dc Forgot to serialize a new unitMotion variable, resulting in OOS on rejoin.
This was SVN commit r17245.
2015-11-12 20:57:50 +00:00
9357cce112 Math is hard
This was SVN commit r17242.
2015-11-12 17:32:33 +00:00
3febc387d5 Styling fixes.
This was SVN commit r17241.
2015-11-12 17:23:50 +00:00
52443dfe80 Fix an erroneous ENSURE in PatchRData and move it where it will be very slightly clearer. Fixes #3598
This was SVN commit r17240.
2015-11-12 17:22:44 +00:00
913545aa41 Mark several CFixedVector2D as const and passed by reference in Geometry and a few other places. Mark some functions (that probably already were) inline.
Also make sure we don't include Geometry.h where it's not necessary.

This was SVN commit r17238.
2015-11-11 20:50:02 +00:00
f3b22e51a3 Optimize Geometry::PointIsInSquare, which is used quite often in performance hotspots.
Original patch by mimo. Refs #3588

This was SVN commit r17236.
2015-11-11 20:02:47 +00:00
a138bed96b Fix an issue where units did not notice other moving units with my latest commits.
This was SVN commit r17234.
2015-11-11 19:06:07 +00:00
cc199c4cca Fix a critical typo in the last commit and a debug message left in accidentally. Thanks fabio.
This was SVN commit r17232.
2015-11-11 13:55:36 +00:00
06cb37ff74 Add PlanNextStep back to the unitMotion, in a completely different version. This basically anticipates where we'll probably move next, and checks if static units might block us. Makes paths look slightly better.
This was SVN commit r17229.
2015-11-11 13:29:06 +00:00
607955489d Check if units are in the world in UnitRenderer::PickAllEntitiesAtPoint. Probably fixes #3587, though I'm not sure as it proved unreproducible.
This was SVN commit r17228.
2015-11-11 13:27:13 +00:00
3b13fb7608 Improve unitMotion behavior. When a unit's path is obstructed, it will now try shortpathing around an increasingly large search range, to optimize behavior in trivial cases where it just needs to go around a unit.
Also stop trying too hard when we are close to the destination and our
only order is to move there.
This should result in a slight optimization of the behavior, as well as
slightly more sanity overall.

This was SVN commit r17226.
2015-11-11 12:49:24 +00:00
3ddd72c1a4 Fix a rare case where units might get stuck around other idle entities, and clarify a related comment.
Refs #3471

This was SVN commit r17225.
2015-11-11 12:28:38 +00:00
c42160ec10 Fix an issue where units could not go around large obstructions when short-pathing as it ran in the search-space "walls", reported by gamebot. Fixes #3593.
This is also a very slight optimization.

This was SVN commit r17224.
2015-11-11 12:23:11 +00:00
2f6f0bd477 Serialize everything that is needed by UpdateVisibilityData instead of assuming everything as dirty.
Fixes #3271.

This was SVN commit r17223.
2015-11-11 12:15:57 +00:00
32da740f14 Allow kicking/banning players from gamesetup and session. Patch by elexis. Fixes #3241.
This was SVN commit r17217.
2015-11-11 02:05:23 +00:00
d3ff090ce7 Fix an OOS issue where, on ownership change, units affected by speed-modifying technologies did not update their speed.
This was SVN commit r17215.
2015-11-10 23:31:06 +00:00
51ec6f4728 improve function RasterizeRectWithClearance, about 40% faster, ref #3588
This was SVN commit r17212.
2015-11-09 21:16:46 +00:00
0ba9fa1cc1 Optimize RasterizeRectWithClearance slightly further. Thanks mimo for noticing.
This was SVN commit r17209.
2015-11-08 18:08:49 +00:00
313d324fac Fix some cases of unit "dancing". Thanks to Elexis for nagging me.
This was SVN commit r17208.
2015-11-08 17:55:23 +00:00
fe040c695f Change the shape rasterization to not use DistanceToSquare, which often called sqrt. This apparently reduces total turn time by as much as 5% (!)
Refs #3368

This was SVN commit r17207.
2015-11-08 17:24:59 +00:00
cb025bb725 Removes extraneous check from XpartaMuPP. Fixes #3568.
This was SVN commit r17206.
2015-11-08 17:09:59 +00:00
dd6d09521c Not sure how but I messed up the previous commit.
This was SVN commit r17205.
2015-11-08 16:44:08 +00:00
42d0e6d46e Optimize the hierarchical pathfinder's "makeGoalReachable" slightly. Does not affect simulation results.
This was SVN commit r17204.
2015-11-08 16:39:43 +00:00
cd025b2069 fix typo
This was SVN commit r17203.
2015-11-08 13:09:49 +00:00
c319ff062d Partial fix to a formation "gliding" issue, unsure so far what is causing this.
This was SVN commit r17198.
2015-11-07 17:36:31 +00:00
3163c9d4a2 Fix a rare issue with the short-range pathfinder where units took odd paths when the target was beyond the search zone.
This was SVN commit r17197.
2015-11-07 14:33:55 +00:00
2d7074e8d6 Fix unused variables left behind.
This was SVN commit r17194.
2015-11-06 20:42:12 +00:00
596025df71 Fix a bug in [17163] that could get units with a large passability class stuck.
This was SVN commit r17192.
2015-11-06 20:33:13 +00:00
e26b59c917 Changes to unitMotion.
Make sure we do not treat as circles entities that we really should
treat as squares (such as trees). This fixes an issue reported by Stan.
Make sure we never forget about our destination if we are blocked by
unit obstructions. This makes sure that units in a group but not in
formation will not be blocked by the other units, and probably makes the
general behavior more sane. Helps following [17166]

Refs #3505, #3471, #3376

This was SVN commit r17191.
2015-11-06 20:09:18 +00:00
9efd79e240 Fix an issue where square diagonals were incorrectly handled when checking the distance to the target. Fixes #3577 properly. Patch by mimo.
Decrease fishing ship gathering range in consequence (revert [17178]).

This was SVN commit r17190.
2015-11-06 19:56:52 +00:00
1ed3761859 Fix style issues and redundant code in [17161] and [17163].
This was SVN commit r17189.
2015-11-06 19:48:08 +00:00
2126b53b9d Fixes interpolation of flying objects.
This was SVN commit r17187.
2015-11-06 16:56:39 +00:00
83bba7bdfc revert e0771b98dd which was based on misunderstanding of the algo, and fix the inverted_circle case, refs #3577
This was SVN commit r17184.
2015-11-05 19:22:04 +00:00
05547bf36f Fix an oversight.
This was SVN commit r17182.
2015-11-05 16:52:19 +00:00
a9323da01b Fix #3566 by fixing an off-by-one error in the final replay turn logic. Patch by elexis.
This was SVN commit r17180.
2015-11-04 20:33:34 +00:00
8f1853b8d8 Prevent accidental overwriting of replays in very rare cases while we wait for a better solution.
Refs #3255

This was SVN commit r17177.
2015-11-04 19:26:40 +00:00
f91478c730 Fix an oversight in the obstruction manager that lead to possibly the most insidious OOS error we've seen so far.
Fixes #3292 .

This was SVN commit r17176.
2015-11-04 18:51:47 +00:00
e527a5c321 Fix #3525 and #3399 by recalculating territories on request to GetTerritoryPercentage. Patch by elexis
This was SVN commit r17171.
2015-11-02 07:32:43 +00:00
6493974800 Fix #2676 by only acknowledging commands matching the sender's name if cheats are disabled. Based on patch by historic_bruno.
This was SVN commit r17170.
2015-11-02 03:20:44 +00:00
d9e9345be2 fix some indentation of 6e05a00929
This was SVN commit r17164.
2015-11-01 16:47:53 +00:00
357203a90f Pathfinding changes: unit-unit collisions now allow for some overlap, so units can get closer to each other, which I found improved pathfinding considerably.
Also fix a potential issue I noticed in some cases, though that
particular fix implies scrapping waypoints, so if units seem to get
lost, please report so and I'll revert those changes.

I can't find any way to get units stuck with this patch.

This was SVN commit r17163.
2015-11-01 13:38:48 +00:00
14038d4cd8 Fix more pathfinding issues.
Change the way the long-range pathfinder rasterisation works slightly so
that we have a better compatibility with the short-range pathfinder.
Should fix the "stuck units" issues, though I am not sure so I am not
marking them as fixed so far. Refs #3471, #3505, and possibly #3292.

Caveat: I am now using clearance of 0.8 for "default" class, which might
have side-effects: please report anything weird.

Also fix leftover style issues.

This was SVN commit r17161.
2015-11-01 07:28:43 +00:00
a6111ff8b7 Fix #3309 by capping m_DeltaSimTime in NetTurnManager.cpp. Patch by elexis. Review by Philip.
This was SVN commit r17159.
2015-10-31 21:04:47 +00:00
6acfec0f44 Fix a logic error in the hierarchical pathfinder that resulted in it not updating all passability classes correctly. Fixes #3538, refs #3292 (it fixes one of the cases, but not the examples).
Also features style fixes, thanks leper for noticing.

This was SVN commit r17158.
2015-10-31 20:47:47 +00:00
a3f467ae4e Make resources have a static, passable obstruction. Ought to be a temporary fix. Fixes #3530
See #3530#comment:9 for a proper fix to this issue.

This was SVN commit r17156.
2015-10-31 15:28:42 +00:00
4d804cf26b fix typo in 6e05a00929
This was SVN commit r17155.
2015-10-31 13:42:14 +00:00
6e05a00929 fix obstruction of target entity not taken into account in short pathfinder, closes #3539
This was SVN commit r17154.
2015-10-31 13:37:34 +00:00
8494e36aa8 Revert the logic change in 9da482ead4. This commit removed the checks in UnitMotion against structures, which should have been fine except the short-range pathfinder and the long-range pathfinder are not entirely compatible (check out #3532 for details). This behavior was probably slightly optimized, but it was too clever for its own good in the current state of the pathfinder, might be reintroduced later.
This resulted in ALL "units inside obstructions" issues.

Thanks to elexis for the testing.

Fixes #3532, #3450.
Refs #3538 (still OOSes), #3410 (unitmotion remains buggy for
formations, but this is only aesthethic.)
Probably affects #3471 and #3505, but those are not fixed.

This was SVN commit r17152.
2015-10-31 08:43:31 +00:00
108633affd Fix #3415. Removes 'ghost' scrollbar bounding to enable extreme-right hover and selection in dropdowns. Patch by elexis.
This was SVN commit r17149.
2015-10-31 05:40:43 +00:00
e0771b98dd fix switch between square or circle approximation in UnitMotion, refs #3539
This was SVN commit r17145.
2015-10-26 22:59:26 +00:00
f4cb822d9d do the circle approximation also in INVERTED goals in UnitMotion, refs #3405
This was SVN commit r17143.
2015-10-18 20:23:02 +00:00
70d5e4e318 fix the INVERTED_CIRCLE and INVERTED_SQUARE PathGoal, fixes #3405
This was SVN commit r17142.
2015-10-18 20:21:20 +00:00
82590753d7 fix a moved function, fixes #3531
This was SVN commit r17137.
2015-10-16 17:14:39 +00:00
b97e565017 Fixes path formatting in Windows OOS error message, patch by elexis, fixes #3498
This was SVN commit r17134.
2015-10-15 03:50:45 +00:00
c0b4e78801 Fixes stream serialization bug on OS X 10.8 and older, which caused instant OOS in multiplayer games, fixes #3108.
Fixes test failures on OS X 10.7 and older, refs #3109

This was SVN commit r17133.
2015-10-15 03:31:30 +00:00
4043c56518 Fixes global init order bug that caused OOS between OS X and other platforms, fixes #3499. May improve pathfinding behavior in some cases, please test!
This was SVN commit r17132.
2015-10-15 02:51:12 +00:00
4994dfb26a Avoids RuntimeError: dictionary changed size during iteration
This was SVN commit r17127.
2015-10-11 20:47:52 +00:00
9db4fb5ddb fix typo in Game.cpp
This was SVN commit r17126.
2015-10-11 11:12:27 +00:00
b0f267b61c fix typo in UnitMotion, fixes #3474
This was SVN commit r17124.
2015-10-11 11:00:11 +00:00
f5348c6dd6 Introduce less rounding errors in the falloff to allow a more precise territory calculation. Fixes #3334. Based on code by elexis.
This was SVN commit r17122.
2015-10-11 09:01:50 +00:00
40acf66ba9 Fixes hotkey bugs introduced in a07add11c6, patch by elexis. Fixes #3495
This was SVN commit r17116.
2015-10-10 07:22:07 +00:00
02628b8902 Removes unused pathfinder consts, patch by stanislas69. Fixes #3500
This was SVN commit r17115.
2015-10-10 06:48:42 +00:00
e0093c8ecc Remove an unused function (it was used by the old pathfinder).
This was SVN commit r17103.
2015-10-04 18:02:16 +00:00
2505a2ec70 Remove a preprocessor ambiguity, fixes #3480.
This was SVN commit r17101.
2015-10-04 17:21:36 +00:00
cfe4a2e568 Fix a cause of serialization problems. Fixes #3450.
This was SVN commit r17097.
2015-10-03 11:02:12 +00:00
bb997f6cae Fix previous commit.
This was SVN commit r17096.
2015-10-03 10:32:30 +00:00
d60940ac59 Code improvements and style fixes.
This was SVN commit r17095.
2015-10-03 08:27:19 +00:00
dc69aed954 Remove some old and unused code.
This was SVN commit r17094.
2015-10-02 18:27:10 +00:00
102358a5cb Fix build for recent versions of miniupnpc.
This was SVN commit r17091.
2015-09-30 21:32:54 +00:00
061c7f6058 Const ref.
This was SVN commit r17090.
2015-09-30 20:28:23 +00:00
2132f868b8 Replace the rectangle rasterization algorithm by the original version from Philip's branch.
The current version is flawed (it doesn't handle the partially
obstructed cells as it should).

Refs #3410.

This was SVN commit r17084.
2015-09-27 16:46:26 +00:00
a7e0dc1534 update attack and heal range queries, patch by leper, fixes #3080
This was SVN commit r17082.
2015-09-27 12:23:40 +00:00
dcf8e66aca Update the goal serialization for 03d2c5e40b. Fixes #3425.
This was SVN commit r17068.
2015-09-24 17:13:39 +00:00
b830233498 Fix previous commit, some new files didn't pass through.
This was SVN commit r17055.
2015-09-21 17:14:26 +00:00
d64b95b28c An awesome Visual Replay menu, made by elexis. Fixes #3258.
This was SVN commit r17054.
2015-09-21 17:00:21 +00:00
3317e6c68b rename autostart visualreplay, refs #3258, patch by elexis
This was SVN commit r17050.
2015-09-20 12:29:59 +00:00
b77ad821c2 Reenable formations and fix/improve the communication between UnitAI and UnitMotion. With the new pathfinder some path requests can be completed instantaneously, so UnitAI has to handle MoveStarted messages even in the IDLE state.
Please note that this commit makes #3410 really visible. Formation
members might pass through buildings.

Refs #3410, #3337.

This was SVN commit r17028.
2015-09-17 16:31:23 +00:00
21619a4705 Move the victory conditions to the new simulation settings system. Patch by elexis. Refs #3355,#3001
This was SVN commit r17026.
2015-09-16 09:22:36 +00:00
7eefcbe8c5 Do not use non-static data member initializer.
GCC 4.6 does not support those and initializing it in the ctor is a lot
clearer in this case.

This was SVN commit r17022.
2015-09-15 00:55:03 +00:00
a65a8472f9 Mark some const functions as such.
This was SVN commit r17021.
2015-09-13 20:59:10 +00:00
ae3aad704d fix previous commit
This was SVN commit r17018.
2015-09-13 19:06:14 +00:00
9816e7c92d Rename some variables to point out that they are only used in visual replay. Add script function IsVisualReplay. Refs #9 #3355, patch by elexis
This was SVN commit r17017.
2015-09-13 19:03:33 +00:00
ae6475fcc0 Fix a typo, patch by godlikeldh.
This typo didn't have any influence since dirty unit shapes are usually
discarded during the rasterization (they don't block long-range
pathfinding). Switching the order of a check in RasterizeHelper prevents
performance problems to a really small extent.

This was SVN commit r17014.
2015-09-13 10:18:37 +00:00
03d2c5e40b Support inverted goals with the long-range pathfinder. This allows units to flee and should fix problems with ranged units too close to their targets. Fixes #3405, refs #3372.
Now that units flee it's necessary to fix the unit chasing: this commit
reintroduces some code from 298115f4c5 that disappeared with the
committing of the new pathfinder. Refs #1537.

Also includes some style improvements to the UnitMotion code.

This was SVN commit r17013.
2015-09-13 09:33:09 +00:00
8507a7bc27 Create commands.txt only when actually starting the game. Patch by elexis. Fixes #3408.
This was SVN commit r17004.
2015-09-11 17:44:50 +00:00
558695365d Add some documentation about system components. Fixes #3315.
This was SVN commit r17003.
2015-09-11 04:10:26 +00:00
fc051d94cc Add check for non-passable (likely water-only) maps to territory percentage calculation.
Patch by s0600204. Fixes #3407.

This was SVN commit r17002.
2015-09-11 02:16:21 +00:00
9da482ead4 Based on previous experimental changes, major update to the unit motion.
With this change, units will not check their movement against all
obstructions when moving: terrain and static obstructions are assumed to
be handled by the long-range pathfinder.
However, when static obstructions are changed, the paths have to be
invalidated. In order to minimize the performance impact, units will
check for obstructions when they move after a passability change. If
they collide with something, they will recompute a path that will take
into account the new passability map.

Also includes some code cleanup. This patch should not change
performance a lot: the lower number of checks should give a small
performance improvement while using the message broadcasting system
should hurt it a bit.

Fixes #3376, #3337, #1914.

This was SVN commit r16998.
2015-09-10 18:12:13 +00:00
8b437a0b1c Fix #3386, patch by elexis.
This was SVN commit r16997.
2015-09-10 05:30:18 +00:00
5a685b84ca Recompute the cost grid in the TerritoryManager when needed. Patch by s0600204. Fixes #3399, #3400.
This was SVN commit r16990.
2015-09-06 22:35:38 +00:00
4e3b933b11 Fixes some issues in checkrefs.pl: soundgroups have new gender and lang tags, PMP version bump, GUI XML can include directories, civ data path changed
This was SVN commit r16987.
2015-09-06 04:42:28 +00:00
448b8248cf Revert my experimental changes from the previous days. Hopefully I can design something that doesn't introduce a ton of new issues. Refs #3376
This was SVN commit r16986.
2015-09-05 18:20:08 +00:00
1d89d05956 Don't try to short-path to non-point goals, because the algorithm won't deal with connectivity. Fixes another bug reported in #3363.
This was SVN commit r16985.
2015-09-04 20:43:05 +00:00
3005637370 Make a compromise between f240374b28 and f134ac63bb by making the filtering of pathfinding-blocking shapes conditional.
Those shapes need to be taken into account when computing a short path,
but they need to be discarded when checking movements or they will
create long/short inconsistencies.

This was SVN commit r16981.
2015-09-03 20:09:25 +00:00
ad9736b5a5 Fix Arabic plural equation in tinygettext.
Patch by SafaAlfulaij taken from
https://github.com/tinygettext/tinygettext/pull/8.

This was SVN commit r16980.
2015-09-03 16:42:05 +00:00
7d6553099f Fix wrong offset when clicking too close to the header of sortable lists. Also added some code comments.
Patch by elexis, fixes #3391

This was SVN commit r16976.
2015-09-02 17:55:02 +00:00
8dde1cda94 Style cleanup, and remove a wrong TODO.
This was SVN commit r16974.
2015-09-02 17:40:31 +00:00
f134ac63bb Revert most of f240374b28 which was actually bad. It caused units to get stuck because the obstructions won't block the same paths when rasterized on the grid and when directly tested for collisions.
As a general rule, pathfinding-blocking shapes should not be tested
against for movements. Only the passability grid should be considered.
As the algorithm which tests paths on this grid was fixed in 1c9ea56800,
it can be safely used.

Fixes #3376.

This was SVN commit r16971.
2015-09-02 15:50:16 +00:00
8a8a3b8377 Revert a wrong piece of code from 63e42fbd31. Refs #3293
This was SVN commit r16965.
2015-08-30 20:32:22 +00:00
1a15131d2d Lobby bot optimizations.
This was SVN commit r16964.
2015-08-30 17:50:16 +00:00
63e42fbd31 Display which player(s) are OOS when it happens. Also fix some encoding issues with file paths.
Patch by elexis, fixes #3293.

This was SVN commit r16963.
2015-08-30 17:47:18 +00:00
f47cb2c711 Fix the OOS reported by elexis in #3335, and clean some whitespace and style.
The list of modified entities was thrown out on global visibility
updates (those happen on rejoin) but only in-world entities were
actually updated then, causing problems with garrisoning.

Now the list of modified entities can happen to be large, so replace the
hacky check for infinite loops by a real check.

This was SVN commit r16962.
2015-08-30 17:42:10 +00:00
45a39e7dfd Fix 3171 by moving some logic to C++. These changes do not optimize the presence buffer and only fix the state bug.
This was SVN commit r16961.
2015-08-30 12:56:48 +00:00
2aef62d65f Handle backrefs properly for maps and sets. Fixes #3374.
Allocate the tag for the backreference before deserializing the content,
to match the order of serializing.

This was SVN commit r16959.
2015-08-30 04:51:16 +00:00
57f340f906 Fix player rejoins. Refs #3242.
This was SVN commit r16955.
2015-08-30 02:03:50 +00:00
c9893b3dd0 Test serialization of nested maps. Refs #3164, #3374.
This was SVN commit r16954.
2015-08-30 00:06:39 +00:00
8217fa1a0e Warn about range queries that can never return any results.
This was SVN commit r16951.
2015-08-29 22:49:49 +00:00
e56dddbefb Optionally allow observers to rejoin a game when they weren't here during the game setup.
Patch by elexis, fixes #3242.

This was SVN commit r16945.
2015-08-28 20:20:10 +00:00
8e70140ec2 Handle properly static shapes that overlap the edge of the map (likely to happen with square maps).
This should fix #3364.

This was SVN commit r16944.
2015-08-28 11:38:14 +00:00
34555ad70c Enhance i18n extractor to support a single context for a json file. Patch by elexis. Refs #3355.
This was SVN commit r16942.
2015-08-27 19:07:36 +00:00
d129ae3cd8 Fix a special situation where map control percentage wasn't computed properly.
Also improve the code and fix a typo.

Based on patch by s0600204, fixes #3378.

This was SVN commit r16941.
2015-08-27 16:26:32 +00:00
b9ab8f5855 Explicitly include public's mod.json in Windows packages.
Also clean up some unused options in the dist script.

This was SVN commit r16939.
2015-08-25 12:55:05 +00:00
a63b7a0126 Add ability to query the map control percentage, and use this value in the summary screen. Patch by s0600204, fixes #3321
This was SVN commit r16933.
2015-08-23 17:44:37 +00:00
b694ab41d9 Show the number of trade carts and looted resources in the summary screen. Patch by bb, fixes #3311
This was SVN commit r16932.
2015-08-22 17:57:41 +00:00
74c420f658 GUI code cleanup. Fixes #3354.
Lots of code style fixes:
 * type [*&]varname -> type[*&] varname
 * else
   if (...)
   ->
   else if (...)
 * Spaces around some ops.
 * i++ -> ++i.
 * switch-case style fixes.
 * Indentation fixes.
 * Removing some commented out code.
 * include header sorting
 * Changed multiple pointer var declarations to be one per line.
 * Removed strange spaces in some places.
 * Changed some include header guards to be consistent with the rest of
the codebase.
 * Use UNUSED() instead of UNUSED2().

Some small code fixes:
 * Using .find() instead of .count() == 0.
 * !.empty() instead of .size() == 0.
 * Range-based for loops.
 * Making some member functions const by small changes.
   * Adds GetScrollBarPos(idx) const for this.
 * Using early returns/continues in some places.
 * Uses size_t for some loops in CList and COList.
 * Removes unused heading element (not attribute) from COList.
 * Use ENSURE in one case where some custom code did something similar.
 * Made some parameters const ptrs/refs.
 * Change removal loop in GUItext.cpp to erase-unique.
 * Made some static things const.
 * Allow iterating over children of IGUIObject with range-based for
loops by
   exposing begin() and end() (rename from ChildrenIt{Begin,End}()) and
use it.

Comments:
 * Comment COList.
 * Update a few comments.
 * Remove useless or duplicated comments.

This was SVN commit r16931.
2015-08-21 17:08:41 +00:00
a63e9c521d Optionally limit the framerate in menus to 50 FPS, to save power. Patch by elexis, fixes #2882
This was SVN commit r16927.
2015-08-20 13:22:44 +00:00
ba82743777 Some range-based for loops.
This was SVN commit r16926.
2015-08-20 12:58:41 +00:00
b2e8a241d2 Properly check loaded scripts in the second simulation instance of a serialization test. Fixes #3238
This was SVN commit r16925.
2015-08-20 12:52:29 +00:00
1ab3a4a02d Fix 6506bc20cb, refs #3238
This was SVN commit r16924.
2015-08-20 12:49:43 +00:00
558d43bac5 Replace some functor structs with lambdas, closures or range-based fors.
This was SVN commit r16923.
2015-08-19 03:33:04 +00:00
36c6b50944 Revert emplace for associative containers. Fixes #3366.
GCC < 4.8.0 does not support emplace for those.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44436.

This was SVN commit r16922.
2015-08-19 03:32:47 +00:00
674f49f1a8 Remove generated test files during clean-workspaces.sh. Patch by otero. Fixes #3275.
Also remove two generated and disabled test files.

This was SVN commit r16921.
2015-08-19 01:30:09 +00:00
bd8f9b7824 Fix enemy corpses visible in the fog of war. Fixes #3179.
This was SVN commit r16919.
2015-08-16 09:29:34 +00:00
1c9ea56800 Fix the CheckLineMovement algorithm. Added some comments and a test to avoid problems.
This addresses some "stuck units" cases.

This was SVN commit r16918.
2015-08-13 16:21:39 +00:00
01de76f4be Code improvements for the hierarchical pathfinder: cache hits and variable initialization.
This was SVN commit r16917.
2015-08-11 15:21:11 +00:00
28ef270571 Enhance the MakeGoalReachable algorithm to handle better non-point goals.
Fixes #3363, #3297.

This was SVN commit r16915.
2015-08-11 09:47:08 +00:00
f7a7b687fc Don't send TerrainChanged messages when painting the terrain, as terrain texture doesn't influence passability.
This was SVN commit r16914.
2015-08-10 11:55:43 +00:00
ec96c737ee Actually use vpObj instead of obj, and use it in all cases. Refs #3354.
This was SVN commit r16909.
2015-08-02 14:40:51 +00:00
94302a4149 Move engine version to common file. Patch by elexis. Fixes #3359.
This was SVN commit r16906.
2015-08-01 23:03:13 +00:00
217a500d60 Add missing license headers. Fixes #3357.
This was SVN commit r16903.
2015-07-31 11:28:14 +00:00
1a8096a920 Reliably send the ReplayFinished message at the very end of visual replays. Patch by elexis.
This was SVN commit r16902.
2015-07-30 21:55:34 +00:00
a4e606c575 TerrainTextureManager cleanup.
This was SVN commit r16901.
2015-07-30 21:51:01 +00:00
c5aad60776 Actually stop iterating if retval != INFO::OK. Also fix comments.
This was SVN commit r16900.
2015-07-30 21:50:58 +00:00
15a4c813d6 Add support for AArch64 (ARM64). Patch by tbm. Fixes #3345.
This was SVN commit r16899.
2015-07-30 19:52:55 +00:00
0868d03e74 Fix previous commit.
This was SVN commit r16898.
2015-07-30 17:27:27 +00:00
2238a18aee Close and free replay streams. Based on patch by elexis.
This was SVN commit r16897.
2015-07-30 16:43:22 +00:00
47336b770f Add clipping to OList cells. Patch by elexis. Fixes #3353.
This was SVN commit r16895.
2015-07-30 01:33:48 +00:00
8bfe16cac8 Use in-place construction.
This was SVN commit r16894.
2015-07-29 23:44:17 +00:00
c5eb9b7bb7 Range-based for for VfsPath loops.
This was SVN commit r16893.
2015-07-29 23:44:12 +00:00
540cf75794 L10n code cleanup.
This was SVN commit r16892.
2015-07-29 23:44:05 +00:00
a07add11c6 Some range-based for loops and some style cleanup.
This was SVN commit r16888.
2015-07-29 01:07:23 +00:00
b4d517c261 Fix infinite loop in key code to key name mapping.
Also make some data const and construct data in-place.

This was SVN commit r16887.
2015-07-29 01:07:18 +00:00
851e863892 Remove animation name compatibility mapping.
10 years should have given everyone enough time to move to the new
naming scheme.

This was SVN commit r16884.
2015-07-27 01:08:29 +00:00
da48c8c26f Some const refs and one const function.
This was SVN commit r16882.
2015-07-27 01:08:25 +00:00
bd53e9d736 Remove unused ah_translate code.
This was SVN commit r16881.
2015-07-27 01:08:15 +00:00
f240374b28 Fix a number of short/long range pathfinder inconsistencies revealed by 128a603287.
This was SVN commit r16869.
2015-07-18 12:33:40 +00:00
128a603287 Use the terrain-only grid for terrain edges in the short pathfinder algorithm. This grid is updated on each terrain change, whereas the passability grid is updated once a turn. This caused OOS on rejoin, fixes #3292.
However, using the terrain-only grid reveals one discrepancy between the
short pathfinder (which uses unit radii) and the long one (which uses
unit clearances). So I implemented the change proposed by sanderd17 in
#3294, which is removing unit radius and using only the pathfinder
clearance. Refs #3294
Now some tweaking has to be done in the templates, so that units get a
passability class suited to their apparent size. In the meantime the
unit motion is quite bugged.

This was SVN commit r16867.
2015-07-18 08:37:49 +00:00
8fc4ecaa6b Fix previous commit, stupid typo...
This was SVN commit r16859.
2015-07-15 16:57:23 +00:00
b58f8ab969 Serialize the activation flag of the scripted Visibility component.
Currently only preview entities are affected, and they are not
serialized, but it could break a lot of things in the future.

This was SVN commit r16858.
2015-07-15 16:55:05 +00:00
39d93ea17c Change the handling of modified entities in the visibility update.
The game has to deal with situations such as: the visibility of an
entity changes, a mirage is created for it -> the mirage visibility is
updated -> the entity visibility is updated back.
All of this process now happens in the same turn, and all updates are
guaranteed to be performed. This fixes a source of serialization errors
and rejoin OOSes.

Fixes #3107

This was SVN commit r16857.
2015-07-15 16:46:59 +00:00
9f1b85d562 Remove a useless global terrain update when modifying environment settings in Atlas.
Also make sure that the settings are updated in the game view in a
non-hacky way.

This was SVN commit r16855.
2015-07-14 17:08:02 +00:00
04982b0bf5 Fix compiler warning
This was SVN commit r16849.
2015-07-12 16:49:26 +00:00
edf6e909b2 ...aaaaand I forgot this guy.
This was SVN commit r16846.
2015-07-12 08:11:30 +00:00
0d32afd688 Improve the style of GUI string text call functions.
This was SVN commit r16845.
2015-07-12 08:09:55 +00:00
0682190def Don't postpone rendering of icons when they are at the end of a GUI string.
Fixes #2502

This was SVN commit r16844.
2015-07-12 07:38:04 +00:00
0c45e3b5d0 Correctly compute the masks for shared visibility updates. The old code was working only because of luck when shared vision was always reciprocal.
Refs #2055, fixes #3327

This was SVN commit r16842.
2015-07-11 16:45:09 +00:00
aa78c1be66 Make the connectivity grid generation algorithm of the hierarchical pathfinder a bit less stupid.
This was SVN commit r16834.
2015-07-05 20:32:52 +00:00
11c9471ad6 Change back the long pathfinder to take into account non-pathfinding classes, but only when reloading, to avoid impacting the performance.
Also make the GetPassabilityClasses functions use references instead of
wild allocations. Use a reference when passing pass classes to the AI
worker.

This was SVN commit r16833.
2015-07-05 19:14:52 +00:00
0e4e3754e9 Update the passability grid properly when changing the map shape or the water height. Also include a fix for a possible bad memory access.
This was SVN commit r16832.
2015-07-04 21:25:57 +00:00
3018359576 Improve a little bit Atlas performance when modifying terrain elevation.
This was SVN commit r16827.
2015-07-01 19:13:56 +00:00
30e5f032d8 Adapt Atlas to the new pathfinder. Fixes #3298
This was SVN commit r16824.
2015-06-29 19:59:41 +00:00
e1a34eb4ea Handle (de)serialization of the AI pathfinder.
This was SVN commit r16815.
2015-06-24 20:24:58 +00:00
0b7343dccc Preserve the dirtiness informations of the passability grid at deserialization for proper AI updates.
Refs #3310

This was SVN commit r16814.
2015-06-24 20:15:06 +00:00
152d39d8a6 Fix save/load games, and use the new code to enhance the tests.
This was SVN commit r16812.
2015-06-23 20:39:11 +00:00
1793a96c14 Actually remove the unused expression.
This was SVN commit r16805.
2015-06-21 20:44:31 +00:00
495aa7bec5 Expose TemplateExists() to RM scripts.
This was SVN commit r16804.
2015-06-21 20:22:34 +00:00
c5814ef76c Fixes tests adding system components without using the SYSTEM_ENTITY id - this caused assertion failures in debug builds
This was SVN commit r16803.
2015-06-21 19:22:12 +00:00
ae4dfe294d Actually state the file instead of the directory in some error messages.
This was SVN commit r16802.
2015-06-21 18:46:33 +00:00
5a0b9b0e70 Fix some issues found by static analysis (clang-analyzer and cppcheck).
This was SVN commit r16801.
2015-06-21 18:46:31 +00:00
caa8f51c2e Annotate custom assert for clang-analyzer.
This was SVN commit r16800.
2015-06-21 18:46:23 +00:00
bbafed7fbf Lobby code cleanup.
This was SVN commit r16796.
2015-06-19 17:25:28 +00:00
1830c6346b Revert most of 989f164500, and add a comment to prevent people from making the same mistake.
This code used to make units with the pass class "ship-small" blocked
nearly everywhere.

This was SVN commit r16794.
2015-06-18 19:54:30 +00:00
c6ca83949c Prevent players from rejoining that were not present on game start. Patch by elexis. Fixes #3305.
This was SVN commit r16792.
2015-06-18 18:20:54 +00:00
9701a85554 Fix a possible problem with grid updates. Refs #3296.
This was SVN commit r16791.
2015-06-18 16:31:38 +00:00
e7707f0f0c Fix issue with OOS in replays. Patch by elexis
This was SVN commit r16790.
2015-06-18 15:29:03 +00:00
989f164500 Make the terrain analysis slightly more efficient for pathfinding passability classes, and fix a mistake introduced in 1709353e2c.
This was SVN commit r16787.
2015-06-17 20:48:41 +00:00
155c6e6ccd Properly initialize the AI pathfinder, and clean whitespace.
This was SVN commit r16786.
2015-06-17 20:35:23 +00:00
1709353e2c Changes the general behavior of non-pathfinding passability classes, in order to make the handling of foundation obstructions less difficult. This will allow the AI to be fixed, as reported in #3295.
Also some cleanup and comments updates.

Refs #3295.

This was SVN commit r16784.
2015-06-17 20:19:53 +00:00
b8fce56821 Implement sortable columns for the gui, and use them in the lobby. Patch by Vladislav. Fixes #2405.
This was SVN commit r16781.
2015-06-17 09:10:50 +00:00
c8a5708654 Fix tests.
This was SVN commit r16777.
2015-06-15 19:48:42 +00:00
8380b67f94 Move GUI schemas to the mod mod. Fix some validation related errors in the mod mod.
Check if the used directory exists before trying to add a validator.
Refs #245.

This was SVN commit r16773.
2015-06-15 16:00:26 +00:00
68ea5f37f4 Remove unused ctors. Fixes compilation with GCC 4.6.
This was SVN commit r16771.
2015-06-14 23:50:38 +00:00
4af117434d Fixes clang unused parameter warning
This was SVN commit r16770.
2015-06-14 23:45:15 +00:00
25a7d79d1e FIXE ERROR: CCmpPosition::GetPosition called on entity when IsInWorld is false, when you save a map with garrisoned units, thx to daniel for report
This was SVN commit r16769.
2015-06-14 22:17:39 +00:00
0a67de37bc Fixes clang warning about unknown warning group -Wunused-but-set-variable
This was SVN commit r16768.
2015-06-14 21:07:42 +00:00
473b282265 Refactor the grid update code. Should give a significant performance boost to the simulation update.
Also fixes some bad code that could lead to hidden bugs.

Fixes #3296, thanks elexis for testing ;)

This was SVN commit r16764.
2015-06-14 19:22:07 +00:00
0e7f0f861b Fixes A19 map converter script to be compatible with Python 2 (uses struct instead of to_bytes and from_bytes)
This was SVN commit r16763.
2015-06-14 17:53:12 +00:00
d676b047a0 Move ~LongPathfinder after the declaration of LongOverlay.
Also improve the style.

This was SVN commit r16762.
2015-06-13 21:02:01 +00:00
30efa73a38 FIX error: comparison between pointer and integer ('IReplayLogger *' and 'int') introduced in [16727] over osx
This was SVN commit r16754.
2015-06-13 02:42:21 +00:00
6581796103 New long-range pathfinder.
Based on Philip's work located at
http://git.wildfiregames.com/gitweb/?p=0ad.git;a=shortlog;h=refs/heads/projects/philip/pathfinder
Includes code by wraitii, sanderd17 and kanetaka.

An updated version of docs/pathfinder.pdf describing the changes in
detail will be committed ASAP.

Running update-workspaces is needed after this change.

Fixes #1756.
Fixes #930, #1259, #2908, #2960, #3097
Refs #1200, #1914, #1942, #2568, #2132, #2563

This was SVN commit r16751.
2015-06-12 18:58:24 +00:00
fd3d697edf Make it easier to add different backgrounds
This was SVN commit r16747.
2015-06-11 09:08:46 +00:00
7cac7cd65e Add RNC to RNG conversion script that uses trang. Fixes #245.
Also fix the material.rnc.

This was SVN commit r16734.
2015-06-07 23:52:52 +00:00
a18fbd12ec XML validation. Based on patch by historic_bruno. Refs #245.
This was SVN commit r16733.
2015-06-07 21:56:52 +00:00
2457b69fb3 Fix const attribute for some function parameters.
This was SVN commit r16730.
2015-06-07 09:24:19 +00:00
be93b31411 Visual replay of command files, patch by elexis.
Works with the command line argument
"-replay-visual=/path/to/commands.txt". It is not integrated to the main
menu GUI yet.

Refs #9.

This was SVN commit r16727.
2015-06-06 08:45:49 +00:00
14bfbbf9d4 Allow sprites to have color multiplication, which allows player-colored bars. Patch by Vladislav. Fixes #3233
This was SVN commit r16715.
2015-06-04 12:16:52 +00:00
f6f4f83784 Fixes instant multiplayer crash on OS X Lion (10.7). libc++ had a bug where it set eofbit on reading the last character in a stringstream, we compare gcount with the expected length as a workaround to detect real eofs. Fixes #3109.
This was SVN commit r16714.
2015-06-04 05:11:47 +00:00
6506bc20cb Fixes #3238, SetGlobal 'TriggerHelper' called multiple times
This was SVN commit r16713.
2015-06-03 20:34:59 +00:00
2092ed4396 Removes use of 'register' storage class, deprecated in C++11. Fixes -Wdeprecated-register build warnings in clang, fixes #3068.
This was SVN commit r16708.
2015-06-02 03:20:04 +00:00
c3b8923ff7 Update tinygettext.
Updates tinygettext to upstream commit
0e34a55e514763a48f8abe7812405ffe722a31f4.
No actual code changes from the previously bundled version, but it was
relicensed to zlib.
Keeps the addition of precompiled.h and win32 dirent.

This was SVN commit r16705.
2015-06-01 01:09:19 +00:00
f71be3c764 Use iterators for XMBAttributeList and XMBElementList. Fixes #3269.
This was SVN commit r16704.
2015-06-01 00:29:35 +00:00
d3da00dc99 Fix some issues found by static analysis.
Actually abort in case of recursive includes again. Refs #2622.

This was SVN commit r16703.
2015-06-01 00:29:23 +00:00
b738772d65 Fix typo
This was SVN commit r16696.
2015-05-29 19:51:48 +00:00
e68ef21334 Don't decay when connected to connected allied territory, and also allow the decay script to determine which parts of the territory should blink
This was SVN commit r16692.
2015-05-29 07:02:16 +00:00
e5727980da Adds debug output to display return code of failing SHGetFolderPathW, refs #3267
This was SVN commit r16688.
2015-05-27 02:02:32 +00:00
e638af5422 Clean up some unused variables and assignments.
This was SVN commit r16684.
2015-05-26 15:40:07 +00:00
4ccc9130ba Add missing include.
This was SVN commit r16683.
2015-05-26 15:40:04 +00:00
60f784900a Fix the territory influence weight to fit into an u16 number. (no idea why the buildings have so many different weights though).
This was SVN commit r16682.
2015-05-26 14:25:23 +00:00
0054486dba Implement methods to find the neighbour of a certain territory, and use it for territory decay. Fixes #3204
This was SVN commit r16676.
2015-05-25 14:17:45 +00:00
c93c1c92eb Replace std::auto_ptr uses by std::unique_ptr since the former is deprecated.
This was SVN commit r16674.
2015-05-25 01:23:27 +00:00
8b4b8431e3 Small cleanup, based on a change from one of Philip's old patches
This was SVN commit r16653.
2015-05-16 09:39:27 +00:00
a39aa76e62 These temporary roots aren't needed anymore with SpiderMonkey 31
This was SVN commit r16647.
2015-05-10 09:01:39 +00:00
399daeddbf prevent loading of templates in AIManager when no AIs, fixes #3101
This was SVN commit r16633.
2015-05-07 19:09:39 +00:00
8e44687ae3 Properly fix #3223.
The previous commit destroyed the context while it was still in use.

This was SVN commit r16631.
2015-05-06 20:28:28 +00:00
642500b49e Make the Ptolemaic lighthouse reveal the shore on the entire map.
Fixes #3174

This was SVN commit r16628.
2015-05-06 18:47:02 +00:00
4db041e3c6 Stop leaking g_ScriptStatsTable in replay mode. Fixes #3223.
This was SVN commit r16627.
2015-05-05 22:34:41 +00:00