1
0
forked from 0ad/0ad
Commit Graph

19510 Commits

Author SHA1 Message Date
4967d176b9 Define variables before mentioning them in scripted component tests, and add a linter rule for this.
Patch By: Krinkle
Differential Revision: https://code.wildfiregames.com/D1986
This was SVN commit r22380.
2019-06-16 20:48:28 +00:00
f4babd9b34 Wrap damage types in a Damage element in XML templates to prepare for genericizing them.
Patch By: Freagarach
Reviewed By: Wraitii
Differential Revision: https://code.wildfiregames.com/D1950
This was SVN commit r22379.
2019-06-16 17:08:27 +00:00
61db02790c Fix cppformat failures on MacOS tests.
cppformat tests failed on MacOS - the global locale was not set and
defaulted to something unexcpeted.
It is now fixed to US notation.

Patch By: Krinkle
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1978
This was SVN commit r22378.
2019-06-16 15:25:17 +00:00
9e8a43401e fixed anomaly in doum palm
This was SVN commit r22377.
2019-06-15 19:43:22 +00:00
7a25c9e88e Holly oaks, fixing some weird normals on the atlas cedar, and a few edits to the quarry stone and texture maps I don't remember doing, but I can trust past me to have made good decisions, right?
This was SVN commit r22376.
2019-06-15 19:00:12 +00:00
190f8d3566 Calculate entity limit counts correctly when SpawnUnits fails in ProductionQueue.
When adding a batch of unit, these in-training units get added to the
production queue and to the entity limit count.
These in-training units need to be removed from the entity limit counts
when spawning them, or we would be double-counting them. This was done
when creating the cached entities, but this was too early: entities
might fail to spawn, for example when there is no room around the
foundation.

Change that so the entity limit count is now decremented right before
giving spawned entities the correct owner (which triggers EntityLimits
OnGlobalOwnershipChanged, which adds the spawned entities to the entity
limit count).

Additionally, add Init to TrainingRestrictions so that the test setup
doesn't complain. Other components have an empty Init instead of
checking for Init in the test setup (and 61/67 have an Init function) so
it seems more standard this way.


Reported By: elexis
Reviewed By: wraitii
Patch By: Angen
Tests By: wraitii
Differential Revision: https://code.wildfiregames.com/D1879
This was SVN commit r22375.
2019-06-15 17:27:24 +00:00
5992943f43 Fix resource-returning order sometimes not working correctly (introduced by 0c20afdfda)
Differential Revision: https://code.wildfiregames.com/D1975
This was SVN commit r22374.
2019-06-15 15:07:27 +00:00
d1fb66d2a7 Cleanups BoundingBoxAxisAligned and fixes coding styles a bit.
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1951
This was SVN commit r22372.
2019-06-12 20:23:14 +00:00
3e53d05298 Fixes includes and forward declarations in CPatchRData.
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1952
This was SVN commit r22371.
2019-06-12 20:03:22 +00:00
2bcf4f678b Refactors Developer Overlay using an object instead of global functions.
Reviewed By: wraitii
Commented By: elexis
Differential Revision: https://code.wildfiregames.com/D1928
This was SVN commit r22370.
2019-06-12 19:21:44 +00:00
63e1c9ff1a Fix typo in 0b41e8ee61.
This was SVN commit r22368.
2019-06-11 20:09:40 +00:00
0b41e8ee61 Fix leftovers from 0c20afdfda - improve repairing, chasing and fleeing behaviour.
0c20afdfda made states more caller-independent but did not change some
callsites to be compatible with that. This fixes those.

This does not fix chasing entirely however since unitMotion does not
always recognize that the target moved enough that the entity will never
be in range.
This will be fixed upstream.

Differential Revision: https://code.wildfiregames.com/D1968
This was SVN commit r22367.
2019-06-11 20:06:25 +00:00
98f609df1d UnitMotion - Change "Possibly At Destination" logic.
UnitMotion will now send hints that a move may be completed if:
- it is a formation member and the formation member has stopped moving.
- it isn't and it is in range from its target.

Differential Revision: https://code.wildfiregames.com/D1899
This was SVN commit r22366.
2019-06-11 19:52:40 +00:00
8ac104b07a Fix 'gliding' behaviour at the end of movement by moving the PossiblyAtDestination check earlier.
Units in 0 A.D. exhibited a "gliding" behaviour at the end of a
movement, e.g. they switched to the Idle animation and still moved a
little bit.

