1
0
forked from 0ad/0ad
Commit Graph

7302 Commits

Author SHA1 Message Date
33e01af15e Fix formation walking following "improved ship pickup"/375c319639
Summary:
As reported by @bb and @Angen , 375c319639 broke formation walking in a
few situations.

The issue is that f489ab3a16/D2871 requires formation members to get no
messages until the controller is stopped, but 375c319639 didn't use the
correct function (on account of a missed rebase), so members stopped too
early.

Reported by: bb, Angen
Reviewed By: bb
Differential Revision: https://code.wildfiregames.com/D3006
This was SVN commit r24029.
2020-09-08 13:48:12 +00:00
e916b8cc01 Improve splash damage falloff calculation to account for obstruction size.
Splash falloff was calculated using centre-to-point distance, where
nearest-edge to nearest-edge ought to have been used.
Use DistanceToPoint to correct for that.

Make sure the damage multiplier cannot go negative.
Remove GetUnitSize in favour of GetSize.

Reviewed By: bb
Differential Revision: https://code.wildfiregames.com/D2963
This was SVN commit r24010.
2020-08-31 15:01:04 +00:00
4e63ddbfd9 Add a NVTT version check at compile-time, fixes #5757, refs #5804.
This will prevent users who have an old NVTT installed on their system
from experiencing crashes. Other NVTT issues at runtime should be fixed
by clearing the cache.

Differential Revision: https://code.wildfiregames.com/D2765
This was SVN commit r23974.
2020-08-18 17:30:41 +00:00
996b37f07b Fix logic issue with the DXT1a texture format, refs #4549.
Before the NVTT upgrade, no DXT1a file would have been properly decoded:
they would all have been mistaken for a 8bpp greyscale due to a logic
issue in our code, which would have triggered a crash. I did not notice
the logic issue when performing the upgrade. As a result, decoding those
files now fails silently: their alpha bit will be ignored and they will
be handled as DXT1.

This patch fixes the logic and allows us to decode DXT1a properly, in
accordance with the format specifications. Currently, we do not use this
format.

Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D2522
This was SVN commit r23973.
2020-08-18 16:45:56 +00:00
840ed69fa3 Implements correct distance to edges for the building snapping feature.
The feature was added in a8f241da5d.

Reviewed By: Itms
Tested By: Freagarach
Differential Revision: https://code.wildfiregames.com/D2945
This was SVN commit r23967.
2020-08-17 20:13:18 +00:00
4f39e6675a Completely separates fixed and shader paths in sky rendering.
Removes usages of fixed pipeline functions in shader path.

Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2944
This was SVN commit r23954.
2020-08-09 15:21:06 +00:00
b664a1ae8e Moves GL calls of fixed pipeline under the same condition.
This was SVN commit r23953.
2020-08-09 13:01:58 +00:00
4c1847d3db Removes old matrices from sky rendering in shader path.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2943
This was SVN commit r23952.
2020-08-09 11:24:09 +00:00
26ae55cad0 Adds contrast-adaptiv-sharpening filter, also helps to partly remove FXAA texture blurring.
Patch By: OptimusShepard
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2642
This was SVN commit r23947.
2020-08-07 22:16:55 +00:00
f27e5ce139 Fix ODR violation for ShaderModelRendererInternals.
ShaderModelRendererInternals is defined twice, once by ModelRenderer.cpp
and once by HWLightingModelRenderer.cpp.
Having two different definitions in the global namespace is a violation
of the C++ One-Definition-Rule.

Patch by: StefanBruens
Reviewed By: wraitii, Vladislav
Differential Revision: https://code.wildfiregames.com/D2932
This was SVN commit r23941.
2020-08-06 11:33:26 +00:00
45d136d57e Fix GetPosition2D call when the entity may be out of the world in unitMotion
As reported by Freagarach following a7da40ac2f.

32e8ed51aa introduced a "MoveObstructed" message, that could be sent
when the entity ran into obstructions, to stop early.
In HandleObstructedMove, my intention, as written in the comment, was
that the caller would do its thing (call StopMoving(), move out of the
world etc.) and thus ComputeGoal would return early.

However, I mistakenly left the `cmpPosition->GetPosition2D()` in between
that and ComputeGoal, which would then fail.

This fixes that by moving it after the `ComputeGoal` call.

Also add a sanity StopMoving() call to a7da40ac2f's move-out-of-world
call.

Reported by: Freagarach
Differential Revision: https://code.wildfiregames.com/D2935
This was SVN commit r23940.
2020-08-06 08:40:14 +00:00
395a10beb0 Fix compilation error on arch introduced by 5473393e30
CLogger.h uses std::deque but doesn't include the required header file.
This fails since 5473393e30 on Arch Linux

