Commit Graph

19560 Commits

Author SHA1 Message Date
4ca448a686 Fix Formation walking / other orders with the new UnitMotion
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.
2019-07-09 19:58:44 +00:00
a1dc9cadd8 UnitMotion / AI - remove the special 'move' animation, make UnitMotion inform the visual actor directly.
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.
2019-07-09 19:56:28 +00:00
09e129bce2 Adds an tool to pick water high by terrain click in Atlas.
Reviewed By: trompetin17
Differential Revision: https://code.wildfiregames.com/D2037
This was SVN commit r22445.
2019-07-09 18:16:55 +00:00
8a32b0b3d4 Fix some gcc 8 and gcc 9 compiler warnings that were thrown 4500 times.
Refs #5294
Differential Revision: https://code.wildfiregames.com/D2055
Reviewed By: Vladislav
This was SVN commit r22443.
2019-07-09 00:18:48 +00:00
7cf6244110 Formation animation refactor - use animation variants instead of special move override.
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.
2019-07-08 18:23:44 +00:00
3c3f85ce98 Unit Motion - remove m_State
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.
2019-07-08 18:09:21 +00:00
54ffd9df94 Various Unit AI fixes following UM / UAI changes
- 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.
2019-07-08 18:06:37 +00:00
01161e3451 Fix build without precompiled headers following the Atlas UTF8 fix in 800bf0da24 and ThreadUtil include removal in ba736916fc.
Differential Revision: https://code.wildfiregames.com/D2043
Reviewed By: Vladislav, wraitii
This was SVN commit r22437.
2019-07-07 21:52:52 +00:00
bb
61a346e55b Add damage container also in the examples, following f4babd9b34
Reviewed By: Nescio
Patch By: Freagarach
Differential Revision: https://code.wildfiregames.com/D1995
This was SVN commit r22436.
2019-07-05 18:15:42 +00:00
a70374b1da Improvements to gather order when out or resources and fix 8a38cfb7cf
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.
2019-07-04 19:55:09 +00:00
da2f644428 Adds a possibility to disable saving of replay in autostart mode.
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D2017
This was SVN commit r22432.
2019-07-03 21:36:40 +00:00
99a341f379 UnitMotion - account for target's movement in ComputeTargetPosition (improve chasing behaviour).
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.
2019-07-03 18:09:31 +00:00
58018a1056 UnitMotion - rename CheckTargetMovement to PathingUpdateNeeded for clarity, and improve the logic.
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.
2019-07-03 18:06:53 +00:00
f990cd2381 Ensure units do get in attacking range since that range can change over time because of elevation differences.
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.
2019-07-03 18:05:11 +00:00
8a38cfb7cf Return Gathering to A23 behaviour - Make units try to gather near the target resource's position instead of their position.
Units were incorrectly looking at resources near their position
following 7d53fb19a2.

Fixes #5477.

Differential Revision: https://code.wildfiregames.com/D2034
This was SVN commit r22428.
2019-07-03 17:57:16 +00:00
5fef05d780 UnitMotion - make ComputeTargetPosition return a position for point goals
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.
2019-07-02 07:29:31 +00:00
5568bd4c16 UnitMotion - Explicit handling of movement errors (such as target death) in Combat.Approaching
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.
2019-07-02 06:49:27 +00:00
ff9d162c8c Make sure states are exited if the movement update fails.
Differential Revision: https://code.wildfiregames.com/D1998
This was SVN commit r22423.
2019-07-01 19:51:21 +00:00
44aef27b78 Adapt unitMotion to edge-edge distance checks.
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.
2019-07-01 19:50:06 +00:00
d2c88acf44 Fix 3e43ddd869: s/target/this.gatheringTarget
Differential Revision: https://code.wildfiregames.com/D2032
This was SVN commit r22421.
2019-07-01 19:02:00 +00:00
bb
bdb742488a Cleanup UnitAI's FaceTowardsTarget function and allow units without a unitMotion in that.
Patch By: Freagarach
Differential Revision: https://code.wildfiregames.com/D2014
This was SVN commit r22420.
2019-07-01 12:32:57 +00:00
bb
3a77eb25d3 Fix ESLint semicolon-related warnings
Patch By: Krinkle
Differential Revision: https://code.wildfiregames.com/D2004
This was SVN commit r22419.
2019-07-01 11:09:19 +00:00
b20f357764 Don't use the opposite edge in UnitAI range checks.
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.
2019-06-30 19:05:04 +00:00
69d3e76fd2 Unit Motion - Stop when targets have an invalid position.
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.
2019-06-30 19:00:27 +00:00
3e43ddd869 Fix 0b41e8ee61, make units again properly hunt animals that died in FoW.
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.
2019-06-30 18:55:26 +00:00
f42d97c6f3 Fix some animals "roaming" state not working correctly (units seem stuck in place)
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.
2019-06-30 18:53:25 +00:00
a7573ae911 Fix IsInjured overwrite in 56ed4c1dc8
Reported By: wowgetoffyourcellphone
Differential Revision: https://code.wildfiregames.com/D2027
This was SVN commit r22412.
2019-06-29 19:42:58 +00:00
56ed4c1dc8 Fix IsInjured call on miraged entities.
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.
2019-06-29 17:17:07 +00:00
bb
445a5d8855 Clean up technologie data files:
- 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.
2019-06-28 15:58:21 +00:00
6cde90104a Update precompiled win32 libogg to 1.3.3 and libvorbis to 1.3.6, building them with VS2015, refs #5379.
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.
2019-06-27 22:36:04 +00:00
8babfe2330 Refactors camera projections - makes projection functions of camera more clear.
Reviewed By: elexis
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2012
This was SVN commit r22404.
2019-06-26 22:54:05 +00:00
ec4d84c72f Removes unused and obsolete LightingModel.
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.
2019-06-26 22:30:23 +00:00
3b77a0fba1 Update the minimap, range overlay renderer, and status bars when a player's color is changed in Atlas.
These were missing from 343ec21e75.

