1
0
forked from 0ad/0ad
Commit Graph

21788 Commits

Author SHA1 Message Date
0e7fafebe1 Refuse to serialize NaN values.
NaN values could not be serialised safely because of the multiple
possible NaN numbers.
Since NaN values are usually the result of bugs or dangerous code, it
seems simpler to refuse to serialise them.

(D3205 was a safe-serialization alternative, should the need arise).

Fixes #1879

Differential Revision: https://code.wildfiregames.com/D3729
This was SVN commit r25151.
2021-03-28 16:48:25 +00:00
f6a2d6da63 Fix degenerate case in UnitMotion resulting in lag.
9d82ae15af introduced logic to extend the search range of the short
pathfinder in some situations. This extension was unbounded, resulting
occasionally in search domains several hundred meters wide, and path
computation that can take several seconds.

Reported by: Vico (on the forums).
Differential Revision: https://code.wildfiregames.com/D3760
This was SVN commit r25150.
2021-03-28 13:12:51 +00:00
4146428825 Update build/ dockerfiles & jenkinsfiles
This reflects their current state on the VM/Jenkins.

Differential Revision: https://code.wildfiregames.com/D3133
This was SVN commit r25149.
2021-03-28 13:02:06 +00:00
37cc13010c Fix missing context in hotkey page translations.
Patch by: nwtour
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D3754
This was SVN commit r25148.
2021-03-28 07:59:38 +00:00
b477892440 Fix issues in 87a2c3347f
Fixes 87a2c3347f:
- NoPCH was broken
- two warnings slipped through.

Differential Revision: https://code.wildfiregames.com/D3751
This was SVN commit r25147.
2021-03-28 07:01:34 +00:00
2ee0e62a0e Fix 1adedf447c and 31808e6fa3
Fix 1adedf447c and 31808e6fa3.

Patch By: Nescio
Differential Revision: https://code.wildfiregames.com/D3752
This was SVN commit r25146.
2021-03-28 07:01:03 +00:00
d533084d7c Removes unused code from Size2D and changes eol-style to native.
This was SVN commit r25144.
2021-03-27 21:11:36 +00:00
db84c2a9b2 Moves CSize into a separate file and renames it to CSize2D according to other geometric entities.
This was SVN commit r25143.
2021-03-27 16:08:06 +00:00
fa3e501f8f Makes EAlign more consistent with other enums by CC.
This was SVN commit r25142.
2021-03-27 12:07:38 +00:00
6332760528 Removes implicit default value operator for CGUIColor.
This was SVN commit r25141.
2021-03-27 11:47:49 +00:00
734b672569 Removes unused and limited cell sprite functionality.
Tested By: Freagarach
Differential Revision: https://code.wildfiregames.com/D3749
This was SVN commit r25140.
2021-03-27 11:38:34 +00:00
f884848745 Move Can*-function implementations from UnitAI to their respective components.
Makes for less duplicated logic, easier modding and better split
responsibilities.

Differential revision: D3638
Closes: #5884

This was SVN commit r25139.
2021-03-27 11:22:34 +00:00
d0de32b2a8 Fix 8bd7a4f4b5 - crossbowman introduced in 7bf2f9ed74
This was SVN commit r25138.
2021-03-27 09:48:30 +00:00
31808e6fa3 Fix 1adedf447c
The patch did not apply cleanly and I failed to notice it when merging.

This was SVN commit r25137.
2021-03-27 09:45:03 +00:00
1adedf447c Remove the attack from wall turrets.
Wall turrets/towers have more HP & are cheaper than free-standing
towers, and have no build restriction distance. Their attack, while
limited, is still high when garrisoned, and this makes them awkward to
balance and is poor design in general.
This removes their attack capability entirely, and standardizes the rest
of their statistics.

Patch by: Nescio
Accepted By: borg-, wowgetoffyourcellphone, wraitii
Differential Revision: https://code.wildfiregames.com/D3706
This was SVN commit r25135.
2021-03-26 17:35:51 +00:00
0baeb8d1fd Increase gather rate technology effects / revert 3731886e2c
Reverts D3404 / 3731886e2c, thus making economic technologies more
effective.
The lower values led to resource shortages in the late game.