Reported by: navigo_ps91
Reviewed By: irishninja
Differential Revision: https://code.wildfiregames.com/D2928
This was SVN commit r23933.
2020-08-05 09:25:24 +00:00
ea725cc289 Fix text input max_length attribute. fixes 5593f573f4
Reviewed by: @wraitii
Fixes #5266
Differential Revision: https://code.wildfiregames.com/D2377
This was SVN commit r23927.
2020-08-03 12:39:25 +00:00
01118c1196 Fix issues relating to SDL and wxWidgets interaction in Atlas.
This fixes the transfer of key inputs from WxWidgets to SDL, making it
possible to type in the in-game GUI from Atlas.

Also fixes whitespace issues in some Atlas files.

The following improvements are OSX specific:
- fixes an SDL assertion related to unused subsystems in Atlas.
- Remove the 'osxguiapplication' override. This fixes the editor
starting up in the background and not accepting input when launched from
in-game.
- To prevent an issue with sdl/wxwidgets conflict when running from
inside the game, actually boot a new instance (see #2427)


Reported by: wik (Many thanks for your investigations)
Tested by: trompetin17, Stan
Fixes #2427
Fixes #2846

Differential Revision: https://code.wildfiregames.com/D2788
This was SVN commit r23926.
2020-08-03 12:23:16 +00:00
375c319639 Improve ship pickup.
Improve unitAI: don't move if the requester can reach us and we are
close enough. This avoids an issue where ships moved more than necessary
when picking up many units.
Also improve requester UnitAI -> retry pickup if the target entity is
Idle.
Improve unitMotion: periodically recompute paths in "known bad path"
mode to adapt to moving targets.
Expose UnitMotion reachability to scripts and other code.

This adds a test map for some common and some tricky pickup cases, using
triggers.

Based on a patch by: causative
Reviewed By: Freagarach
Fixes #3472

Differential Revision: https://code.wildfiregames.com/D665
This was SVN commit r23925.
2020-08-03 12:02:24 +00:00
21cdcf44bc Fix segfault when sending a very large net chat message.
This crash occured on the receiver machine, making it effectively a
remote crash attack.

Reported by: Riddler66
Based on a patch by: elexis
Fixes #5726

Differential Revision: https://code.wildfiregames.com/D2629
This was SVN commit r23918.
2020-08-01 15:25:13 +00:00
5473393e30 Add an interface for Reinforcement Learning.
Implement a simple HTTP server to start games, receive the gamestate and
pass commands to the simulation.
This is mainly intended for training reinforcement learning agents in 0
AD. As such, a python client and a small example are included.

This option can be enabled using the -rl-interface flag.

Patch by: irishninja
Reviewed By: wraitii, Itms
Fixes #5548

Differential Revision: https://code.wildfiregames.com/D2199
This was SVN commit r23917.
2020-08-01 10:52:59 +00:00
Angen
f0f0d6eed7 Allow selectable component to overwrite shape of displayed selection from footprint
Removing strict binding of selection to footprint by adding optional
choice similar in footprint. If present, that one will be used, else it
will fallback to footprint size.
Allowing to use any selection shape without affecting gameplay, because
foorprint is used for projectile hit detection.

Differential revision: https://code.wildfiregames.com/D2844
Reviewed by: wraitii
This was SVN commit r23900.
2020-07-26 18:26:20 +00:00
eb0d89e220 Delete unused function left behind in e9361705ae
e9361705ae cleaned up our config setup, but left behind isOverriden,
triggering a compilation warning.

Reported by: Imarok
This was SVN commit r23885.
2020-07-25 07:05:36 +00:00
1368f87590 Fixes actor seed for deleted entities in Atlas.
This was SVN commit r23882.
2020-07-24 19:13:09 +00:00
8190dd9054 Fix Atlas crash introduced by aeaba3c14c
Reviewed by: @Angen @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D2898
This was SVN commit r23881.
2020-07-24 18:53:03 +00:00
57bbd774f6 Makes FXAA working only for GLSL and disabled for ARB.
Also adds option dependency. FXAA was introduced in 113b1c49b9.

Patch By: OptimusShepard
Differential Revision: https://code.wildfiregames.com/D2780
This was SVN commit r23880.
2020-07-24 18:48:18 +00:00
f489ab3a16 Abort formation-walking on any message from UnitMotion.
Units in formation can occasionally request many short paths (and thus
introduce crippling lag) if their offset is obstructed.
This particularly happen when the formation is idle, since the offset
then always remains obstructed.

To prevent this, it is OK to immediately stop pathing on any motion
message (obstructed, failure, success). This does not break formation
movement since messages are only sent when the formation controller is
not moving (this finishes what was started in 0535eb9b92).

Ideally, this hack could be removed if the short-pathfinder was quick
enough / units were better at aborting.

Fixes concern raised by Freagarach on a7da40ac2f.

Refs #5624 in that the max-short-path range is the source of the lag.

Reviewed By: Angen
Differential Revision: https://code.wildfiregames.com/D2871
This was SVN commit r23867.
2020-07-22 09:31:08 +00:00
3ed9df0d6c Allow map to recenter during resize in Atlas. Fixes #1109.
Patch By: Clockwork-Muse
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D825
This was SVN commit r23859.
2020-07-21 02:08:50 +00:00
Angen
eec47157ad Set previous behaviour for SetFacePointAfterMove.
Implement get method in cmpUnitMotion.
Use it in UnitAI.

This was SVN commit r23850.
2020-07-19 10:42:45 +00:00
aeaba3c14c Use victory conditions json's in Atlas
Reviewed by: @Angen
Differential Revision: https://code.wildfiregames.com/D2393
This was SVN commit r23847.
2020-07-18 17:39:59 +00:00
Angen
6f1d17c954 Stop failing if mod is broken and display invalid mods in downloader [Mod Io]
If one mod is not signed or broken in any other way, mod.io downloader
fails and does not display any mod.
The problem with unsigned mod is that its metadata are empty.

That means one cannot break mod io downloader with mods having invalid
data.

mark mod as invalid and display in list as disabled and display reason
instead description to not spam ugly error messages on screen as this is
not error by the game but of the moder
report failed signatures back to list of mods
fail if property is not set using strict mode when getting from js
check in js for undefined values

Allow to filter only valid mods.

Differential Revision: https://code.wildfiregames.com/D2114
Reviewed by: @Itms
Fixes: #5459

This was SVN commit r23821.
2020-07-12 09:25:03 +00:00
9f4e398585 Fix rooting mistake in CGame::ReallyStartGame, detected by Bellaz89, fixes #5776.
Differential Revision: https://code.wildfiregames.com/D2869
Accepted By: Bellaz89
This was SVN commit r23815.
2020-07-11 14:24:09 +00:00
365dbd91fc Fixes terrain index type (causing a warning) introduced in 1e1ce27eba.
This was SVN commit r23807.
2020-07-07 16:51:20 +00:00
56d3aa40fe Fix conversion of UTF8 strings between the scripts and the engine.
SpiderMonkey uses UTF16 internally, and only provides APIs for that
encoding, so stop hacking UTF8 strings: properly convert them to and
from UTF16 when passing them through SM.

Patch By: wraitii
Differential Revision: https://code.wildfiregames.com/D2838
This was SVN commit r23795.
2020-06-30 10:46:06 +00:00
dc65912043 Fix building on GCC 10, fixes #5709, #5756.
Patch By: pcpa and wraitii
Tested By: Nescio, andy5995 and others
Differential Revision: https://code.wildfiregames.com/D2745
This was SVN commit r23794.
2020-06-30 10:24:00 +00:00
853e8c0f1e CVector2D: Fix members may not be initialized warnings
Differential Revision: https://code.wildfiregames.com/D2825
This was SVN commit r23784.
2020-06-21 18:21:31 +00:00
ec4f51d928 Fix --without-pch build following ffd2219200
Differential Revision: https://code.wildfiregames.com/D2819
This was SVN commit r23775.
2020-06-14 20:51:21 +00:00
6b2b071ad5 Move LOS to a los helper header and cleanup Grid.h includes.
Changing Grid.h should recompile faster, as it is now included in fewer
TUs.

Differential Revision: https://code.wildfiregames.com/D2784
This was SVN commit r23774.
2020-06-14 20:39:03 +00:00
ffd2219200 Don't overwrite JS error reporting by calling JS_ReportError.
Upstream spidermonkey supports JSNative error reporting by returning an
explicit failure code. This provides a full stacktrace. Calling
JS_ReportError, removed upstream, removes that stacktrace.

Instead, we should simply LOGERROR.

Based on a patch by: elexis
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D2627
This was SVN commit r23773.
2020-06-14 10:34:49 +00:00
4b1a4ef4cf Rework ScriptInterface EnumeratePropertyNames to support non-enumerable properties.
This lets it support the JSClass syntax, introduced for components in
5fb88172a2/D2492, which required a workaround before.
As cleanup, remove the prefix logic which was too specific to be in
ScriptInterface, and use an upstream-compatible API that also does more
of what we want.

Based on a patch by: elexis
Differential Revision: https://code.wildfiregames.com/D2644
This was SVN commit r23771.
2020-06-14 09:49:32 +00:00
939002f0dc RangeManager: Grid for 2D array, enum cleanups.
Range manager has several `std::vector` for fixed-size arrays and 2D
grids. By using proper data structures, the code readability is
improved.
This also moves around the LosVisibility enum.

Comments by: Stan`, nani
Differential Revision: https://code.wildfiregames.com/D2770
This was SVN commit r23769.
2020-06-13 09:05:40 +00:00
6f70a901f8 Remove duplicated call in tile rendering for TerrainOverlay.
Patch By: vinhig
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D2811
This was SVN commit r23767.
2020-06-12 20:52:18 +00:00
fd8a47f5d9 Moves calculations of bounds for fixed shadows to a separate function.
Reduces complexity of the SetupFrame function. Fixed shadows were added
in 8e48e1b17e.

This was SVN commit r23766.
2020-06-12 20:09:08 +00:00
06bf3a8739 Adds GLSL shaders of overlay lines.
We were using ARB shaders in GLSL mode for overlay lines (unit
selection, ranges and so on).

Tested By: Freagarach, OptimusShepard, Stan
Differential Revision: https://code.wildfiregames.com/D2621
This was SVN commit r23765.
2020-06-12 15:39:44 +00:00
5176f848b8 Fixes missing deletion of files in 409c436ae2.
Patch By: linkmauve
Differential Revision: https://code.wildfiregames.com/D2476
This was SVN commit r23755.
2020-06-08 22:36:19 +00:00
409c436ae2 Remove obsolete GetVideoMode platform-specifics, replaces by platform-agnostic SDL2`s APIs.
Before and after the commit we don't support multiple displays and HiDPI
properly.

Patch By: linkmauve
Tested By: Angen, elexis, Stan
Differential Revision: https://code.wildfiregames.com/D2476
This was SVN commit r23754.
2020-06-08 17:49:26 +00:00
b62308a301 Fix error in e9361705ae.
The HWDetect changes were not working properly.

Reported by: Nescio
Tested by: Nescio
Differential Revision: https://code.wildfiregames.com/D2799
This was SVN commit r23748.
2020-06-07 20:11:37 +00:00
e9361705ae Refactor HWDetect and rendering options setup.
Remove duplication when setting graphic options by reading the configDB
directly.
Properly protect the ModIO config keys.

Approved By: linkmauve
Refs #5538

Differential Revision: https://code.wildfiregames.com/D1931
This was SVN commit r23747.
2020-06-07 13:16:57 +00:00
7440523ade Enable garrisoning on gates / fix movement of units with visible garrison points (2nd commit)
This is the same commit as 2abd9cead2 / D1418, fixing noted issues.

This addresses two related issues:
- Units visibly garrisoned on gates keep the gate open.
- Units visibly garrisoned on entities keep their pathfinding blocker
flags.

De-activate the obstruction of visibly-garrisoned entities, fixing the
2nd issue.
Keep a list of entities that cannot move and thus should not count
towards gate-opening logic.

Packing logic is kept separate: it is more related to entities having
'alternate forms' with different capabilities than being currently
incapable of moving.

Based on work by temple

Fixes #2679.
Fixes #5151.

Differential Revision: https://code.wildfiregames.com/D2775
This was SVN commit r23731.
2020-06-02 11:40:29 +00:00
c4625b14df Improve the warning message for FromJSValue<CColor> when trying to convert a non-object to CColor.
Reviewed by: wraitii
Differential Revision: https://code.wildfiregames.com/D2778
This was SVN commit r23727.
2020-06-01 16:09:28 +00:00
945ac4fc3b Do not change the gamma of the display on startup.
Added in df6fceba62 to (most likely) have some control over brightness,
this conflicted with dimming utilities and would not play nice with
starting 0 A.D. in windowed mode.

If gamma handling were to be reintroduced later, it should only affect
the 0 A.D. window.

Reviewed By: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1976
This was SVN commit r23722.
2020-06-01 05:12:51 +00:00
531dcf40c3 Revert 0363202a20, 2abd9cead2 and b4144dc2c3
Player-testing has revealed QA issues, so reverting these for now.

Differential Revision: https://code.wildfiregames.com/D2773
This was SVN commit r23714.
2020-05-31 10:06:39 +00:00
2abd9cead2 Enable garrisoning on gates / fix movement of units with visible garrison points
This addresses two related issues:
- Units visibly garrisoned on gates keep the gate open.
- Units visibly garrisoned on entities keep their pathfinding blocker
flags.

Remove the block-movement flag from visibly garrisoned entities.
Keep a list of entities that cannot move and thus should not count
towards gate-opening logic.

Packing logic is kept separate: it is more related to entities having
'alternate forms' with different capabilities than being currently
incapable of moving.

Based on work by temple

Comments by: Freagarach
Tested by: Nescio
Fixes #2679
Fixes #5151

Differential Revision: https://code.wildfiregames.com/D1418
This was SVN commit r23710.
2020-05-30 09:18:33 +00:00
ebd9786268 Add missing cpp files in last commit refs D2503
This was SVN commit r23704.
2020-05-28 18:18:00 +00:00