The reason for this behaviour is that entities check if they reached
their destination after moving. Other components (unitAI mostly) will
then possibly change animations and such, resulting in a movement over
the turn while the entity is possibly now in another animation state
than "move".
Instead, what should be done is checking if the entity has arrived
before moving, so if UnitAI calls StopMoving, then entity won't move at
all on the same turn, and the gliding effect vanishes.

The STATE_STOPPING state is made un-necessary by this change, since this
off-by-one mistake was the reason for its existence. It can be removed
(see downstream).

Differential Revision: https://code.wildfiregames.com/D1898
This was SVN commit r22365.
2019-06-11 18:51:55 +00:00
f04bdd84ae UnitMotion - Split Move() into several functions
Move() is generally 4 parts:
- Moving
- Updating our state
- Handling obstructed moves
- Checking if we are at destination.

These can all be put in their own functions, clarifying logic and making
it harder to make mistakes.

Differential Revision: https://code.wildfiregames.com/D1897
This was SVN commit r22364.
2019-06-11 17:25:59 +00:00
ad4594e55d UnitMotion - move TryGoingStraight before the core of the 'Move' logic
In preparation for D1897, this logic isn't related to the "movement"
part of Move(), and can be called earlier.

Differential Revision: https://code.wildfiregames.com/D1896
This was SVN commit r22363.
2019-06-10 19:35:02 +00:00
36341b5d6c UnitMotion - Handle obstruction moving flag similarly to m_CurSpeed
The obstruction manager keeps a flag of moving units. This should be
updated in the same location as the entity's current speed, since they
have similar properties.

Differential Revision: https://code.wildfiregames.com/D1895
This was SVN commit r22362.
2019-06-10 19:33:24 +00:00
1adf9560b8 Unit Motion - update our current speed even when we have not moved.
VisualActor refers to unit motion's `m_CurSpeed` to know what animation
to display in the special walk mode. However that variable was
inconsistently updated. By making sure we reach that codepath in one
place, we remove opportunities for issues.

This should fix most existing instances of moonwalking, another upstream
diff will fix the rest.

Differential Revision: https://code.wildfiregames.com/D1894
This was SVN commit r22361.
2019-06-10 18:27:27 +00:00
017cb504ee Drop an indentation level in UnitMotion.
This will simplify later changes.

Differential Revision: https://code.wildfiregames.com/D1893
This was SVN commit r22360.
2019-06-10 17:15:27 +00:00
eee977fd7d Fix wrong actor file for persian cavalry javelinist base actor when gathering meat
Patch by: @Angen
Differential Revision: https://code.wildfiregames.com/D1967
This was SVN commit r22359.
2019-06-10 10:13:24 +00:00
641a1a4b85 Remove duplication of attack variant from Kush hero 'hero_infantry_archer_amanirenas.xml'.
Patch by: @Angen
Differential Revision: https://code.wildfiregames.com/D1966
This was SVN commit r22358.
2019-06-10 10:11:07 +00:00
70e22e2923 Unit Motion - Face point when calling StopMoving()
FacePointAfterMoving intends for the unit to face the destination once a
move is done. Since 4fda917f46, stopping is the responsibility of UnitAI
(through a call to StopMoving()). Thus we should move that code in that
function, as this ensures we don't forget to do it and removes
duplications.

Differential Revision: https://code.wildfiregames.com/D1889
This was SVN commit r22355.
2019-06-09 17:06:24 +00:00
f2db913a7d Unit Motion - remove the m_Moving variable
The variable is not necessary since having a target is equivalent,
removing it thus reduces redundant state.

Differential Revision: https://code.wildfiregames.com/D1888
This was SVN commit r22354.
2019-06-09 17:04:18 +00:00
6e6f7699d0 Fix repairing/garrisoning range checks following 4fda917f46
4fda917f46 introduced mistakes in range checks which sometimes broke
garrisoning and repairing.

Reported By: gameboy
Differential Revision: https://code.wildfiregames.com/D1963
This was SVN commit r22353.
2019-06-09 16:59:27 +00:00
4a15cc3b9f Unit Motion - wrap target state into a struct
These variables together held the state for the target of UnitMotion, as
set by the MoveTo[X] family of functions.
Wrapping them in a struct reduces the chances that one will accidentally
forget to reset part of the state and makes it explicit in-code that
these are grouped together.

