Commit Graph

7324 Commits

Author SHA1 Message Date
9d53bed0bd Adds a LOS mask to Minimap.
Commented By: elexis, Stan
Differential Revision: https://code.wildfiregames.com/D2216
This was SVN commit r24141.
2020-11-08 08:51:54 +00:00
ada16439ab Fix the random slowdowns and speedups on AMD CPUs for Windows
Remove the MAHAF code and binaries, which doesn't work on anything more
recent than Windows XP due to the usage of an unsigned driver.
Remove the custom timer (PMT, TSC...) code to use the Windows
recommended way aka, QueryPerformanceCounter (QPC)
Remove the deprecated functions in wpthread relating to this. Some
further cleanup will be needed, but this patch is already big enough.

This patch voluntarily excludes the Linux Fix for further investigation
as we haven't ruled out a kernel bug yet;

Discussed with: @wraitii, @vladislavbelov, @janwas, AMD Inc,
Tested by: Dakara, @OptimusShepard, Stan (On W10, Win7; with and without
PCH)

Threads:
https://wildfiregames.com/forum/topic/28367-amd-ryzen-threadripper-user-read-before-posting/
https://wildfiregames.com/forum/index.php?/topic/26890-problem-with-ryzen-3000er-series/page/3/

Differential Revision: https://code.wildfiregames.com/D2726
This was SVN commit r24137.
2020-11-06 23:18:16 +00:00
b7cbfecd19 Replacing losMap usages by existed and more consistent losTex.
losMap was introduces in fe21c5e023.

This was SVN commit r24130.
2020-11-04 22:55:34 +00:00
ad965e167d Moves simple water from fixed pipeline to shader pipelines (ARB/GLSL).
Commented By: Stan
Reported By: Freagarach
Tested By: Freagarach, Stan
Differential Revision: https://code.wildfiregames.com/D3059
This was SVN commit r24129.
2020-11-04 22:25:08 +00:00
2d54653bc3 Little cleanup of PatchRData by reordering includes and correctly formats some loops.
This was SVN commit r24126.
2020-11-04 15:53:33 +00:00
c64f8824d7 Fixes wireframe mode for terrain, continuing remove fixed pipeline dependencies.
Commented By: Stan, wraitii
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D3056
This was SVN commit r24125.
2020-11-04 15:52:26 +00:00
d7d02a4740 Moves terrain lighting calculation to GPU.
Reviewed By: wraitii
Tested By: OptimusShepard, Stan, wraitii
Differential Revision: https://code.wildfiregames.com/D3052
This was SVN commit r24124.
2020-11-04 12:54:17 +00:00
770280436b Removes FFP option from Atlas and adds ARB/GLSL selection.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D3055
This was SVN commit r24123.
2020-11-04 12:21:55 +00:00
6e3db3d84c Removes remaining fixed program used in shader pipelines and adds check on FFP create.
Commented By: Stan
Differential Revision: https://code.wildfiregames.com/D3048
This was SVN commit r24121.
2020-11-03 18:59:27 +00:00
478f96d0fd Fix Atlas crash in RangeManager following 939002f0dc
939002f0dc changed from vectors to grid which broke resetting when
terrain size changed.
Also use SAFE_ARRAY_DELETE for simplicity.

Reported by: vladislavbelov
Reviewed By: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D2961
This was SVN commit r24117.
2020-10-31 10:21:08 +00:00
413003fe4f Fix a compartment mismatch in XmppClient, causing crashes in MP games.
Added in 9023f4bebb, which changed lobby GUI messages to JS::Values,
requiring a real context. The original code mistakenly inverted the
owning script interfaces.

Given the reproducibility discovered in SM52, the timeline of the bug,
and the nature of the issues encountered in MP, this is a rather safe
fix for #5655.

Reviewed By: Itms
Fixes #5655

Differential Revision: https://code.wildfiregames.com/D2922
This was SVN commit r24116.
2020-10-31 10:13:33 +00:00
03f9522ff4 Remove useless SDL debug message introduced in 5593f573f4.
Reviewed by: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D3050
This was SVN commit r24112.
2020-10-27 21:19:33 +00:00
acc254533b Refactors water shader to move refraction in a separate function.
Commented By: Angen, asterix, linkmauve, Stan, wraitii
Reviewed By: Angen
Tested By: Angen, asterix, linkmauve, Stan
Differential Revision: https://code.wildfiregames.com/D2908
This was SVN commit r24110.
2020-10-25 21:00:52 +00:00
Angen
dcdc17b2dd Do not use GPUSkinning without glsl [Crash fix]
Disable GPUSkinning when glsl is disabled, because VertexAttribPointer
is not implemented on ARB/GLES and it is called by GPUSkinning.

Differential Revision: D2423
Reviewed by: vladislavbelov
Fixes: #5635

This was SVN commit r24101.
2020-10-13 16:48:04 +00:00
bb
c93bd91ef6 Do not hardcode attacktypes in the engine/Atlas
fixes 0ad79096bd
refs #252, D368
Reviewed By: vladislavbelov
Comments By: Stan, wraitii
Differential Revision: D2998
This was SVN commit r24095.
2020-10-10 15:12:17 +00:00
acfd466c32 Fixes crash with mod packing on a wrong path.
Reviewed By: Stan
Differential Revision: https://code.wildfiregames.com/D3026
This was SVN commit r24087.
2020-10-04 10:17:34 +00:00
1273307b58 Don't detect audio card when audio is disabled, Fix compilation with --without-audio, fix a few warnings.
Reviewed by: @bb
Comments by: @vladislavbelov, @wraitii
Differential Revision: https://code.wildfiregames.com/D2809
This was SVN commit r24079.
2020-10-02 07:35:59 +00:00
Angen
69a13c2be5 Refactor UpdateMessageSubscriptions in CCmpRangeOverlayRenderer
Introduced in 5fbb224dc0

rewrite 3 ifs to 1 if
merge 2 member variables into 1 member variable
remove 2 function local variables
save one call for CComponentManager as both ifs would or execute or not

code is shorter and looks nicer

Differential Revision: D3009
Reviewed by: bb
This was SVN commit r24072.
2020-09-27 13:12:30 +00:00
b0e4eecdfe Fix map serialization bug in aeaba3c14c and 8190dd9054.
Reviewed by: @Angen
Differential Revision: https://code.wildfiregames.com/D2974
This was SVN commit r24051.
2020-09-20 09:33:18 +00:00
ff9a5fe8f9 Render waves for fancy water effects only if we have water on screen.
Waves were added in 9ce51f4357.

This was SVN commit r24047.
2020-09-16 18:43:58 +00:00
92cbf5ead0 Reduces memory usage for fancy water by merging two textures.
Two textures were added in 9ce51f4357.

Reviewed By: wraitii
Tested By: Angen, Freagarach
Differential Revision: https://code.wildfiregames.com/D2983
This was SVN commit r24046.
2020-09-16 18:03:51 +00:00
Angen
34dee54d90 Remove branch from InParabolicRange
This was SVN commit r24041.
2020-09-15 10:10:52 +00:00
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