1
0
forked from 0ad/0ad
Commit Graph

8040 Commits

Author SHA1 Message Date
37aa0456c8 Fixes missed assignment to currentTech in ParticleRenderer added in 5adbe4f1a3.
This was SVN commit r26296.
2022-02-04 16:27:35 +00:00
ac77d1c3e0 Moves scissor test management to DeviceCommandContext.
This was SVN commit r26288.
2022-02-01 17:58:21 +00:00
aeaf495da3 Renames GL::CTexture levelCount to MIPLevelCount to match Tex.
This was SVN commit r26287.
2022-02-01 16:48:24 +00:00
a1f98b016b Moves depth and stencil tests to PipelineState and DeviceCommandContext.
Differential Revision: https://code.wildfiregames.com/D4471
This was SVN commit r26286.
2022-02-01 16:38:55 +00:00
709e8292b0 Moves color mask, depth mask and function management from CShaderPass to DeviceCommandContext.
Tested By: Langbart
Comments By: Stan
Differential Revision: https://code.wildfiregames.com/D4465
This was SVN commit r26284.
2022-01-31 20:10:06 +00:00
22db9202f1 Fixes EOL in PipelineState files after 5adbe4f1a3.
This was SVN commit r26283.
2022-01-31 11:47:58 +00:00
8c068aab07 Removes possibility to link lowlevel library dynamically.
Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/D4470
This was SVN commit r26281.
2022-01-31 06:53:30 +00:00
02c96903c5 Renames sgn function to Sign to fit the naming of other MathUtil functions.
This was SVN commit r26276.
2022-01-30 20:51:01 +00:00
0e403632cf Allow giving different weights to different templates when pushing.
This makes it possible to make units heavier, which both push more & get
pushed less by other units.
In particular, the diff does it for siege units & elephants.

This improves movement for these units in crowd situation, since they
will now basically not move when other regular units push into them.

Supported By: asterix, marder
Refs #6127

Differential Revision: https://code.wildfiregames.com/D4452
This was SVN commit r26275.
2022-01-30 14:22:27 +00:00
4df03ed2d2 Run the AI in the same Compartment as the simulation. Let the AI access Sim data.
This is a paradigm change for AI computation.
Historically, the AI was intended to be run in a separate thread from
the simulation. The idea was that slow AI wouldn't stop the renderer
from being smooth.

In that original design, the AI received a copy of the game world and
used that to run its logic. This meant the simulation could safely do
whatever it wanted in the meantime. This copy was done via AIProxy &
AIInterface.

This design ended up having significant flaws:
- The copying impacts the simulation negatively, particularly because
AIProxy subscribes to a lot of messages (sometimes sent exclusively to
it). This time cannot be threaded, and impacts MP games without AIs.
- Copying the data is increasingly difficult. Modifiers are a headache,
LOS is not implemented. Lots of logic is duplicated.

The intended benefits of the design also failed to realise somewhat:
- The AI was never threaded, and in fact, it is probably better to try
and thread Sim + AI from the renderer than just the AI, at which point
threading the AI specifically brings little benefit.

The new design is much simpler and straighforward, but this has some
side-effects:
- The AI can now change the simulation. This can be used for cheating,
or possibly for a tutorial AI.
- The AI runs in the same GC zone as the simulation, which may lead to
more frequent Sim GCs (but overall we might expect a reduction in
temporary objects).
- The AI state was essentially cached, so replacing some functions with
Engine.QueryInterface might be slower. The tradeoff should be balanced
by lower AIProxy computation times.

Future work:
- Threading some specific AI tasks could still be worthwhile, but should
be done in specific worker threads, allowed to run over several turns if
needed.

Technical note: the AI 'global' is in its own Realm, which means name
collisions with the same are not possible.

Other notes:
- The RL Interface uses the AI Interface and thus will gradually lose
some data there. Given that the RL Interface can now request data
however, this should be dine.

Refs #5962, #2370