Calling StopMoving() resets this target, which wasn't before and left
the component in an incoherent state.

Differential Revision: https://code.wildfiregames.com/D1887
This was SVN commit r22352.
2019-06-09 11:18:06 +00:00
4fda917f46 Prevent UnitMotion from stopping on its own, and rename "MoveCompleted" to "MovementUpdate"
UnitAI is now solely in charge of moving and stopping, making UnitMotion
behaviour easier to predict, which will ultimately help with unitAI
development. It might temporarily make units more resilient than before
however.

UnitMotion also tells UnitAI that it's arrived with "MoveCompleted"
messages, but these actually could be wrong - unitAI could decide that
we didn't want to stop after all - so change the name for something less
misleading.

Differential Revision: https://code.wildfiregames.com/D1886
This was SVN commit r22351.
2019-06-09 11:16:40 +00:00
27b686215a Remove "MoveStarted" messages
"MoveStarted" messages were sent by UnitMotion when the unit started
moving (sort of) or failed to do so. This was used by formations and
guarding but was not really necessary as this can be done in "enter" or
in a timer.

Differential Revision: https://code.wildfiregames.com/D1885
This was SVN commit r22350.
2019-06-08 12:53:28 +00:00
08bfcf144b Allow techs to affect unit counters stats.
Reviewed by: @wraitii
Differential Revision: https://code.wildfiregames.com/D1782
This was SVN commit r22346.
2019-06-06 20:44:30 +00:00
c219ee54b2 Move "IsInRange" family of functions to the Obstruction Manager and make the commutative.
These functions were placed in UnitMotion, which had nothing to do with
range checks and made them available only to moving entities for no
particular reason.

This patch also adds support for square-square range checks and
shape-shape distance checks.

Modified from a patch by bb on top of work from wraitii.

Differential Revision: https://code.wildfiregames.com/D981
This was SVN commit r22345.
2019-06-06 19:37:23 +00:00
ba736916fc Clean up ThreadUtil, use standard C++11 constructs instead of custom ones.
ThreadUtil shipped a scope lock and a mutex implementation, which can be
removed since we now have these in the standard library.
This lets us clean up this header which get included everywhere (through
profiler includes).

Tested By: Angen and Stan
Differential Revision: https://code.wildfiregames.com/D1915
This was SVN commit r22344.
2019-06-06 19:30:48 +00:00
7c88828814 Add a glow material that supports normal maps as well.
This was SVN commit r22343.
2019-06-05 23:17:37 +00:00
7d53fb19a2 Additional fixes following 0c20afdfda - units no longer return to gather nearby resources when depleting a chicken/tree/...
Reuse the timer code in the gathering sub-state to avoid broken
duplication.

Reported By: minohaka
Test By: Angen
Differential Revision: https://code.wildfiregames.com/D1956
This was SVN commit r22342.
2019-06-05 20:44:43 +00:00
3ac1a004fa Fixes black water glitches for certain wind angles with the approximate solution.
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1804
This was SVN commit r22341.
2019-06-05 20:13:31 +00:00
70ccc3e5cb Adds Camera test for ortho projection.
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1948
This was SVN commit r22340.
2019-06-05 19:55:37 +00:00
dd67d0769e Resolve issues with 0c20afdfda - unitAI order cleanup and unitMotion MoveTo change
0c20afdfda had two issues:
- some of the unitAI code did not return true when switching states in
the "enter" phase
- missed a return false in unitMotion.cpp

This fixes the issue noticed by @bb.

Differential Revision: https://code.wildfiregames.com/D1947
This was SVN commit r22339.
2019-06-05 17:27:12 +00:00
f97213187e Version and update the Windows autobuilder script, refs #5379.
Patch by Angen, based on the previous bat script for the autobuilder
job.
Comments by Stan.
Differential Revision: https://code.wildfiregames.com/D1909
This was SVN commit r22338.
2019-06-04 16:48:22 +00:00
37e5097ea9 Fix a m_JumpPointCache assertion failure in debug mode, refs fa726867f1.
Patch By: Stan
Comments By: wraitii
Differential Revision: https://code.wildfiregames.com/D1942
This was SVN commit r22336.
2019-06-04 08:29:47 +00:00
800bf0da24 Improve UTF-8 character handling in Atlas
(Also prevents the compile-time warnings reported in the abandoned
D1432)

