Commit Graph

802 Commits

Author SHA1 Message Date
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
3febc387d5 Styling fixes.
This was SVN commit r17241.
2015-11-12 17:23:50 +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
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
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
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
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
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
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
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
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
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
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