1
0
forked from 0ad/0ad
Commit Graph

23758 Commits

Author SHA1 Message Date
ce25351443 Fix typo in CanTrade.
Introduced in c917c39a0d.
Reported by @gameboy at
https://wildfiregames.com/forum/topic/107586-an-error-occurred/?do=findComment&comment=553753.

Also adds a small test.

Differential revision: https://code.wildfiregames.com/D5060
Reviewed by: @wraitii
This was SVN commit r27737.
2023-06-23 12:58:14 +00:00
435d842bc1 Fix Gaia not being its own mutual ally.
For `!0 === false`.
Reported by: @gameboy at
https://wildfiregames.com/forum/topic/107586-an-error-occurred/.
Introduced in c917c39a0d.

Differential revision: https://code.wildfiregames.com/D5058
Reviewed by: @wraitii
This was SVN commit r27736.
2023-06-23 12:53:49 +00:00
f4caf15710 Fix missed allied view tech in init.
Noticed by @gameboy at
https://wildfiregames.com/forum/topic/107586-an-error-occurred/.
Introduced in c917c39a0d.

Differential revision: https://code.wildfiregames.com/D5057
Reviewed by: @wraitii
This was SVN commit r27735.
2023-06-23 12:51:03 +00:00
fb065a4022 Removes manual loading of Windows functions unavailable on XP from wvm.
This was SVN commit r27734.
2023-06-23 12:09:33 +00:00
70e7acfb26 Removes manual unload of delay-loaded DLLs on Windows.
Differential Revision: https://code.wildfiregames.com/D5056
This was SVN commit r27733.
2023-06-23 11:55:33 +00:00
3190729f85 Small bugfix in Petra's Defense manager
We were incorrectly comparing an object to a number.
I don't think this will drastically change the AI behaviour as it's
rather an edge case.

Reviewed By: Freagarach
Differential Revision: https://code.wildfiregames.com/D5030
This was SVN commit r27732.
2023-06-23 07:22:43 +00:00
7df7566d7c Fix 'Options' asking for confirmation without changes during a game.
Since 281bb0b2ec, opening the 'Options' menu in-game will show that
there are pending changes, even if the user has done nothing.
Unfortunately the cinematic logic to hide silhouettes, which comes from
cfd08bbf28, is broken following those changes. We use the configuration
to hide them, which results in us, indeed, changing the configuration.

There isn't really a good short term fix. This change only attemps to
reset the setting if we changed it for a cinematic, which fixes the
issue, but has drawbacks.
Ideally, we would use a superior config level, but we need to be careful
about exposing that to JS.

Reported by: langbart
Fixes #6821

Differential Revision: https://code.wildfiregames.com/D5040
This was SVN commit r27730.
2023-06-23 07:19:16 +00:00
87063a94ff Pass ScriptRequest instead of ScriptInterface in simulation messages.
The previous code was constructing un-necessary ScriptRequest objects.
Minor optimisation from not entering/leaving realms.

Differential Revision: https://code.wildfiregames.com/D5026
This was SVN commit r27728.
2023-06-21 07:50:00 +00:00
dafa5ab774 Minor optimisations when calling JS functions from C++
ScriptFunction::Call_ checks HasProperty, but then JS_CallFunctionName
calls GetProperty. This is redundant and can be simplified.

Reviewed By: phosit
Differential Revision: https://code.wildfiregames.com/D5000
This was SVN commit r27726.
2023-06-20 11:40:18 +00:00
92c9cc5206 Removes delayed loading of RtlCaptureContext as it's available since Windows XP.
This was SVN commit r27725.
2023-06-20 08:54:29 +00:00
73ec56a44e Optimisations to vertex pathfinder - relax optimality, sort unaligned edges
Two changes to the vertex pathfinder that should generally improve
performance:
 - Sort unaligned edges by distance like we did aligned edges. This
isn't very scientific, but the idea is generally sound, and empirically
it seems to do OK.
 - Relax the optimality by using a weighted heuristic, with weight 4/3
or 5/3 depending on the number of obstacles around. In the worst cases,
A* will return paths that are this many times less optimal, but search
should be faster in general (and sometimes much faster).

Both of these optimisations might increase the constant-cost slightly,
but should decrease the worst-case runtimes.

Differential Revision: https://code.wildfiregames.com/D5034
This was SVN commit r27724.
2023-06-20 07:14:11 +00:00
c917c39a0d Pull Diplomacy out of cmpPlayer.
Who says only players should be able to conduct diplomacy?
Also separation of concerns, more maintainable files.

Differential revision: https://code.wildfiregames.com/D4921
Comments by: @elexis, @Stan
Refs. #5894