Accepted by: Itms
Patch linting by: Stan, Vladislav, wraitii
Also tested by: Imarok
Fixes: #4936
Differential Revision: https://code.wildfiregames.com/D1395
This was SVN commit r22335.
2019-06-03 20:19:53 +00:00
4b65cc0317 Fixes a typo introduced in cb048b4738 in shore calculations, found by Angen and fixes style notes by elexis.
Reviewed By: Angen
Differential Revision: https://code.wildfiregames.com/D1949
This was SVN commit r22334.
2019-06-03 20:19:18 +00:00
f4194df416 Removes unused variable from ModelRenderer introduced in 6bc33fe8bd. Found by Angen.
Patch By: Angen
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1812
This was SVN commit r22333.
2019-06-03 20:06:01 +00:00
wackyserious
9618c1fc2f Roman helmets texture recolor
-Adjusted the hue and saturation of the textures to achieve visual
uniformity.

Reviewed by: Stan
This was SVN commit r22331.
2019-06-01 10:44:01 +00:00
2b5aaad399 Revert 899714f667 to faciliate committing it again with credit in the commit message.
Agreed with: wraitii and liked by vladislavbelov in
https://wildfiregames.com/forum/index.php?/topic/26104-leper-attribution-request-899714f667/
Refs D1504

This was SVN commit r22330.
2019-05-31 21:56:13 +00:00
bb
7d25ab3a45 Merge persian and mauryan Archery Tradition technologies
Add the tech to ranges, and make them also pop upin captured barracks

Patch By: Nescio
Differential Revision: https://code.wildfiregames.com/D1941
This was SVN commit r22329.
2019-05-31 21:35:30 +00:00
bb
658a5a8dd1 Rename Stables class to Stable since we use the singular forms.
Fixes 964934cf4e

Patch By: Angen
Reviewed By: Nescio
Differential Revision: https://code.wildfiregames.com/D1890
This was SVN commit r22328.
2019-05-31 20:47:57 +00:00
5ecacc60f0 Fix the smoothing group issue reported by @vladislavbelov on the chat today, that is made more visible by https://code.wildfiregames.com/D1925.
- Rename civil_centre to civic_center
- Rename the shield prop object to a more explicit name.
- The template and the rubble template should be renamed in another
commit to make sure that do not affect the AI.

This was SVN commit r22327.
2019-05-31 13:21:58 +00:00
bb
bd26f04e5a Set ship status bars in parent
Patch By: Nescio
Reviewed By: wraitii
Comments By: Imarok, Stan
Differential Revision: https://code.wildfiregames.com/D1842
This was SVN commit r22326.
2019-05-31 12:00:49 +00:00
bb
e7f720d7bc Reduce defensive_wall* duplication
Including:
Remove LongWall from gates
Change the ("unused") gate cost component in more reasonable number and
adapt the repairTimeRatio with it to keep the health/second the same

Patch By: Nescio
Differential Revision: https://code.wildfiregames.com/D1794
This was SVN commit r22325.
2019-05-31 11:17:10 +00:00
ddcdc643ba Further cleanup of MikkTSpace
- Move the * and & to the correct side,
- Add .0 and  0.f to clearly mark the types
- Pass pointers instead of arrays
- Add a newline after forward declaration
- Add spaces between operators
- Use c++ cast

Reviewed by: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1934
This was SVN commit r22323.
2019-05-30 23:03:01 +00:00
bb
4495467e65 Seperate stable from barracks
Including:

    moves template_structure_military_barracks_stables.xml to
template_structure_military_stable.xml
    updates all its children accordingly
    merges values from pers_stable.xml into the new generic template
    changes generic name Stable (singular, without s)
    standardizes rubble sizes to 5x5 (pers had 4x4)
    corrects specific name for Greek factions
    adds foundation actor to kush_stable.xml

Patch By: Nescio
Comments By: Angen
Differential Revision: https://code.wildfiregames.com/D1790
This was SVN commit r22322.
2019-05-30 21:00:18 +00:00
2cf1f85d7e Fixes tests compilation after ebfec91057. Found by Angen.
Reviewed By: Angen
Differential Revision: https://code.wildfiregames.com/D1937
This was SVN commit r22321.
2019-05-30 17:27:55 +00:00