Differential Revision: https://code.wildfiregames.com/D3769
This was SVN commit r26274.
2022-01-30 13:33:34 +00:00
0779c64052 Add tests for fixed::FromFraction
Differential Revision: https://code.wildfiregames.com/D4458
This was SVN commit r26273.
2022-01-30 12:57:08 +00:00
d740b4f335 Fix bug where 'archive' XMB files could end up being written to the user mod
Users sometimes ended up with bad (wrong version) XMB files in the user
mod. This resulted in A25 loading a black screen.
There is a combination of unfortunate code paths that lead to this. The
core issue is that:
- cdd75deafb changed the XMB loading code that if there is an error in
Init from a cached XMB, it reports an error. This error happens to be
silent, because the GUI expects CXeromyces to do its own error reporting
(a pretty poor decision, all in all, but whatever). This explained why
the black screen showed no errors.
- The code flow attemps to load an 'archive' XMB first, then only a
loose cache. _But_ if the XMB that fails to load is an archive (which
generally never happens except when using incompatible mods, which is
generally less easy in A25 since we added code to stop that), then the
game will try to recreate the XMB as an 'archived' path, not a 'loose
cache' path as it would usually do.
- Because the 'archived' path already exists in the VFS, the game will
attempt to overwrite that. It so happens that in non-dev copies, this
writes to the user mod.
- Because the user-mod is always loaded, this was unexpected for users.

Fixing this is rather simple: the game should never attempt to write
'archive' XMBs in that function. Added explicit barrier, which shouldn't
matter performance-wise but fixes the issue by writing in the proper
place, and also properly recovering in case of read failure.
I will note that the game will still try to load the archived file, and
recreate it every time, but I don't think that's a particularly big
deal, in general having engine-incompatible mods in the future should be
harder because of A25 changes there.
(NB: users that have used both A24 and A25 should perhaps still be
advised to check their user mod folder, otherwise they'll end up
recreating those files forever).

Reported by: dave_k
Fixes #6320

Differential Revision: https://code.wildfiregames.com/D4275
This was SVN commit r26272.
2022-01-30 12:50:43 +00:00
e0d98cd94d Call SetTerrainDirty on CModelAbstract without going through CmpVisualActor
The UnitManager already lists all units, so we do not need to go through
the visual actor of entities to update them. This is faster and
decouples simulation & graphics code slightly.

Further, the simulation does not need to know about texture changes (see
also 410d2e883a), so remove those calls in Atlas.

Differential Revision: https://code.wildfiregames.com/D4455
This was SVN commit r26270.
2022-01-29 08:28:04 +00:00
410d2e883a Remove leftover terrain-based movement cost code.
6581796103 removed the ability for terrain to affect movement speed. The
JPS pathfinder cannot support it, and the approach was poor anyways,
coupling rendering data with simulation data.
This lets us remove the dependency on CTerrainTextureManager everywhere.

Tested by: langbart
Differential Revision: https://code.wildfiregames.com/D4459
This was SVN commit r26269.
2022-01-29 08:22:28 +00:00
1e07283bac Disables possibility to mix shader types with a single backend.
Differential Revision: https://code.wildfiregames.com/D4463
This was SVN commit r26264.
2022-01-28 06:34:34 +00:00
285e542a0a Removes redundant comment about alpha test in shaders forgotten in 5cbd46de94.
This was SVN commit r26260.
2022-01-27 17:32:07 +00:00
d4d1bc039f Moves culling mode and front face state management to DeviceCommandContext.
Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/D4456
This was SVN commit r26259.
2022-01-27 17:25:37 +00:00
83d251406c Move BuildAnimation to CSkeletalAnimMgr / CObjectEntry
There is no need to have BuildAnimation in CModel when everything is
done in CObjectEntry anyways.
This removes a pointer in every CModel object, which is nice.

Accepted By: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D4454
This was SVN commit r26254.
2022-01-26 14:55:19 +00:00
27f64b80ed Remove unused variable following 330b570ba8
Forgotten in that diff.

Reported by: vladislavbelov
This was SVN commit r26250.
2022-01-25 18:47:38 +00:00
330b570ba8 Remove RENDERDATA_UPDATE_COLOR, which is not used, and cleanup.
RENDERDATA_UPDATE_COLOR was used to precompute lightEnv-dependent data
on the CPU. This is no longer done following engine upgrades, and in
particular d7d02a4740 which explictly always did this on the GPU.