This was SVN commit r27722.
2023-06-19 06:33:33 +00:00
54c606e6aa Removes LowFragmentationHeap from Windows as it's enabled by default since Vista.
Differential Revision: https://code.wildfiregames.com/D5048
This was SVN commit r27720.
2023-06-18 16:34:29 +00:00
f8798c2245 Removes wversion_Number usage from wvm as we don't support XP anymore.
Differential Revision: https://code.wildfiregames.com/D5049
This was SVN commit r27719.
2023-06-18 16:32:14 +00:00
3d071e4649 Removes OpenGL driver DLL version from reports on Windows.
Differential Revision: https://code.wildfiregames.com/D5052
This was SVN commit r27718.
2023-06-18 16:29:13 +00:00
e31d70f059 Removes waiting from MapGenerator. This makes the game window more responsible during map generating.
- remove `SDL_Delay(100)`
- the progress is now an `std::atomic` (not protected by the mutex
anymore)

Based On Patch By: @vladislavbelov
Accepted By: @wraitii
Differential Revision: https://code.wildfiregames.com/D3676
This was SVN commit r27717.
2023-06-18 12:19:26 +00:00
5e12848511 Remove these 3 terrains, which are no longer necessary.
This was SVN commit r27715.
2023-06-16 17:10:35 +00:00
ea1c6a8d11 Removes wdbg_heap from tests following 7782aa95f1.
This was SVN commit r27714.
2023-06-16 16:44:21 +00:00
e2fb23731c Fix | Mauryan Palace
Reported to me by: Stan'
Fixes #6825

This was SVN commit r27713.
2023-06-16 16:39:55 +00:00
186bedae56 Removes unused Windows sample-based custom profiler. Usage was removed in 56bd5b59b4.
Differential Revision: https://code.wildfiregames.com/D5047
This was SVN commit r27712.
2023-06-16 16:38:18 +00:00
e4bcfd0556 Removes winit usage from wtime. LatchInitialSystemTime was added in c45ef68a88 and unused since ada16439ab.
Differential Revision: https://code.wildfiregames.com/D5046
This was SVN commit r27711.
2023-06-16 16:36:34 +00:00
7782aa95f1 Removes custom debug heap analysis on Windows.
Differential Revision: https://code.wildfiregames.com/D5045
This was SVN commit r27710.
2023-06-16 16:34:10 +00:00
85bb745295 Fix | Art | Royal Palm texture transparency.
Reported by: @nifa
This was SVN commit r27709.
2023-06-16 16:02:47 +00:00
fdd30b3d85 Some cleaning in the Barter component.
- Add explicit variables for magic values.
- `let`s to `const`.
- Don't start the regen timer when not needed.

Differential revision: https://code.wildfiregames.com/D4965
Comments by: @Stan
This was SVN commit r27707.
2023-06-16 06:25:36 +00:00
291f17b3c5 Reset speed when stopping.
And use an explicit function for running.

Differential revision: https://code.wildfiregames.com/D4957
Comments by: @Stan
This was SVN commit r27706.
2023-06-15 06:56:41 +00:00
0e57957a09 Maps | Fix and improve the Libyan Oasis 2p skirmish map
This was SVN commit r27704.
2023-06-14 16:21:35 +00:00
5ede423224 Art | Fix | Fix texture refs to some head actors
This was SVN commit r27703.
2023-06-14 16:20:40 +00:00
8480cfc35f Remove FSM conditions.
FSM conditions aren't used. So this removes dead code.

Accepted By: @wraitii
Differential Revision: https://code.wildfiregames.com/D4959
This was SVN commit r27702.
2023-06-14 14:58:37 +00:00
298f207e5b Improve AttackEntitiesByPreference by short-circuiting on best possible preference.
Similar trick to D3446 / c87229aa48 - we can short-circuit if we find
units that match our best possible preference.
This is, in particular, almost a 40% wall time improvement on Combat
Demo Huge, but it should apply in a number of more normal cases.

Differential Revision: https://code.wildfiregames.com/D5020
This was SVN commit r27701.
2023-06-14 07:52:30 +00:00
64efa0acf9 Delay a distance computation in UnitMotion.
Minor optimisation to computing a point goal.

Differential Revision: https://code.wildfiregames.com/D5035
This was SVN commit r27700.
2023-06-14 07:48:45 +00:00
61e932a890 Turn off SPECTRE mitigation in jit code
SPECTRE attacks mitigations were added to SpiderMonkey's JIT output in
version 57. Turning these off is a very large speedup, around 10-20%
wall time (on my computer) depending on the map and the situation.
For the most part, from profiling on my machine, this is from memory
fences after JIT -> C++ calls. 0 A.D. does a lot of these.