Patch by: Nescio
Accepted By: borg-, chrstgtr, wowgetoffyourcellphone
Differential Revision: https://code.wildfiregames.com/D3703
This was SVN commit r25134.
2021-03-26 17:30:25 +00:00
29ab4b5af3 Exclude Towers from Town->City phase requirements.
Towers, unlike walls, palisades, and outposts, counted towards the
required Town Phase structures for City Phase. Given the requirement to
build 4 structures, this pushed players into making them.

This removes that, and lowers the requirement to 3.

Patch by: Nescio
Accepted By: ValihrAnt, borg-, wowgetoffyourcellphone, wraitii
Differential Revision: https://code.wildfiregames.com/D3686
This was SVN commit r25133.
2021-03-26 17:21:03 +00:00
5376ed3e10 Unlock the Iberian monument in Town Phase
This can give Iberian an edge at defensive play earlier, fitting their
civ theme.

Approved by: borg-, wowgetoffyourcellphone, berhudar
Differential Revision: https://code.wildfiregames.com/D3685
This was SVN commit r25132.
2021-03-26 17:14:14 +00:00
4ca8cb70dd Change 'Archery Tradition' tech to an attack range increase.
This new bonus makes the tech more predictable.
Cost has been reduced slightly.

Patch by: Nescio
Differential Revision: https://code.wildfiregames.com/D3671
This was SVN commit r25131.
2021-03-26 17:09:16 +00:00
ac6fe96eac Unify the resistance of foundations.
All foundations now have a resistance of 1 Hack, 1 Crush, 10 pierce.

Patch by: Nescio
Differential Revision: https://code.wildfiregames.com/D3600
This was SVN commit r25130.
2021-03-26 17:05:27 +00:00
8bd7a4f4b5 Reduce cavalry training time and increase movement speed for ranged cavalry.
The early-game cavalry rush was overly nerfed in A24 with longer train
time, slower speed, and the need for stables.
This rolls that back slightly by reducing train tim from 16 to 15, and
increasing the movement speed of ranged cavalry from 15 to 16.

Patch by: borg-
Differential Revision: https://code.wildfiregames.com/D3664
This was SVN commit r25129.
2021-03-26 17:03:45 +00:00
eda03c54f6 Remove then entity limit for the Embassy.
Was previsouly bumped to 3 in A24.

Patch by: borg-
Approved By: ValihrAnt, chrstgtr, wraitii
Differential Revision: https://code.wildfiregames.com/D3666
This was SVN commit r25128.
2021-03-26 16:59:48 +00:00
d01a995cbb Fix missing translations (from missing context) in tooltips.
Fixes:
- A logic issue in the attack name tooltip.
- A missing context in the status effects tooltip

Patch by: nwtour
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D3745
This was SVN commit r25127.
2021-03-26 16:52:09 +00:00
d050c3377d Fix unit overlapping following bae258f9a1
Following bae258f9a1, all units moved, then all messages were sent. This
could result in units overlapping, which cannot be resolved without unit
pushing. Fixing this makes for a fairer comparison with the pushing
diff, so it seems worthwhile.

Differential Revision: https://code.wildfiregames.com/D3746
This was SVN commit r25126.
2021-03-26 16:49:59 +00:00
eac613b7bf Enforce tight coupling of CCmpUnitMotion/CCmpUnitMotionManager
bae258f9a1 implemented CCmpUnitMotionManager, which handles motion for
CCmpUnitMotion (as distinct from ICmpUnitMotion, the interface).
The tight coupling between these two components was awkward at the
interface level, leaking underlying implementation details.

This diff makes CmpUnitMotionManager explicitly manage CmpUnitMotion,
instead of any implementation of ICmpUnitMotion, and moves files around
as requir
ed.
This:
- Makes it impossible to accidentally try to have the wrong
IID_UnitMotion managed by the UnitMotionManager.
- Allows devirtualising the calls from the manager to UnitMotion itself
(and inlining, as they are compiled in the same TU).
- Cleans up the manager interface - MotionState is now part of
CCmpUnitMotionManager.
- Cleans up ICmpUnitMotion interface - no need to provide a private
interface for the manager.

Differential Revision: https://code.wildfiregames.com/D3732
This was SVN commit r25125.
2021-03-26 16:47:07 +00:00
8eca1facde Fix the description of garrison hero aura.
Since siege engines are not capturable anymore, since d583048690.