ModelAbstract had a 'SetDirtyRec' hack for it because of decals, which
can also be removed. The 'dirty' bit of CRenderableObject is renderdata
for the specific item, never its props, so it never actually needs to be
recursive.

CheckLightEnv is also useless as a result, and removed.

Differential Revision: https://code.wildfiregames.com/D4453
This was SVN commit r26249.
2022-01-25 16:59:29 +00:00
acb043f4a2 Adds a rasterization state to the renderer backend pipeline state.
This was SVN commit r26248.
2022-01-25 16:28:58 +00:00
158cf8ea8d UnitMotion pushing improvements
The main change is the introduction of a 'pushing pressure' counter on
units. This counter increases when units get pushed around, and
decreases over time. In essence, units under high pressure move slower &
are harder to push around.
The major effect is that units can now get bogged down when very dense
groups start colliding. This makes movement more realistic, makes unit
movement more 'chokepointy', and generally improves the mathematical
soundness of the system (lower values are easier to handle for our 200ms
turns).

Other changes:
- The logic to detect units crossing each other's path has been
reworked. Units that run towards each other should not more obviously
avoid each other.
- New parameters: 'Spread' is a measure of how strong the pushing effect
is based on distance. With the current settings, static-pushing is
rather 'on/off', whereas moving-pushing is more gradual (and thus the
max influence distance was increased when moving).
- Default values have been tweaked for lower overlap.
- Units only looked at other units within their grid region. This led to
overlap near grid-borders. Units now look at neighboring grid elements,
which largely removes this issue. While this may be slower, the
performance of pushing was largely negligible before, so it is unlikely
to become a main cause of lag (and overlap was generally disliked by
players).
- Units no longer orient in the direction of pushing, but instead keep
facing their target. This can look slightly odd under very heavy pushing
forces, but vastly improves behaviour of very slow units such as rams
(since they spend much less time turning around). As a side-effect,
clean up angle code following acc780bcbb .

Engine changes:
- Add a debug rendering mode at compile-time to help understand what is
happening.
- Make it possible to constexpr initialise fractional fixed numbers by
using FromFraction

The 'pressure' change was inspired by alre's suggestion at
https://wildfiregames.com/forum/topic/56436-for-a-better-unit-movement/#comment-461987

Refs #6127

Differential Revision: https://code.wildfiregames.com/D4439
This was SVN commit r26245.
2022-01-24 15:36:13 +00:00
4ce609bb1f Uses MIPs for terrain textures previews following e4455a8e8f.
Comments By: Stan
Differential Revision: https://code.wildfiregames.com/D4447
This was SVN commit r26239.
2022-01-24 07:00:55 +00:00
c114bab396 Removes mem_get_ptr from the Tex::get_data comment forgotten in 63086f4e26.
This was SVN commit r26237.
2022-01-23 11:59:35 +00:00
ad5377bc0e Fixes fancy water shores drawing after 1d9a8b2b0b.
Reported By: wraitii
This was SVN commit r26231.
2022-01-20 17:31:21 +00:00
41fe3aafa4 Fixes minimap texture scissoring rect following b5d85e279f. Fixes #6382
This was SVN commit r26229.
2022-01-19 17:40:26 +00:00
5adbe4f1a3 Moves blend state management to DeviceCommandContext. Fixes #6420
Tested By: Langbart
Comments By: Stan
Differential Revision: https://code.wildfiregames.com/D4441
This was SVN commit r26228.
2022-01-19 17:28:47 +00:00
40e75f9c89 Removes binding additional attribute for water shader added in 1d9a8b2b0b.
Reported By: Freagarach
This was SVN commit r26223.
2022-01-15 16:47:42 +00:00
a4a647e9f0 Removes unused variable in ParticleRenderer after fc223e3540.
This was SVN commit r26222.
2022-01-15 16:29:26 +00:00
971b734873 Moves hardcoded blend state in debug overlay and water to their techniques.
This was SVN commit r26218.
2022-01-14 18:44:40 +00:00
fc223e3540 Moves hardcoded blend state in ParticleRenderer to the transparent particles technique.
This was SVN commit r26217.
2022-01-14 18:18:28 +00:00
829e37371b Moves hardcoded blend state in CCanvas2D to its technique.
This was SVN commit r26216.
2022-01-14 17:44:42 +00:00
1d9a8b2b0b Splits water surface and shore drawing functions and fixes their switch.
Differential Revision: https://code.wildfiregames.com/D4436
This was SVN commit r26215.
2022-01-14 17:34:58 +00:00
9aedcade7f Draws slider button only inside its element.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D4435
This was SVN commit r26213.
2022-01-14 06:50:44 +00:00
5cbd46de94 Removes deprecated GL alpha test.
In GL3.0 alpha test mode was deprecated and removed in GL3.3. We should
use discard/kill in shaders instead.
In shaders alpha test was removed in d3a24c26ba, in FFP it was removed
with FFP in b7e6811ea6.

