m_PathState kept 3 pieces of information that can be deduced using other
variables:
- whether the entity was following a path. This can be better deduced
by checking if the entity has short/long waypoints.
- whether a path is currently being requested. This can be better
deduced by checking the value of m_ExpectedPathTicket
- whether the requested path is long or short. This can be stored
directly alonside the path request ticket number, making it more obvious
why it exists.
With these changes, m_PathState can be removed.
Differential Revision: https://code.wildfiregames.com/D1903
This was SVN commit r22456.
Fixes macOS linker warning "PIE disabled absolute - addressing not
allowed".
Updates nettle to 3.5.1, GnuTLS to 3.6.8, gloox to 1.0.22.
Disables TCP fast open feature of GnuTLS (requires 10.11, no SDK build
support).
Fixes GnuTLS detection of GMP by adding it to LIBS flag.
Disables getaddrinfo on gloox 1.0.22. Lobby connections failed during
server hostname resolution.
Adds --with-pic to GMP build to force consistent PIC usage.
Adds -N flag to patch commands to avoid reapplying them.
Removes unneeded build flags.
Documents --enable-fat configure flag: GMP and nettle detect
CPU-specific features, fat binaries let us build and run them on
different CPUs (see D1772).
Fixes#5453, 5489. Refs #5481.
Tested by: kali0ad, trompetin17
Reviewed by: elexis, trompetin17
Differential Revision: https://code.wildfiregames.com/D2057
This was SVN commit r22455.
It is generally better to use the movement request data as that is our
actual target and goals are just a representation of that at any given
time. Where a PathGoal is required, compute this lazily.
This allow failing easily in MoveToX() functions if the goal cannot be
computed.
Differential Revision: https://code.wildfiregames.com/D1902
This was SVN commit r22452.
Introduced by 70e22e2923. PositionChanged messages sent between
MT_Destroy handling in CmpObstruction and the actual destruction of the
component could re-recreate an obstruction, which would then live
forever in the obstruction manager.
This prevents that by de-activating the obstruction when it is
destroyed, so that further PositionChanged messages do nothing.
Differential Revision: https://code.wildfiregames.com/D2060
This was SVN commit r22451.
MoveToPoint and MoveToTarget both compute a goal from a move request.
They can be combined to reduce duplication and streamline the code.
Differential Revision: https://code.wildfiregames.com/D1984
This was SVN commit r22450.
HandleObstructedMove contains logic to drop long waypoints, should they
be occupied by units (because that can get the pathfinder stuck, since
the long-range pathfinder can find a path, but not the vertex one).
However PathResult already drops waypoints this way, so this code can be
removed for simplification.
Differential Revision: https://code.wildfiregames.com/D1981
This was SVN commit r22448.
This fixes a number of issues with formations:
- Gives the controller an obstruction. This fixes the bug where units in
formations can't gather from a tree.
- Stop special-casing formation members in PathResult. This fixes
formation members being stuck in-place when they run in an obstruction.
- Makes sure units stay in Formation.IDle when they are idle so that
D1337/D1901 can work correctly in the IDLE state.
- Warn if animals enter this state.
- Make sure that formation members that end up in INDIVIDUAL.IDLE go
back to FORMATION.IDLE for sanity and for better housekeeping (refs
#3144 - fixed completely upstream).
Differential Revision: https://code.wildfiregames.com/D2048
This was SVN commit r22447.
Use UpdateMovementState to inform the visual actor of the unit's speed,
which cill update the movement animation accordingly.
The removes the need for UnitAI to handle movement animation using the
special "move" state.
Differential Revision: https://code.wildfiregames.com/D1901
This was SVN commit r22446.
The animation overrides are a little awkward. Instead, use animation
variants, which allow defining different animations (and props and such)
easily for different units in a formation.
This lets us clean up the special C++ code to override the walk
animations.
It continues the work started by 8446b92f1b.
Original Patch By: temple
Differential Revision: https://code.wildfiregames.com/D1337
This was SVN commit r22442.
Following D1899/98f609df1d, we have logic that can handle calling
MoveSucceeded() even if we don't go through the special STATE_STOPPING
state, and following D1898/8ac104b07a we no longer need STATE_STOPPING
for animation sync either.
m_State can therefore be entirely removed as it is redundant with other
information.
Differential Revision: https://code.wildfiregames.com/D1900
This was SVN commit r22441.
- Garrisoning cleanup (return true in some cases in ENTER when we do
change the state)
- Fix animal walking speed until D1901 lands
- Fix trading behaviour which occasionally bugged out.
Differential Revision: https://code.wildfiregames.com/D2045
This was SVN commit r22440.
8a38cfb7cf introduced an issue, as it expected "this.order.data.initPos"
to always exist. But going through `GatherNearPosition` did not set it.
Fix this by setting that variable in `GatherNearPosition`.
Use the opportunity to still fallback to the unit's position if the
variable were to not exist for some reason (defensive programming
against future changes).
Re-enable "return resource" behaviour as the final fallback case - The
GatherNearPosition call previously always passed thus this no longer
triggered.
Possible follow-up: try gathering near the dropsite found.
Differential Revision: https://code.wildfiregames.com/D2039
This was SVN commit r22434.
After the recent UM changes, units sometimes chase/flee forever as they
can never actually get in range.
This is because moving to the current target's position is not enough
when the target is moving.
By accounting for the target movement's in ComputeTargetPosition, the
behaviour is much improved.
Differential Revision: https://code.wildfiregames.com/D1987
This was SVN commit r22431.
This new version compares the final waypoint with the target's
obtruction shape and uses reachability checks to know if we will be in
range or not.
Differential Revision: https://code.wildfiregames.com/D1983
This was SVN commit r22430.
This is a partial revert of 4fda917f46, which skipped the
"MoveToTargetAttackingRange" in APPROACHING. I (incorrectly) assumed
that the original order was still perfectly fine, but in fact the
attacker's max range may have changed as that depends on the relative
elevation between attack and target - and so the original order might
never get us in range!
This was introduced originally in 8c74df2acd.
Add a comment to clarify this.
Further, this makes sure UnitMotion still is aware that it has a target
even if it is in range from the beginning, as that could lead
to stuckiness (and did when chasing sometimes). This was done in D1984
anyways.
Fixes#5478.
Differential Revision: https://code.wildfiregames.com/D2035
This was SVN commit r22429.
This makes it possible to merge the TryGoingStraightTo family of
function.
This means it is now called even for point goals and decreases the
likelihood of stuck units (as we take over from the long-range
pathfinder which brings units to navcell centers, which may not be in
the goal).
Differential Revision: https://code.wildfiregames.com/D1982
This was SVN commit r22426.
In A23, units that are approaching an enemy (Combat.Approaching) will
carry on moving to their last waypoint if the target dies, and then go
idle.
As of 69d3e76fd2, this no longer happens and units stop in their tracks,
staying in attacking forever.
This lets Combat.Approaching explicitly handle the error, deciding what
is best to do:
- go to the next order (for hunting and queued orders)
- find new targets nearby (in case the attack wasn't a forced order)
- walk to the target's last known position and find units to attack
there (in case it was). This is A23 behaviour.
Differential Revision: https://code.wildfiregames.com/D1992
This was SVN commit r22425.
D981/c219ee54b2 changed IsInXChecks to use edge-to-edge distance instead
of centre-to-edge, which broke UnitMotion's min-range movement, which
assumed distance to the center.
Since units are represented as squares, the diagonal point may be closer
to the target than the "real" clearance by a factor √2, so the delta
between minimum range and maximum range should be at least `(√2 - 1) *
clearance` to be safe in all situations (this is generally not a problem
for regular units which have a clearance of 0.8, but could be one for
catapults or elephants).
Differential Revision: https://code.wildfiregames.com/D1969
This was SVN commit r22422.
For now, we use the nearest-edge to nearest-edge distance for min-range
checks (following much discussion on D981).
This was missed when committing it in c219ee54b2.
UnitMotion was already correctly not using opposite edge checks.
Differential Revision: https://code.wildfiregames.com/D2031
This was SVN commit r22416.
Previously, unitMotion had no code that checked particularly if the
target was still in the world.
When the target moved out of the world, unitMotion would follow the path
to its last known position, then send a "MoveSucceeded" message once
there.
Following 98f609df1d, this message was no longer sent. Thus unit would
follow their path to its last waypoint and stay there, unable to carry
on or finish the order. UnitMotion now explcitly sends a "MoveFailed"
message.
This still changes behaviour from A23, requiring further revisions to
UnitAI (see D1992 for one such case).
Minohaka tested an earlier version of this change (which incorporated
D1992) and accepted it.
Differential Revision: https://code.wildfiregames.com/D1979
This was SVN commit r22415.
The reason was that the unit immediately tried gathering nearby instead
of going to the unit's last known position.
Related to D1997.
Differential Revision: https://code.wildfiregames.com/D1996
This was SVN commit r22414.
Due to an issue in 4a15cc3b9f, animals incorrectly tried going towards
the roaming point instead of away from it.
With that fixed, MovementUpdate still did not trigger as the min and max
range were the same.
Use -1 as max range (= infinite) instead since we want to move
arbitrarily away.
Having an infinite max range was broken in c219ee54b2, this
re-implements that.
Further, other calls with equal min and max range have been changed
likewise.
This does not entirely fix whales, which run in other problems because
of their large roaming range.
Differential Revision: https://code.wildfiregames.com/D1980
This was SVN commit r22413.
ea208f19a3 introduced an "IsInjured" function, used in the GUIInterface.
Mirages must mock this function and this was missed in the original
diff.
Tested By: wowgetoffyourcellphone
Differential Revision: https://code.wildfiregames.com/D2018
This was SVN commit r22411.
- put modification each on an own line
- space/tab correct
- space correct objects
- remove trailling 0's
Partially requested by: Stan
Patch By: Nescio
Differential Revision: https://code.wildfiregames.com/D1953
This was SVN commit r22408.
Use the default naming for both libraries (libvorbis instead of vorbis),
and use our default suffix for debug versions of the libs.
This was SVN commit r22406.
It was introduced in d295dacb9b as a way to control behavior of shaders.
Its usage in shaders was completely removed in 05008d190e (before that
in b7888aea52).
Reviewed By: elexis
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2011
This was SVN commit r22403.
It helps to test/debug patches like D1847.
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1972
This was SVN commit r22395.