Patch By: temple
Differential Revision: https://code.wildfiregames.com/D1261
This was SVN commit r22402.
2019-06-26 19:16:57 +00:00
da13a6c734 Fix missing slash in common-api of entity. The mistype was introduced in c1e86161b5.
It wasn't found because it's not used at all. It was added in
07ea313ad6, and its usage was removed in 998dc21676.

Patch By: Angen
Differential Revision: https://code.wildfiregames.com/D1994
This was SVN commit r22401.
2019-06-26 18:04:33 +00:00
352ce9b41c Add the new keyword for BigTiger's maps.
Fixes 4ac8ea7989

This was SVN commit r22400.
2019-06-25 21:08:29 +00:00
fe2bb77e0f Skybox calculation - fix regression of 9376609ee8 introduced in 01a8138780
Audited By: vladislavbelov
Reviewed By: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1985
This was SVN commit r22399.
2019-06-25 19:23:57 +00:00
47256dca84 Add Krinkle to 0 A.D.'s programming credits
Reviewed By: Krinkle
Differential Revision: https://code.wildfiregames.com/D1990
This was SVN commit r22398.
2019-06-25 19:22:46 +00:00
844462b0c0 #5445
This was SVN commit r22397.
2019-06-25 05:05:06 +00:00
3573c87fc8 Makes rendering helpers (culling camera, frustums) be available through the developer overlay.
It helps to test/debug patches like D1847.

Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1972
This was SVN commit r22395.
2019-06-23 20:17:44 +00:00
98f6866814 Remove two duplicate textures and models. They were incorrectly added in 4981cdedad in the flow of new objects.
Noticed by: @elexis
This was SVN commit r22394.
2019-06-22 20:50:47 +00:00
abc0beb07d Teak, dragon bamboo, scaled down some baked normal and ao maps larger than the base map, minor edits to areca palm
This was SVN commit r22392.
2019-06-19 08:16:38 +00:00
1c4de428cb may have forgotten an actor file, also areca palms
This was SVN commit r22391.
2019-06-18 17:57:13 +00:00
b77336b491 bananas and strangler figs
This was SVN commit r22390.
2019-06-18 16:04:28 +00:00
6d0a91a886 Fix a little glitch on the Athenian storehouse.
Reported by: @vladislavbelov.
This was SVN commit r22389.
2019-06-18 12:14:54 +00:00
44d699b432 Remove three unused capes.
This was SVN commit r22388.
2019-06-18 09:34:15 +00:00
afca278486 Improve starting position camera for Oceanside (2)
Patch by: BigTiger
This was SVN commit r22387.
2019-06-17 22:34:41 +00:00
4ac8ea7989 3 New temperate maps by BigTiger.
This was SVN commit r22386.
2019-06-17 18:24:09 +00:00
0df4d130cf New particle actors by BigTiger.
This was SVN commit r22385.
2019-06-17 18:23:41 +00:00
1d841a71fe New terrain textures by BigTiger for the temperate biome.
This was SVN commit r22384.
2019-06-17 18:23:16 +00:00
4981cdedad New bushes, trees (Oaks, firs, Birch) by Big Tiger, as well as new cliffs, and decals.
This was SVN commit r22383.
2019-06-17 18:22:07 +00:00