Differential Revision: https://code.wildfiregames.com/D4434
This was SVN commit r26211.
2022-01-13 17:50:28 +00:00
a2ab6b9b72 Allow to cap FPS up to the current max refresh rates of gaming screens: 360Hz
Patch by: @OptimusShepard
Reviewed by: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D4366
This was SVN commit r26207.
2022-01-13 14:30:23 +00:00
712b7ebf9a Remove JS_New in favour of JS::Construct in preparation for SM91
Spidermonkey 91, the next ESR, removes JS_New in favour or
JS::Construct.
See
https://github.com/mozilla-spidermonkey/spidermonkey-embedding-examples/blob/migration-guide/docs/Migration%20Guide.md#object-construction
and
https://bugzilla.mozilla.org/show_bug.cgi?id=1491055

This change is SM78 compatible and therefore done beforehand.

Tested by: Freagarach
Refs #5986

Differential Revision: https://code.wildfiregames.com/D4427
This was SVN commit r26205.
2022-01-12 16:51:32 +00:00
6d28c44f0f Removes unused method from CShaderTechnique.
This was SVN commit r26201.
2022-01-11 16:02:27 +00:00
9757cc2539 Removes direct shader binding, uses BeginPass always following e1374252b7.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D4431
This was SVN commit r26199.
2022-01-11 05:56:44 +00:00
2e38c117d2 Fixes comments of CLOSTexture and CTerritoryTexture following 57ba7c4a1c.
This was SVN commit r26197.
2022-01-10 17:58:51 +00:00
0cda752ec3 Uses CVertexBufferManager handle instead of raw VBChunk pointer management.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D4430
This was SVN commit r26196.
2022-01-10 16:51:43 +00:00
795fb070af Removes asking GL of current bind framebuffer to avoid syncs.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D4422
This was SVN commit r26193.
2022-01-09 07:36:56 +00:00
95318d34ff Removes redundant layer check added in f715b73f4f.
Reported By: Freagarach
This was SVN commit r26189.
2022-01-08 13:44:40 +00:00
9924450d36 Moves default GL state setup to GL device.
This was SVN commit r26187.
2022-01-07 22:21:22 +00:00
5610c71fc6 Fixes rendering big screenshot pieces onto screen, refs 52a8793450.
This was SVN commit r26186.
2022-01-07 20:15:48 +00:00
f715b73f4f Uploads cube textures in SkyManager via DeviceCommandContext.
Commented By: Stan
Differential Revision: https://code.wildfiregames.com/D4421
This was SVN commit r26185.
2022-01-07 20:00:41 +00:00
15c40861b4 Separates terrain alphamap combining and uploading.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D4419
This was SVN commit r26184.
2022-01-07 14:33:54 +00:00
9d7457da9b Removes ogl_tex usage from CRenderer.
This was SVN commit r26181.
2022-01-06 23:23:36 +00:00
b061a7ead4 Optimizes FBO usages for LOSTexture and water shore foam.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D4418
This was SVN commit r26180.
2022-01-06 22:44:54 +00:00
9bc3dd4699 Fixes terrain overlay texture upload after fd976456d7.
Reported By: nwtour
This was SVN commit r26176.
2022-01-06 14:16:32 +00:00