Fixes: d583048690.
Differential revision: D3742
Reviewed by: @Nescio
This was SVN commit r25124.
2021-03-26 10:37:52 +00:00
21e866fcf0 Technically seperate Turrets from GarrisonHolder.
While they often look alike, their behaviour is totally different.
This split has some implications:
- There are now separate auras for garrisoning and turrets.
- Entities can now have both turret points and garrison slots,
independent of eachother.

In general previous behaviour is maintained as much as possible.

Differential revision: D3150
Comments by: @Nescio, @wraitii
Tested by: @v32itas
This was SVN commit r25123.
2021-03-26 10:18:30 +00:00
7bf2f9ed74 Introduce crossbowman templates.
Allows for easier differentiation. No values were changed in this patch.

Differential revision: D2886
Comments by: @Angen, @borg-, @Stan, @ValihrAnt, @wraitii
This was SVN commit r25122.
2021-03-26 09:55:52 +00:00
db21f246f1 A bit more cleanup in ProductionQueue.
- Removed some useless comments.
- Don't assume an item only has either a tech or a unit in
ProgressTimeout.
- Don't initialise boolean values (refs. #5979).

Differential revision: D3739
Comment by: @wraitii
This was SVN commit r25119.
2021-03-25 15:55:54 +00:00
0ff0282b8f Removes unused code for GPU skinning introduced in 779a33ee30 and forgotten in 97b46d402c.
This was SVN commit r25118.
2021-03-25 13:18:49 +00:00
39c8e7f1a2 Cleanups ShadowMap, fixes possibly wrong depth format name for GLES.
This was SVN commit r25117.
2021-03-25 12:09:56 +00:00
ebc2ec5498 Give option to switch between specific and/or generic entity names.
As requested on the forums (e.g.
https://wildfiregames.com/forum/index.php?/topic/25202-transliteration-of-ancient-greek-into-english/&tab=comments#comment-378174).

Differential revision: D2126
Closes: #3397

This was SVN commit r25116.
2021-03-25 06:58:47 +00:00
4e728bf68f Uses sky as a water reflection instead of a fixed color.
Differential Revision: https://code.wildfiregames.com/D3734
This was SVN commit r25114.
2021-03-24 16:40:03 +00:00
0c419b5bab CI linting: fix issues with char being null for cppcheck.
The CPPCheck linter outputs 'char: null', which trips the
phabricator-jenkins-plugin, and fails to lint on CI.
To avoid this, filter out null values, since e.g. char is optional
anyways. We do want to fail if non-optional values are missing.

Differential Revision: https://code.wildfiregames.com/D3730
This was SVN commit r25112.
2021-03-23 17:43:19 +00:00
de02f9870c Make WxWidgets High-DPI aware / Upgrade WXWidgets to 3.1.4 on MacOS
Fixes issues on Big Sur with the development 0 A.D. (bundles were
working correctly because they are Low-DPI).

Thanks to @wik for investigations on High-DPI in WxWidgets.

Differential Revision: https://code.wildfiregames.com/D3326
This was SVN commit r25111.
2021-03-23 15:47:29 +00:00
275a5bccde Always pass a civcode to Viewer when instatiated by the session gui
Previously this was only done for technologies.

The Viewer tries to determine an appropriate civcode from a passed
template,
however trainable gaia-animals have a template-assigned civ of `gaia`
(and
technologies don't have one at all).

The behaviour of the Viewer isn't changed by this commit: it will still
prefer
whatever civ is set within a template before falling back to the passed
civcode.

However, trained gaia-animals now have something to fall back to,
permitting the
appropriate build list (the list of buildings that train the animal) to
be
displayed.

This was SVN commit r25110.
2021-03-23 15:44:01 +00:00
f06bdb31bf Use Treasure tooltip function in Template Viewer
Function added in ea96e81098

This was SVN commit r25109.
2021-03-23 13:38:16 +00:00
1867b70d3a Properly unset the civilisation when unchecked in Atlas.
Previously, atlas would save the default value when the 'civilisation'
checkbox was unset.

Patch by: nwtour
Differential Revision: https://code.wildfiregames.com/D3725
This was SVN commit r25108.
2021-03-23 13:16:53 +00:00
87a2c3347f Make real directory paths on the VFS predictable (retry)
This is the same commit as 4bb31f084e, reverted in 5d1899785a. Noted
issues were fixed.

Partial revert/fix of 2f19cf86d3 and 2567fee329.

Before this diff, it was possible for a mod containing a cache/ or a
config/ folder to get written to incorrectly.
The issue is VFS can map multiple directories to one 'virtual' path, for
reading mods. However, writing data is problematic: which path to
choose?
The only viable solution is to use a path relative to the highest
priority directory encountered in the VFS path, or write paths could be
'hijacked' by lower-priority mods.

This fixes these issues by:
- Adding a new lookup mode ('Real-path') that explicitly picks the real
path relative to the highest-priority subdirectory in the VFS Path.
- Preventing overwriting a real directory with a lower priority one in
general.
- Revert c0c8132dd4's GetRealPath change, re-introducing the function as
GetOriginalPath.

This also cleans up some duplication that led to empty mod folders in
the user mod path, and cleans up loading the 'user' mod.
It also makes it explicit that a directory must be passed to Mount().

Note that the new 'realpath' lookup can still be somewhat complex with
many mount points at various hierarchy levels, but it is at least
predictable/deterministic without having to be careful about populating
order.

Fixes #2553

Differential Revision: https://code.wildfiregames.com/D3728
This was SVN commit r25107.
2021-03-23 12:46:59 +00:00
5d1899785a Revert 4bb31f084e
4bb31f084e led to an issue in windows-specific code not detected by the
tests. I'll debug later.

This was SVN commit r25105.
2021-03-22 19:52:07 +00:00
4bb31f084e Make real directory paths on the VFS predictable.
Partial revert/fix of 2f19cf86d3 and 2567fee329.

Before this diff, it was possible for a mod containing a cache/ or a
config/ folder to get written to incorrectly.
The issue is VFS can map multiple directories to one 'virtual' path, for
reading mods. However, writing data is problematic: which path to
choose?
The only viable solution is to use a path relative to the highest
priority directory encountered in the VFS path, or write paths could be
'hijacked' by lower-priority mods.

This fixes these issues by:
- Adding a new lookup mode ('Real-path') that explicitly picks the real
path relative to the highest-priority subdirectory in the VFS Path.
- Preventing overwriting a real directory with a lower priority one in
general.
- Revert c0c8132dd4's GetRealPath change, re-introducing the function as
GetOriginalPath.

This also cleans up some duplication that led to empty mod folders in
the user mod path, and cleans up loading the 'user' mod.

Note that the new 'realpath' lookup can still be somewhat complex with
many mount points at various hierarchy levels, but it is at least
predictable/deterministic without having to be careful about populating
order.

Fixes #2553

Differential Revision: https://code.wildfiregames.com/D3217
This was SVN commit r25104.
2021-03-22 18:49:42 +00:00
a048271806 Fix AI+Player from persistent settings (again)
Reintroduced in fa3b341b57, as I changed the execution order of onLoad.

This fixes the problem by explicitly handling this case, which should
avoid accidentally reintroducing the problem.

Differential Revision: https://code.wildfiregames.com/D3724
This was SVN commit r25103.
2021-03-22 16:57:10 +00:00
c87229aa48 Optimise FindWalkAndFightTargets.
FindWalkAndFightTargets is used during attack-walk (and a few other
situations) to find new entities to attack. This function can be a bit
slow, taking large chunks of time during battles.

This optimises it by assuming that one of the surrounding unit will
match preferred criteria (which, for most soldiers, are 'Human'), thus
returning the first attackable entity. In the worst case, it should
still be slightly faster than the current code.

Differential Revision: https://code.wildfiregames.com/D3446
This was SVN commit r25102.
2021-03-22 13:27:33 +00:00
72f0fdb41b GameSetup GUI cleanup - Renaming.
- rename 'Controls' class to 'Controllers' to avoid ambiguity and mimic
MVC lingo.
- rename GameRegisterStanza into LobbyGameRegistration, and make it
explicitly a controller.
- rename GameSettingsFile to PersistentMatchSettings & move it to its
own folder (since it could be reused independently of the controllers)
- remove the StartGameController & move `launchGame` to the
GameSettingsController (simplifies the control flow)
- the GUI Object "setupWindow" was actually the GameSettingsPage, this
is corrected.
- the LoadingPage was showing the GameSettingsPage -> in the current
code, it makes more sense to have both handle their own visibility.
- make the NetMessages class independent of other gamesetup logic, so
that it can be reused by other code. Remove the custom XML object.

Differential Revision: https://code.wildfiregames.com/D3719
This was SVN commit r25101.
2021-03-22 12:26:48 +00:00
293cd95ccb Flush order queue when given an order to perform a action on the same entity.
Follows a4c698ac48.

Fixes: #6046
Differential revision: D3587
Reviewed by: @wraitii
This was SVN commit r25100.
2021-03-22 11:36:50 +00:00
87fc52b780 MP: don't enforce game init attributes synchronization in PREGAME.
The NetServer stored a complete copy of the game Init Attributes, which
it sent to new clients on updates from the controller. This worked well,
but prevents incremental updates and other unrelated messages from being
sent.

This changes the system so that:
- in PREGAME state, the server does not update its copy of the game init
attributes
- the server forwards game setup messages from the controller to all
clients
- Joining clients get a full copy of the Settings, when joining, from
the controller (this is a js-driven behaviour - other situations might
not need do it).
- Make the StartNetworkGame message take a copy of the final init
attributes, to ensure synchronization (and simplify some logic).

In practice, this:
- makes it possible to send different types of gamesetup messages (this
introduces two: a regular update and the full 'initial-update' for new
clients).
- moves some C++ hardcoding into JS - here in essence the PREGAME server
state is now init-attributes-agnostic.
- does not change much for readiness control - the server already needed
to force a change at game start to set random elements.

Note that the loading page is currently still receiving the 'local' game
attributes, which assumes that all clients are correctly synchronized
(they should be).

Refs #3806, #3049

Differential Revision: https://code.wildfiregames.com/D3714
This was SVN commit r25099.
2021-03-22 10:13:27 +00:00
8c2ab4df62 Improve & translate hotkey name/descriptions.
Improve the hotkey translations. This adds them to messages.json for
translation, closing the work from 09ad8bfbe5

Refs #5867, refs #5996

Differential Revision: https://code.wildfiregames.com/D3641
This was SVN commit r25097.
2021-03-21 14:23:57 +00:00
fa3b341b57 Further gamesetup fixes & tweaks.
Fixes dc18d94030

- Player assignment still had some trouble. This cleans things up by
moving a little more logic in the controller & fixing other usage.
 - As a consequence, in MP, if the host swaps two player, the change
will take a few frames to register. It shouldn't be too much of a
problem in practice.
 - Fix issues with AI being assigned to player slots for joiners.
- Fix issues with similar color not being correctly picked when swapping
a map.
- Fix issues with rating & locked team settings.

Reported by: langbart
Differential Revision: https://code.wildfiregames.com/D3723
This was SVN commit r25096.
2021-03-21 13:09:52 +00:00
Angen
841bf5f2dd Color incompatible mods and add filter
This helps to see compatible mods in the list, which can get a bit long.
For incompatible mods in disabled section use gray colour.
For incompatible mods in enabled section use red colour (what can happen
when using arguments to start the game or they can be in config file).
Add option to filter compatible mods, this does not affect enabled
section, because if there is incompatible mod, it is error and it needs
to be always visible.
Add function recomputeCompatibility and g_ModsCompatibility to avoid
recomputing aredependenciesmet when coloring mods, because every column
is colored separately.
Disable enable mod button if mod is incompatible.
Remove all dependencies met messages as they are now replaced by this
mechanism.

fix getSelectedModUrl in process

Differential revision: D3687
Fixes: #6053
Tested by: @Freagarach
Comments by: @vladislavbelov
This was SVN commit r25095.
2021-03-21 10:22:50 +00:00
Angen
1c68d9890b Remove redundant applyFilters method from modmod
All functionality in applyFilters is handled by displayModLists and
modSelected functions.
This is also fixing issue of triggering selected event on the same list
multiple times and not updating mod description and buttons when
applying filters.

Differential revision: D3722
This was SVN commit r25094.
2021-03-21 08:51:17 +00:00