The SPECTRE class of attack is a timing attack based on speculative
execution to leak sensitive information, and it seems extraordinarily
unlikely that something like this could be successfully mounted using 0
A.D.

Differential Revision: https://code.wildfiregames.com/D5014
This was SVN commit r27699.
2023-06-14 07:44:23 +00:00
9399ba043e Speed up AI computation by not using structured clones
Following the AI unthreading in 4df03ed2d2 / D3769, structured clones
are no longer needed to pass the gamestate around.
This is much faster, about 10-15% wall time on an AI 1v1 profile.

This also potentially reduces memory fragmentation and GC needs, as
writing clones allocated a lot of data.

Differential Revision: https://code.wildfiregames.com/D5019
This was SVN commit r27698.
2023-06-14 07:32:22 +00:00
e5acc73fcf Remove useless line from 507f44f7f9
This is unused and makes the function twice as slow as it needs to be.

Differential Revision: https://code.wildfiregames.com/D5015
This was SVN commit r27697.
2023-06-14 07:28:37 +00:00
cce7d02036 Bugfix & optimisations to ApplyModifiers
This functions is amongst the most called in JS, so it's important to
make it speedy.

- Bugfix: if 'originalValue' is falsy, the result was never cached. This
in particular affected the minRange of archers, which is 0. It's a large
optimisation on combatDemoHuge, but the effect elsewhere is less likely
to be noticeable.
- Don't go through the helper to get the player Entity ID, in this case
it's slower.
- Concat is slower than Flat() in this case according to my profiling.
- Some micro-optimisation by strict equality.

Differential Revision: https://code.wildfiregames.com/D5012
This was SVN commit r27696.
2023-06-14 07:27:06 +00:00
080599442f Don't send PositionChanged messages in TurnTo when not actually turning
FaceTowardsTarget is called quite often by UnitAI, and we can skip some
un-necessary messages as an optimisation.

Differential Revision: https://code.wildfiregames.com/D5005
This was SVN commit r27695.
2023-06-14 07:23:05 +00:00
44611294de Fixes Sampler::Desc comment about using BorderColor.
This was SVN commit r27694.
2023-06-14 07:14:31 +00:00
8f78ac1ef8 Decouples renderer code from VideoMode to get backend device.
Differential Revision: https://code.wildfiregames.com/D5043
This was SVN commit r27693.
2023-06-14 07:06:22 +00:00
5893c4bc85 Allow to set the biome with the autostart command.
Basically a patch by: @wraitii
Differential revision: https://code.wildfiregames.com/D4976
Comments by: @bb, @sera
Accepted by: @Langbart
Fixes #6521

This was SVN commit r27692.
2023-06-14 06:35:27 +00:00
f64b3f773e Art | Misc actor and texture improvements
This was SVN commit r27690.
2023-06-14 01:23:30 +00:00
14dd3c0aad Make Farmstead aura icon appear over affected Fields as well as gatherers
This was SVN commit r27689.
2023-06-14 01:19:27 +00:00
70c83b9c3d Art | Add a new variant texture for Spartan women
This was SVN commit r27688.
2023-06-14 01:18:03 +00:00
466968ca3e Art | Buildings | New Gallic structure textures with roof shingles instead of thatch.
This was SVN commit r27687.
2023-06-14 01:16:47 +00:00
227bc8db02 Maps | Update a bunch of skirmish maps and add a new one (Arabian Oases 2p)
This was SVN commit r27686.
2023-06-14 01:13:44 +00:00
075d8589f3 Art | Player color for Greek defense tower
This was SVN commit r27685.
2023-06-14 01:07:15 +00:00
9aa118d6be Art | Move Mauryan heads to the correct folder.
This was SVN commit r27684.
2023-06-14 01:01:56 +00:00
22cbd39bbd Civs | Remove AI names which duplicate in-game heroes.
This was SVN commit r27683.
2023-06-14 00:57:58 +00:00
aa7dfc196e Art | New model for the Mauryan Palace
This was SVN commit r27682.
2023-06-14 00:56:01 +00:00
59a805dac8 Art | Fix the ostrich feather actors for Nubian units
This was SVN commit r27681.
2023-06-14 00:36:05 +00:00
50453f1e1f Art | Use a better portrait for Whales
This was SVN commit r27680.
2023-06-14 00:34:18 +00:00
df2a0cf3ab Art | New and improved terrains
New Farmland terrains for various biomes

Remove alpha channel from numerous terrain normal maps

This was SVN commit r27679.
2023-06-14 00:32:34 +00:00