Compare commits

..

757 Commits

Author SHA1 Message Date
Freagarach 32f3d18a15 Fix walk and fight with formations.
Introduced in c87229aa48, FindWalkAndFightTargets returns after the
first UnitAI finds a target, instead of also querying the rest of the
members.

Differential revision: https://code.wildfiregames.com/D4208
Comments by: @Stan, @wraitii
Fixes: #6260

This was SVN commit r25847.
2021-08-03 16:43:43 +00:00
Freagarach c48d0c562f Fix fromations gathering treasures.
Introduced in ea96e81098.
The formation ignored the order to collect a treasure, but got into a
individual state (which should not happen).
Subsequent orders may fail due to unimplemented components/functions.

Reported by: @wowgetoffyourcellphone in
https://wildfiregames.com/forum/topic/39973-a25-feedbacks-from-testing/page/15/?tab=comments#comment-444979.

Differential revision: https://code.wildfiregames.com/D4207
Tested by: @wowgetoffyourcellphone
Comments by: @Stan, @wraitii
Fixes: #6266

This was SVN commit r25846.
2021-08-03 16:42:56 +00:00
Angen 8b0d82be33 Reject FormationWalk if entity is not part of formation anymore
Attack orders can be and looks like are pushed in front of formationwalk
order.
That is generally also logic in single entity behaviour.

In case formation gets destroyed and then target dies, attacker is
supposed to stop attacking target immediately.
That essentially leads to getting to old formationwalk command, what was
not issue for packable units until 674cdae166, that introduced
formationcompoennt into the order.

Hovewer abandoning this order without being in formation makes more
sense. Probably this one and FormationLeave should be FORMATIONMEMBER
specific commands and error out in INDIVIDUAL state, but thats too much
refactoring and potential rabbit hole.

Differential revision: D4206
Reviewed by: @wraitii
Accepted by: @asterix
Fixes: #6263

This was SVN commit r25845.
2021-08-02 16:48:00 +00:00
wraitii 0ba9cbef74 Fix units changing appearance when switching animation.
Bug introduced in 76acc4e146.
The previous CUnit code had logic to select random aesthetic variants
once initially. The new code removed that, as I completely missed its
purpose, assuming that the random selection, being based on a seed,
would pick the same variants every time. This is incorrect because
entity selections can change the RNG calls, thus the variants, and thus
entity appearance can change when the animation changes (typically, a
horse will change color when walking and running).

The solution is to re-introduce the choice of actor selections on CUnit
creation. This makes sure that units don't change their purely-aesthetic
selections when e.g. animations change.

Reported by: Wowgetoffyourcellphone
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D4205
This was SVN commit r25844.
2021-07-31 17:55:10 +00:00
wraitii 12aa35eb3b Fix loading grayscale heightmaps for RM maps.
d2948937a0 introduced code to read Heightmap images into RM terrain
data. However, the original diff contained a bug where it read
Out-of-bounds array data for grayscale images. This bug was hidden by
another issue until D1816 / cbc04ba83b, which changed the code and made
the OOB read actually relevant. The effect was twofold:
- The height chosen was not the max of the 3 color channels, but the max
of the 3 neighboring pixel (thus slightly lowering the quality of
generated maps)
- The height for the bottom-right coordinates were random memory values,
thus garbage.

This random height ended up resulting in non-deterministic map
generation, which was reported on Ngorongoro.

The cause of this silent failure is that the transformation to BGRA is
not applied for grayscale images, as the alpha transformation is
processed first and exits. This is not per-se buggy, so it is not
changed here.
The fixed behaviour is specialized for the common grayscale case, and
retains the max-of-3-color-channel intended behaviour otherwise.

Fixes #6261.

Reported by: Feldfeld
Differential Revision: https://code.wildfiregames.com/D4203
This was SVN commit r25843.
2021-07-31 17:52:05 +00:00
Angen ae744f13f3 Prevent formation members to run when they should not
Reported on forum:
https://wildfiregames.com/forum/topic/41264-alpha-25-pre-releaserelease-candidate-build-testing/page/13/
Introduced in: 40cbde1925
Differential revision: D4201
Tested by: @Freagarach, @marder
This was SVN commit r25841.
2021-07-27 18:20:26 +00:00
Stan cba3528c48 Update translation credits.
- Restore original language names, and keep an English fallback in case
the font is missing for some languages.
Fixes: #6023
Fixes: #6255

This was SVN commit r25839.
2021-07-26 16:40:16 +00:00
Freagarach d3e1184191 Check range extra while gathering to prevent animation changes when gathering from dropsite.
Introduced in 3c4a341906.

Reported by: @wowgetoffyourcellphone
Differential revision: https://code.wildfiregames.com/D4198
This was SVN commit r25837.
2021-07-25 18:14:39 +00:00
Freagarach 5fba65e97d Don't lose trade gain when ordering a trader.
Introduced in 8f04d2ee90 due to overeagerly stopping trade when leaving
the trading-state.
Noticed in:
https://wildfiregames.com/forum/topic/41264-alpha-25-pre-releaserelease-candidate-build-testing/page/9/?tab=comments#comment-437888.

Differential revision: https://code.wildfiregames.com/D4197
Comment by: @Stan
This was SVN commit r25835.
2021-07-23 05:24:41 +00:00
Stan c7a6d49fc8 Translate map name in game setup
Patch by: @s0600204
Tested by: @Langbart
Differential Revision: https://code.wildfiregames.com/D4188
Fixes: #6241

This was SVN commit r25833.
2021-07-20 22:08:36 +00:00
Stan 2bda444435 Fix foundation and corpses phenotypes being different than the source entity.
Reported by: @wowgetoffyourcellphone
This was SVN commit r25832.
2021-07-20 22:04:19 +00:00
Stan c6a9e7188e Fix actor being different after foundation has been built.
Reported by: @wowgetoffyourcellphone
Introduced in: 5b3bdf3647

This was SVN commit r25831.
2021-07-20 21:51:29 +00:00
Stan 72a20be1df Fix rare crash on Linux when opening dropdowns.
Patch by: @wraitii
Accepted by: @Angen
Fixes #5598
Fixes #6225

Differential Revision: https://code.wildfiregames.com/D4183
This was SVN commit r25830.
2021-07-20 20:59:45 +00:00
Stan 5eec8039b4 Fix segfault with daytime option in gamesetup.
Based on patch by: @Angen, @wraitii
Fixes #6238
Differential Revision: https://code.wildfiregames.com/D4182
This was SVN commit r25829.
2021-07-20 20:52:25 +00:00
Freagarach b06dd26dd7 Fix PetraAI constructing ships as ordinary units.
Since 3d7af82328 PetraAI constructed many ships (and cavalry) because
they have the "Ranged" class and we didn't check for "Infantry" anymore
when training workers.

Basically a patch by: @Angen
Differential revision: https://code.wildfiregames.com/D4193
Reviewed by: @Angen
Refs. #6250 by fixing the ships case.
Fixes the concern on 3d7af82328.

This was SVN commit r25828.
2021-07-20 05:18:50 +00:00
Freagarach fe6ce8d402 (Partly) Fix PetraAI building a lot of siege and not using it.
Following 3d7af82328.
The used classes for adding siege were wrong.

Reported in
https://wildfiregames.com/forum/topic/45178-a25-svn-version-25810-not-playable/.
Differential revision: https://code.wildfiregames.com/D4184
Refs. #6250 by (partly) fixing the siege case.
Reviewed by: @Angen
This was SVN commit r25826.
2021-07-18 05:05:13 +00:00
Angen f891ed4e53 Fix treasure in statistics
Introduced in ea96e81098.
Wrong entity is passed when getting statistic tracker, so collected
treasure is not updated correctly in statistics.
Reported on forum:
https://wildfiregames.com/forum/topic/47585-a25-svn-treasures-collected-not-registering-under-resources-summary-playing-atlas-mountains/?tab=comments#comment-441383

This was SVN commit r25824.
2021-07-13 16:46:32 +00:00
Freagarach 68e40575a4 Disable autoqueue when changing ownership.
PetraAI can't cope with that and it may be a suprise for other players
as well, when a captures production entity has autoqueue enabled.

Differential revision: https://code.wildfiregames.com/D4185
Refs: #6213

This was SVN commit r25819.
2021-07-05 06:18:26 +00:00
Stan 4c2d060d73 Move wild lake biome specific entities to a json file like hellas.
Fix map not generating with nubia and steppe biomes (Missing farmsteads
and mercenaries)
Fix an oak being placed no matter the biome and use a biome tree instead
Use the goat instead of a sheep for the alpine biome.

Refs: 4de9c4c164, #6180

This was SVN commit r25816.
2021-06-29 16:48:57 +00:00
Stan dddaa67abd Fix unicode build for Atlas on OpenSuse.
Based on a patch by: @MatSharrow
Reviewed by: @wraitii
Differential Revision: https://code.wildfiregames.com/D4178
This was SVN commit r25815.
2021-06-29 12:41:31 +00:00
Freagarach 7871d74521 Give picking up treasures back its sound.
Introduced in ea96e81098.

Reported by: Gurken Khan in
https://wildfiregames.com/forum/topic/41264-alpha-25-pre-releaserelease-candidate-build-testing/?do=findComment&comment=437100.
Differential revision: https://code.wildfiregames.com/D4180
Tested by: @Langbart
Fixes: #6237

This was SVN commit r25814.
2021-06-29 09:04:24 +00:00
Freagarach 42c3fc12cf Don't show turreted entities as idle.
Introduced in: 21e866fcf0

Reported by: @Palaiologos
Differential revision: https://code.wildfiregames.com/D4179
Tested by: @Langbart
Comments by: @Angen, @wraitii
Fixes: #6233

This was SVN commit r25813.
2021-06-29 08:51:21 +00:00
wraitii 79fb6e6ab2 Fix incorrect comment/default parameter introduced in e1a0cabf5a
Reported by: Freagarach
Differential Revision: https://code.wildfiregames.com/D4176
This was SVN commit r25811.
2021-06-26 09:09:04 +00:00
wraitii a541f3a317 Fix hotloading making models disappear.
The actors were always hotloaded because of a bad logic change in
76acc4e146.

Fixes #6228

Differential Revision: https://code.wildfiregames.com/D4175
This was SVN commit r25805.
2021-06-17 07:52:50 +00:00
Freagarach 8c7d77a610 Fix serialisation crash when patrolling.
6778fc4ea6 introduced waiting at the patrol points, but it was possible
that at such a point an enemy was noticed, thus quiting the "look
around" state, deleting `this.stopSurveying`, which was later `++`-ed.
That lead to an `NaN` property which got serialised. `NaN` serialisation
crashes as of 0e7fafebe1.

Differential revision: https://code.wildfiregames.com/D4177
Reported in:
https://wildfiregames.com/forum/topic/41264-alpha-25-pre-releaserelease-candidate-build-testing/page/4/?tab=comments#comment-435709
Reviewed by: @wraitii
This was SVN commit r25804.
2021-06-17 07:40:24 +00:00
wraitii 17c54d5a69 Fix options occasionally thinking they've been modified when they haven't.
std::array leave the values in an undefined state which can very well be
'true'.

Tested By: Freagarach
Fixes #6205

Differential Revision: https://code.wildfiregames.com/D4170
This was SVN commit r25802.
2021-06-16 15:54:55 +00:00
wraitii d8f0bde05e Reset the campaigns previews
I had used a debug image which I left in and which looks broken.
Removing it defaults to the normal 'missing preview' 0 A.D. image which
looks more correct.

Differential Revision: https://code.wildfiregames.com/D4172
This was SVN commit r25801.
2021-06-16 15:53:19 +00:00
wraitii 8e26bd0446 Fix bug with map-dependent random settings
Settings like Landscape, Daytime & team placement are map dependent. If
"random" map is chosen, we first must select the map before selecting
these.
This wasn't done correctly and so starting "random" map that picked e.g.
Unknown could fail.

Biomes were already correctly handled.

Reported by: langbart
Fixes #6227

Differential Revision: https://code.wildfiregames.com/D4173
This was SVN commit r25800.
2021-06-16 15:52:19 +00:00
wraitii eafa7fc005 Mirage unrepairable in cmpRepairable.
e0800bc092 introduced a `repairable` toggle, but did not mirage that
function, meaning one could not repair an allied miraged structure.

Reported by: Langbart
Patch by: Freagarach
Refs #6226

Differential Revision: https://code.wildfiregames.com/D4171
This was SVN commit r25799.
2021-06-15 08:46:14 +00:00
Itms 6f49e7bd6b New key for signing A25-compatible mods.
This was SVN commit r25798.
2021-06-14 19:42:00 +00:00
Freagarach fde057dd1c Provide Magadha description.
Text by: @wowgetoffyourcellphone
Patch by: @Langbart
Differential revision: https://code.wildfiregames.com/D4169
Comment by: @marder
Fixes: #6222

This was SVN commit r25796.
2021-06-14 06:15:28 +00:00
vladislavbelov 6b493aa52c Fixes big screenshots, implements CCamera::GetViewQuad properly for custom projections.
Differential Revision: https://code.wildfiregames.com/D4165
This was SVN commit r25794.
2021-06-13 17:42:37 +00:00
wraitii 08400276e1 Slight size increase for the parchment background of loading screen tips.
Prevents overflow in some translations, and aligns it better with the
tip image.

Patch by: Langbart
Fixes #4754

Differential Revision: https://code.wildfiregames.com/D4167
This was SVN commit r25793.
2021-06-13 15:12:14 +00:00
wraitii 893ea3cd10 Alpha 25 Name: Yaunā
This is the old Persian variant of Ionian.

Differential Revision: https://code.wildfiregames.com/D4130
This was SVN commit r25792.
2021-06-13 15:08:27 +00:00
wraitii 467f2140be Fixup 21bbeb4bbc
I momentarily forgot that `arc patch` only pretends it works with binary
files on SVN.

This was SVN commit r25791.
2021-06-13 15:07:03 +00:00
wraitii 7ca15b42fd Add a tip about the default formation feature.
Differential Revision: https://code.wildfiregames.com/D4166
This was SVN commit r25790.
2021-06-13 15:02:54 +00:00
wraitii 21bbeb4bbc Update some MR map previews.
Updates the map previews of all the Best for MP maps & Empire

This removes the fancy mainland biome switch because it was the only map
to do that and we lack the tools to automate it.

Differential Revision: https://code.wildfiregames.com/D4159
This was SVN commit r25789.
2021-06-13 14:56:16 +00:00
wraitii b4b7a1fc3a Fix issues with Introductory Tutorial
- Actually win at the end, thus advancing the campaign
- Count rams properly
- Show the ready button for the city-phase when cheating.

Reported by: langbart
Fixes #6188

Differential Revision: https://code.wildfiregames.com/D4161
This was SVN commit r25788.
2021-06-13 08:55:37 +00:00
wraitii 9ef19ad795 Remove African Plains from "best for Mp" maps
Too similar to either Nearestern Badlands or Mainland.
It seems better to remove it from the filter for this release.

Differential Revision: https://code.wildfiregames.com/D4160
This was SVN commit r25787.
2021-06-13 08:46:12 +00:00
wraitii f189172db6 UnitMotion hack to fix units being stuck near corners.
I think there is a small mismatch between CheckMovement & the vertex
pathfinder when computing passability because one is ray-based and the
other just uses edges. However, it's out of my reach to fix it for now.
This can lead to units being stuck near building edges occasionally.
This introduces an un-intrusive recovery strategy (aka a hack) in
HandleObstructedMove that should get the units unstuck.

Should fix #6114 (to a sufficient extent anyways)

Differential Revision: https://code.wildfiregames.com/D4162
This was SVN commit r25786.
2021-06-13 08:43:32 +00:00
wraitii caebc4d3f9 Update the splash screen.
Link to the forums instead of solely the known issues. We have an FAQ
button already, and there are fewer known issues than in the past.

Remove the bit about formations, which isn't really relevant anymore,
and instead add a request for contributions.

Differential Revision: https://code.wildfiregames.com/D4156
This was SVN commit r25785.
2021-06-13 08:40:26 +00:00
wraitii a5399d34b8 Floor turn rates to 4
The pathfinders are not aware about turn time, and pathing becomes quite
poor with such low turn rates, leading to units that take much longer to
move than they used to.

Until the pathfinders are updated, we should refrain from using very low
turn rates on actual units.

Refs #6142

Differential Revision: https://code.wildfiregames.com/D4163
This was SVN commit r25784.
2021-06-13 08:11:48 +00:00
Imarok dd779872c4 Small tweak of map flare characteristics
Refs #3491

Differential Revision: https://code.wildfiregames.com/D4099
This was SVN commit r25783.
2021-06-12 22:35:30 +00:00
wraitii bfc20bc847 Add a background to campaign load page
Differential Revision: https://code.wildfiregames.com/D4157
This was SVN commit r25781.
2021-06-12 17:20:01 +00:00
wraitii 7e423fe20e Only show the full template run name + template name if they're different.
The campaign screen currently shows both the name of the run (selected
by the user) and the name of the campaign. This is, by default, the
same, and thus looks weird.

Reported by: langbart, marder
Tested by: marder
Differential Revision: https://code.wildfiregames.com/D4158
This was SVN commit r25780.
2021-06-12 17:19:09 +00:00
wraitii 956b3f96db Improvement to autoqueue usability
The graphical interface will show autoqueued units as 'ghost' units so
the player gets immediate feedback on what's happening.
The autoqueue disengages if it runs out of resources or entity limits:
this reflects that the autoqueue cannot resume on its own.

By changing the spot where the autoqueue pushes items, the autoqueue no
longer 'buffers' one unit in advance, but remains very slightly less
efficient than manual queuing. This also prevents cheats from leading to
a ton of units accidentally being created.

Accepted By: Freagarach
Refs #6213

Differential Revision: https://code.wildfiregames.com/D4144
This was SVN commit r25779.
2021-06-12 09:43:57 +00:00
wraitii 42d6893eb8 Fix lobby dgame details panel with incompatible mods.
There was an issue in 07e44a75a1 that made the game details mostly red
with incompatible mods.
This fixes that: now only the 'Mods' title is red, and I added specific
text to highlight why it's colored that way.

Based on a patch by: Langbart
Differential Revision: https://code.wildfiregames.com/D4153
This was SVN commit r25778.
2021-06-12 08:57:34 +00:00
Freagarach 721cfa7ae6 Improve some options texts.
Differential revision: https://code.wildfiregames.com/D3741
Comments by: @Nescio, @wraitii
This was SVN commit r25777.
2021-06-12 05:56:23 +00:00
Freagarach f537fdd87d Look for resources nigh the order when forced.
When tasked to gather, entities looked for resources close to their
current location when the target was invalid (e.g. full).
Now on forced orders the entities will look for resources close to that
order's location, when possible.

Differential revision: https://code.wildfiregames.com/D4146
Fixes: #6085
Reviewed by: @Imarok
Tested by: @Langbart
Comments by: @marder, @Stan, @wraitii
This was SVN commit r25776.
2021-06-12 05:47:06 +00:00
Imarok b3458d408a Add a setting for the minimap flare lifetime.
Tested by: marder, Langbart
Differential Revision: https://code.wildfiregames.com/D4135
This was SVN commit r25775.
2021-06-11 20:47:09 +00:00
Imarok abe7211e15 Remove duplicated loading tip images
In 9b50e4475f I committed some duplicated images.
Noticed by: wowgetoffyourcellphone
This was SVN commit r25774.
2021-06-11 19:07:34 +00:00
Stan ded4859e6e Fix missing templates on wild_lake.js.
Broken in 8ee6774d12

Reported by: @Nobbi
This was SVN commit r25773.
2021-06-11 15:41:40 +00:00
wraitii e1a0cabf5a RM generation: improve metal mines generation
Introduces a new helper to place mines. use it on 'Best for MP' maps for
stone and metal.

The amount of metal will scale with the # of players, and will place
slightly more mines overall for fairer distribution.

This should make 1v1 and 4v4 more playable on these maps.

Differential Revision: https://code.wildfiregames.com/D4148
This was SVN commit r25772.
2021-06-11 15:14:40 +00:00
wraitii ffd62e08d8 Speed up Corinthian Isthmus / Lorraine Plain RM generation
Both maps were using extremely high smoothness setting, that did nothing
but lag extremely.

Differential Revision: https://code.wildfiregames.com/D4150
This was SVN commit r25770.
2021-06-11 06:38:16 +00:00
Imarok fa218b66bb Loading tips: Dynamically adjust the title height and fix the width
Tested by: Langbart
Differential Revision: https://code.wildfiregames.com/D4152
This was SVN commit r25768.
2021-06-10 19:59:23 +00:00
Imarok 9b50e4475f Brush up the loading tips
New loading screen tips. Update for the pictures and the text.

Patch by: marder
Reviewed by: Freagarach
Some based on work of: wowgetoffyourcellphone
Fix #6191

Differential Revision: https://code.wildfiregames.com/D4107
This was SVN commit r25767.
2021-06-10 17:25:18 +00:00
Stan 79e772152b Fix game not closing when compiled with --without-nvtt.
Fixes: #6107

Differential Revision: https://code.wildfiregames.com/D4138
This was SVN commit r25766.
2021-06-10 15:42:38 +00:00
wraitii 4de9c4c164 Fixes for some random maps.
- Hellas_biome isn't a RM but as a JSON script it does load, and then
silently fails on mapgen. Explicitly fail.
- Fix player.js when a valid position cannot exist.
- Fix unknown.js when landscape isn't set in the settings.

Reported by: vladislavbelov
Refs #6180

Differential Revision: https://code.wildfiregames.com/D4147
This was SVN commit r25765.
2021-06-10 13:16:10 +00:00
wraitii b84e268a1f Fix arctic biome with postrocessing and tweak for nubia and steppe
- Arctic biome was much too bright with postprocess (error in
717a9d0252)
- Change sun angle in Nubia to make the grass less yellow at default
camera angle
- Change sun angle in Steppe to make the game look less flat at default
camera angle.

Patch by: marder
Differential Revision: https://code.wildfiregames.com/D4145
This was SVN commit r25764.
2021-06-10 06:48:38 +00:00
wraitii 0b6486dc7a Fix 0 A.D. quitting 'too fast' when it gains focus after alt+F4
There appears to be an SDL issue with linux and X11 that causes Keydown
events to be sent immediately when 0 A.D. gains focus. This can loead to
Alt-F4 quitting 0 A.D. immediately upon focus gain, such as when another
application was quit via Alt-F4.

The typical bug case was:
- Open 0 A.D.
- Open another app
- Alt-F4 other app
- 0 A.D. immediately receives alt-F4 as well and exits.

Since SLD handles this hotkey natively via SDL_QUIT, it seems easier to
default to "no hotkey", as that fixes the problem.

Reported by: Imarok
Fixes #6092

Differential Revision: https://code.wildfiregames.com/D4132
This was SVN commit r25762.
2021-06-09 18:39:06 +00:00
Imarok 4ee03b544d Disable the flare button for observers.
Use the new button that Stan committed in b3ec0d48ba
Reviewed by: Freagarach
Differential Revision: https://code.wildfiregames.com/D4136
This was SVN commit r25761.
2021-06-09 16:34:53 +00:00
wraitii 270378414e Uncompress cached DDS in mouse event mask.
Reported by: langbart
Differential Revision: https://code.wildfiregames.com/D4142
This was SVN commit r25759.
2021-06-09 13:50:57 +00:00
wraitii f620ed8750 Make grass greener in temperate biome
And slightly reduce the desaturation since it now looks better.

Patch by: marder
Differential Revision: https://code.wildfiregames.com/D4139
This was SVN commit r25758.
2021-06-09 08:55:44 +00:00
wraitii 717a9d0252 Further RM biome tweaks
- Make Savanna and Nubia have a .25 Forest probability.
- Remove brightness changes from HDR, this made postproc look too
different, particularly on Savanna
- Lower postproc impact on constrast/saturation for the same reasons.
- Lighten up Aegean, Alpine, Savanna, Nubia, slightly darken Arctic
- Make Aegean water a bit bluer. Likewise lightwen Savanna water.
- Fix the sun elevation/rotation on Nubia, Sahara and Savanna
- Remove the HDR settings of Cantabrian Highlands
- Remove the water/HDR settings of Corinthian Isthmus RM

Comments by: marder
Differential Revision: https://code.wildfiregames.com/D4124
This was SVN commit r25757.
2021-06-09 08:17:12 +00:00
wraitii 324b4bdf64 Small tweak to the Roman Army Camp balance
- Max garrison reduced to 20, like fortresses (caps the capture regen
rate)
- Can construct rams
- Cost an additional 100S/100M

The capture stats have been tweaked but there's no fundamental change.

See also D4080

Differential Revision: https://code.wildfiregames.com/D4109
This was SVN commit r25756.
2021-06-09 06:42:20 +00:00
wraitii a36e7d6986 Make elephant archers cost 2 population.
This is intended to make a deathball of elephant archer less OP, as the
units are difficult to mass but really strong once that is done.

See D3599 for larger changes.

This was SVN commit r25755.
2021-06-09 06:40:35 +00:00
wraitii 05ace86b76 Fix caledonian meadows.
Broke in 6cc6d8c156

Refs #6180

Differential Revision: https://code.wildfiregames.com/D4131
This was SVN commit r25754.
2021-06-09 06:35:17 +00:00
wraitii b8758c8941 Prevent ProductionQueue.AddItem for going over the entity limits / Fix autoqueue being able to train infinite heroes.
Autoqueue can ignore entity limits like Heroes, because AddItem does not
check for them, only commands.js. This changes that, fixing the
autoqueue.

Reported by: Player of 0AD
Tested by: langbart
Refs #6213

Differential Revision: https://code.wildfiregames.com/D4133
This was SVN commit r25753.
2021-06-09 06:33:52 +00:00
s0600204 184ed2fb55 Apply modifiers from civ/team bonus auras in Reference Suite
The Reference Suite (Structure Tree, Civ Info, Viewer) wasn't taking
into
account civilization- or team-bonus auras when calculating entity stats.

This wasn't really a problem (for Vanilla 0AD) prior to a18d97b047, as
civ-bonus auras don't exist in Vanilla 0AD, and our team-bonus auras
didn't
apply to the owning civ before that change. Now they do, the Suite needs
to
take them into consideration.


Differential Revision: https://code.wildfiregames.com/D4093
This was SVN commit r25751.
2021-06-08 23:35:44 +00:00
s0600204 06672206d4 (Re)display phase idents in Structure Tree
They were all set to hidden-by-default as part of b7ff371d00, only there
wasn't anything to tell them to unhide when we actually want them. This
commit
fixes that.


Differential Revision: https://code.wildfiregames.com/D4114
This was SVN commit r25750.
2021-06-08 23:20:39 +00:00
vladislavbelov 990d61a74a Draws all characters for a very long text of the same style.
Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/D4120
This was SVN commit r25749.
2021-06-08 18:17:10 +00:00
wraitii 870e689e5f Unit pushing: fix pairs of unit being allowed to overlap.
Following 40cbde1925, the minimum pushing force is 0.2. This also
happens to be the maximum pushing force any pair of units can exert on
each other, so they can freely overlap instead of being pushed.

This tweaks settings slightly to fix that problem.

Reported by: marder
Differential Revision: https://code.wildfiregames.com/D4129
This was SVN commit r25748.
2021-06-08 16:38:06 +00:00
wraitii 83703992c9 Fix speed glitch
Introduced in 40cbde1925
MoveToFormationOffset may be called after the formation controller is
reset, leading to issues. It seems best to trust only
SetMemberOfFormation.

This causes the speed glitch experienced by wow & Valihrant.

Differential Revision: https://code.wildfiregames.com/D4128
This was SVN commit r25747.
2021-06-08 16:03:31 +00:00
wraitii b7ff371d00 Prevent OOM crash in Reference Tree on error
The structTree, in case of errors, could have enough items to draw to
trigger an OOM failure in the Arena allocator.

This fixes that by hiding elements by default and some c++ memory
optimisation (mostly, this should make all platforms take the same
memory footprint for VisibleObject).

Discussed with vladislavbelov and s0600204

Differential Revision: https://code.wildfiregames.com/D4114
This was SVN commit r25746.
2021-06-08 14:57:59 +00:00
Stan 858148d332 Add garrison flags for all wonders.
Fixes: #6160
Refs: #4581

This was SVN commit r25745.
2021-06-08 12:04:08 +00:00
Stan f3be9bd465 Fix forge garison flag and add some missing death particles.
Refs: #4581
Refs: #6160

This was SVN commit r25744.
2021-06-08 11:42:31 +00:00
Stan 1aa944b0bb Slightly improved parchment.png texture.
Patch by: @marder
Refs:  D4107

This was SVN commit r25743.
2021-06-08 11:05:44 +00:00
Stan 055c2d009b Change the mine selection sound and make it louder.
Patch by: @Langbart
Fixes #6184

Differential Revision: https://code.wildfiregames.com/D4102
This was SVN commit r25742.
2021-06-08 10:42:15 +00:00
wraitii d03112d2f6 Fix gamesetup issues with map filters.
Redo 09a33b6626.
When the host set te 'best for mp' mapfilter and a non-default maps,
ordering issues bugged things out.
This handles things slightly better.

Fixes #6208

Differential Revision: https://code.wildfiregames.com/D4121
This was SVN commit r25741.
2021-06-08 08:51:36 +00:00
wraitii 224a96373b Revert parts of 09a33b6626
There is an issue when no matchsettings.json is present.

This keeps the network synchronisation fix, that worked.

This was SVN commit r25739.
2021-06-07 19:55:05 +00:00
wraitii 1d518f5d6f Fix MouseEventMask for bundles.
The .png get converted to .dds and they failed to load. Use a custom
CacheLoader since that's lightweight enough and avoids having to hack
into the texture manager.

Thanks Stan for testing

Differential Revision: https://code.wildfiregames.com/D4119
This was SVN commit r25738.
2021-06-07 19:27:54 +00:00
wraitii 65ae6543c3 Increase maximum size of mac bundle DMG
The game is slightly over 3G now.
This doesn't affect the actual DMG size, just the maximum size we can
write into it.

Differential Revision: https://code.wildfiregames.com/D4118
This was SVN commit r25737.
2021-06-07 18:56:32 +00:00
wraitii f5f493681d Fix atlas crash with RM capture the relic.
As no default values got set, some game settings became NaN, which
triggered exceptions.
This sets sane default.

This also includes better debugging logic in case of exception, so it's
easier to know what happens.

Fixes #6200

Reported by: langbart
Differential Revision: https://code.wildfiregames.com/D4113
This was SVN commit r25736.
2021-06-07 18:48:16 +00:00
vladislavbelov 67539a8837 Fixes an old bug with missed handle appeared in 63c1347ef7.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D4115
This was SVN commit r25735.
2021-06-07 18:45:28 +00:00
wraitii d95eda9eb3 Add description for new hotkeys
Adds a proper description for flare & last attackfocus hotkeys.
Fixes eb2e489898 and 8e63a0322c

Reviewed By: Imarok
Differential Revision: https://code.wildfiregames.com/D4116
This was SVN commit r25734.
2021-06-07 18:45:03 +00:00
wraitii 275ee9d75b Disable TreasureCollector component in siege engines.
This is unexpected and does not seem particularly useful/sensical.

Patch by: pszemsza
Fixes #5214

Differential Revision: https://code.wildfiregames.com/D3929
This was SVN commit r25733.
2021-06-07 12:54:08 +00:00
wraitii 7e9bb4d4e8 Only save MP match settings if the player is the controller
Broken in 72f0fdb41b.

Differential Revision: https://code.wildfiregames.com/D4112
This was SVN commit r25732.
2021-06-07 11:45:14 +00:00
wraitii 09a33b6626 Fix MP gamesetup issues with mapfilter
- Settings weren't sent to the server when mapfilters change.
- Because of ordering issues, the 'multiplayer' mapfilter would be
activated at the wrong time and things would go haywire.
- Likewise, selecting a non-default map with a non-default filter
wouldn't work well.

Fixes #6208

Differential Revision: https://code.wildfiregames.com/D4111
This was SVN commit r25731.
2021-06-07 11:40:43 +00:00
wraitii 70f2ac6788 Fix error on resign with formation
Formation controllers that were about to be destroyed could bug out.
It's plausible this bug would also happen with regular units, but
couldn't reproduce.

Differential Revision: https://code.wildfiregames.com/D4110
This was SVN commit r25730.
2021-06-07 11:38:16 +00:00
Stan a8480b1dc9 Fix incorrect animation for african elephants
Patch by: @wowgetoffyourcellphone
This was SVN commit r25729.
2021-06-07 09:48:34 +00:00
Stan b3ec0d48ba Add a disabled flare icon for observers.
This was SVN commit r25728.
2021-06-07 08:51:23 +00:00
wraitii cdb73b29f2 Lower Forge technology costs, introduce a 3rd level.
Follows 9a3da390b9 / b5bbed4690.
Forge technologies are cheaper in A24, but still too expensive to use
directly, making the forge not immediately useful.
This changes the technologies from 2 levels to 3, and further decreases
costs.
Instead of 600/400 then 900/600, costs are 200/100, 350/250 then
500/400. This makes the Town Phase techs immediately accessible, and
lengthens impact of City Phase with stronger late techs.

Iberians and Mauryas had a special "wootz steel" tech that gave
swordsmen +20% damage, this is folded into the 3rd level. I have not
changed the effect because the tech was cheap, but we shall see.

Patch by: Nescio
Comments by: borg-, Valihrant
Differential Revision: https://code.wildfiregames.com/D3679
This was SVN commit r25726.
2021-06-07 07:33:59 +00:00
wraitii d0989ee3ac Expand Experience trickle to stables and elephant stables
Increases consistency, unlikely to be overpowered. Temple and Fortress
were considered but found risky of being too strong.

Patch by: langbart
Differential Revision: https://code.wildfiregames.com/D3994
This was SVN commit r25725.
2021-06-07 06:55:59 +00:00
wraitii 8e853a7a0d Lower infantry crossbowmen walk speed.
Their lowered prepare time (since c78ead79e6) makes them too good at
hit-and-run, they should be slower since a crossbow is encumbering.

Accepted By: ValihrAnt
Differential Revision: https://code.wildfiregames.com/D4096
This was SVN commit r25724.
2021-06-07 06:50:26 +00:00
wraitii add76379d4 Correctly reset teams when changing scenario.
When switching scenarios, teams should always be reset.
Do nothing in skirmish mode.

Reported by: Stan
Differential Revision: https://code.wildfiregames.com/D4104
This was SVN commit r25723.
2021-06-07 06:46:11 +00:00
wraitii 7787176802 Ship the fontbuilder folder to distribute font licenses
Fixes #6198

Differential Revision: https://code.wildfiregames.com/D4090
This was SVN commit r25722.
2021-06-07 06:43:54 +00:00
wraitii 88e6671388 Lower Champion Elephant armor against Pierce.
Elephants go from 2150 real HP to 2100 against Hack and 1700 against
Pierce.
The intention is to make them more vulnerable to range (and somewhat
spearmen as well).

Suggested by: Valihrant
Differential Revision: https://code.wildfiregames.com/D4058
This was SVN commit r25721.
2021-06-07 06:40:38 +00:00
wraitii d9511564ce Fixup tooltips after 73dcf36976
Some civ-specific variants had specific tooltips.

Differential Revision: https://code.wildfiregames.com/D4095
This was SVN commit r25720.
2021-06-07 06:36:42 +00:00
vladislavbelov 8597cd2c2e Removes FFP shader program. Fixes #5791
This was SVN commit r25717.
2021-06-06 19:49:43 +00:00
Imarok cc4087f3fe Don't open the template viewer when in special input state
Fix #6041

Differential Revision: https://code.wildfiregames.com/D4105
This was SVN commit r25716.
2021-06-06 19:00:04 +00:00
Imarok eb2e489898 Add a hotkey to focus on the last attack alarm
Fix #5608

Differential Revision: https://code.wildfiregames.com/D4101
This was SVN commit r25715.
2021-06-06 18:29:48 +00:00
vladislavbelov e0b492a83a Removes old gui_* materials, replaced by a single canvas2d material.
This was SVN commit r25714.
2021-06-06 18:25:04 +00:00
vladislavbelov 7d039f2627 Replaces gui material by solid material in water waves rendering.
This was SVN commit r25713.
2021-06-06 18:13:20 +00:00
vladislavbelov fa03eb3485 Switches ShadowMap debug rendering to canvas2d material.
This was SVN commit r25712.
2021-06-06 18:05:10 +00:00
vladislavbelov 30e135693e Implements configurable cascade shadows.
Tested By: Langbart, Stan, wraitii
Differential Revision: https://code.wildfiregames.com/D3972
This was SVN commit r25711.
2021-06-06 16:44:54 +00:00
Imarok ca6fcb28ab Don't store the camera pointer in the minimap
Reviewed by: vladislavbelov
Fix #5973

Differential Revision: https://code.wildfiregames.com/D4100
This was SVN commit r25710.
2021-06-06 16:08:10 +00:00
vladislavbelov 63c1347ef7 Removes windows enumeration on Windows to retrieve HWND taking it from SDL and wxWidgets.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D4064
This was SVN commit r25709.
2021-06-06 15:31:55 +00:00
wraitii 40cbde1925 Further Pushing tweaks: more customisable, longer ranges.
This overall decreases the deathball effect from units walking to each
other a bit.
- Fix formations - this cleans up a UnitMotion hack for formations,
making it possible to increase pushing ranges without breaking closely
knit formations like testudo.
- Make MINIMAL_PUSHING and the MOVE_EXTENSION configurable, and add a
STATIC_EXTENSION as well.
- Increase the pushing range significantly, making units sparser.

Differential Revision: https://code.wildfiregames.com/D4098
This was SVN commit r25708.
2021-06-06 15:25:52 +00:00
Stan 063408c252 New pikemen small shields.
Patch by: @wowgetoffyourcellphone,
This was SVN commit r25707.
2021-06-06 14:28:28 +00:00
Stan cea23ac864 Improve the UVMap of some old rocks. They were looking very weird with some of the new textures.
This was SVN commit r25706.
2021-06-06 14:27:02 +00:00
Stan 683759c4c6 Fix some texture bug on tree_oak_new_c the uv was referencing some transparent parts of the texture. The texture was also a bit too transparent on the bark.
Reported by: @vladislavbelov
This was SVN commit r25705.
2021-06-06 11:23:32 +00:00
vladislavbelov 7fdbe037dd Uses canvas2d material for line drawing instead of gui_solid.
This was SVN commit r25704.
2021-06-06 10:13:57 +00:00
vladislavbelov 337c4100ce Cleanups ddbf1ea770 which fixes 4ffc005a7f. Sprites can not be inserted twice.
This was SVN commit r25702.
2021-06-06 09:31:36 +00:00
wraitii 374b869480 Tweaks to the alpine RM biome
- Rename to subalpine to fit the theme better & tweak tooltip
- improve the shore textures
- remove the snow dir texture which contrasted too heavily.

Differential Revision: https://code.wildfiregames.com/D4027
This was SVN commit r25701.
2021-06-06 08:24:39 +00:00
wraitii 3f2265a09e Update for the Steppe RM biome
- Change the grass actor, which was too lighting dependent and heavy on
performance
- Change the main terrain texture which was quite noisy
- Change shore textures to be more seamless.

Based on a patch by: marder
Differential Revision: https://code.wildfiregames.com/D4025
This was SVN commit r25700.
2021-06-06 08:21:35 +00:00
wraitii 8af0689b5f Fix gamesetup player assignment issue when joining
Switch some logic from C++ to JS in PREGAME for player assignments. Refs
#3049

Fixes #6204

Reported by: Imarok
Tested By: Imarok
Differential Revision: https://code.wildfiregames.com/D4092
This was SVN commit r25699.
2021-06-06 08:02:28 +00:00
wraitii ddbf1ea770 Hotfix 4ffc005a7f
A GUI sprite can have e.g. "color:" and "stretched:", but 'sprite' was
moved from after the first call.
Refs #6206

Differential Revision: https://code.wildfiregames.com/D4094
This was SVN commit r25698.
2021-06-06 07:44:20 +00:00
wraitii 73dcf36976 Remove territory root from fortresses.
Reverts D1762 / 014c2922f2.
Because any territory connected to a root does not decay, this made it
possible to anchor CC territories by adding a fortress somewhere, thus
making it much, much harder to push against an enemy territory.
This led to a much more turtley gameplay and overall made the game
worse.

For now, I do not reintroduce the larger territory range (which was
reduced in 014c2922f2).

Differential Revision: https://code.wildfiregames.com/D3989
This was SVN commit r25697.
2021-06-06 07:35:40 +00:00
vladislavbelov 4ffc005a7f Removes raw pointers management from sprites owned by CGUI.
This was SVN commit r25695.
2021-06-06 00:32:49 +00:00
vladislavbelov 8e150199a8 Removes raw pointers management from CGUISprite.
This was SVN commit r25694.
2021-06-06 00:22:43 +00:00
vladislavbelov a2257237b3 Removes raw pointers management from GUIScrollBarOwner.
This was SVN commit r25693.
2021-06-06 00:12:31 +00:00
vladislavbelov fdb4040838 Adds HiDPI mode for testing. HiDPI on Windows isn't supported in SDL yet. So we use a custom code.
Differential Revision: https://code.wildfiregames.com/D4076
This was SVN commit r25692.
2021-06-05 19:01:37 +00:00
Imarok 8e63a0322c Map flares
Add flaring on the map and resize the minimap buttons.
Target marker and button by Stan.
Reviewed/Commented by wraitii, elexis, vladislavbelov
Refs: #3491
Refs: #57

Differential Revision: https://code.wildfiregames.com/D1751
This was SVN commit r25691.
2021-06-05 17:37:18 +00:00
s0600204 3bb5f364c2 (Reference Suite) Support aura-based civilization bonuses
As a side effect of 6b7a80b260, this is now trivial to do.

We don't (currently) have any aura-based civ bonuses in Vanilla 0A.D.,
but hopefully modders will find it useful.

This was SVN commit r25690.
2021-06-05 16:39:59 +00:00
s0600204 6b7a80b260 (Reference Suite) Fetch teambonus auras from player_{civ}.xml files
(The `civ` key (in the team bonus aura templates) was added in
190d6e7cf5 for the
purpose of identifying which aura belongs to which civ. It's no longer
used.)

Proposed by: @Nescio
Comments by: @Freagarach
Refs: 190d6e7cf5
Differential Revision: https://code.wildfiregames.com/D3864
This was SVN commit r25689.
2021-06-05 16:24:25 +00:00
wraitii ad8c7cb2e0 Fixup artic biome: add lillies replacement
Since lillies wouldn't make too much sense, add rocks.

Differential Revision: https://code.wildfiregames.com/D4087
This was SVN commit r25688.
2021-06-05 10:47:20 +00:00
wraitii f3efe47ff6 Default-init atomics in TaskManager::Impl
std::atomic<bool> does not value-initialise the boolean.
This caused windows tests to use way too much CPU and fail.

Differential Revision: https://code.wildfiregames.com/D4089
This was SVN commit r25687.
2021-06-05 09:48:41 +00:00
wraitii 3745940de8 Fix OOS in unit motion
Fixes 592453c62f
wasObstructed and wentStraight are not reset when Move() isn't called,
but PostMove may still be called (if the unit was pushed). This will
OOS.

Differential Revision: https://code.wildfiregames.com/D4088
This was SVN commit r25686.
2021-06-05 09:33:57 +00:00
wraitii 7de9487a87 "New maps" demo campaign
This shows off the new maps, and shows off campaigns in a straighforward
manner.

Differential Revision: https://code.wildfiregames.com/D4020
This was SVN commit r25684.
2021-06-04 18:04:17 +00:00
wraitii 498c2f402d Allow setting a custom page for the 'back' page in the gamesetup.
Forgotten in c012888e2a. This is useful for campaigns that would want to
use the full gamesetup, and in general makes the gamesetup slightly more
flexible.

Differential Revision: https://code.wildfiregames.com/D4082
This was SVN commit r25683.
2021-06-04 17:22:15 +00:00
wraitii f2c9c392bb Rework metal/stone techs to cost Food and Stone.
Food/Wood techs now cost Wood and metal (with food techs being slightly
less expensive as they provide less bonus). Metal/Stone techs now cost
Food and Stone instead of Wood and Metal, reducing the load on those
resources, and making Stone slightly more critical.

Initial work by: Nescio
Accepted By: chrstgtr, Valihrant
Differential Revision: https://code.wildfiregames.com/D3704
This was SVN commit r25682.
2021-06-04 17:20:15 +00:00
wraitii a359275841 Map touchup: Corinthian isthmus
- Support biomes
- Hills, forests, food & metal mines won't spawn on the isthmus anymore,
to avoid obstructions and make things a little fairer
- Stone mines spawn only on the isthmus and players start only with
small stones
- Tidier forests
- The central passageway is sometimes slightly offset left/right
- The central passageway is surrounded by a walkable shallow, which
prevents effectively walling the actual passageway.
- Widen the river slightly.

Overall the intention is to make the map less of a turtle-fest, though
it remains chokepointy by nature.

Differential Revision: https://code.wildfiregames.com/D4062
This was SVN commit r25681.
2021-06-04 17:08:10 +00:00
wraitii eae2538802 Map touchup: gulf of bothnia
- Denser forests
- frozen lake biome gets some watery holes in there, just to make it
slightly more mazey.
- Tweak the lighting of the specific biomes to avoid overexposing the
ground textures.

Differential Revision: https://code.wildfiregames.com/D4073
This was SVN commit r25680.
2021-06-04 16:50:44 +00:00
wraitii 76191d43c8 Map touchup: River/Lake/Mainland/Continent
- Slightly denser forests with the new helper
- good default biome for African Plains in Atlas.

Differential Revision: https://code.wildfiregames.com/D4072
This was SVN commit r25679.
2021-06-04 16:36:02 +00:00
wraitii bc17e1ade3 Map touchup: neareastern badlands
- Support African biomes
- Tidier forests

This was SVN commit r25678.
2021-06-04 16:34:09 +00:00
wraitii 990eea63b9 Map touchup: Cantabrian Highlands
- Support biomes
- Tidier forests

This was SVN commit r25677.
2021-06-04 16:32:37 +00:00
Imarok 146b680d63 Fix borders of game description in gamesetup
Spotted by Langbart
Reviewed by Langbart
Refs 6f9a162dfa

Differential Revision: https://code.wildfiregames.com/D4074
This was SVN commit r25676.
2021-06-04 16:30:36 +00:00
wraitii c1d3584da3 Map touchup: hyrcanian shores
- Properly split mainland & highland forests
- slightly tidier forests
- support biomes

Differential Revision: https://code.wildfiregames.com/D4063
This was SVN commit r25675.
2021-06-04 16:21:59 +00:00
wraitii e865db3bfb Map touchup: Ardennes forest
- reuse settings from the temperate biome
- More wood / slightly denser
- replace the aleppo pine with the Fir, looks better
- Rework the terrain textures

Differential Revision: https://code.wildfiregames.com/D4061
This was SVN commit r25674.
2021-06-04 16:16:53 +00:00
wraitii 5e0b65853b Map touchup: African plains
- Support the 3 african biomes.
- Bigger forests (same # of trees overall)
- More hills/watering holes, more animals there.

Differential Revision: https://code.wildfiregames.com/D4060
This was SVN commit r25673.
2021-06-04 16:00:37 +00:00
wraitii 2599289872 Update the Savanna RM biome
Patch by: marder
Differential Revision: https://code.wildfiregames.com/D4067
This was SVN commit r25672.
2021-06-04 15:39:43 +00:00
wraitii d1e51593cd Fix water texture in aegean biome
The new texture is less visually intrusive thus a better general fit.

Patch by: marder
Differential Revision: https://code.wildfiregames.com/D4026
This was SVN commit r25671.
2021-06-04 15:24:48 +00:00
wraitii 93e450c433 Increase the size of the Lobby Create match dialog
Based on a patch by: langbart
Fixes #6202

Differential Revision: https://code.wildfiregames.com/D4081
This was SVN commit r25670.
2021-06-04 13:10:34 +00:00
wraitii 54dae5257d Make Stable technologies more affordable
Patch by: ValihrAnt
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D3919
This was SVN commit r25669.
2021-06-04 13:00:25 +00:00
wraitii db7d63f208 Add a 'createDefaultForests' wrapper around createForests
This new helper gives fewer but larger forests by default.

Follows 70a4406bef

Differential Revision: https://code.wildfiregames.com/D4071
This was SVN commit r25668.
2021-06-04 12:57:05 +00:00
wraitii 69901d9ffb Tweaks to TaskManager code
Reported by: Vladislav
Differential Revision: https://code.wildfiregames.com/D4077
This was SVN commit r25667.
2021-06-04 12:55:15 +00:00
Stan f9ed769355 Add a mahout for the Maurya support elephant. Re-enabling building should be done in a separate [gameplay] differential.
Fixes: #6091
Thread:
https://wildfiregames.com/forum/topic/37023-task-add-mahout-to-mauryan-worker-elephant/

This was SVN commit r25666.
2021-06-04 10:34:53 +00:00
Stan b2f887da2c Improved Seleucid pikemen and Archers.
Patch by: @wowgetoffyourcellphone
This was SVN commit r25665.
2021-06-04 08:59:11 +00:00
Stan 741d53e3e7 Do not go to the nearest dropsite when full and asked to hunt/slaughter and attack instead. This is fine as long as units don't decay.
Comments by: @wraitii, @Freagarach
Reported by: @FeldFeld
Fixes: #5954
Refs: 6d187f2145
Differential Revision: https://code.wildfiregames.com/D3444
This was SVN commit r25664.
2021-06-04 08:44:15 +00:00
wraitii dd61eb4751 Update "autumn" biome
Patch by: marder
Differential Revision: https://code.wildfiregames.com/D4065
This was SVN commit r25663.
2021-06-04 08:33:13 +00:00
user1 82c44e826d Lobbybots: Send IQ result containing the IP address to a client starting a new hosted match and remove the IP from gamelist stanza.
Refs: D3490, D3184

This was SVN commit r25660.
2021-06-04 00:33:43 +00:00
vladislavbelov b360b7bd2b Disallow hardware without VBO support to simplify vertex buffer usages.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D4054
This was SVN commit r25659.
2021-06-03 22:06:59 +00:00
Stan 45d7bee29b Revert the UI change.
It looks bad on the summary graph, and might need further adjustments in
general.

Discussed with: @Langbart, @Imarok, @wraitii
cc @wowgetoffyourcellphone

This was SVN commit r25658.
2021-06-03 17:02:02 +00:00
wraitii 0ebc08b13c Thread the pathfinder computations using the task manager.
The pathfinder computations are run asynchronously (and potentially on
the main thread) in-between simulation turns, thus reducing
pathfinder-related lag considerably in common cases.

To make this most efficient, the number of paths computed during a turn
via MaxSameTurnMoves is reduced from 64 to 20.

This has a hard dependency on the obstruction manager (via the vertex
pathfinder) not being modified in-between simulation turn (or to put it
more generally on the simulation state not changing outside of turn
computation), otherwise results will be non-deterministic and go OOS.
This is currently entirely safe (as in, it indeed does not happen that
the simulation state changes in-between turn), but future work towards
improving simulation sandboxing would be good.

Thanks to Kuba386 for maintaining & improving the patch in 2020
Thanks to everyone who tested the various iterations of this patch.

Fixes #4324

Differential Revision: https://code.wildfiregames.com/D14
This was SVN commit r25657.
2021-06-03 16:21:28 +00:00
wraitii 1b35d36daa Implement a global task manager using a pool of worker threads
Tasks are simple callables (e.g. lambdas), and can be pushed with 2
priority levels. Pushing a task returns a future.
Futures can be waited on, can return results, and can be cancelled
deterministically. Futures can also not be waited on.

This gives 'hardware concurrency - 1' threads to maximize CPU usage in a
work-stealing workflow.

Reviewed by: vladislavbelov
Refs #5874

Differential Revision: https://code.wildfiregames.com/D3848
This was SVN commit r25656.
2021-06-03 14:48:38 +00:00
wraitii c78ead79e6 Standardize prepare time for ranged units.
Prepare time is the time between an attack order and the arrows actually
flying.

Archers go from 500ms to 800ms standard, making them slower to fire than
other ranged units, and making them slightly harder to micro against
e.g. raids.
Javelineers go from 750ms to 400ms, for the opposite effect.
Crossbowmen, as a 'special' feature, get 200ms, meaning they fire their
first volley really fast despite their long repeat rate.

This also standardizes all javelineer units to have 1250ms repeat time.

Differential Revision: https://code.wildfiregames.com/D4050
This was SVN commit r25655.
2021-06-03 13:49:07 +00:00
wraitii 5d542ab63b Fix new biomes: small mines are again small
The terrain update introduced large actors for both small and large
stone and metal actors. This replaces the small ones by the appropriate
small actors.

Patch by: marder
Differential Revision: https://code.wildfiregames.com/D4057
This was SVN commit r25654.
2021-06-03 13:44:14 +00:00
wraitii 70a4406bef Allow specifying forest size in createForests
This makes it easier to have more forests with fewer trees, or fewer
larger forests.

Differential Revision: https://code.wildfiregames.com/D4059
This was SVN commit r25653.
2021-06-03 13:40:48 +00:00
wraitii 37d979d898 Fix wrong textures in nubia/savanna biome
Differential Revision: https://code.wildfiregames.com/D4068
This was SVN commit r25652.
2021-06-03 13:39:32 +00:00
wraitii 3662b2d5e2 Fix error in HasSameMods with old matchsettings.
Add some retro-compatibility to avoid issues.

First reported by: gameboy
Differential Revision: https://code.wildfiregames.com/D4066
This was SVN commit r25651.
2021-06-03 10:16:59 +00:00
Stan dd0d4dc57a Some more fixes for miletus.
Patch by @wowgetoffyourcellphone.

This was SVN commit r25650.
2021-06-03 07:08:32 +00:00
vladislavbelov 83608c9205 Removes complex transform from TextRenderer.
This was SVN commit r25648.
2021-06-02 22:16:09 +00:00
Imarok 94d669c198 Fix ignoring arrays as supported biomes in gamesetup
Fix regression of dc18d94030.
Spotted by: marder
Reviewed by: wraitii
Differential Revision: https://code.wildfiregames.com/D4044
This was SVN commit r25647.
2021-06-02 22:03:59 +00:00
Imarok 455b784f62 Delete test .zip file after running tests
Issue spotted by kalimaps
Reviewed by: wraitii
Code parts by: wraitii
Differential Revision: https://code.wildfiregames.com/D4043
This was SVN commit r25646.
2021-06-02 21:31:18 +00:00
vladislavbelov 2d455df18d Removes Z value from TextRenderer translate, renames TextRenderer methods to more explicit ones.
This was SVN commit r25645.
2021-06-02 21:21:28 +00:00
Stan ad9cb9d467 Use new small shields for mace archers too.
This was SVN commit r25644.
2021-06-02 18:53:29 +00:00
Stan c8c2b03a08 Differentiate Ptolemaic archers from Seleucid ones. Use a fancier shield mesh.
Patch by: @wowgetoffyourcellphone, @Alexandermb, @Stan
Reported by @Hidan

This was SVN commit r25643.
2021-06-02 18:49:39 +00:00
Stan 6243fd07da New UI background
Patch by: @wowgetoffyourcellphone
This was SVN commit r25641.
2021-06-02 18:04:19 +00:00
Stan d4cf36574e Some map tweaks
Patch by: @wowgetoffyourcellphone
This was SVN commit r25640.
2021-06-02 18:03:38 +00:00
Angen dfbc481ec1 [Mod] Fix list and filter in mod selection breaking page when mod is missing some attribute
In case mod is missing some required field, for example label or version
for some reason, mod page would stop functioning.
Adding default to empty string in list and filter.

Differential revision: D4028
This was SVN commit r25639.
2021-06-02 17:58:49 +00:00
Angen 0f8ba775c3 Fix areFilters
Removed in 0d87ec5cf4.

Differential revision: D4041
Tested by: @marder
Reviewed by: @wraitii
This was SVN commit r25638.
2021-06-02 17:45:17 +00:00
Stan be3749a788 New savanna textures based on cc0 textures
Patch by: @marder
This was SVN commit r25637.
2021-06-02 17:44:20 +00:00
wraitii c012888e2a Allow switching to the gamesetup from the campaign screen
This allows switching to the gamesetup, with a harcoded map, from the
campaign screen. Lets player sets up a few things (e.g. their civ &
favorite AI), which can be convenient for some simple campaigns that
lack options.

Differential Revision: https://code.wildfiregames.com/D4039
This was SVN commit r25636.
2021-06-02 17:37:29 +00:00
wraitii 48ea6ee7d2 Moddability for pushing: radius in XML, allow deactivating globally/some templates.
Differential Revision: https://code.wildfiregames.com/D4040
This was SVN commit r25635.
2021-06-02 17:36:32 +00:00
wraitii 07e44a75a1 Allow mods to say they should be ignored in replay/MP compatibility checks
Since it is very non-trivial to determine which mods change checksums
and which don't, this relies on modder goodwill (and on verification on
our end for signed mods).

The declaration is an optional "ignoreInCompatibilityChecks" boolean in
mod.json

Also rework slightly the MP lobby mod display to always show the host
mods in a clear manner.

Differential Revision: https://code.wildfiregames.com/D3968
This was SVN commit r25634.
2021-06-02 06:50:16 +00:00
wraitii 693f296e71 Improve 'incompatible mods' splash screen
Fix some language elements, add some details, and update to SVN specs.
Make the window wider to have the first phrase take a single line in
English/most languages hopefully.

Differential Revision: https://code.wildfiregames.com/D4049
This was SVN commit r25633.
2021-06-02 06:44:43 +00:00
vladislavbelov 2c3a49734c Removes ShaderProgram from MiniMap header, removes unnecessary members, removes useless scissoring.
This was SVN commit r25631.
2021-06-01 21:37:14 +00:00
vladislavbelov e0fd3b532f Cleanups MiniMapTexture a bit.
This was SVN commit r25630.
2021-06-01 19:50:15 +00:00
vladislavbelov c2c9059f67 Fixes removed terrain missed in 7ce4552f5e.
This was SVN commit r25629.
2021-06-01 19:08:22 +00:00
vladislavbelov 7ce4552f5e Moves partially MiniMap texture rendering into a separate object.
Tested By: Langbart, Stan
Differential Revision: https://code.wildfiregames.com/D4045
This was SVN commit r25628.
2021-06-01 18:55:35 +00:00
wraitii 0cc0852683 Remove build limits of structures that train champions.
The champions these structures built were not very usable in practice
because of their limited build rate.
Apadanas are a special case since they grant resources, their limit is
increased to 2 and their resource rate divided by two (this reduces
their economic impact early on, but increases their potential military
impact).
The preferred solution would be giving apadanas a pop count, but that
does not work very well right now given that they grant resources and
can still be built.

Patch by: Valihrant
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D3897
This was SVN commit r25627.
2021-06-01 08:09:43 +00:00
wraitii eda3eb7cc6 Speed up citizen rotation & differentiate ranged infantry unit move speed
Refs 42c70cd508, be286d4345, refs #5106

The introduction of "turn time" in A24 has been pointed out as a
gameplay change that made rushing less viable, and made the game more
turtley overall. Combined with other changes in the same direction, this
was seen by several top MP players as a step back.
Increasing turn times to 14 for infantry makes them somewhat irrelevant,
and a value of 10 for cavalry makes them noticeably more reactive while
keeping a little speed debuff.

Champions have a lower value, and heroes keep their lower values still
to prevent a reintroduction of 'dancing'.

Patch by: Valihrant
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D3971
This was SVN commit r25626.
2021-06-01 07:45:36 +00:00
wraitii 9e0c30f316 Improve Cart tech 'colonization'
It was underpowered and too costly.

Patch by: borg`
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D3698
This was SVN commit r25625.
2021-06-01 07:26:07 +00:00
wraitii 44ea80977a Tweak mercenaries: no food cost, advanced rank, faster training
The intention is that while mercenaries are still difficult and costly
to train, they are more effective in their particular niche.

Patch by: Nescio
Differential Revision: https://code.wildfiregames.com/D3699
This was SVN commit r25624.
2021-06-01 07:20:21 +00:00
wraitii 2147da9aa6 Revert citizen train times to A23 values
The significant slowdown in train times, particularly for infantry
resulted in an increase in the # of barracks and overall contributed to
shifting towards a defensive, turtley gameplay.
Cavalry was already reverted in 8bd7a4f4b5.

Reverts parts of D2866/8726a2abbf.

Patch by: ValihrAnt
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D4033
This was SVN commit r25623.
2021-06-01 07:16:16 +00:00
wraitii 6cc6d8c156 Speed up and simplify TileClass implementation
Use a more memory-efficient layout, reducing memory usage and speeding
things up considerably.

Patch by: smiley
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D4021
This was SVN commit r25622.
2021-06-01 07:06:36 +00:00
vladislavbelov 01e940217e Adds header safeguards to LOSTexture forgotten in fe21c5e023.
This was SVN commit r25620.
2021-05-31 20:47:03 +00:00
vladislavbelov 4d11256510 Adds shader technique caching to Canvas2D.
Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/D4034
This was SVN commit r25619.
2021-05-31 19:22:14 +00:00
wraitii b86b4d352e Fix broken SP persisted settings
The MP ones were always used instead.

Differential Revision: https://code.wildfiregames.com/D4038
This was SVN commit r25618.
2021-05-31 16:27:50 +00:00
wraitii 3d20791837 Add a "Best for MP" filter for random maps
This allows picking 'random' on a bunch of maps known to be playable in
MP, with the hope of increasing variety in actual maps played.

Discussed with players on the balancing forums.

Differential Revision: https://code.wildfiregames.com/D4012
This was SVN commit r25617.
2021-05-31 13:44:02 +00:00
wraitii 42e67be0ee Fix crash when pushing a page while pushing a page.
Because the page stack is a vector, if during PushPage, a new page is
pushed, the vector may re-allocate. This 'pulls the rug out' from
underneath the code stack that originally pushed, which then crashes.

To fix this, use a deque, since push/pop won't invalidate references.

Reported by: Imarok.
Based on a patch by: Imarok (tests are his)
Differential Revision: https://code.wildfiregames.com/D4037
This was SVN commit r25616.
2021-05-31 13:42:08 +00:00
Stan b1902d8e80 Allow setting texture quality in the config file. Fixes a todo.
Differential Revision: https://code.wildfiregames.com/D3020
This was SVN commit r25615.
2021-05-31 12:52:43 +00:00
Stan fcd8035fd4 Use the new "Lod" Feature for aprons
* Disable "aprons" on low quality
* Disable cast shadows on medium quality

This was SVN commit r25614.
2021-05-31 12:00:05 +00:00
wraitii 0bc7ba50ea Add an option to reduce the diversity of actor variants
Variants can now have limited or no diversity. This can occasionally
speed rendering slightly (5-10% FPS increase was reported on Combat Demo
Huge, which is very variant-heavy).

Reported by: bb
Based on a patch by: bb
Fixes #5831

Differential Revision: https://code.wildfiregames.com/D3035
This was SVN commit r25613.
2021-05-31 11:42:46 +00:00
Stan 6f72560228 Use the new "Lod" Feature for celt barrels
* Disable "castshadow" on low quality
* Adds new low quality versions for medium and low quality.

This was SVN commit r25612.
2021-05-31 11:38:34 +00:00
wraitii 9cc6228b28 Fix random biome not working.
As the available biome was a Set, pickRandom didn't work.

Reported by: Langbart
Refs #6190

Differential Revision: https://code.wildfiregames.com/D4036
This was SVN commit r25611.
2021-05-31 07:49:20 +00:00
wraitii 4188e7ff18 Remove unuseful 'siege bolt accuracy' from Kushites arsenal
Kushites should not have a bolt accuracy upgrade in arsenal, as they do
not have the ability to produce bolts.

Fixes #6167

Patch By: Langbart
Differential Revision: https://code.wildfiregames.com/D4035
This was SVN commit r25609.
2021-05-31 06:53:07 +00:00
vladislavbelov 2cc671fd36 Makes 2D text drawing via Canvas2D.
This was SVN commit r25607.
2021-05-30 19:10:10 +00:00
vladislavbelov 7f16a5c40c Moves TextRenderer shader to a more relevant place, into the rendering function argument.
This was SVN commit r25606.
2021-05-30 18:28:06 +00:00
vladislavbelov 7f6ef5db79 Removes gui_solid material usage from CChart.
This was SVN commit r25605.
2021-05-30 18:13:23 +00:00
vladislavbelov 9933fe4b69 Removes gui_solid material usage from ProfileViewer.
This was SVN commit r25604.
2021-05-30 17:35:26 +00:00
vladislavbelov 1f192f1593 Removes low level GL code from GUI sprite rendering and switches to Canvas2D.
Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/D4031
This was SVN commit r25603.
2021-05-30 13:48:58 +00:00
Angen c388ef64ad Add missing credits in 7e92f714ca
This was SVN commit r25602.
2021-05-30 10:44:48 +00:00
Angen 0d87ec5cf4 Fix and simplify areFilters functions
Workaround is not needed anymore since 37e08a4ffb

This was SVN commit r25601.
2021-05-30 09:32:18 +00:00
Angen 7e92f714ca [PetraAI] - Make easy difficulties of AI weaker
This patch decreases the popScaling so that the easy AI difficulties
have lower targeted population.
And it also decreases the size & priority of the attacks from the easy
an very easy AI.

Refs: #6149
Differential revision: D3997
Patch by: @marder
Tested by: @Langbart
Comments by: @wraitii, @Freagarach
This was SVN commit r25600.
2021-05-30 09:07:27 +00:00
vladislavbelov d08c96be43 Uses Canvas2D for str_gui_add material in GUIRenderer.
This was SVN commit r25598.
2021-05-30 01:01:42 +00:00
vladislavbelov bee5a4b3a6 Uses Canvas2D for str_gui_solid_mask material in GUIRenderer.
This was SVN commit r25597.
2021-05-30 00:30:55 +00:00
vladislavbelov 9e611e11f8 Uses Canvas2D for gui_basic material in GUIRenderer.
This was SVN commit r25596.
2021-05-29 23:41:07 +00:00
vladislavbelov a462970707 Restores GL check for tests in TextureManager forgotten in 283f524fcf.
Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/D4030
This was SVN commit r25595.
2021-05-29 23:24:36 +00:00
vladislavbelov 7f0c4ee9ab Removes unnecessary blend state changes from GUIRenderer.
This was SVN commit r25594.
2021-05-29 22:48:52 +00:00
vladislavbelov df7cabd653 Implements DrawTexture in Canvas2D.
This was SVN commit r25593.
2021-05-29 22:30:23 +00:00
vladislavbelov dacbab8b02 Fixes a mistype introduced in 283f524fcf. A smaller size might cause a write to an allocated memory.
This was SVN commit r25592.
2021-05-29 20:07:15 +00:00
vladislavbelov 57dde8d082 Provides Canvas2D for sprite rendering.
Differential Revision: https://code.wildfiregames.com/D4029
This was SVN commit r25591.
2021-05-29 19:47:36 +00:00
vladislavbelov 283f524fcf Implements DrawRect in Canvas2D, removes CConsole background drawing with low level GL calls.
This was SVN commit r25590.
2021-05-29 12:31:14 +00:00
vladislavbelov 2f3837e0b5 Adds Canvas2D to encapsulate low level GL calls for 2D rendering.
Implements DrawLine for charts.

Differential Revision: https://code.wildfiregames.com/D4024
This was SVN commit r25588.
2021-05-28 16:35:57 +00:00
Imarok 6f9a162dfa CList, COList, CDropdown, CText, CInput: Draw borders above the rest and improve scrollbar drawing order
Fixes: #6055
Differential Revision: https://code.wildfiregames.com/D4004
This was SVN commit r25587.
2021-05-28 16:32:04 +00:00
Stan d50ca8e8ec Slight tweak to the grass texture.
Patch by: @marder
This was SVN commit r25586.
2021-05-28 13:11:16 +00:00
Freagarach 3d7af82328 Improve support for classes in PetraAI.
Let PetraAI use MatchesClassList more.

Differential revision: https://code.wildfiregames.com/D2150
Reviewed by: Angen
Comments by: Stan
This was SVN commit r25584.
2021-05-28 06:54:48 +00:00
vladislavbelov f7ad2daf62 Removes gui_solid material shader usages from scene rendering.
This was SVN commit r25582.
2021-05-27 20:13:47 +00:00
wraitii 25b9faf1cb Split graphics options in two tabs
To allow incorporating more options, this splits the graphics settings
into two tabs, one containing general options (such as
silhouettes/windowed), and one with more advanced settings.

Accepted by: asterix
Differential Revision: https://code.wildfiregames.com/D3985
This was SVN commit r25581.
2021-05-27 10:12:13 +00:00
Stan f57c2f71d5 Fix map names
Noticed by @wraitii

This was SVN commit r25580.
2021-05-27 09:18:00 +00:00
wraitii bd8c6b1572 Fix GetLoadedModsWIthVersions following 498f0d420b
Accidentally broke it in 498f0d420b and didn't notice because D3968
fixes it again.

This was SVN commit r25579.
2021-05-27 08:30:27 +00:00
vladislavbelov b17e8f3043 Removes global g_xres and g_yres dependency from GUI objects.
Differential Revision: https://code.wildfiregames.com/D4014
This was SVN commit r25577.
2021-05-26 18:52:22 +00:00
Stan bcac3bb896 Fix two issues noticed by @marder.
Disable AO on quarried objects as its arguably broken.
Adds a second uv in case it's enabled again to prevent crashes in Atlas.
Use normal instead of parallax for the texture that do not have height
information.

This was SVN commit r25576.
2021-05-26 15:18:25 +00:00
wraitii 18372d665c Campaign menu: reuse default map preview if available.
Differential Revision: https://code.wildfiregames.com/D4019
This was SVN commit r25575.
2021-05-26 14:45:44 +00:00
wraitii 81457ef952 Fix potential undefined conversion.
Summary: Ran into this when testing things in the lobby - I'm not sure
it can happen if everything is working correctly, but I've had it
repeatedly when testing broken stuff. Feels safer.

Test Plan: ^

Differential Revision: https://code.wildfiregames.com/D4018
This was SVN commit r25574.
2021-05-26 13:29:11 +00:00
wraitii bce26e905f Mod selector: "start mods" saves the configuration.
Differential Revision: https://code.wildfiregames.com/D3992
This was SVN commit r25573.
2021-05-26 13:27:43 +00:00
vladislavbelov 8f4b3dfb16 Removes GL1 constants deprecated in GL3+ from HWDetect since they are not useful anymore.
This was SVN commit r25571.
2021-05-25 22:34:57 +00:00
Imarok 35601a7bb3 Fix some error in rmgen.
Reviewed by: kalimaps
Refs: #6180
Differential Revision: https://code.wildfiregames.com/D4017
This was SVN commit r25570.
2021-05-25 21:26:48 +00:00
vladislavbelov cf454fe533 Removes unused BitBuf added in 5b5726ed4d.
Bit operations can be done via std::bitset. The current implementation
is too specific to have it just for a future. Refs 479f59e386,
5ca66fc757.

This was SVN commit r25569.
2021-05-25 19:42:06 +00:00
vladislavbelov db9356944c Removes unused base32 encoding added in 5cc814759f.
For modern standards base64 costs a bit less space and might be
implemented on demand. base32 usage was introduced in e0dfbe719d and
removed in 93cffe9deb.

Refs a34b759720, 317f98a6c0.

This was SVN commit r25568.
2021-05-25 19:18:22 +00:00
vladislavbelov 38e085a8c0 Removes unused wutil command line arguments parsing added in 5383eff15c.
We already have a single place to access arguments, so we don't need
a platform dependent place for that.

Refs 3f58951808, 8c1bd05ab9.

This was SVN commit r25567.
2021-05-25 18:42:27 +00:00
vladislavbelov 007d30f4b4 Removes outdated user32.dll preload hack added in 7a889deca3 and became useless in bbcd9b34cc.
Refs 4b33f49da1, b242eafd02, 56bd5b59b4.

Tested By: Angen
Differential Revision: https://code.wildfiregames.com/D4007
This was SVN commit r25566.
2021-05-25 18:29:50 +00:00
Stan 3f371f40b1 Replace missing biomes by the closest we now have.
Reported by:  @Freagarach
This was SVN commit r25565.
2021-05-25 14:17:39 +00:00
Freagarach 23d7969ffd Fix city phase requirements in PetraAI HQ.
Defence towers were removed from the requirements in 29ab4b5af3, but
PetraAI was not made aware of this.

Differential revision: https://code.wildfiregames.com/D4015
Reviewed by: @Angen, @wraitii
Comment by: @Imarok
This was SVN commit r25564.
2021-05-25 13:46:03 +00:00
Stan 44f935562c Update mainland icons
This was SVN commit r25563.
2021-05-25 12:26:29 +00:00
Stan 95e576dbe3 Use new biomes for random maps,
Patch by: @wowgetoffyourcellphone
This was SVN commit r25562.
2021-05-25 12:25:39 +00:00
Stan de1a10ca53 New maps using the new biomes.
Patch by: @wowgetoffyourcellphone
- cisalpine_winter_2p
- crocodilopolis_4p
- gallic_highlands_2p
- hindu_kush_2p
- hydaspes_river_4p
- magadha_2p
- miletus_peninsula_2p
- nubian_frontier_2p
- saharan_oases_2p
- scythia_4p
- white_cliffs_of_dover_5p

This was SVN commit r25561.
2021-05-25 12:18:40 +00:00
Stan 88d3f50f7e Update some maps with new terrains
Patch by: @wowgetoffyourcellphone
- syria_2p
- sporades_islands_2p
- saharan_oases_4p
- butana_steppe_2p
- bactria_2p
- alpine_valleys_2p
- belgian_bog_2p

This was SVN commit r25560.
2021-05-25 12:15:41 +00:00
Stan 20bb3ea4a3 Add trading posts and shrines as map props
Add a placement obstructor (idea by @Grapjas) to prevent  construction
but not movement

This was SVN commit r25559.
2021-05-25 11:32:07 +00:00
Stan 92a4fdc8e4 Add more ruin objects
Add a new metal type of ruins
Update templates accordingly.

Patch by @wowgetoffyourcellphone

This was SVN commit r25558.
2021-05-25 11:00:13 +00:00
Stan c8f1501db4 Add templates for the new rock and stone mines
This was SVN commit r25557.
2021-05-25 10:57:22 +00:00
Stan b6ae8915de Add more prop actors for maps
- Update the stone and metal mine meshes and
textures/skins/gaia/decal_quarry_sahara_a.png
- Slight tweak to the steppe grass
- Add some ptol eyecandy

Templates will come in a following commit.

This was SVN commit r25556.
2021-05-25 10:53:20 +00:00
Stan ac33c8513b More grass types for biomes
Patch by @wowgetoffyourcellphone

This was SVN commit r25555.
2021-05-25 10:44:19 +00:00
Stan 63199dac2d Some tweaks to the grass fields.
This was SVN commit r25554.
2021-05-25 10:40:39 +00:00
Stan 47fc344567 Update the resource icons.
Patch by @wowgetoffyourcellphone.

This was SVN commit r25553.
2021-05-25 10:21:52 +00:00
Stan 463775faa4 Slight tweaks to particles.
This was SVN commit r25552.
2021-05-25 10:07:04 +00:00
Stan 6324f3369a Use correct projectiles for artillery.
Patch by @wowgetoffyourcellphone

This was SVN commit r25551.
2021-05-25 10:06:34 +00:00
Stan b3aa84adea New shark and whale icons. update the berry an tree and artic wolf icons.
This was SVN commit r25550.
2021-05-25 09:24:23 +00:00
Stan fb84adda3b New autoqueue icons.
This was SVN commit r25549.
2021-05-25 08:35:46 +00:00
wraitii 424b3cdcab Fix 498f0d420b - re-add special-casing of mod & user mods
These do not have a mod.json, triggering spurious errors.

This was SVN commit r25548.
2021-05-25 07:50:04 +00:00
wraitii 863ef0f88a Tweak sound distance attenuation & add configurability
Following D3108 / 876f6d5e50, sounds are attenuated by their actual
distance. However, as noted by players on A24, the dropoff is stark and,
when zoomed out, can easily result in not hearing things that are
happening in the middle of the screen.

The new default settings almost double the max-range, change the minimum
range to have greater dynamic range, and reduce the stereo depth
slightly to better match the default camera FOV.

These are stored per sound-grounp, possibly allowing future tweaks on a
per-soundgroup basis, and are configurable.

Tested by: Imarok
Discussed over mail with: Samulis, Porru

Differential Revision: https://code.wildfiregames.com/D3612
This was SVN commit r25547.
2021-05-25 06:19:25 +00:00
wraitii 498f0d420b Mod data parsing rework
Parses mod.json data not only in temporary JS values, but in a proper
C++ struct.
This will ultimately make it more convenient to pass more than just the
version to JS in D3968, and it enforces the schema a bit more.

Differential Revision: https://code.wildfiregames.com/D3988
This was SVN commit r25546.
2021-05-25 06:12:45 +00:00
wraitii b56f0222d9 Prevent hotkeys from firing for disabled buttons
Reported by: Angen
Accepted By: Angen
Refs #6042

Differential Revision: https://code.wildfiregames.com/D4013
This was SVN commit r25545.
2021-05-25 06:10:53 +00:00
vladislavbelov 8742fac032 Reorders GL error checks during a frame to ask only when needed, combines depth test switches.
This was SVN commit r25543.
2021-05-24 21:03:48 +00:00
Imarok 1fd940b3d0 Adjust position of replay filters
Differential Revision: https://code.wildfiregames.com/D4010
This was SVN commit r25542.
2021-05-24 20:04:28 +00:00
vladislavbelov 3e5638e548 Removes hardcoded 1px width borders from GUI sprites.
Tested By: Imarok
Differential Revision: https://code.wildfiregames.com/D4008
This was SVN commit r25541.
2021-05-24 18:42:51 +00:00
wraitii 8054097daf Mouse event mask for the diplomacy colors button
Differential Revision: https://code.wildfiregames.com/D4011
This was SVN commit r25540.
2021-05-24 12:09:30 +00:00
wraitii 581e5b8752 Remove differences in territory decay rates.
Structures now decay in the same time span, including walls/palisades.
This buffs houses/storehouses against capture slightly.

Exceptions:
- Fortresses decay 4 times slower (but, as of now, they are also
territory roots).
- Wonders decay 4 times slower.

Differential Revision: https://code.wildfiregames.com/D3993
This was SVN commit r25539.
2021-05-24 10:45:38 +00:00
wraitii 0e234dbb61 Check translations for spam, broken font tags and sprintf errors.
Supersedes D1674 and D3520.

This still generates some false positives (particularly the
singular-plural check), but in general it will suffice to better check
bundled languages.

Refs #4250

Differential Revision: https://code.wildfiregames.com/D3926
This was SVN commit r25538.
2021-05-24 10:25:19 +00:00
vladislavbelov 768313d7db Adds Vulkan check to HWDetect reports.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D3429
This was SVN commit r25535.
2021-05-23 22:32:29 +00:00
Imarok 4e8691acde Clip rendered text correctly
General idea acked by: vladislavbelov
Tested by: Langbart
Differential Revision: https://code.wildfiregames.com/D4006
This was SVN commit r25534.
2021-05-23 22:05:17 +00:00
vladislavbelov 1e18a93302 Removes using shared_ptr to make STL usages consistent.
Differential Revision: https://code.wildfiregames.com/D4005
This was SVN commit r25533.
2021-05-23 22:01:18 +00:00
Angen c1f8e74717 Add Filter placeholder text to modio filter field
Differential revision: D4000
Reviewed by: @Imarok
This was SVN commit r25532.
2021-05-23 08:55:38 +00:00
vladislavbelov 10cf87f3d1 Adds std namespace to shared_ptr usages in lib/tex.
This was SVN commit r25530.
2021-05-22 19:34:39 +00:00
vladislavbelov 5656c4117d Adds std namespace to shared_ptr usages in lib.
This was SVN commit r25529.
2021-05-22 19:32:38 +00:00
vladislavbelov b927f163d6 Adds std namespace to shared_ptr usages in scriptinterface and simulation.
This was SVN commit r25528.
2021-05-22 19:30:18 +00:00
vladislavbelov d9d19543b5 Adds std namespace to shared_ptr usages in network and engine.
This was SVN commit r25527.
2021-05-22 19:28:40 +00:00
vladislavbelov babfd913fb Adds std namespace to shared_ptr usages in gui and sound.
This was SVN commit r25526.
2021-05-22 19:23:03 +00:00
vladislavbelov b03b560e71 Adds std namespace to shared_ptr usages in graphics.
This was SVN commit r25525.
2021-05-22 19:21:33 +00:00
vladislavbelov 0728c58a4d Removes unnecessary z-level from GUI sprite rendering.
Tested By: Imarok
Differential Revision: https://code.wildfiregames.com/D4003
This was SVN commit r25524.
2021-05-22 18:06:18 +00:00
vladislavbelov 2111f864d4 Removes dehydra build scripts following 53369d593b. Fixes #4446
Refs d7a057143d.

This was SVN commit r25523.
2021-05-22 14:25:53 +00:00
vladislavbelov faca950e83 Removes unused CONFIG2_CACHE_READ_ONLY config macro forgotten in 2374caac3e.
Refs 149ebb67c0, 9269be9ee3.

This was SVN commit r25522.
2021-05-22 14:04:11 +00:00
vladislavbelov 53369d593b Removes Dehydra config macro. Introduced in 378bd89c1d.
Dehydra was abandoned in 2010s.

This was SVN commit r25521.
2021-05-22 13:28:55 +00:00
vladislavbelov 0812ded348 Removes unused CONFIG_OMIT_FP config macro forgotten in 0d23e3f333.
This was SVN commit r25520.
2021-05-22 13:18:15 +00:00
vladislavbelov c73f674055 Removes unused DynHashTbl. Last usage was removed in 6c915291cc.
STL or Boost provides containers with DynHashTbl's functionality (and
not worse performance). Refs 9fd08fb044, 5ca66fc757.

This was SVN commit r25519.
2021-05-22 12:59:41 +00:00
vladislavbelov b5535c4ba3 Removes OpenMP from external libraries. It's better to avoid its usage with a custom thread management.
This was SVN commit r25518.
2021-05-22 12:24:18 +00:00
wraitii 80a8c3827b Fix CanAttack for mirages following 88549e77e1
CanAttack queries the miraged Resistance which did not exist, thus
failing.
This mirages Resistance explicitly (fixing parts of #5883)

Fixes 88549e77e1, reverts the mirage.xml change in 738b200dda

Refs #5883

Reported by: Asger_Spear
Differential Revision: https://code.wildfiregames.com/D4001
This was SVN commit r25517.
2021-05-22 10:56:40 +00:00
wraitii c535a282ac Rename ModsLoaded to EnabledMods
Differential Revision: https://code.wildfiregames.com/D3987
This was SVN commit r25516.
2021-05-22 09:50:30 +00:00
wraitii d7a4fb7c20 Try to punch a hole through local firewalls, and fallback to localhost.
Fixes (probably rare) regression in 2034136560.

Differential Revision: https://code.wildfiregames.com/D3999
This was SVN commit r25515.
2021-05-22 08:34:00 +00:00
Freagarach 0dfebc8d2b Let PetraAI check for different templates when finding the best dropsite.
Loops buildable templates to find the best.

Differential revision: https://code.wildfiregames.com/D3876
Comments by: @Angen, @Stan, @wraitii
This was SVN commit r25514.
2021-05-22 07:53:47 +00:00
Freagarach 494d12fb9c Let PetraAI check for droppable resources when finding the best dropsite location.
Instead of hardcoding resources.

Differential revision: https://code.wildfiregames.com/D3874
Comments by: @Angen, @Stan
This was SVN commit r25513.
2021-05-22 07:51:08 +00:00
Freagarach 012ac9f36b Add rated game information to the objectives dialog.
So an joined observer can see that information.

Patch by: @Langbart
Differential revision: https://code.wildfiregames.com/D3964
Comment by: @wraitii
Idea accepted by: @asterix
This was SVN commit r25512.
2021-05-22 07:39:17 +00:00
Freagarach 340aa419f4 Deduplicate add/remove entity to/from AIs resource map.
Also moves the function to the shared_script, since that is the
prototype it uses and the function doesn't use anything of the
terrain_analysis (as per @Angen's request).

Differential revision: https://code.wildfiregames.com/D3906
Comments by: @Angen, @wraitii
This was SVN commit r25511.
2021-05-22 07:35:16 +00:00
wraitii 8f8e29c092 Fix incompatible mods start: show both incompatible and enabled mods;
As noted by Angen in a26535d023, refs 3bcf360107
When starting with incompatible mods, the non-incompatible mods were no
longer shown. This fixes that.
I think the code looks cleaner from this new control flow that
explicitly only mounts "mod".

Tested by: Angen
Differential Revision: https://code.wildfiregames.com/D3996
This was SVN commit r25510.
2021-05-22 07:33:49 +00:00
Freagarach 3548feb16a Fix entities receiving double hunt order only attacking.
Caused by: 293cd95ccb.
Noticed by @Asger and @Kate.
Special case hunting.

Differential revision: https://code.wildfiregames.com/D3986
Comment by: @wraitii
This was SVN commit r25509.
2021-05-22 05:27:51 +00:00
vladislavbelov 2be76d52b5 Reduces CConsole interface and simplifies the initialization step.
This was SVN commit r25507.
2021-05-21 23:10:43 +00:00
vladislavbelov d7ac3c6b89 Removes macOS system version include added in 7e87211d91 and forgotten in 9a2d0f803e.
This was SVN commit r25506.
2021-05-21 21:46:01 +00:00
Imarok b2e1181982 Partly revert 5f1f768ed5.
The underlying cause was fixed by 8eb4871c9b.
Reviewed by: wraitii
Differential Revision: https://code.wildfiregames.com/D3836
This was SVN commit r25505.
2021-05-21 21:37:07 +00:00
vladislavbelov 7ae43c149e Replaces global g_VSync state by VideoMode property.
This was SVN commit r25504.
2021-05-21 21:33:43 +00:00
vladislavbelov b2d0bd9a81 Adds a warning in case ShaderManager is trying to load an ARB shader with enabled GLSL.
This was SVN commit r25503.
2021-05-21 20:32:33 +00:00
vladislavbelov 4215533ea9 Removes inclusionPath forgotten in b469983c58.
This was SVN commit r25502.
2021-05-21 20:15:58 +00:00
vladislavbelov 78aedfcb93 Removes unused declarations of g_xres and g_yres.
This was SVN commit r25501.
2021-05-21 20:02:03 +00:00
vladislavbelov fa44b9ae97 Removes g_ShowPathfindingOverlay forgotten in 72bd886f80.
This was SVN commit r25500.
2021-05-21 19:27:43 +00:00
vladislavbelov 312225570f Removes g_AutostartMap forgotten in c684c211a2.
This was SVN commit r25499.
2021-05-21 19:21:24 +00:00
vladislavbelov 7cf579c597 Removes g_TriPathfind forgotten in d3048906cb.
This was SVN commit r25498.
2021-05-21 19:11:12 +00:00
vladislavbelov 5be764e384 Removes outdated archive trace code forgotten in 63086f4e26.
This was SVN commit r25497.
2021-05-21 19:05:40 +00:00
Stan fe4890e0b2 Improved particles by @wowgetoffyourcellphone
This was SVN commit r25496.
2021-05-21 10:49:11 +00:00
Stan 9756fb3dad Darker AO for the stone quary
This was SVN commit r25495.
2021-05-21 10:42:20 +00:00
Stan 274fadaf30 More consistent animal portraits by @wowgetoffyourcellphone
This was SVN commit r25494.
2021-05-21 10:41:41 +00:00
Stan bdfacbfdd3 Add a round 9x9 decal
This was SVN commit r25493.
2021-05-21 10:40:20 +00:00
Stan 15140751a7 Improved farm decals by @wowgetoffyourcellphone
This was SVN commit r25492.
2021-05-21 10:33:13 +00:00
Stan 19f7db1681 Remove the floating property from shipwrecks.
Patch by: @wowgetoffyourcellphone
EOL native.

This was SVN commit r25491.
2021-05-21 09:49:32 +00:00
Stan db829373cb Add new cliff textures
Patch by: @wowgetoffyourcellphone
Textures from: https://cc0textures.com/
Thread
https://wildfiregames.com/forum/topic/17326-your-0-ad-screenshots/page/30/

This was SVN commit r25490.
2021-05-21 09:23:08 +00:00
Stan 809dba254a Add new indian biome
Patch by: @wowgetoffyourcellphone
Textures from: https://cc0textures.com/
Thread
https://wildfiregames.com/forum/topic/17326-your-0-ad-screenshots/page/30/

This was SVN commit r25489.
2021-05-21 09:22:17 +00:00
Stan 70a6826b51 Add new nuba biome
Patch by: @wowgetoffyourcellphone
Textures from: https://cc0textures.com/
Thread
https://wildfiregames.com/forum/topic/17326-your-0-ad-screenshots/page/30/

This was SVN commit r25488.
2021-05-21 09:21:22 +00:00
Stan e10fa5b80f Add new saharan biome
Patch by: @wowgetoffyourcellphone
Textures from: https://cc0textures.com/
Thread
https://wildfiregames.com/forum/topic/17326-your-0-ad-screenshots/page/30/

This was SVN commit r25487.
2021-05-21 09:19:46 +00:00
Stan b5a1e9ba51 Add new steppe biome
Patch by: @wowgetoffyourcellphone
Textures from: https://cc0textures.com/
Thread
https://wildfiregames.com/forum/topic/17326-your-0-ad-screenshots/page/30/

This was SVN commit r25486.
2021-05-21 09:18:20 +00:00
Stan b00f000477 Add new sudd biome
Patch by: @wowgetoffyourcellphone
Textures from: https://cc0textures.com/
Thread
https://wildfiregames.com/forum/topic/17326-your-0-ad-screenshots/page/30/

This was SVN commit r25485.
2021-05-21 09:16:38 +00:00
Stan 91e244d364 Add new temperate europe biome
Patch by: @wowgetoffyourcellphone
Textures from: https://cc0textures.com/
Thread
https://wildfiregames.com/forum/topic/17326-your-0-ad-screenshots/page/30/

This was SVN commit r25484.
2021-05-21 09:15:47 +00:00
Stan 8e3ef8dd8f Add new aegean alpine arctic biome
Patch by: @wowgetoffyourcellphone
Textures from: https://cc0textures.com/
Thread
https://wildfiregames.com/forum/topic/17326-your-0-ad-screenshots/page/30/

This was SVN commit r25483.
2021-05-21 09:12:35 +00:00
Stan baeceab0c8 Add new aegean anatolian biome
Patch by: @wowgetoffyourcellphone
Textures from: https://cc0textures.com/
Thread
https://wildfiregames.com/forum/topic/17326-your-0-ad-screenshots/page/30/

This was SVN commit r25482.
2021-05-21 09:11:42 +00:00
wraitii 0aedcced74 Remove Gate/Defensive from ram preferred classes
This leaves them with 'Structure', undifferentiated. This avoids the
issue reported in #6096 that rams can try to hit unreachable buildings
indefinitely.

Based on a patch by: Nescio
Differential Revision: https://code.wildfiregames.com/D3684
This was SVN commit r25481.
2021-05-21 07:47:54 +00:00
wraitii b6f2dee43b Increase pushing range by 60%
Reduces the 'clumpiness' of units, particularly when ordered to move to
a single point. The minimum pushing force was increased to compensate.

Differential Revision: https://code.wildfiregames.com/D3978
This was SVN commit r25479.
2021-05-21 07:23:47 +00:00
Freagarach 37c8e9caa8 Allow right-clicking to show template panel on queued items.
Request at:
https://wildfiregames.com/forum/topic/40311-a24a23-context-information/.

Differential revision: https://code.wildfiregames.com/D3983
This was SVN commit r25478.
2021-05-21 07:11:05 +00:00
Freagarach e1f9304601 Fix alpine biome in Wild Lake RM.
After 8ee6774d12.

Differential revision: https://code.wildfiregames.com/D3984
This was SVN commit r25477.
2021-05-21 07:07:47 +00:00
wraitii a26535d023 Fix mistake in 3bcf360107 which stopped the incompatible mods page from showing.
I didn't quite understand what was supposed to happen here. This makes
things work as before.
While at it, fix a conversion bug & do some more tweaks.

Differential Revision: https://code.wildfiregames.com/D3990
This was SVN commit r25475.
2021-05-20 17:11:26 +00:00
wraitii 3bcf360107 Mod and mod-mounting cleanup and improvements.
- Non-visual replays now automatically try to load the replay mods. This
removes the annoyance that -mod=public usually had to be passed.
- MountMods is no longer called in InitVfs but later, making it possible
to load the game in one pass & simplifying things considerably.
- Explicitly ignore duplicates when loading mods
- Interface cleanup: failed mods and incompatible mods were redundant,
only incompatible mods is kept.
- Interface cleanup: `AreModsCompatible`becomes
`CheckForIncompatibleMods`, which becomes a private pure function,
simplifying the control flow somewhat.
- Interface cleanup: `CheckAndEnableMods` is just `EnableMods`, which
explicitly updates loaded & incompatible mods.
- `CacheEnabledModVersions` becomes private and is called on behalf of
the user, removing the need to be careful about updating that (fixes my
concern at 44ec2e324e)

Overall, the logic around mounting & enabled mods should be easier to
understand.

Differential Revision: https://code.wildfiregames.com/D3982
This was SVN commit r25474.
2021-05-20 14:36:42 +00:00
vladislavbelov 1e297fe212 Fixes PCH after 7bfcd9f78b.
This was SVN commit r25473.
2021-05-20 11:47:56 +00:00
Stan 21b7e8faaf Better quality acacia trees by @Sundiata. Needed for the map overhaul.
This was SVN commit r25472.
2021-05-20 11:26:49 +00:00
wraitii eda2901a33 Translate the default campaign name in NewCampaignModal
Patch by: nwtour
Differential Revision: https://code.wildfiregames.com/D3977
This was SVN commit r25471.
2021-05-20 10:03:51 +00:00
Freagarach 5e6038eeaf Change the visuals of the counters in the top panel.
- Abbreviate large numbers (fixes #6063).
- Added popMax to the population counter.
- Also show `0` gatherers, highlights and changes the font.

Patch by: @Langbart
Differential revision: https://code.wildfiregames.com/D3911
Reviewed by: @Angen, @Freagarach
Comments by: @asterix, @nwtour, @s0600204, @wraitii
This was SVN commit r25470.
2021-05-20 08:55:08 +00:00
wraitii 04549a081d Rework Mod into a class.
`Mod` currently modifies 4 global arrays, including some that are
'public'.

The logic flow is easier to understand if this becomes a real class with
const-correctness and public/private methods.

Differential Revision: https://code.wildfiregames.com/D3981
This was SVN commit r25469.
2021-05-20 08:32:11 +00:00
Freagarach 13c1b55f42 Fix UnitAI states in PetraAI.
Sometimes PetraAI relies on UnitAI state of an entity, but those were
not changed after modifying UnitAI.
Introduced in ea96e81098 and 3579097d95.

Differential revision: https://code.wildfiregames.com/D3976
This was SVN commit r25468.
2021-05-20 08:31:30 +00:00
wraitii 453fe486de Triggers: prevent event names from conflicting with added methods
Refs c0157d613d / D3913 which removed the 'actions' suffix. The reason
for this suffix was probably avoiding this type of conflict, but this
new solution does a better job.

Fixes (at least) Survival of the Fittest, which used an
OnOnwershipChanged trigger.

Differential Revision: https://code.wildfiregames.com/D3979
This was SVN commit r25467.
2021-05-20 08:26:04 +00:00
vladislavbelov 575cd6c953 Removes unused uniforms and attributes from water shader.
This was SVN commit r25466.
2021-05-19 21:51:36 +00:00
wraitii 88549e77e1 Require 'Resistance' in CanAttack
This was already effectively the case, so this change increases
coherence.

Accepted By: Freagarach
Differential Revision: https://code.wildfiregames.com/D3980
This was SVN commit r25465.
2021-05-19 12:36:22 +00:00
wraitii 1619be9902 Differentiate movement speeds of ranged cavalry
Ranged cavalry goes from a base 0.89 walkspeed multiplier to:
- 0.8 for crossbowmen
- 0.85 for archers
- 0.9 for javelineers

The intention is to nerf archers slightly.

Patch By: Nescio
Accepted By: ValihrAnt, chrstgtr
Differential Revision: https://code.wildfiregames.com/D3758
This was SVN commit r25464.
2021-05-19 08:21:05 +00:00
wraitii 5d1d2d27d7 Outposts have vision without garrisoning again.
Reverts D2986 / f9f7b4d49f.

Outposts have 90 base vision, increasing to 120 with the 'Carrier
pigeon' technology.
Outposts no longer decay in neutral territory, thus not needing
garrisoning. To compensate, they decay 10x faster in enemy territory.

Differential Revision: https://code.wildfiregames.com/D3898
This was SVN commit r25463.
2021-05-19 08:13:35 +00:00
Freagarach 9093e7bbe2 TreasureCollecter -> TreasureCollector.
Noticed by @Stan on ea96e81098.

Differential revision: https://code.wildfiregames.com/D3949
This was SVN commit r25461.
2021-05-18 16:51:44 +00:00
Freagarach 4195205904 Use a set for the selection internals.
Avoids recreating an object and frequent casting.
Allows some optimisations.
Simplifies some calls.

Differential revision: https://code.wildfiregames.com/D3934
Comment by: @Stan
This was SVN commit r25460.
2021-05-18 15:56:47 +00:00
wraitii 7bfcd9f78b Additional entropy when hashing match passwords.
The purpose of our client-side hashing for lobby game passwords is to
prevent malicious hosts from getting valuable passwords from clients
(e.g. accidentally typing their lobby password instead of the game, or
even their email password, etc).
However, the hashing was deterministic (and rather simple), making it
possible to compute rainbow tables and recover user passwords anyways.

By adding more variation, including some that cannot so easily be
controlled by the host (the client name), this becomes impractical. The
password hashing function used is rather fast, but given the base low
probability of mistypes, this seems fine.

Differential Revision: https://code.wildfiregames.com/D3459
This was SVN commit r25459.
2021-05-18 14:47:36 +00:00
wraitii 40f9372d29 Allow decaying only in enemy territory.
Reviewed By: Freagarach
Differential Revision: https://code.wildfiregames.com/D3969
This was SVN commit r25458.
2021-05-18 12:43:01 +00:00
wraitii 0c23e595fa Include CStrInternStatic where necessary only.
This makes incremental recompilation faster when changing static
interned strings.

Differential Revision: https://code.wildfiregames.com/D3975
This was SVN commit r25457.
2021-05-18 11:09:54 +00:00
Freagarach 3939e0f035 Fix autostart without default difficulty.
If a default difficulty is given by the map, use that. Else use the
default of the game.

Patch by: @JCWasmx86
Differential revision: https://code.wildfiregames.com/D3951
This was SVN commit r25455.
2021-05-17 15:59:05 +00:00
Freagarach 4f2e730d3c CodingConventions: Prefer using const on immutable values.
Using `const` for values that should not be changed is considered a good
practice (https://eslint.org/docs/rules/prefer-const).

Forum poll:
https://wildfiregames.com/forum/topic/38347-codingconventions-use-const-instead-of-let-for-immutable-values-in-functions/
Differential revision: https://code.wildfiregames.com/D3950
Comments by: @bb, @Stan, @wraitii
This was SVN commit r25454.
2021-05-17 15:50:16 +00:00
wraitii 895e4e6aa6 StunClient code cleanup: use enet functions, endianness
Instead of using platform-specific sockets, use enet_socket* functions
(which ends up doing the same).
Clean up some confusing APIs, removing the distinction between finding
the public IP for the host/join.

Fix endianness support & use simpler code.

Refs D364 / 61261d14fc (and some subsequent fixing diffs).

Differential Revision: https://code.wildfiregames.com/D3970
This was SVN commit r25453.
2021-05-17 15:14:10 +00:00
wraitii f1467d10fd Make pathfinder debug rendering thread-safe.
Also cleans up the jump point cache const-correctness.

Differential Revision: https://code.wildfiregames.com/D3966
This was SVN commit r25452.
2021-05-17 09:38:24 +00:00
vladislavbelov 8b6d4233eb Disables by default Intel Mesa workaround to save video memory.
Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/DD3967
This was SVN commit r25449.
2021-05-16 19:08:28 +00:00
wraitii 2034136560 Implement a workaround for routers without NAT loopback.
This allows joining a lobby game hosted on the same network (behind the
same NAT gateway).
This is relatively primitive to keep things simple: if the server and
the client have the same public IP, it is assumed that they are on the
same network and the client instead requests the local IP.

Differential Revision: https://code.wildfiregames.com/D3944
This was SVN commit r25448.
2021-05-16 15:34:38 +00:00
wraitii a19dc1717f Don't include ComponentManager.h in ScriptComponent
ScriptComponent does not use ComponentManager, and its derived classes
(most ICMP*.cpp files) do not either. Therefore, we can skip a lot of
transitive inclusions and speed up recompiling by not including it
there.

Differential Revision: https://code.wildfiregames.com/D3962
This was SVN commit r25447.
2021-05-16 15:12:39 +00:00
wraitii e908733220 Speed up GetAvailableMods for archives.
Refs 64bfa089af and 44ec2e324e

When a .zip file is encountered by the VFS population, it reads the info
for all files in the archives. This is quite slow for the public archive
(400-500ms on my computer), which means calling GetEngineInfo()
repeatedly is impossible.

By only opening the external mod.json, we skip most of the work. The
archive can still be opened if needed as fallback.


Differential Revision: https://code.wildfiregames.com/D3216
This was SVN commit r25446.
2021-05-16 13:50:05 +00:00
vladislavbelov 5ff4fa19c0 Removes unused and outdated includes, replaces some includes by forward declarations.
This was SVN commit r25444.
2021-05-15 17:27:01 +00:00
vladislavbelov 41a29a590a Fixes broken PCH after wraitii commits (4f972bc623, 0f60bf3a97) and Itms (833c9f108c).
This was SVN commit r25443.
2021-05-15 14:50:24 +00:00
wraitii 507f44f7f9 Remove all external usage of CmptPrivate. Header cleanup.
This removes usage of CmptPrivate outside of ScriptInterface.
ScriptRequest can now be used to safely recover the scriptInterface from
a JSContext instead of going through ScriptInterface, which allows more
code cleanup.

Follows 34b1920e7b

Differential Revision: https://code.wildfiregames.com/D3963
This was SVN commit r25442.
2021-05-15 13:54:58 +00:00
vladislavbelov 3ebff376cc Adds view bounds test for an ortho camera and removes commented code after 44f8d2c6f5.
This was SVN commit r25441.
2021-05-15 13:47:48 +00:00
vladislavbelov 44f8d2c6f5 Fixes a bounding box projection to an incorrect camera causes the red water bug.
Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/D3905
This was SVN commit r25440.
2021-05-15 13:33:36 +00:00
Freagarach 6b0802836a Fix duplicating promoting entities in XP trickling structures.
The entity received a value modif. message while promoting, triggering a
second promotion.

Differential revision: https://code.wildfiregames.com/D3918
Fixes: #6162
Comments by: @Angen, @Stan
This was SVN commit r25439.
2021-05-15 05:40:13 +00:00
Stan 66c75068bc Fix broken non pot texture by @m7600
Reported by: @nwtour
Fixes: #6177 and 318a5d7a2b

This was SVN commit r25437.
2021-05-14 18:06:00 +00:00
Stan 79e294ec06 Make fruit (berries and some fruit trees)'s obstructions smaller.
Patch by: @nani
Liked by: @ffffffff
Tested by: me and @Langbart
Differential Revision: https://code.wildfiregames.com/D3957
This was SVN commit r25436.
2021-05-14 15:13:55 +00:00
wraitii cf5c815879 Fix 4f972bc623
Shouldn't make last-minute changes without recompiling...

This was SVN commit r25435.
2021-05-14 11:12:07 +00:00
wraitii 4f972bc623 Split off JSON-related function from ScriptInterface, clean up headers.
Follows 34b1920e7b.

JSON functions and ToString are movec to their own headers.
Also clean out a few PersistentRooted usage to use the 2-phase init to
clean up scriptInterface usage.

With these functions split off, we can finally clean out headers and
remove ScriptInterface.h from most of them, in favour of smaller and
more precise headers.


Take the opportunity to clarify some comments regarding Mutability.

Differential Revision: https://code.wildfiregames.com/D3961
This was SVN commit r25434.
2021-05-14 10:18:03 +00:00
wraitii f368e1a69e Remove unused m_rng member from ScriptInterface.
The one in ScriptInterface_Impl is actually used.
Introduced in e9e05f4efc and from what I can tell never actually used.

Differential Revision: https://code.wildfiregames.com/D3960
This was SVN commit r25433.
2021-05-14 09:27:12 +00:00
wraitii 0f60bf3a97 Split off Object-related functions from ScriptInterface
Follows 34b1920e7b.

This splits off the object-related functions, such as
[Set/Get/Has]Property, CreateObject, CreateArray, FreezeObject.

It also puts the definitions in the header itself, which might end up
with faster code here & there, though perhaps slower compilation time
(somewhat doubtful since we already included most things anyways).

Differential Revision: https://code.wildfiregames.com/D3956
This was SVN commit r25430.
2021-05-13 17:23:52 +00:00
Stan cb263b9f26 Add a decal to the berry bushes to make them more visible and make the fruits bigger
Suggestions by: @m7600, @wraitii, @JCWasmx86
Reported by: @Yekaterina
Thread:
https://wildfiregames.com/forum/topic/39973-a25-feedbacks-from-testing/

This was SVN commit r25429.
2021-05-13 11:19:37 +00:00
wraitii 61e0aef0b4 Split JS conversions from ScriptInterface.
All ToJSVal/FromJSVal definitions are put in a separate header.
Remove AssignOr[To/From]JSVal duplication.

The functions were already static so this is rather straightforward.

Follows 34b1920e7b and 2bae30c454

Differential Revision: https://code.wildfiregames.com/D3953
This was SVN commit r25428.
2021-05-13 09:43:33 +00:00
wraitii d798a2ec0e Fix crash in Atlas.
Fixes 6fbf036ae4

Reported by: Stan
Differential Revision: https://code.wildfiregames.com/D3954
This was SVN commit r25425.
2021-05-12 19:25:09 +00:00
user1 dd19cc3444 Major improvements to the lobby bots XpartaMuPP and EcheLOn.
Reviewers: elexis, Dunedan

Fixes: #5914

Differential Revision: https://code.wildfiregames.com/D2630
This was SVN commit r25424.
2021-05-12 15:40:50 +00:00
Stan 4ad78018f9 Fix no-pch build. Potentially fixes bb49fbe793, 0198942a79, 34b1920e7b, 8b08f4ae7a 0dbf417171, 3af1fc64d2, 5fbdbaa3bc, 6fbf036ae4.
Comments by: @vladislavbelov, @wraitii.
Differential Revision: https://code.wildfiregames.com/D3948
This was SVN commit r25423.
2021-05-12 13:48:55 +00:00
bb 412e870c55 Add defeat condition on civil centre loss
Somewhat obsoleting 171afdc7a6.

Reviewed By: Freagarach
Comments By: Stan, Nescio and wowgetoffyourcellphone
Differential Revision: D3530
This was SVN commit r25422.
2021-05-12 13:34:50 +00:00
Freagarach 441c122331 Fix collecting treasures near position.
Also refactors the order a bit to be more equal to other orders.
Removes the `autocontinue` because it was not useful (since that is more
about doing other tasks than the one ordered).
Follows ea96e81098 97addf2aa7.

Differential revision: https://code.wildfiregames.com/D3942
Tested by: @Langbart
Fixes: #6175

This was SVN commit r25421.
2021-05-11 07:41:40 +00:00
wraitii 6fbf036ae4 Split off StructuredClone from ScriptInterface
Follows 34b1920e7b.

This separates StructuredClone & DeepCopy logic into its own header,
reducing the size of the monolithic ScriptInterface header.

Differential Revision: https://code.wildfiregames.com/D3922
This was SVN commit r25419.
2021-05-10 11:51:32 +00:00
wraitii ad62707eef Ensure rated game and cheat won't be enabled at the same time.
Reported by: Freagarach
Differential Revision: https://code.wildfiregames.com/D3943
This was SVN commit r25418.
2021-05-10 07:49:30 +00:00
wraitii 5fbdbaa3bc Fix 3af1fc64d2 - incorrect texture path on Windows.
sizeof(const char*) returns the pointer size and not the string size,
and 'texture:' happend to be 8 characters long, which is the same as a
64-bit pointer but not a 32-bit pointer.

Reported by: Stan
Differential Revision: https://code.wildfiregames.com/D3947
This was SVN commit r25415.
2021-05-09 17:29:50 +00:00
Angen b4d11bda89 Fix warnings and missing break from f1acd22455
make linter happy
add missing break to loop if correct comparator has been found, reported
by @Langbart

Differential revision: D3945
Tested by: @Langbart
This was SVN commit r25414.
2021-05-09 17:05:02 +00:00
wraitii 8f8996e338 Allow registering custom data for triggers
This allows easier handling of e.g. range triggers calling into the same
function.

The original trigger data is also forwarded for convenience.

Differential Revision: https://code.wildfiregames.com/D3904
This was SVN commit r25413.
2021-05-09 16:55:36 +00:00
wraitii f653541e2c Fix warnings in 3af1fc64d2
Differential Revision: https://code.wildfiregames.com/D3946
This was SVN commit r25412.
2021-05-09 16:24:13 +00:00
Angen f1acd22455 Do not allow to start pyrogenesis with incompatible mods
Fixing following problems:
Issue number one:
Enable mod with a23 compatibility in a23b.
Save configuration.
Start a24.
Better result:
Mod will be enabled and invisible in mod selection screen producing
various errors.
Worse result:
Game will crash and refuse to start.

Issue number two:
Mods can silently set loaded mods without restarting the engine, so mods
can unlist themselves from compatibility detection.

Solution:
Enable necessary mods instead if running with gui and open mod page.
Open information window on top of mod page to infom why mod page is
showing up.
On mod page show mods which failed in compatibility check and color the
resposnible ones.
Disable start button without enabled mods.
Show non existed mods if they failed in compatibility check.

Else just log to mainlog and close.

Another fixes:
Display in enabled mods really enabled mods as current logic confuses
players about which mods they have enabled and is not helpful (ref
#4881)

Note:
this will not solve issue with mods claiming being compatible with
engine version while in fact being incompatible.

Comments by: @vladislavbelov, @Stan, @Imarok
Tested by: @wraitii
Differential revision: D3592
Fixes: #6044 #4881

This was SVN commit r25410.
2021-05-09 13:53:25 +00:00
Angen 933b331c1b Hide icon for matches without password
This should help with better visual experience.
Icon introduced in c2155e31c0.

Differential revision: D3939
Fixes: #6153

This was SVN commit r25409.
2021-05-09 13:47:03 +00:00
wraitii 3af1fc64d2 Allow GUI elements to define custom mouse event mask shapes.
This allows GUI elements to use a texture as their "mouse event mask",
making it possible to have arbitrarily-shaped GUI elements with regards
to mouse interactions.

Used for the minimap idle worker button as a proof-of-concept.

Differential Revision: https://code.wildfiregames.com/D3814
This was SVN commit r25408.
2021-05-09 13:08:07 +00:00
wraitii e94faf7827 Don't hardcode the "0ad" resource into lobby XMPP & hosting
XMPP JID has a concept of 'resources', which can be used to
differentiate multiple clients of the same account.

We currently hardcode this 'resource' to '0ad' in two places:
- The 0 A.D. client always uses '0ad'
- The network code expects a host resource to be '0ad' when connecting.

As noted in 0fd8aa2a77#31215, it is less effort to store the JI
D directly. This patch does that. It also makes 0 A.D. use a different
resource each time.
Note that resources ought not contain particular information, as the
XMPP server is free to
 clobber it. I keep '0ad-' here for debug purposes.

This allows:
- multiple 0 A.D. instances to log on the lobby at the same time (not
massively useful, but good for debugging sometimes)
- hosting a game with a custom resource, which will potentially make it
easier to have dedi
cated servers on one account.

Note that hosting multiple games on one account is currently not
supported and will have weird behaviour on the lobbybots side. They
should be upgraded independently of this.

Refs #3556

Differential Revision: https://code.wildfiregames.com/D3500
This was SVN commit r25407.
2021-05-09 12:51:32 +00:00
wraitii 88810524b3 Make it explicit that technology specific names expect an object.
Simple strings would trigger errors.

Patch by: nwtour
Differential Revision: https://code.wildfiregames.com/D3921
This was SVN commit r25406.
2021-05-09 12:46:58 +00:00
wraitii abb124a36f Fix cpuid call with -fPIC on i386 architectures.
GCC < 5 used to reserve the ebx register for PIC (position-independent
code) metadata. This meant that we needed to save the state of ebx
before calling cpuid (fixed in #2675)
However, the original patch from 03eaf9b461 did not force a particular
register to store this value in. Following the GCC 5 upgrade, GCC
stopped reserving ebx, and that register silently got used instead. The
code became non-sensical, and our ASM __cpuidex started returning random
garbage in edx.

Since we now only support GCC7 and above, the PIC-specific branch is no
longer necessary and is removed.

Fixes #6028. The assertion was a result of random data in ebx.
Refs #2675 / reverts 6334ee3f8b and reverts 03eaf9b461.

Patch by: nwtour
Comments by: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D3575
This was SVN commit r25405.
2021-05-09 12:41:45 +00:00
wraitii 1e1af6e2df Separate campaign replays in replay page & fix for i18n
The 'map name' dropdown filter did not work in localised interfaces.

Patch by: nwtour
Differential Revision: https://code.wildfiregames.com/D3883
This was SVN commit r25404.
2021-05-09 08:39:38 +00:00
s0600204 14324b8918 Fix auto-complete chat entries for Biome names in GameSetup
The line altered here was returning an Array of Objects. This array
would
eventually passed to code that expected it to be an Array of Strings.
This was
causing an error to thrown that could be replicated by going to the
Multiplayer
GameSetup, entering text (e.g. "Winter", "Dry", "lol") into the chat
field, and
pressing `Tab` to trigger the auto-complete.

This line now returns an Array containing the user-facing names of the
Biomes
available to the selected map (if it has them), which is what this
method was
returning prior to dc18d94030.


Related: dc18d94030, dc18d94030

This was SVN commit r25403.
2021-05-08 20:45:20 +00:00
wraitii 0dbf417171 Fix 8b08f4ae7a - CGUIColor setting
Reported by: langbart
Fixes #6173

Differential Revision: https://code.wildfiregames.com/D3937
This was SVN commit r25401.
2021-05-07 11:34:20 +00:00
Freagarach f008edea73 Fx low resource supply tricking AI.
Strength was floored, resulting in possibility for `0`, which was not
handled gracefully by the map.
Since the strength is multiplied by something that can be non-integer in
the map, the floor is not needed.

Differential revision: https://code.wildfiregames.com/D3884
Comments by: @Angen, @smiley
This was SVN commit r25400.
2021-05-07 09:07:20 +00:00
Freagarach a18d97b047 Let team bonuses also apply to own player.
Requested in D3810 (and other places).
It was weird that e.g. the Romans gave their allies a training bonus but
lacked that themselves.

Differential revision: https://code.wildfiregames.com/D3899
Reviewed by: @ValihrAnt
Comment by: @darkcity
Idea approved by: @wraitii
This was SVN commit r25399.
2021-05-07 08:48:51 +00:00
Freagarach 2dfc8681d2 Fix returning resources by formation members.
Noticed by @mysticjim.
Introduced in 21645f5c1c.

Differential revision: https://code.wildfiregames.com/D3931
Differential revision: D3838
Fixes: #6170
Reviewed by: @wraitii
This was SVN commit r25397.
2021-05-07 07:05:57 +00:00
Freagarach d2d0c6b347 Some small fixes for the AutoQueue feature.
51ab4315ff
Fix using the hotkey on entities that don't have a Production Queue.
Fix showing the icon on entities that don't produce entities.

Differential revision: https://code.wildfiregames.com/D3932
Fixes: #6172
Comment by: @wraitii
Tested by: @Langbart
This was SVN commit r25396.
2021-05-07 07:01:39 +00:00
wraitii 64b475b390 Fix Profiler1 "time per turn".
Actually call Turn() when a turn is processed.

Fixes #6144

Differential Revision: https://code.wildfiregames.com/D3885
This was SVN commit r25394.
2021-05-06 16:49:34 +00:00
wraitii e0800bc092 Allow toggling repairability.
Useful for trigger maps.

Differential Revision: https://code.wildfiregames.com/D3901
This was SVN commit r25393.
2021-05-06 14:25:33 +00:00
wraitii 8b08f4ae7a Change GUI settings to explicitly be member variables.
Completes work starting in D2313 / a33fd55e81:
- Make C++ mistakes where values can be changed without messages being
sent easier to notice / harder to do.
- Make the IGUISetting interface more flexible, allowing custom settings
implementing their own logic. This is used to clean up hotkey code
introduced in 33af6da5e1.

Side effects:
- FromJSVal_Vector clears the vector being passed in. I have some vague
memory of not doing that in D24 / 2bae30c454 as an optimisation, but it
seems more like a footgun to me.
- Most usage of SetSettingFromString is replaced by direct method calls,
as we can generally cast to the proper GUI object type. Where we can't,
it is kept as a poor's man virtual dispatch.
- It moves a few member variables elsewhere, e.g. TextOwner now gets its
own member variable settings.

Differential Revision: https://code.wildfiregames.com/D3892
This was SVN commit r25392.
2021-05-06 08:22:37 +00:00
wraitii 4db5467717 Fix mistake in 100159548c
I last-minuted a "X = X * Y" into a "X *= Y" but that turns out to map
to "X = Y * X" with our matrix overloads.

Reported by: langbart
This was SVN commit r25391.
2021-05-06 07:42:49 +00:00
Stan c2167ffc7e Differentiate a bit the spart and athen rams.
- Use Athenian Shields
- Reduce Duplication
- Add default material

Patch by: @wowgetoffyourcellphone & @Stan`
This was SVN commit r25390.
2021-05-06 07:17:09 +00:00
wraitii 100159548c Fix bounding boxes after f73fa05542
Skinning calculations must happen in bone-space.

Fixes f73fa05542

Reported by: langbart
Fixes #6168

Differential Revision: https://code.wildfiregames.com/D3927
This was SVN commit r25387.
2021-05-05 16:20:33 +00:00
wraitii 781afea4b1 More broken implicit conversions.
Differential Revision: https://code.wildfiregames.com/D3928
This was SVN commit r25386.
2021-05-05 15:39:44 +00:00
wraitii 8724b86915 Fix macOS boost compilation
Bintray has moved. Also upgrade to 1_76 while at it.

Differential Revision: https://code.wildfiregames.com/D3925
This was SVN commit r25383.
2021-05-05 08:25:01 +00:00
Freagarach 51ab4315ff Enable production entities to autoqueue.
This adds a new command button that enables training of units
automatically.
Use:
- Enable auto-queue.
- Train an entity.

This adds a new item to the queue whenever the previous item starts,
such that good micro is more resource-efficient.

Patch by: @azayrahmad
Differential revision: https://code.wildfiregames.com/D3865
Comments by: @Langbart, @nani, @Stan, @wraitii
This was SVN commit r25381.
2021-05-05 06:12:31 +00:00
wraitii fe3ff1b0ff Map browser fixes and improvements
- 'Random' map is filtered correctly
 - When in 'fallback to all' mode, selecting something works (#6165).
 - Fix hotkeys being broken (fixes map browser following 0406c4dfde)
 - Clear filters when reopening the map browser (seems natural).

Based on a patch by: nani
Refs #6045.
Fixes #6165.

Differential Revision: https://code.wildfiregames.com/D3833
This was SVN commit r25379.
2021-05-04 16:40:16 +00:00
wraitii 2e08fd38ea GUI cleanup: XML & child handling.
- We only need an XMBFile, not a CXeromyces to parse GUI
objects/scripts/... This makes the interface more consistent with other
usage, notably ParamNode.
- Rename IGUIObject::AddChild to RegisterChild and flesh out the
interface a little.

Differential Revision: https://code.wildfiregames.com/D3908
This was SVN commit r25378.
2021-05-04 15:17:50 +00:00
wraitii 0198942a79 Fix warning in cdd75deafb
GCC complained, even if the path cannot be taken.

This was SVN commit r25377.
2021-05-04 14:01:18 +00:00
wraitii 911f49c655 Gamesetup: make sure GameSpeed is a number
The dropdown converted the numbers to string, and the code expected
numbers.

Differential Revision: https://code.wildfiregames.com/D3924
This was SVN commit r25376.
2021-05-04 13:59:30 +00:00
wraitii cdd75deafb XMB Improvements, parse JS into XMB, make strings more efficient.
XMB format is bumped to 4, invalidating all cached files. The
differences are:
 - element/attribute names are stored after the elements themselves, and
not before. This allows writing XMB data in one pass instead of two.
 - names themselves becomes offsets (instead of arbitrary integers),
making getting the string from the int name much more efficient.

XMBFile is renamed to XMBData to clarify that it does not, in fact,
refer to a file on disk.

XMBData::GetElementString is also changed to return a const char*, thus
not creating an std::string. A string_view version is added where
convenient.

The XML->XMB and JS->XMB conversion functions and the corresponding
storage are moved to `ps/XMB`, since that format doesn't particularly
relate to XML. CXeromyces becomes lighter and more focused as a result.
The XML->XMB conversion also benefits from the above streamlining.

Note that in a few cases, string_view gets printed to CLogger via
data(), which is generally not legal, but we know that the strings are
null-terminated here. Our libfmt (version 4) doesn't support
string_view, that would be v5.

Differential Revision: https://code.wildfiregames.com/D3909
This was SVN commit r25375.
2021-05-04 13:02:34 +00:00
wraitii a1010b83d3 Enable specifying the trigger action independently of the trigger name.
Trigger functions/actions were tied to the trigger 'identifier'. This is
inconvenient if several triggers should call the same function, e.g. for
range triggers.

By setting an 'action' in the trigger data, one can now specify the
function to call independently of the trigger name.

For clarity, the 'action' parameter in RegisterTrigger is changed to
'name'. By default, the action still matches the trigger name for
compatibility and convenience.

Differential Revision: https://code.wildfiregames.com/D3903
This was SVN commit r25374.
2021-05-04 12:33:45 +00:00
wraitii c0157d613d Simplify trigger event naming scheme.
Reduces confusion and string manipulation.

Refs #52.

Differential Revision: https://code.wildfiregames.com/D3913
This was SVN commit r25373.
2021-05-04 09:46:38 +00:00
Stan 79118e6716 Remove castshadow from decals.
This was SVN commit r25372.
2021-05-04 09:21:32 +00:00
Stan 6663b27fa2 Disable shadows for blood. Since they are decals it doesn't seem to make much difference.
This was SVN commit r25371.
2021-05-04 09:06:13 +00:00
wraitii 2efe255bbd Fix error when hosting lobby game.
Revealed by 0406c4dfde. The fix also avoids sending a redundant
lobbyregistration message.

Reported by: langbart
Differential Revision: https://code.wildfiregames.com/D3923
This was SVN commit r25369.
2021-05-04 08:58:22 +00:00
Freagarach 738b200dda Let entity react on target death directly.
Don't let entities waste a repeat time when they've killed their target.
Done by storing a list of attackers in cmpResistance (since that cmp is
obligatory anyway).

Differential revision: https://code.wildfiregames.com/D2129
Comments by: @Angen, @wraitii
This was SVN commit r25368.
2021-05-04 05:18:11 +00:00
wraitii 34b1920e7b Split ScriptRequest in its own header.
We often only need to include ScriptRequest.h and not the full
ScriptInterface.h

Differential Revision: https://code.wildfiregames.com/D3920
This was SVN commit r25366.
2021-05-03 16:07:26 +00:00
wraitii 0406c4dfde Throw errors instead of warnings on wrong implicit conversions.
This prints out a stack trace, which is quite helpful when debugging.
Also fixes an issue with stack trace not always being reported.

Differential Revision: https://code.wildfiregames.com/D3210
This was SVN commit r25365.
2021-05-03 15:44:06 +00:00
Freagarach 5287dd768d Add some missing credits.
@mysticjim and @Sundiata manage the community, but were not named in
those credits yet.
@Langbart does a lot of valuable work (amongst which is writing patches)
and was not credited at their first patch (my fault).

Differential revision: https://code.wildfiregames.com/D3880
This was SVN commit r25364.
2021-05-03 14:03:43 +00:00
Freagarach 48cb9a2d6f Allow triggers to spawn turreted entities.
After 21e866fcf0.

Differential revision: https://code.wildfiregames.com/D3872
Comments by: @Angen
This was SVN commit r25363.
2021-05-03 08:54:54 +00:00
wraitii bb49fbe793 Further reduce usage of TERRAIN_TILE_SIZE in non-terrain components
TERRAIN_TILE_SIZE is now only used in relevant places in the simulation.
This also makes it mostly possible to use CFixed in constexpr contexts.

Refs #5566

Differential Revision: https://code.wildfiregames.com/D3078
This was SVN commit r25360.
2021-05-02 17:40:00 +00:00
wraitii 6d10a35d97 Fix some warnings.
- 25332f9b86 added 'override' to a method in ShaderProgram.cpp. This
adds it to the rest.
- BinarySerializer.cpp had custom JS includes, because putting those in
ScriptExtraHeaders failed. The cause is that gloox leaves "#define
lookup" up. This has been reported upstream, and fixed here.
- VS17 complains about an uninitialised variable, though the usage is
safe.

Differential Revision: https://code.wildfiregames.com/D3916
This was SVN commit r25359.
2021-05-02 15:45:40 +00:00
wraitii 3801a4dd47 Allow implicit JS boolean -> string conversions.
`false` becomes `"false"`, `true` becomes `"true"`.

Differential Revision: https://code.wildfiregames.com/D3917
This was SVN commit r25358.
2021-05-02 15:43:59 +00:00
wraitii e53628ab56 Remove debug code left in d9748173c7
Reported by: Freagarach
This was SVN commit r25357.
2021-05-02 07:08:40 +00:00
Angen 0ad3dba097 Do not transfer xp twice on Promotion
ChangeEntityTemplate used by Promotion is transfering xp from old unit
to new one, but also Promotion component itself does the same thing.
Introduced in cc1ea7cca0

Differential revision: D3915
This was SVN commit r25356.
2021-05-01 17:40:26 +00:00
vladislavbelov 2fcab79e15 Moves terrain independent code for viewport bounds calculations to camera.
This was SVN commit r25355.
2021-05-01 16:59:42 +00:00
wraitii d46a417748 Replace ScriptInterface::Call* with new ScriptFunction functions
Finishes work started in f3aedf88a6.
This removes the boost-CPP function wrappers entirely, in favour of pure
templated code in FunctionWrapper.h
The Call* functions were already heavily templated, so there is nothing
really new here. I just use tag dispatch to reduce the number of
overloads slightly.

The new functions do not need the script interface, only the script
request.

Differential Revision: https://code.wildfiregames.com/D3912
This was SVN commit r25354.
2021-05-01 14:04:53 +00:00
wraitii d9748173c7 Generalize icon-specific tooltips to a tag, streamline code.
We can currently specify a custom tooltip for an icon. This extends that
to a generic tag `[tooltip='something']...[/tooltip]` for any particular
piece of text, and removes the iconTooltip hardcoding by instead using a
virtual `GetTooltipText` call since all IGUIObject descendants have a
tooltip. This is both cleaner & more efficient.
Removes the ability to set a custom tooltip style (that doesn't seem
particularly useful), it'll reuse the style of the CText itself.

Differential Revision: https://code.wildfiregames.com/D3895
This was SVN commit r25353.
2021-05-01 12:38:05 +00:00
vladislavbelov 9107d6d8c7 Fixes unused CCamera argument in debug rendering in SilhouetteRenderer.
This was SVN commit r25352.
2021-05-01 12:13:48 +00:00
wraitii 8633a28b00 TriggerPoint - default required component is '0'.
Differential Revision: https://code.wildfiregames.com/D3902
This was SVN commit r25351.
2021-05-01 09:02:30 +00:00
wraitii 19b01dc710 Migrate DEFINE_INTERFACE_METHOD_* to the ScriptFunction wrappers.
The main benefits are more convenient code in the component interfaces
TU and no limit on the # of arguments that can be passed.

Differential Revision: https://code.wildfiregames.com/D3910
This was SVN commit r25350.
2021-05-01 08:01:30 +00:00
wraitii c62ad8fefa Implement FromJSVal<IObject*> safely
By making all GUI proxy objects share the same class, we can easily
confirm if a given JS object is one, and from there convert to the
appropriate types.

Differential Revision: https://code.wildfiregames.com/D3907
This was SVN commit r25347.
2021-04-30 13:20:43 +00:00
Freagarach 3579097d95 Count resource gatherers also when returning their resources.
Followup on 1e0a6f66f0.
This gives a better image of the amount of units which are gathering.
By decision, entities are _not_ accounted from when the player tasks
them to return their resources.

Refs. #643
Differential revision: https://code.wildfiregames.com/D3226
Comments by: @wraitii
This was SVN commit r25345.
2021-04-30 06:24:13 +00:00
wraitii 835c081ca4 Fix large slowdown in rendering on some configurations.
Usage of GL_VERTEX_ARRAY client state apparently prevented OpenGL from
using hardware acceleration on my computer (Macos 10.14 with an Intel
GPU).
It is unclear how many people would be affected by this issue, but on my
end it makes GLSL performance competitive with ARB again.

Reviewed By: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D3900
This was SVN commit r25343.
2021-04-29 07:38:40 +00:00
wraitii 2ce4c2e7d5 Unify pierce resistance of defensive structures.
Defensive buildings now have 25H/35P/3C resistance.

Patch by: Nescio
Differential Revision: https://code.wildfiregames.com/D3757
This was SVN commit r25342.
2021-04-29 07:35:27 +00:00
wraitii f0b2c31533 Buff stone throwers: increased range and HP.
Patch by: borg-
Differential Revision: https://code.wildfiregames.com/D3781
This was SVN commit r25341.
2021-04-29 07:32:49 +00:00
wraitii 70149803c5 Introduce a specific limit to domestic animals pop.
- Prevents lag
- Prevents abuse by using animals to break pathfinding.

Patch by: Nescio
Differential Revision: https://code.wildfiregames.com/D3777
This was SVN commit r25340.
2021-04-29 07:29:48 +00:00
wraitii b1267f7878 Unify resistances of non-buildable structures.
Resistance is unified to 1H/10P/1C.

Patch by: Nescio
Differential Revision: https://code.wildfiregames.com/D3756
This was SVN commit r25339.
2021-04-29 07:27:12 +00:00
wraitii 04d242c456 Introduce an Hoplite tradition tech for Athens/Sparta.
Similar to the archer tradition tech.
Intended to boost usage of melee units.

Patch by: borg-
Differential Revision: https://code.wildfiregames.com/D3688
This was SVN commit r25338.
2021-04-29 07:26:00 +00:00
wraitii e3c7c4656a Increase archer spread slightly, introducing a compensating technology.
This new value was last changed in 4a2cc3273e. The new value sits
halfway.
The technology is available at the forge for all civilizations with
archers and independent of the already existing “Archery Tradition”
technology.

Patch by: Nescio
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D3736
This was SVN commit r25337.
2021-04-29 07:22:20 +00:00
wraitii 59168b015e Revert 2e1545ffc4, fix correctly.
This was SVN commit r25335.
2021-04-28 16:38:45 +00:00
Stan c9a7aabbea Fix enabling / disabling shadows in the actor viewer.
Differential Revision: https://code.wildfiregames.com/D3896
This was SVN commit r25334.
2021-04-28 11:09:16 +00:00
Stan d981536a5e Fix horses props going OOS when gathering.
- EOL native and xml mime type
- Add player_trans_norm_spec.xml
- Disable cast shadow for manes.
- Use norm instead of parallax

Reported by @Freagarach

This was SVN commit r25333.
2021-04-28 11:03:15 +00:00
wraitii cbd91ca999 Translation fixes.
- Fix in tooltip context for healing 'Health'
- Fix in tooltip for splash shape.
- Translate locale_advanced
- Translate specific name in the structure truee
- Translate player name in gamesetup.

Patch by: nwtour
Differential Revision: https://code.wildfiregames.com/D3889
This was SVN commit r25332.
2021-04-28 08:04:13 +00:00
vladislavbelov b74d5bf0d8 Removes glColor* calls from scene rendering, colors are set explicitly by uniforms.
This was SVN commit r25330.
2021-04-27 19:35:36 +00:00
vladislavbelov 5b33d3a76c Removes ShaderProgramPtr argument from DebugRenderer methods.
This was SVN commit r25329.
2021-04-27 19:23:37 +00:00
vladislavbelov cd6a554198 Removes GL matrix stack usages from scene rendering.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D3894
This was SVN commit r25328.
2021-04-27 18:43:49 +00:00
Stan 4718760754 Fix ugly water color in polynesia.xml
This was SVN commit r25327.
2021-04-27 14:09:57 +00:00
wraitii 66fbc23f2c De-singletonify CConfigDB, make hooks RAII.
CConfigDB is no longer a singleton, and its members are no longer
static.
This makes it possible to have several instances of it, useful for
testing of if we ever want to have different config profiles.

Also updates hooks to delete themselves on destruction, to fit a more
natural RAII pattern. Long-lived objects must take care to destroy hooks
before ConfigDB is reset.

Differential Revision: https://code.wildfiregames.com/D3866
This was SVN commit r25326.
2021-04-27 07:45:40 +00:00
vladislavbelov 2698cf8ba2 Fixes missing DrawCameraFrustum argument after 5e12424123.
This was SVN commit r25324.
2021-04-26 21:21:13 +00:00
vladislavbelov 5e12424123 Removes glBegin from scene rendering, removes GL matrix stack dependency from scene rendering.
This was SVN commit r25323.
2021-04-26 21:11:35 +00:00
Stan 67948e4229 Fix flag position for barracks.
Refs: #6160

This was SVN commit r25322.
2021-04-26 15:33:54 +00:00
wraitii 8963786a76 Improve error message for broken quality levels in Actor files.
Differential Revision: https://code.wildfiregames.com/D3887
This was SVN commit r25321.
2021-04-26 14:59:32 +00:00
wraitii ad87f1e295 More actor file validation, preventing crashes.
It's currently possible to trigger ENSUREs in the code if loading empty
groups, which is easy enough with LOD and shouldn't happen.

Recover gracefully from these errors instead.

Differential Revision: https://code.wildfiregames.com/D3888
This was SVN commit r25320.
2021-04-26 14:57:13 +00:00
Stan 9957ff1b08 Fix broken garrison flag on the athenian temple.xml
Refs: #6160

This was SVN commit r25319.
2021-04-26 14:56:50 +00:00
wraitii 2e1545ffc4 Fix unused variable warning in a97f7f3917
This was SVN commit r25318.
2021-04-26 08:47:24 +00:00
vladislavbelov 2086a66340 Adds circle drawing to DebugRenderer.
This was SVN commit r25315.
2021-04-25 21:55:19 +00:00
vladislavbelov e90aaf6348 Adds line drawing to DebugRenderer.
This was SVN commit r25314.
2021-04-25 20:48:44 +00:00
Angen 9977c73eb6 Revert 895182cbcb
This was SVN commit r25313.
2021-04-25 13:42:51 +00:00
Angen 895182cbcb Make player entities more visible on minimap
This patch is increasing contrast of player colours used on minimap in
minimap component instead of changing player colours themselves to not
mess with other cases, when they are used.

Differential revision: D3242
Comments by: @vladislavbelov, @ValihrAnt, @Freagarach
This was SVN commit r25312.
2021-04-25 11:05:41 +00:00
Angen 45805043a1 Use better colour in multiplayer lobby for away status
Colour for away status, makes it hard to spot among busy statuses.
Setting more orange colour for this.

Differential revision: D3856
Ref: #6055
Accepted by: @asterix
Comments by: @Langbart
This was SVN commit r25311.
2021-04-25 10:56:57 +00:00
wraitii 1ccb85d8d7 Unify damage of arrow-shooting structures
- Arrow shooting structures (towers, CC, fortress, camps...) now deal 10
pierce data per arrow, one arrow every 2 second (i.e. 5 pierce DPS).
- Adjust the count of arrows per building accordingly.

This makes these buildings easier to compare.

Accepted By: #balancing, borg-, wraitii
Differential Revision: https://code.wildfiregames.com/D3668
This was SVN commit r25309.
2021-04-24 13:46:36 +00:00
wraitii a97f7f3917 Hotloading fix after 76acc4e146
Emplace does not replace existing element, insert_or_assign does.

While at it:
 - Clean up the 'outdated' logic and reuse it for actors
 - When an actor fails to load, return a placeholder. This improves
hotloading of broken actors, and makes Cunit behaviour more predictable.
 - Some minor cleanup

Reported by: Stan
Fixes #6157

Differential Revision: https://code.wildfiregames.com/D3882
This was SVN commit r25308.
2021-04-24 09:39:33 +00:00
wraitii f73fa05542 Cache the model-animation bounds more efficiently.
To render models, we need to know the maximum bounds it takes over the
course of an animation. This depends only on the ModelDef and the
AnimationDef (and thus the SkeletonDef).
Currently, we recompute this data for each model, which is inefficient.
Caching it in ModelDef is faster, particularly avoiding lag spikes at
game start on some maps.
The animations are referred by a unique ID to avoid pointer-related
issues. I would have preferred weak_ptr, but that cannot be stably
hashed for now.

While at it, switch to unique_ptr/vectors.

Differential Revision: https://code.wildfiregames.com/D2967
This was SVN commit r25306.
2021-04-23 14:26:59 +00:00
Stan 52258ce48b Use the new "Lod" Feature for reins
* Disable "castshadow" on medium quality
* Disable them on low for performance.
* EOL & Mime Type

This was SVN commit r25305.
2021-04-23 09:38:23 +00:00
vladislavbelov f3bc024e79 Draws scrollbar above list to have a correct order for Z sorting after a6cb77a204.
Reported By: nwtour
Tested By: nwtour
Differential Revision: https://code.wildfiregames.com/D3881
This was SVN commit r25303.
2021-04-23 06:56:01 +00:00
Freagarach 6f1644aac3 Some translation fixes.
Patch by: @nwtour
Differential revision: https://code.wildfiregames.com/D3875
Comment by: @vladislavbelov
This was SVN commit r25301.
2021-04-22 07:41:56 +00:00
vladislavbelov f4905066ab Reduces number of allocations during error message formatting.
Differential Revision: https://code.wildfiregames.com/D3871
This was SVN commit r25300.
2021-04-22 06:53:03 +00:00
Freagarach 19e055c6e1 Store build time modifier in template.
Instead of hardcoding it in the component.
Allows modders to easily change the value.

Differential revision: https://code.wildfiregames.com/D3792
Comments by: @Angen, @Nescio, @Stan
This was SVN commit r25299.
2021-04-22 06:18:00 +00:00
Freagarach 56aabc1242 Add note about patience on the chat-button and add FAQ-button.
We have a FAQ, that is now pretty up-to-date, so use it.
Also add note that people may want to be more patient when chatting with
us on IRC.

Patch by: @Langbart
Differential revision: D3499
Comment by: @Stan
This was SVN commit r25298.
2021-04-22 04:52:38 +00:00
Stan 8332425142 Use the new "Lod" Feature for handgrips
* Disable "castshadow" as they are never much larger than the shields
* Disable them on medium because they are part of the texture
* Disable them on low for performance.
* EOL & Mime Type
* Add a new materials/basic_trans_norm_spec.xml to disable parallax
(while keeping normal and transparency) when not needed and use it for
the handgrips with transparency.

This was SVN commit r25297.
2021-04-21 09:26:23 +00:00
Stan 228a2f49e0 Use the new "Lod" Feature for greaves
- Disable "castshadow" as they are never much larger than the legs
- Disable them on medium because they are part of the texture
- Disable them on low for performance.
- Add a missing mesh reported by @wowgetoffyourcellphone the r variant
was used for the l actor
- EOL & Mime Type

- Add a new materials/no_trans_norm_spec.xml to disable parallax (while
keeping normal) when not needed and use it for the greaves.

This was SVN commit r25296.
2021-04-20 21:27:26 +00:00
Stan e2b43b2fbf Fix no idle alarm sound;
Noticed & Tested by: @Langbart
Tweaks by: @Samulis
This was SVN commit r25294.
2021-04-20 17:15:21 +00:00
wraitii 8d02102885 Fix triggerhelper for 59d0885d68
59d0885d68 made formation take "formation", not "name". This broke
TriggerHelper.

Reported by: Angen
Reviewed By: Angen
Differential Revision: https://code.wildfiregames.com/D3873
This was SVN commit r25293.
2021-04-20 09:36:33 +00:00
Freagarach 80e9f2c517 Fix typo in PetraAI's extended entity.
Called the member instead of the function.
Introduced in ea96e81098. Noticed by @Angen.

Differential revision: https://code.wildfiregames.com/D3870
Reviewed by: @Angen
This was SVN commit r25291.
2021-04-19 06:43:50 +00:00
vladislavbelov fe991aaa62 Moves cinematic overlay to GUI.
Differential Revision: https://code.wildfiregames.com/D3869
This was SVN commit r25289.
2021-04-18 16:23:10 +00:00
Freagarach 9450cfcbda Move custom JS data structures to globalscripts.
These don't depend on the simulation and can be useful for e.g. the GUI
(the FSM) or map scripts.
Confer also the vector implementation.

Differential revision: D3863
Comment by: @wraitii (agreed with concept)
This was SVN commit r25288.
2021-04-18 08:31:30 +00:00
Freagarach fb3e9ad96e Play a sound when there are no idle entities.
If there are no idle units and the idle-unit hotkey is pressed there is
now a sound played.
Beneficial when there are already units selected since selection doesn't
change.

Sound courtesy of @Samualis.

Refs. #5360
Based on a patch by: @cpc
Differential revision: https://code.wildfiregames.com/D1692
Comments by: @asterix, @smiley, @Stan, @vladislavbelov
This was SVN commit r25287.
2021-04-18 08:10:00 +00:00
vladislavbelov 5c51ce2e2f Removes old ARB state.matrix usages.
This was SVN commit r25285.
2021-04-17 23:08:55 +00:00
vladislavbelov 769b0426a7 Removes unused debug render from ShadowMap.
This was SVN commit r25284.
2021-04-17 22:16:01 +00:00
vladislavbelov b7e6811ea6 Removes fixed shader technique from effects.
This was SVN commit r25283.
2021-04-17 22:07:18 +00:00
Freagarach fd008e11ad Fix some translations.
- Idle builder hotkey 28bd4f0092.
- "Other hotkey"-catagory.
- Tooltipless hotkeys.

Patch by: @nwtour
Differential revision: https://code.wildfiregames.com/D3862
This was SVN commit r25282.
2021-04-17 07:47:30 +00:00
wraitii 518fb7eafa Set a stack quota for JS scripts to prevent crashes from infinite loops.
Infinite loop will instead trigger JS exceptions, which will make error
reports much nicer.

Differential Revision: https://code.wildfiregames.com/D3851
This was SVN commit r25280.
2021-04-16 16:49:18 +00:00
wraitii 89032c4d2b Improvements on 76acc4e146
See 76acc4e146. Follows comments by @vladislavbelov.

Differential Revision: https://code.wildfiregames.com/D3852
This was SVN commit r25279.
2021-04-16 16:04:01 +00:00
wraitii 924c6ce34e Rework 7ee94f23df
Following comments by @vladislavbelov.

Differential Revision: https://code.wildfiregames.com/D3860
This was SVN commit r25278.
2021-04-16 16:01:30 +00:00
Freagarach b3e3d1f715 Use a map for the weighted list.
Less object creations at addition time, more intuitive handling.

Differential revision: https://code.wildfiregames.com/D3854
Comments by: @Stan, @wraitii
This was SVN commit r25276.
2021-04-16 07:02:58 +00:00
Freagarach 4329dd90ce Rename Attacking.js-helper to Attack.js and its global to AttackHelper.
16b452cf91#inline-4026

Differential revision: https://code.wildfiregames.com/D3858
Comment by: @wraitii
This was SVN commit r25275.
2021-04-16 06:55:23 +00:00
Freagarach 3184a51787 Add stable to fortress random map.
Replaces a house by a stable.
Since c4eeb82d83 cavalry cannot be trained at the barracks anymore.

Patch by: @Nescio
Differential revision: D3691
This was SVN commit r25274.
2021-04-16 06:26:37 +00:00
Freagarach 2e69526e26 Correct Arthashshastra quotes.
Chanakya was the teacher and minister of Chandragupta Maurya, whereas
Kautilya is the author of the Arthashshastra. While the two are often
equated (out of ignorance or for ideological reasons), they are
different persons, and the first versions of the Arthashshastra were
composed only a few centuries after the Mauryas were gone. See
https://wildfiregames.com/forum/topic/27113-bibliography-and-references-about-ancient-times-book-reviews/?tab=comments#comment-402302
for a more detailed explanation.
This patch therefore:
- changes the author from Chanakya to Kautilya;
- lists the quotes at the correct location in the file (under K instead
of C);
- removes the chapter titles (which depend on the text edition or
translation) and give a more precise location, to make it easier for
people to look up.

For those interested, the Sanskrit is:
KAZ01.4.07 na-iti kauṭilyaḥ | 7 |
KAZ01.4.08 tīkṣṇa.daṇḍo hi bhūtānām udvejanīyo bhavati | 8 |
KAZ01.4.09 mṛdu.daṇḍaḥ paribhūyate | 9 |
KAZ01.4.10 yathā.arha.daṇḍaḥ pūjyate | 10 |
and:
KAZ01.19.01 rājānam utthitam anūttiṣṭhante bhṛtyāḥ | 1 |
KAZ01.19.02 pramādyantam anupramādyanti | 2 |

And the translations in Patrick Olivelle King, Governance, and Law in
Ancient India / Kauṭilya’s Arthaśāstra / A New Annotated Translation
(Oxford 2013) are on p. 69:
7 “No,” says Kauṭilya;
8 “for one who punishes severely terrifies the people,
9 and one who punishes lightly is treated with contempt,
10 whereas one who dispenses appropriate punishment is treated with
respect.
and on p. 92:
1 When the king is energetic, people in his service, in turn, become
energetic;
2 and when he is lethargic, they, in turn, become lethargic.

Patch (and description above) by: @Nescio
Differential revision: https://code.wildfiregames.com/D3598
This was SVN commit r25273.
2021-04-16 06:23:16 +00:00
vladislavbelov 4a51012442 Adds line drawing to DebugRenderer.
This was SVN commit r25271.
2021-04-15 22:51:25 +00:00
Angen 57e85c195e Fix wrongly placed parameter in 841bf5f2dd
Correctly colour url of invalid mod.

This was SVN commit r25270.
2021-04-15 20:21:47 +00:00
vladislavbelov 389a5a4379 Removes low-level GL calls from graphics and geometrics primitives and adds DebugRenderer.
Tested By: Freagarach
Differential Revision: https://code.wildfiregames.com/D3857
This was SVN commit r25269.
2021-04-15 18:07:01 +00:00
Angen f1a1cf11d3 Check for replay compatibility when opening summary screen
Summary screen and mainly its statistics can be influenced by mod as
much as replay itself with mod removing or adding classes and trackers
to the game.
Summary screen allows to replay the match without checking
compatibility, that is fine I think if it is prevented to see summary of
incompatible replay in a first place.

Therefore this is adding compatibility check for opening summary of
replay.

Differential revision: D3799
Fixes: #6119
Tested by: @Langbart
This was SVN commit r25268.
2021-04-15 17:19:27 +00:00
Angen 894fc1dd5d Fix EstimateFuturePosition in UnitMotionFlying
Introduced in f737831167

Differential revision: D3855
Fixes: #6141

This was SVN commit r25267.
2021-04-15 17:15:40 +00:00
wraitii 7ee94f23df Use type_identity to simplify Clamp usage.
Differential Revision: https://code.wildfiregames.com/D3859
This was SVN commit r25266.
2021-04-15 13:01:24 +00:00
Freagarach b74ab54cf7 Fix translation of damage types.
Broken in d28a91b83d.
Due to not checking for `template_helpers` in the game's files.

Patch by: @nwtour
Differential revision: https://code.wildfiregames.com/D3850
This was SVN commit r25265.
2021-04-15 05:47:54 +00:00
Freagarach 079212fe46 Fix entities able to attack allied structures in rare cases (take 2).
Caused by not checking the attack type whilst performing an attack.

Fixes: #5511
Differential revision: D3845
Refs. #3484

This was SVN commit r25264.
2021-04-15 05:45:13 +00:00
vladislavbelov 092ccfec77 Removes unused header dependencies from CTimeManager.
This was SVN commit r25262.
2021-04-14 22:14:37 +00:00
vladislavbelov 715dca0701 Removes unused shadow settings forgotten in 12e2428495, removes direct SkipSubmit access.
This was SVN commit r25261.
2021-04-14 20:25:05 +00:00
s0600204 f57ac432e8 Show correct cost/phase of template-variants in structree whilst maintaining correct build lists in viewer
("Variant" in this case means a template that is functionally the same
as its
base template - but is a different promotion level, requires a
technology to
unlock (that the base template doesn't), is an upgrade of its base, or
is a
trainable version.)

Should fix concern raised on b2842e8021.

Accepted by: Angen
Differential Revision: https://code.wildfiregames.com/D3347
This was SVN commit r25260.
2021-04-14 20:05:26 +00:00
Stan 63224865d5 Fix selection height for the apple, banana, date, fig, olive and palm trees. Use the biggest variation as reference. Forgotten in https://code.wildfiregames.com/24043 (Height was 10 initially)
Reported by: @nani
Fixes: #6075

This was SVN commit r25259.
2021-04-14 16:55:44 +00:00
wraitii 43a780504a Delete "Compact RelaxNG" / .rnc files
(Follows 76acc4e146 where I deleted actor.rnc)

This deletes the .rnc validation files, upgrading the .rng files to
being the source of truth.

- The engine uses, via LibXML2, .rng files to validate XML schemas, to
the .rnc files are redundant.
- The RelaxNG "Compact" format is a DSL for the RelaxNG XML format. Its
syntax is unique, unlike .rng files which are XML.
- Some errors are likely - I'm not sure anyone has converted the compact
files in years.
- The tool to generate .rng from .rnc files is trang
(https://github.com/relaxng/jing-trang), which runs on the JVM and is
quite annoying to install compared to "your usual text editor".
- The JS components use the full .rng format in XML, so editing this
format is already familiar to most people that mod the game.

The .rnc files were added in 2c9939ac74 along the .rng files.

Refs #413, #245

Differential Revision: https://code.wildfiregames.com/D3824
This was SVN commit r25258.
2021-04-14 07:39:36 +00:00
wraitii fde66f5134 Fix 4 small gamesetup issues
- Random lanscape option now works properly.
- Non-host clients now see the game attributes correctly in the loading
screen, including in particular the map name.
- AI bots are again translated.
- 'Cheat' setting is persisted correctly in MP gamesetup.

Reported by: myself, Freagarach, nwtour
Differential Revision: https://code.wildfiregames.com/D3841
This was SVN commit r25257.
2021-04-14 07:30:26 +00:00
wraitii 0308c2390a Rework the pathfinder path computation setup for threading.
Essentially reverts D1918 / d592bf9cb6.
Instead of copying path requests to workers, setup the result vector,
then setup an index, and compute 'in-place'.
To send messages, the result vectors are read in order. This makes the
order trivially constant no matter how many workers there are, and the
architecture overall makes it much easier to efficiently paralellise.

Tested by: Langbart, Stan
Differential Revision: https://code.wildfiregames.com/D3849
This was SVN commit r25256.
2021-04-14 07:23:47 +00:00
vladislavbelov 990265d974 Fixes warnings after minimap changes in b7db124cb5.
This was SVN commit r25254.
2021-04-13 23:16:46 +00:00
Stan c8b2c09bc3 Fix --without-pch build. fc60d80af1 was missing an include.
Reported by: @vladislavbelov
This was SVN commit r25253.
2021-04-13 17:28:01 +00:00
Stan 1508031f09 Scale down turret icons so that they don't overflow.
Reported by: @nwtour
This was SVN commit r25252.
2021-04-13 17:15:34 +00:00
wraitii e36c8c3763 Destroy components in reverse order of construction.
Components have some initialisation-order dependency. They could also
have destroy-order dependency, and from a RAII-like point of view, it
makes sense to do this.

Differential Revision: https://code.wildfiregames.com/D3843
This was SVN commit r25251.
2021-04-13 13:47:59 +00:00
wraitii 0a59489824 Use unique_ptr for secondary sim data.
Differential Revision: https://code.wildfiregames.com/D3842
This was SVN commit r25250.
2021-04-13 13:46:45 +00:00
Freagarach 67fe65e85b Fix mismatching range checks in finding a new target when gathering.
While gathering resources entities may be tasked to gather near a
position. The range check for that is 10 m. However, the relaxed range
check for the walking state is this.DefaultRelaxedMaxRange, which is 12
meter, currently. Meaning it would lead to a slow infinite loop.

Differential revision: D3839
Comments by: @wraitii
Tested by: @gameboy
(https://wildfiregames.com/forum/topic/38131-tutorial-bug/)

This was SVN commit r25249.
2021-04-13 06:48:13 +00:00
wraitii 1b844606aa Implement mul_round in checkrefs.
Missed in 19f600cfa2. In use since 2078abdcc4.

This was SVN commit r25247.
2021-04-12 16:33:54 +00:00
wraitii 5df6e688e2 Revert 189d00d811 - infinite loop in UnitAI when slaughtering.
Reverting to get some time to investigate.

Reported by: langbart
This was SVN commit r25246.
2021-04-12 16:16:57 +00:00
wraitii 2078abdcc4 Fix issue with 37790e099c
Cost cannot be non-integer, and rounding issues happened.

Reported by: gameboy
This was SVN commit r25245.
2021-04-12 14:07:59 +00:00
wraitii 6d5b710877 Fix undefined values in barter tooltip.
Patch by: nwtour
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D3829
This was SVN commit r25244.
2021-04-12 13:51:02 +00:00
Freagarach 21645f5c1c Minor fixes after Gathering refactoring.
- `initPos` was used wrong.
- There were two `CanGather` functions in `cmpResourceGatherer`.
- Reduced some duplication in the ReturnResource order.

Differential revision: D3838.
This was SVN commit r25243.
2021-04-12 12:50:17 +00:00
Freagarach 189d00d811 Fix entities being able to attack allied structures in rare cases.
Caused by not checking the attack type while performing an attack.

Closes: #5511
Differential revision: D3840
References #3484

This was SVN commit r25242.
2021-04-12 12:41:35 +00:00
vladislavbelov b7db124cb5 Crops minimap view bounds to map size.
Differential Revision: https://code.wildfiregames.com/D3837
This was SVN commit r25241.
2021-04-12 12:39:07 +00:00
Freagarach e17cd7754e Split hotkeys of turrets.
Following 21e866fcf0.
Also support leaving a turret by using a hotkey.
Currently the hotkeys are by default bound to the same ones as
garrisoning.

Differential revision: D3773
Icons by: @wowgetoffyourcellphone and @Stan.
This was SVN commit r25240.
2021-04-12 12:31:29 +00:00
wraitii d0a0ed0b1c Mixins: deduplicate Athen-specific data.
Puts the athen-specific data in the mixin `civ/athen`. Deduplicates.

Differential Revision: https://code.wildfiregames.com/D3831
This was SVN commit r25239.
2021-04-12 11:30:38 +00:00
wraitii 37790e099c Mixins: Remove the special mercenary technology, apply template changes directly.
Reviewed By: Freagarach
Differential Revision: https://code.wildfiregames.com/D3832
This was SVN commit r25238.
2021-04-12 11:28:18 +00:00
Stan 318a5d7a2b Improve Caratacos' portrait.
Patch by: @m7600
Refs: d8709f84f3

This was SVN commit r25237.
2021-04-12 09:13:34 +00:00
Freagarach 3097a7c302 Attack using cmpAttack instead of UnitAI.
Keep responsibilities separated, allow easier modding of attacking
behaviour.
Ideally the BuildingAI attacking routine would be merged in here as
well, but not done for now.

Part of #5810
Differential revision: D3816
Comments by: @smiley, @Stan
This was SVN commit r25235.
2021-04-12 06:51:39 +00:00
Freagarach ea86790e4e Profile the Transform helper.
Differential revision: D3825
Comments by: @Stan, @wraitii
This was SVN commit r25234.
2021-04-12 06:23:30 +00:00
Freagarach 8acc3b049f Combine attack times in a single node.
Reduces duplication, allows all attack types to cause splash damage.
While at it, makes delay and minimal range optional (for obvious
defaults are available).

Split from D368, so basically a patch by @bb.

Note that it may seem like one can arbitrarily name an attack now, but
that is not true.

Differential revision: D2002
Comments by: @bb, @Nescio, @Stan, @wraitii
This was SVN commit r25233.
2021-04-12 06:17:13 +00:00
vladislavbelov a6cb77a204 Disables depth test for GUI rendering.
Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/D3835
This was SVN commit r25231.
2021-04-11 19:36:52 +00:00
wraitii e7159c01fb Fix 3759fc8a98
3759fc8a98 broke decals and particle emitters, as I misplaced the if
block.

Reported by: langbart
This was SVN commit r25230.
2021-04-11 19:04:56 +00:00
vladislavbelov 8eb4871c9b Draws GUI elements by Z order.
Tested By: wraitii
Differential Revision: https://code.wildfiregames.com/D3780
This was SVN commit r25229.
2021-04-11 11:27:53 +00:00
wraitii 35ed55cfd6 ParamNode: switch to utf8, ToXML -> ToXMLString, test tweak, PCH tweak
This changes ParamNode to use UTF8 values internally (XMB files are UTF8
since cb9d0733ef).
This removes the need for a lot of conversions, speeding things up and
allows cleaning up the validator interface & a few other callsites.
ConstructJSVal could be a tad slower because of UTF8->16 conversions
within Spidermonkey; but the difference is unlikely to be noticeable in
practica.

Also:
- Changes `ToXML` to `ToXMLString` for clarity.
- Add a simple "op" test & show a particular behaviour of merge nodes
that I intend to change somewhat in D3830.
- Remove Component.h from simulation2 PCH - brought in too much.

Tested by: langbart
Differential Revision: https://code.wildfiregames.com/D3834
This was SVN commit r25228.
2021-04-11 09:23:10 +00:00
wraitii fcc6bbe797 Fix d73a3f59ad - wstring_view on a temporary & wrong utf16->8 conversion.
Two issues:
- The wstring_view was created on a temporary string - the data got
overwritten sometimes.
- there was some weird UTF16->UTF8 conversion going on.


Reported by: langbart
Differential Revision: https://code.wildfiregames.com/D3828
This was SVN commit r25226.
2021-04-09 18:08:37 +00:00
wraitii fc60d80af1 Simplify GUI Proxy implementation & customisation.
This finishes 7c04ea0211 and 1b67a079fb.
GUI Proxy objects are now easier to specialize, code duplication is
reduced, code is made safer.
In details:
- the proxy private is always the IGUIObject* pointer
- the private data is accessed through a safer wrapper
- CreateJSObject returns an opaque type to allow easier extension &
prevent errors.
- The implementation of CreateJSObject is moved near the GUI Proxy
template instantiation, and both are wrapped in a convenient macro (this
makes it so that if you use the macro, you can't forget to overload the
method, and vice-versa).
- The common IGUIObject JS interface no longer needs to be repeated.
- All specialisations are again put in the same file, for improved
compile-time & clarity, given there are so few lines now.
- While at it, implement toSource which makes it possible to `uneval`
components (does the same as toString though).


Differential Revision: https://code.wildfiregames.com/D3826
This was SVN commit r25225.
2021-04-09 18:01:47 +00:00
wraitii 3759fc8a98 Allow empty actor files.
This allows empty actor files -> they map to a dummy object that renders
nothing.
The use case is automatically hiding objects at lower quality levels &
LOD settings.

Differential Revision: https://code.wildfiregames.com/D3819
This was SVN commit r25224.
2021-04-09 15:45:31 +00:00
wraitii d73a3f59ad Allow arbitrary compositions in TemplateLoader template names.
- Allows compositing any two templates in TemplateLoader, and not just
filters: 'A|B|C' is now valid for any template A, B and C.
- Allows parents to be composited paths 'A|B|C'. In such a schema, if A
or B themselves specify a parent, the actual composition becomes
A|pA|B|pB|C and so on.

This allows, by leveraging the common schema of our entities, to reduce
duplication.

For convenience, templates in "special/filters/" and "mixins/" can be
included by their direct name. Others have to be completely specified.

See the two provided cases for examples:
- 'hoplite' becomes a mixin that can be used to apply the Phalanx
formation
- 'builder' becomes a mixin that can be give a template the ability to
build the standard structures, and gives the 'Builder' identity class.
This also allows deduplicating that list of tokens.

Update checkrefs & swap std::map for std::unordered_map in
TemplateLoader.

Differential Revision: https://code.wildfiregames.com/D3801
This was SVN commit r25223.
2021-04-09 15:43:50 +00:00
wraitii 7321509d5f Fix crash in ActorViewer.
Fixes 76acc4e146 (and some 2007-2010 commit).
ObjectManager needs the Simulation to be initialised, thus needs to come
after it in the class.

Tested by: langbart
Differential Revision: https://code.wildfiregames.com/D3827
This was SVN commit r25222.
2021-04-09 15:34:51 +00:00
Freagarach 14d24e03f2 Fix promoting entities going back to default stance.
Introduced in 93d22ef16b.
Brings back the less intrusive bug of transforming while garrisoned of
turreted and unloading results in the default stance. That needs to be
fixed again.

Differential revision: D3822
This was SVN commit r25221.
2021-04-09 08:46:39 +00:00
Freagarach f7f82ecf25 Use explicit functions for passing on a builders list.
Instead of relying on the assumption that an entity which transforms
only has one of the two (and the same) before and after.
Fixes 5b3bdf3647.

Differential revision: D3821
Comment by: @Stan
This was SVN commit r25220.
2021-04-09 08:42:43 +00:00
wraitii 1af9a4702d Fix MSVC warning.
Introduced in 592453c62f.

Differential Revision: https://code.wildfiregames.com/D3815
This was SVN commit r25219.
2021-04-09 08:13:14 +00:00
Freagarach b1c1cb1657 Fix pickup error.
Introduced by forgetting to change a line in fd1d7d5d83.

This was SVN commit r25217.
2021-04-09 07:08:33 +00:00
Freagarach 8f04d2ee90 Move function to perform trade to substate.
Don't pretend it to be a callable function, while it is certainly part
of the FSM.
(Also makes it easier for us to implement a duration for the trading in
the future, might we ever want to.)

Differential revision: D3813
Comment from: @Angen
Closes: #6135

This was SVN commit r25216.
2021-04-09 06:29:49 +00:00
Freagarach 7ba4b1ffc8 Split dropping resources from approaching in UnitAI.
Allows for non-moving entities to drop resources. (When someone checks
those cases in the order.)
(Also makes it easier for us to implement a duration for the dropping in
the future, might we ever want to.)

Differential revision: D3817
This was SVN commit r25215.
2021-04-09 06:25:47 +00:00
Freagarach 6023a273df Fix phasing requirements of tutorial.
Introduced in 2ef3fd7a77.
Fixed by switching the order of task of the barracks and outpost.

Patch by: @nwtour
Differential revision: D3820
This was SVN commit r25214.
2021-04-09 06:02:22 +00:00
Freagarach 294d102a6f Queue techs at structure with the lowest queue length.
Instead of queueing all techs at the lowest ID.

Patch by: @n1xc0d3r
Differential revision: D3798
Tested by: @Langbart
This was SVN commit r25213.
2021-04-09 05:55:05 +00:00
Freagarach f5a0ab81b6 Fix missing return in 3c4a341906.
Caused entities to walk to the edge of the map when their dropsite was
destroyed.

This was SVN commit r25211.
2021-04-08 10:34:48 +00:00
wraitii 76acc4e146 Implement quality levels for actors & corresponding setting.
An actor file, as referenced by the VisualActor, can now define
different actors for different "quality level" setting.
In this initial version, the quality is handled directly by the object
manager.

Actor format impact:
- '<qualitylevels>' may be used as the root node, containing actor nodes
as children.
  - such actor nodes can refer to a file, or to an inline actor, or
simply be inlined.
  - such actor nodes may have a 'quality' attribute, specifying the
maximum quality level of this actor. By default, 255 (the maximum) is
implied.
- The actor format remains valid, but 'groups', 'variants', 'material',
'castshadow' and 'float' can be given a [minquality, maxquality[ range
via XML attributes. Outside of this range, the XML node is ignored
(making it possible to define, in a single actor file, several quality
levels).

Quality is a 0-255 value, with:
- Range 0-99 intended for lower level-of-detail actors (billboards,
etc.)
- Range 100-200 the 'normal' range for models. 100 is "low", 150
"medium", and 200 "high".
- Range 201-255 used for higher quality actors that might be used for
e.g. cinematics.
The range is wide to make it easier to add intermediate levels in the
future and it seemed easier given that an integer value of some kind was
required anyways.

Engine impacts:
- A new CActorDef class is introduced, wrapping an art/actors XML file
and its different quality levels. ObjectBase remains the definition of a
given 'actor', now at a given quality level.
- CActorDef imposes a maximal # of quality level for a particular actor
definition (5 currently).
- CUnit is made to refer to an Actor Definition explicitly, not a
particular ObjectBase.
- As a minor optimisation, variation keys are calculated on
pointer-to-sets-of-selections, instead of raw sets-of-selections, as
this reduces copying.
- some refactoring, including better const-correctness and hotloading
support via std::shared_ptr.

Differential Revision: https://code.wildfiregames.com/D3787
This was SVN commit r25210.
2021-04-08 07:22:24 +00:00
Freagarach e3695abe59 Build using Builder instead of UnitAI.
Moves the building logic from UnitAI to Builder.
Makes it easier for modders to change building behaviour, e.g. letting
structures build.

Differential revision: D3812
Comment by: @Angen
This was SVN commit r25208.
2021-04-08 05:50:18 +00:00
Freagarach f2d5603422 Heal using Heal instead of UnitAI.
Moves the healing logic from UnitAI to Heal.
Makes it easier for modders to change healing behaviour, e.g. letting
structures heal (instead of using an aura).

Differential revision: D2680
Comments by: @Stan, @wraitii
This was SVN commit r25207.
2021-04-08 05:40:49 +00:00
Freagarach 3c4a341906 Gather using ResourceGatherer instead of UnitAI.
Moves the gathering logic from UnitAI to ResourceGatherer.
Makes it easier for modders to change gathering behaviour, e.g. letting
structures gather.
Refs. #4293 by optimising a bit.

Differential revision: D2662
Comments by: @bb, @Stan, @wraitii
This was SVN commit r25206.
2021-04-08 05:31:34 +00:00
Stan 48d6b84c62 Fix initial animation sync.
UpdateAnimationID → PickAnimationID

Reviewed by: @wraitii
Differential Revision: https://code.wildfiregames.com/D3747
This was SVN commit r25205.
2021-04-07 08:35:02 +00:00
Freagarach a7d777d69b Don't store origin market in this.goods in cmpTrader.
It was introduced in 9b98585275 but made obselete in 98b4fe6d00.

Differential revision: D3809
This was SVN commit r25204.
2021-04-07 07:04:57 +00:00
Freagarach 9ee4ccd8ec Split commit from build in cmpFoundation.
Useful if e.g. a modder wants to commit a structure before building it.

Differential revision: D3806
This was SVN commit r25203.
2021-04-07 07:02:12 +00:00
Freagarach ac7db9850b Move trader gain to cmpMarket.
Deletes the helper, since we need at least one market anyway.

Differential revision: D3808
Closes: #5890

This was SVN commit r25202.
2021-04-07 06:58:36 +00:00
wraitii 739a63828a Suppress CppCheck "unknown macro" lint error.
Including third party libraries to the cppcheck include path is annoying
and the unknownMacro errors are generally not useful.

This was SVN commit r25200.
2021-04-06 15:20:35 +00:00
Freagarach f1e4a0e6f6 Some cleaning in cmpFoundation.
- `var` -> `let`.
- Remove some comments.

Differential revision: D3803
This was SVN commit r25199.
2021-04-06 13:35:29 +00:00
Freagarach e208b703ca Only tell stuff to move from foundation when trying to commit it.
It is wasteful to do and seems not needed anymore.

Differential revision: D3802
Comments by: @Angen, @Stan
Reverts b478b9742a, b478b9742a
Refs. #3410

This was SVN commit r25198.
2021-04-06 13:06:27 +00:00
Freagarach 5b3bdf3647 Use transform to finish construction.
Decreases duplication.

Differential revision: D3804
Comment from: @wraitii (also on IRC)

This was SVN commit r25197.
2021-04-06 12:54:33 +00:00
wraitii 973de1ccd7 Fix foundation committing following 592453c62f (pushing)
592453c62f added a flag to "GetBlockMovementFlag" to return either the
current or the template value, and by default it returns the template
value.
Foundation logic needed it to return the current value.

Gates are also updated to avoid changing behaviour in unpredictable
ways.

Differential Revision: https://code.wildfiregames.com/D3796
This was SVN commit r25196.
2021-04-06 12:28:53 +00:00
wraitii 80f354a125 Fix nopch / tiny hotkey optimisation
Swap an std::set for an std::vector, the set was useful only in an
earlier iteration of the diff. This fixes nopch.

Differential Revision: https://code.wildfiregames.com/D3790
This was SVN commit r25195.
2021-04-06 12:26:34 +00:00
Freagarach 93d22ef16b Allow to specify subunits on creation.
This basically does two things:
- Allow turrets on moving entities (fixes serialisation in cmpPos).
- Allow an entity to be present on another when the other is created.

That makes it basically a boiled down version of a prior patch, omitting
the part where orders could be passed on.
This does allow e.g. ranged units on chariots that fire while the
chariot moves.

Original diff by: @sanderd17
Redone by: @Stan
Differential revision: D1958
Comments by: @Alexandermb, @Angen, @bb, @Langbart, @Nescio, @Stan,
@wraitii
Refs. #2577 by implementing the entity on platform case.

This was SVN commit r25192.
2021-04-05 05:22:25 +00:00
Freagarach e2f4ce0649 Add Upkeep component.
Adds a new component effectively handling negative resource trickles.
Prevents resources from going negative and provides an effect for not
being able to pay.
The effect chosen for 0 A.D. is having the entity not being
controllable.

Not used in the public mod itself, but it is in quite some mods.

Based on an idea of @Nescio
Differential revision: D1323
Comments by: @Angen, (@smiley,) @Stan
This was SVN commit r25191.
2021-04-04 06:52:20 +00:00
Freagarach 7562354c49 Don't pass owner to initialise a foundation.
As ownership is already set.
Refs. bdbd0b9dbf and 9213ee8c27.

Differential revision: D3795
This was SVN commit r25190.
2021-04-04 06:38:16 +00:00
Freagarach 58ec287b1f Use interval instead of timeout for healing in GarrisonHolder.
Prevents constant recreation of a timeout.

Differential revision: D3791
Refs. #6081

This was SVN commit r25189.
2021-04-04 06:32:53 +00:00
Freagarach 0d630fb113 Fix garrison rally point when unloading.
Revealed by f884848745. Noticed by @Langbart.
The holder was deleted after being tasked to garrison the new target,
but with still a holder we were not allowed to garrison.

Differential revision: D3794
Closes: #6128
Tested by: @Lanbart
This was SVN commit r25188.
2021-04-04 05:57:42 +00:00
wraitii 7032a3c12a Further hotkey work: clear hotkeys when an input box/the console gets focus.
This is necessary following 2d53308e1b, which now handles key-up in
input to prevent hotkeys from firing then.
Hotkeys are a global system, which means opening e.g. the chat window or
the summary does't reset things. If you press "S" to scroll the in-game
camera down, then press 'return' to open the chat, the camera keeps
scrolling down. Following 2d53308e1b, it never released since it never
got the keyup.

To handle this nicely, we need to explicitly clear hotkeys when input
boxes get focus (respectively the console).

Differential Revision: https://code.wildfiregames.com/D3797
This was SVN commit r25186.
2021-04-03 20:12:40 +00:00
wraitii 52e8a0c5fb Fix chasing after Motion Manager & Pushing.
The motion manager introduced in bae258f9a1 makes 'chasing' (e.g. an
entity targeting another entity, which also applies to fleeing)
behaviour symmetrical: both units see the initial state instead of it
being ID-dependent.
This allows removing hacks introduced in 6a66fb8205 (and refined in
7b88b1a0f9).

Differential Revision: https://code.wildfiregames.com/D3785
This was SVN commit r25185.
2021-04-03 07:00:58 +00:00
Freagarach fb498d97d9 Fix raising alert.
After 21e866fcf0.
AllertRaiser replaced the order instead of just calling the required
function.
While at it, check for the garrisonable size when looking for buildings.

Differential revision: D3789
Tested by: @Langbart
This was SVN commit r25183.
2021-04-02 17:01:59 +00:00
wraitii 592453c62f Add a simple 'pushing' logic to unit motion to improve movement.
This implements a form of crowd movement that I've generally called
'unit pushing' in the last few years.
Essentially, any two units will push each other away when they're too
close. This makes it possible to ignore unit-unit obstructions, and thus
makes movement much smoother in crowds.
This first iteration of this system only allows pushing between idle
units and between moving units (i.e. a moving unit does not affect an
idle one).
This is because the unitMotion logic to detect it is stuck & needs to
use the pathfinders starts breaking: units can fail to move because they
are pushed away from their intended movement, and the current logic
fails to handle this gracefully.
Thankfully, the most value of this patch in terms of player experience
is found in the improvements to group movements and shuttling.

Other impacts:
- As the short pathfinder is called less often, we can increase the
starting search range & reduce the # of max turns, both improving
collision recovery.
- The performance of idle units is slightly worsened, as they must be
checked for idle-idle collisions. If needed a 'sleeping' system, as used
in physics engine, could be implemented.
- In general, however, expect slight performance improvements, as fewer
short paths are computed.
- Gathering efficiency should increase slightly, since shuttling times
are likely reduced slightly.
- As a sanity change to improve some edge cases (units that say they're
moving, i.e. pushable, but don't actually move), the 'going straight'
logic is turned off if a short path has been computed. This requires a
few cascading changes to work correctly.

Technical notes:
- To reduce the cost of the n^2 comparisons that pushing requires, units
are only compared within a small square on a grid which is lazily
reconstructed each turn. The overhead seems rather small, and this is
much simpler than keeping an up-to-date grid.
- The design is intended to be parallelisable if needed someday.
- The pathfinder's CheckMovement ignores moving units in UnitMotion, as
that is now the spec. Idle units are not ignored, which is required for
the 'collision' detection to work correctly (see above).

Refs #3442 (not fixed - idle units are not pushed by moving units).
Fixes #5084 (the overlap can still happen, but units will push each
other away).

Differential Revision: https://code.wildfiregames.com/D1490
This was SVN commit r25182.
2021-04-02 16:30:59 +00:00
wraitii 8ed1bc2fd1 Don't error in the network delay notifier.
Differential Revision: https://code.wildfiregames.com/D3788
This was SVN commit r25181.
2021-04-02 14:20:37 +00:00
wraitii 2d53308e1b Fix console not preventing hotkeys from firing / Clean up hotkey-input conflict.
- Fix mistake in 4b46c09222 (similar to one in a4852c4c01) that allowed
hotkeys to fire while typing in the console.
- Prevent Alt+key to fire hotkeys in input boxes & console as that is
often text input.
- Split the hotkey triggering logic in two: a preparatory phase & an
actual firing phase.
This allows the GUI code to check which hotkeys are about to fire and
selectively allow them to go through. This makes it easier to change
hardcoded hotkeys, such as the console toggling one.

Differential Revision: https://code.wildfiregames.com/D3786
This was SVN commit r25180.
2021-04-02 14:18:20 +00:00
Freagarach 6842eacde9 Fix allowed classes on turret points.
Should use `_string` on init. Noticed by @wraitii.

Differential revision: D3783
This was SVN commit r25178.
2021-04-02 07:15:46 +00:00
wraitii 0232c0d017 Fix 4b46c09222 - Mouse wheel hotkeys behaving erratically.
Mouse wheel hotkeys behave differently from other hotkeys (mouse
button/keys) in that they are transient: they're always pressed/released
in one go.
As such:
- They shouldn't be added to the stored pressedHotkeys
- They shouldn't be added to active scancodes.

This fixes these issues from 4b46c09222 & also skips un-necessary
processing in those cases.

Reported by: Imarok.
Differential Revision: https://code.wildfiregames.com/D3782
This was SVN commit r25176.
2021-04-01 14:51:22 +00:00
wraitii ae1bc9b785 Show non-default hotkeys that appear in JSON spec files in the hotkey editor.
This makes sure all hotkeys from hotkeys/spec/*.json files are displayed
in the editor, even if they are not found in configuration files.

Differential Revision: https://code.wildfiregames.com/D3767
This was SVN commit r25175.
2021-04-01 09:20:29 +00:00
wraitii 28bd4f0092 Introduce a 'Builder' class for entities that can build structures.
- Increases moddability
- Increases the clarity of visible classes (gatherer & builder vs
Worker)
- Introduce an 'Idle builder' hotkey.

Patch by: Nescio
Differential Revision: https://code.wildfiregames.com/D3290
This was SVN commit r25174.
2021-04-01 07:26:59 +00:00
vladislavbelov 1b5ed5063f Cleanups CGUISprite, removes redundant method.
This was SVN commit r25172.
2021-03-31 19:26:05 +00:00
wraitii 22ea79a56f Fix the 'Introductory Tutorial' found in the 'tutorial campaign'.
Some information & resources were outdated, preventing progress.

Patch by: nwtour
Differential Revision: https://code.wildfiregames.com/D3764
This was SVN commit r25171.
2021-03-31 15:58:16 +00:00
wraitii b55b236379 Remember OOS on a per-client basis.
Change the OOS notification logic to remember the OOS-ness of each
client. Reset it on client leave.
The server will thus continue checking for OOS if the OOS-client leaves.
This is convenient to ignore observer OOS, or wait for an OOS player
without restarting the game.

Also add the turn number to the OOS dump, to fix #3348: particularly
following d4c2cf4430 the turn is likely to not be the same between
different clients.

Agree by: asterix
Differential Revision: https://code.wildfiregames.com/D3753
This was SVN commit r25170.
2021-03-31 15:55:19 +00:00
wraitii 4b46c09222 Do not trigger "HotkeyPress" events when releasing a key.
Follows d0a42f2f00.
Because only the most specific hotkeys can be active at any time,
releasing a key may require re-activating less specific hotkeys.
There were two issues with this behaviour:
- It was buggy, as it only checked one active key, when any still active
key can trigger hotkeys.
- "HotkeyPress" and "HotkeyDown" events where sent, as if the hotkey was
pressed, which was unexpected for most code/users (it is unusual to have
a "Press" event on key release).

This fixes these issues by "silently" re-triggering the hotkeys in such
a case. It also makes it easier for JS code to use "hotkeyPress" instead
of "hotkeyDown" for non-continuous behaviour.

Accepted By: nani
Fixes #6123
Refs #6064 (fixes the problem, but not the code weirdness)

Differential Revision: https://code.wildfiregames.com/D3766
This was SVN commit r25169.
2021-03-31 15:50:25 +00:00
wraitii 457c538780 GameSetup: fix selecting a map with up/down keys.
Fixes dc18d94030.
Using down/up to change the map in the map selection dropdown in the
gamesetup has a one-element lag. The reason is that on dropdown up/down,
two events are sent:
- first the current highlighted item is selected (it's usually the
selected one).
- then the new item is selected.

Because of faulty timer logic, only the first update went through.

Differential Revision: https://code.wildfiregames.com/D3774
This was SVN commit r25168.
2021-03-31 13:10:07 +00:00
wraitii 6c6204f007 Add missing player number to skirmish map names & filenames.
Patch by: langbart
Fixes #6105

Differential Revision: https://code.wildfiregames.com/D3682
This was SVN commit r25167.
2021-03-31 06:53:05 +00:00
vladislavbelov 742b636f70 Moves CRect from ps to maths to related geometric primitives.
This was SVN commit r25165.
2021-03-30 21:14:36 +00:00
Freagarach f50c98cfd1 Check for ability to move on orders that need to move.
Not all orders were checked, which would cause problems when receiving
an order that needed moving and that did not handle not being able to
move properly.

Differential revision: D3771
This was SVN commit r25164.
2021-03-30 15:50:03 +00:00
Freagarach 496884ac73 Some fixes after the split of turrets.
21e866fcf0
Crossbowmen should be able to turret (noted by @Nescio).
TurretHolders should be able to pick entities up.

Differential revision: D3744
This was SVN commit r25163.
2021-03-30 11:24:08 +00:00
Freagarach fd1d7d5d83 Reduce UnitAI duplication in range checks.
By querying the range and passing a target along.

Differential revision: D3748
Comments by: @wraitii
This was SVN commit r25162.
2021-03-30 11:17:46 +00:00
wraitii 649cc49f25 Fix off-by-one error in d8ea401a95.
d8ea401a95 replaced the ExploreTerritories logic, but I did not account
for the territory grid being N cells wide when the LOS is N+1.
Therefore, we could get out of bounds.

Reported by: Vladislavbelov
Differential Revision: https://code.wildfiregames.com/D3765
This was SVN commit r25161.
2021-03-30 07:11:44 +00:00
vladislavbelov c56c856ed5 Moves Frustum from graphics to maths to more related geometric primitives like bounding ones.
This was SVN commit r25159.
2021-03-29 17:28:13 +00:00
vladislavbelov 4f83f1a0e9 Cleanups Frustum and removes access to members.
This was SVN commit r25158.
2021-03-29 17:15:29 +00:00
wraitii e5b971c2bf Allow modifiers without "affects" list.
This allows modifiers without "affects", or with empty "affects" lists,
to do something.
This makes it possible to force a modifier on an entity without classes
(e.g. trees) or with unknown classes.

Accepted By: asterix
Differential Revision: https://code.wildfiregames.com/D3761
This was SVN commit r25157.
2021-03-29 08:10:08 +00:00
wraitii 5ebf2020b0 Netcode: allow observers to lag behind the live game.
Observers no longer lag the game for players. There is still some time
to serialise the game when sending it to a joining observer, and
depending on the chosen 'max lag' the game may stop while observers
sufficiently catch up, but this impact too is reduced.

- Make the NetServerTurnManager ignore players marked as 'observers' for
the purpose of ending a turn, effectively making it possible for
observers to lag without it affecting the players in any way.
- Add a config option (network.observermaxlag) that specifies how many
turns behind the live game observers are allowed to be. Default to 10
turns, or 2 seconds, to keep them 'largely live'.
- The controller is not treated as an observer.
- Implement a simple UI to show this delay & allow the game to speed up
automatically to try and catch up. This can be deactivated via
network.autocatchup.
- Move network options to the renamed 'Network / Lobby' options page.
- Do not debug_warn/crash when receiving commands from the past -
instead warn and carry on, to avoid DOS and "coop play" issues.

Refs #5903, Refs #4210

Differential Revision: https://code.wildfiregames.com/D3737
This was SVN commit r25156.
2021-03-29 07:53:06 +00:00
Freagarach e3a254225a Introduce generic template for support elephants.
To keep civ-specific stuff in civ-specific templates.

Patch by: @Nescio
Differential revision: D3690
This was SVN commit r25154.
2021-03-29 06:59:34 +00:00
vladislavbelov 969112b9c8 Replaces CPos by more a consistent CVector2D, reduces geometry code duplication.
Tested By: Freagarach, Langbart
Differential Revision: https://code.wildfiregames.com/D3759
This was SVN commit r25152.
2021-03-28 21:55:13 +00:00
wraitii 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
wraitii 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
wraitii 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
wraitii 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
wraitii 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
wraitii 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
vladislavbelov 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
vladislavbelov 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
vladislavbelov fa3e501f8f Makes EAlign more consistent with other enums by CC.
This was SVN commit r25142.
2021-03-27 12:07:38 +00:00
vladislavbelov 6332760528 Removes implicit default value operator for CGUIColor.
This was SVN commit r25141.
2021-03-27 11:47:49 +00:00
vladislavbelov 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
Freagarach 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
wraitii d0de32b2a8 Fix 8bd7a4f4b5 - crossbowman introduced in 7bf2f9ed74
This was SVN commit r25138.
2021-03-27 09:48:30 +00:00
wraitii 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
wraitii 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
wraitii 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
wraitii 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
wraitii 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
wraitii 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
wraitii 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
wraitii 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
wraitii 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
wraitii 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
wraitii 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
wraitii 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
Freagarach 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
Freagarach 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
Freagarach 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
Freagarach 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
vladislavbelov 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
vladislavbelov 39c8e7f1a2 Cleanups ShadowMap, fixes possibly wrong depth format name for GLES.
This was SVN commit r25117.
2021-03-25 12:09:56 +00:00
Freagarach 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
vladislavbelov 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
wraitii 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
wraitii 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
s0600204 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
s0600204 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
wraitii 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
wraitii 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
wraitii 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
wraitii 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
wraitii 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
wraitii 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
wraitii 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
Freagarach 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
wraitii 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
wraitii 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
wraitii 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
Angen 84bafd82b1 common-api entity.js cleanup
Do not check for undefined when result is returning undefined or the
variable and nothing else is done.
Dont create variables when might not be used or are returned without
other usage after.
Dont call get with same parameter more than necessary.

Differential revision: D3652
Comments by: @Freagarach
This was SVN commit r25093.
2021-03-21 08:49:26 +00:00
Freagarach aa9292b1fc Fix fishing boats hunting whale.
Accidentally introduced in 24f0cc7695.

Fixes: #6110
Patch by: @Langbart
Differential revision: D3716
Reviewed by: @Nescio
This was SVN commit r25092.
2021-03-20 20:08:48 +00:00
wraitii 7b00d93298 Fix MP Player assignment
Players could not be assigned beyond the first N slots.

Reported by: langbart
Differential Revision: https://code.wildfiregames.com/D3721
This was SVN commit r25091.
2021-03-20 18:04:22 +00:00
Freagarach 07908dfd8c Store components to be miraged in cmpFogging.
Allows modders (and us) to just add an IID to the array and ensure the
`Mirage()`-function to exist in the respective component.

Differential revision: D3713
Comment by: @wraitii
This was SVN commit r25090.
2021-03-20 16:14:35 +00:00
Freagarach a4a7ef983e Move Mirage information to respective components.
Moves the functions that define the properties/functions to mirage to
their respective components, making it easier for modders to know their
existence and to modify.

Closes: #5985
Differential revision: D3695
Comments by: @wraitii
This was SVN commit r25089.
2021-03-20 16:01:11 +00:00
wraitii dd74837e6e Convert InitAttributes disabled techs/templates & starting tech to triggers.
Disabled technologies & templates are not really gamesetting concerns,
since they are map-specific and de-activating these generally does not
make sense.
Starting technologies is unused and not the correct granularity level
for game setup.

Triggers do a better job of specifying these things on a per-map basis
(in fact, some maps already use triggers for that).

Changes:
- StartingTechnologies was used by the cart sandbox and is simply
removed.
- DisabledTechnologies was used by Polar Sea RM, which already had
triggers -> into triggers.
- DisabledTemplates was used for the Ptol Lighthouse on a few maps ->
since we changed the ability to "a lot of range", it's no longer OP on
these maps and the restriction is simply lifted.
- DisabledTemplates was used on Death Canyon Invasion Force -> into
triggers.

Differential Revision: https://code.wildfiregames.com/D3712
This was SVN commit r25088.
2021-03-20 09:36:56 +00:00
Freagarach c3da0cdd0f Fix cosmetic ESLint warnings in JS components (and their tests).
Which were autofixable, with slight modifications.
Not done are the slightly more complex changes.

Refs. #5524
Patch by: @Krinkle
Differential revision: D2279
Comments by: @elexis, @Stan
Reviewed by: @wraitii
This was SVN commit r25087.
2021-03-20 09:02:22 +00:00
vladislavbelov c4d5729c73 Adds basic tests for BuildCameraRay and uses viewport instead of renderer for width and height.
This was SVN commit r25085.
2021-03-19 17:39:34 +00:00
wraitii 30432574fa Fix issues with dc18d94030
Issues from dc18d94030 fixed:
- The AI config page does not work
- Player Color/Civ/Team did not reset when switching out of Scenario,
which locked the setting
- Player color had weird issues with resetting when changing map too.
- Pop Cap could not be changed.
- Explored/Revealed were swapped in the game description (this was
actually fixed at some point in the original diff then reverted).

Reported by: Submariner and langbart

Differential Revision: https://code.wildfiregames.com/D3715
This was SVN commit r25084.
2021-03-19 16:41:17 +00:00
wraitii 76c5263607 Rename GameAttributes to InitAttributes
The initial settings for a game, used to create the map in RM & tosetup
the simulation, are named InitAttributes in the C++, but generally
referred to as GameAttributes in the JS GUI. This renames the latter to
the former to avoid confusion, since these settings are immutable once
the map starts, so InitAttributes is more accurate.

Differential Revision: https://code.wildfiregames.com/D3705
This was SVN commit r25083.
2021-03-19 10:02:10 +00:00
wraitii d751927b89 Linter fix on CI.
The CI wasn't properly reporting linting, as it turns out the output of
`arc lint --output json` is not what the Jenkins plugin expects.

This adds a custom lint printer that is compatible with the plugin
expectations.

Also delete the coala/ folder forgotten in the original diff.

Differential Revision: https://code.wildfiregames.com/D3709
This was SVN commit r25082.
2021-03-19 09:13:00 +00:00
Freagarach ce0fb7770c Clean mirage internals.
Redo 9f27f0eed8. Now! with not broken serialisation :D

Use a map that stores the functions, instead of them being part of the
Mirage component.
Doesn't need to initialise the variables anymore (refs. #5979).

Saves the mirages in a global to allow (de)serialisation.
Only assign values on Init, not on Construction (to allow
deserialisation).

Refs: #5985
Differential revision: D3702
Comments by: @wraitii
This was SVN commit r25079.
2021-03-18 17:34:53 +00:00
wraitii 961ac314ad Fix issues with motionManager / bae258f9a1
Fixes bae258f9a1.

As reported by Freagarach, garrisoned units trigger error messages.
As reported by Vladislavbelov, noPCH was broken & there were some style
issues.


Differential Revision: https://code.wildfiregames.com/D3707
This was SVN commit r25078.
2021-03-18 16:40:34 +00:00
wraitii dc18d94030 Separate Game Settings from the GUI Gamesetup
Split the gamesetup in two: the 'GameAttributes' part into gamesettings/
and the GUI/Presentation part in gamesetup/. This makes it easier to
separate the presentation from the data.

The immediate benefit is that campaigns & autostart scripts don't need
to load the gamesetup folder at all. This also makes it much easier for
any modder that would want to to change the GameSetup itself.

Each 'game attribute' is given a unique class extending GameSetting
(with a few exceptions), in charge of:
- 'Serializing' to the JSON-compatible 'InitAttributes' format, which is
used for persisted settings, network synchronization, map script
settings, hotloading.
- Deserializing from the same format.
- Watching for settings it depends on (such that e.g. unexploring the
map also unreveals it).

The GUI controls remain in charge of presenting the state accurately,
however they now directly subscribe to changes of the GameSettings for
update. The updating logic in general has been lightened on the GUI
side, making it more straightforward to know when something will update,
and reducing un-necessary computations (in theory - in practice, I
believe the gamesetup was already fairly good about this).
The 'Controller' class of the gamesetup have also been lightened, since
more responsibility now lies with GameSettings. In particular, this
include code to actually launch a game.

In general the GameSettings class is permissive - the GUI gamesetup has
tighter restriction for what the player can/cannot modify. This is
intended to give flexibility for campaign maps, which may want to change
arbitrary settings.

Further work would be useful, non-exhaustively:
- the setting of default values remains messy. They currently exist
somethings in GameSettings, sometimes in the GUI gamesetup, and in the
simulation itself (in case attributes are not set).
- the availability and 'lockedness' of settings remains a
work-in-progress.
- some attributes, like disabled technologies, should probably be
removed and triggers used instead.
- the Handling of AI and player-specific data could be improved.
- settings Persistence should follow its own path - not all settings are
worth persisting.
- GAIA settings are added simulation-side but not in the GUI, which is
confusing.

Thanks langbart & Freagarach for testing.

Follows the gamesetup rewrite in 34138a7764.

Refs #3049

Differential Revision: https://code.wildfiregames.com/D3243
This was SVN commit r25077.
2021-03-18 13:59:53 +00:00
Freagarach 413315024d Revert cleaning the mirage internals.
Broke serialisation.
Reverts 9f27f0eed8. (9f27f0eed8)

Refs. #5985
Differential revision: D3701
This was SVN commit r25076.
2021-03-18 09:42:15 +00:00
wraitii 446c134feb Fix infinite loop in healing & potential one elsewhere.
HEAL can infinite loop: if the HEAL.APPROACHING:MoveTo call fails, the
unit will fallback to FINDINGNEWTARGET, which looks for new targets to
heal, which can loop around.
In #6106, the cause was that the target was not visible despite the
order being given (presumably a rangemanager/los incompatibility issue).
When MoveTo() fail, orders usually call FinishOrder as that's
irrecoverable.

Further, GATHERING/COLLECTINGTREASURE also did not FinishOrder - there,
we do want to consider new resources if the target is e.g. unreachable,
so add an explicit check for AbleToMove.

Reported by: moiman
Reviewed By: Freagarach
Fixes #6106

Differential Revision: https://code.wildfiregames.com/D3689
This was SVN commit r25075.
2021-03-18 09:01:19 +00:00
vladislavbelov 92f94e25c6 Adds ortho projection type and its test.
This was SVN commit r25073.
2021-03-17 23:03:35 +00:00
wraitii e7612e8fed Update UnitMotion comment following d4c2cf4430
MP turns are now identical in length to SP turns.

This was SVN commit r25072.
2021-03-17 18:04:31 +00:00
wraitii bae258f9a1 Implement a Motion Manager around UnitMotion.
This new MotionManager handles movement for UnitMotion components (not
UnitMotionFlying).
This is a first step towards unit pushing, by giving a central place for
the relevant units to collide.

One important side-effect is that movement is effectively synchronous -
the positions are not actually updated until all units have moved for a
turn (refs 6a66fb8205).

As a side-effect, it's an optimisation: fewer messages are being sent
overall, which leads to a slight speedup (negligible without a lot of
units though).

This is a first step - ideally, the movement functions called from
UnitMotionManager would actually be moved there.

Differential Revision: https://code.wildfiregames.com/D3509
This was SVN commit r25071.
2021-03-17 17:04:51 +00:00
vladislavbelov ae07dcb4ff Removes joystick from camera controller.
Differential Revision: https://code.wildfiregames.com/D3700
This was SVN commit r25070.
2021-03-17 16:28:48 +00:00
Freagarach 8cdfc107b7 Let garrisoned entities be IDLE.
The "GARRISONED"-state was quite strange, for entities being garrisoned
can just as well perform other tasks (see e.g. turrets).
Also, the need for keeping a "garrison" order on the stack is removed.

Fixes: #6022
Differential revision: D3656
Refs. #6081

This was SVN commit r25069.
2021-03-17 14:53:09 +00:00
Freagarach 9f27f0eed8 Clean mirage internals.
Use a map that stores the functions instead of them being part of the
Mirage component.
Means that a lot doesn't need to be inited now (refs. #5979).

Ticket: #5985
Differential revision: D3694
Comments by: @wraitii
This was SVN commit r25068.
2021-03-17 14:42:06 +00:00
vladislavbelov bc66700e11 Adds more detailed test for perspective camera projection and its corners in world space.
Cleanups CVector3D a little bit.

This was SVN commit r25066.
2021-03-16 22:42:29 +00:00
wraitii b989a6dc8f Minor improvements to campaigns support.
- Remove LevelID harcoding
- Forward the initial data to the endgame script.
- Update the currentRun logic to make it behave more expectedly.

Differential Revision: https://code.wildfiregames.com/D3649
This was SVN commit r25065.
2021-03-16 14:48:12 +00:00
Freagarach a72423d3dc Clean up SpawnUnits in ProductionQueue.
Have an entity cache per item (refs. #6104) (which means it doesn't need
to be created at init; refs. #5979).
Cache the PQ-position instead of querying it for every spawned entity.
One could use any arbitrary player for spawning entities now, increasing
mod support.

Differential revision: D3669
Comment by: @wraitii
This was SVN commit r25064.
2021-03-16 06:01:23 +00:00
Freagarach df45f538df Clean up AddBatch (AddItem) in ProductionQueue.
Removes indentation.
Adds return value.
Cache owner instead of querying often.

This function can be cleaned even more later.

Differential revision: D3670
Comments by: @wraitii
This was SVN commit r25063.
2021-03-16 05:55:04 +00:00
Freagarach 93fe2ffa8a Handle aura and production pause on GarrisonedStateChanged message.
This reduces hard-coupling between the components.

Refs. #6081
Differential revision: D3683
Reviewed by: @wraitii
This was SVN commit r25062.
2021-03-16 05:49:36 +00:00
Freagarach 5cbbd570c0 Add range overlay to artillery.
Structures have them since ad1ab0c3d3, but units were excluded there due
to their mobility and amounts.
Artillery is not that easily massed and also not very mobile, but has a
high range and damage with a low reload time, making it nice to know
their approximate range.

Patch by: @Nescio
Differential revision: D3606
Comments by: @Angen, @borg-, @wraitii
This was SVN commit r25061.
2021-03-16 05:35:19 +00:00
wraitii 54fc516679 Fix rebase error in 8e34371deb
Reported by: Nescio
This was SVN commit r25060.
2021-03-15 18:53:35 +00:00
wraitii 9db72570c2 Disable wicker baskets on polar sea.
There is no fruit on the map, therefore much like wood techs, the fruit
tech is disabled.

Patch by: Nescio
Differential Revision: https://code.wildfiregames.com/D3595
This was SVN commit r25059.
2021-03-15 15:52:32 +00:00
wraitii 8e34371deb Streamline ship stats.
- Fishing boat build time from 20 to 15 (5 less than bireme/merchant).
- Quinquereme population from 3 to 5 (biremes have 2, triremes 3)
- Warships get a 2:1 wood to metal cost
- Loot is standardized to 20% of costs, XP to 10% of health, similar to
siege engines and structures.
- Fishing boath & Merchant ship have the same resistance as warships but
accordingly lower HP, for easier stat comparison.

Patch by: Nescio
Accepted By: borg-, wraitii
Differential Revision: https://code.wildfiregames.com/D2956
This was SVN commit r25058.
2021-03-15 15:45:20 +00:00
wraitii f05235ec09 Lower cavalry melee attack range again.
D3482/5701ffccf8 raised the melee attack range to 6 to compensate for
movement over a turn with 500ms MP turns.
Following D3275/d4c2cf4430, this is no longer necessary. Revert to 4
(half the footprint length + 1 & their capture range).

Patch by: Nescio
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D3673
This was SVN commit r25057.
2021-03-15 15:38:41 +00:00
wraitii c9f37fc613 Lint update: use arclint, remove JSHint, remove coala on CI.
This runs linting using the "arc lint" command of arcanist, which
notably gets run automatically as part of the arc diff workflow.

Changes:
- The major change is that arc lint reports, by default, only issues on
changed lines instead of changed files (--lintall changes that).
- JSHint is largely redundant with eslint and does not support some of
the new Javascript functionality that we are able to use in 0 A.D., such
as conditional chaining, thus it is removed (of course, users can still
run it manually).
- Eslint 7 is supported out of the box and updated to ES 2020
- cppcheck and eslint are optional - if the executable is not found
(e.g. in PATH), it will fallback to a 'dummy' PHP script that does
nothing. This has been tested on windows, mac and Debian (CI).
- The licence year linter now suggests replacement, and has been
rewritten as an arcanist linter.
- Add a JSON error linter.

The intention is to have non-intrusive external linting, and largely the
same text linting.

Coala has largely gone unmaintained in the past few years (more so than
arcanist anyways) and installing it on modern Python is convoluted.

Differential Revision: https://code.wildfiregames.com/D3639
This was SVN commit r25056.
2021-03-15 15:14:28 +00:00
wraitii ab53a351ba Fix siege_attack tech not affecting Maurya.
Patch by: borg-
Accepted By: Nescio, wraitii
Differential Revision: https://code.wildfiregames.com/D3655
This was SVN commit r25055.
2021-03-15 10:15:00 +00:00
Freagarach 7026d1a702 Fix typo in prop-point of Iberian blacksmith.
Patch by: @nwtour
Differential revision: D3667
Reviewed by: @Stan
This was SVN commit r25054.
2021-03-15 08:49:52 +00:00
Freagarach 6bd30fe150 Elephant_stables -> elephant_stable.
- Renames the elephant_stables.xml templates to elephant_stable.xml
(without plural s), as well as their generic template_*.xml parent,
consistent with e.g the stable.
- Corrects all occurrences in simulation and map files accordingly.
- Renames the stable and elephant stable audio files.
- Drops pers_ from the barrack.png and stable.png icons.

Patch by: @Nescio
Differential revision: D3343
This was SVN commit r25053.
2021-03-15 08:45:09 +00:00
Freagarach 8dc86d20bb Improve Army camp and Amun temple tooltips.
Mention they train ranked entities.

Patch by: @borg-
Differential revision: D3677
Reviewed by: @Nescio
This was SVN commit r25052.
2021-03-15 08:34:37 +00:00
Angen 2f5c99776e Fix 85f8d97859
This was SVN commit r25050.
2021-03-14 13:00:13 +00:00
Angen 85f8d97859 Add missing queueplanBuilding.js changes lost somewhere when updating D3654
This was SVN commit r25049.
2021-03-14 12:59:10 +00:00
Angen 6598433108 Call get without has in getEntityById
getEntityById calls .has before actually getting the entity by .get and
otherwise returns undefined.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get

The element associated with the specified key, or undefined if the key
can't be found in the Map object.

So calling has is redundant causing performance loss.

Differential revision: D3653
Reviewed by: @Freagarach
This was SVN commit r25048.
2021-03-14 12:45:08 +00:00
Angen 665f16d1bb Let Petra to build apartments
Teach her to build advanced houses available for cart players as they
provide more population.

Reviewed by: @Freagarach
Differential revision: D3654
This was SVN commit r25047.
2021-03-14 12:43:19 +00:00
vladislavbelov 56047ac9fa Adds logs to CameraController for speed changes of camera scroll, rotate and zoom.
Patch By: nwtour
Differential Revision: https://code.wildfiregames.com/D3604
This was SVN commit r25045.
2021-03-12 20:57:33 +00:00
Freagarach f1e1edad43 Move movement logic from UnitAIs "Garrisoned"-state to approaching.
Reduces switching of states, improves readability.

Refs. #6081
Differential revision: D2368
Comments by: @Stan, @wraitii
This was SVN commit r25044.
2021-03-12 19:53:52 +00:00
Freagarach 90831d5d88 Let PetraAI use the GarrisonHolder from cmpGarrisonable instead of UnitAI.
References 3851a48298.

Differential revision: D3645
Reviewed by: @Angen
This was SVN commit r25043.
2021-03-12 19:47:31 +00:00
vladislavbelov 4d58b0729e Moves CreateDateTimeInstance from the public L10n header to its implementation.
This was SVN commit r25042.
2021-03-12 09:11:22 +00:00
vladislavbelov d6ddc4f3ac Removes tinygettext from the L10n header.
Noticed By: nwtour
This was SVN commit r25041.
2021-03-12 08:51:50 +00:00
Freagarach 533e78b2e5 Clean up RemoveBatch -> RemoveItem code in ProductionQueue.
- Rename `RemoveBatch` to `RemoveItem`.
- Refactor that function. (Don't clear the cached entities when *any*
item is removed.)

Fixes the bug that the training is still blocked when a tech is the next
in the queue and the blocking item is removed.

Based on a patch by: @Polakrity
Differential revision: D1843
Comments by: @Angen, @bb
This was SVN commit r25040.
2021-03-12 08:45:39 +00:00
Freagarach cd705967ce Clean up timer code in production queue.
- Use an interval instead of requesting a timeout every timeout.
- Integrate the lateness-parameter.
- Some other cleanup.
- Don't create objects for null values in messages.
- Don't create this.timer on init.

Based on a patch by: @Polakrity
Differential revision: D1906
Comments by: @Angen, @Stan
This was SVN commit r25038.
2021-03-12 07:22:52 +00:00
Freagarach c4ab28cdbe Improve consistency in tutorial and random map texts.
- Combines multi-spaces into one.
- `\u000a` -> `\n`.
- Proper quotation marks instead of programmers quotes.
- A few typos.
- Capitalise classes.

Scenarios and skirmishes are excluded due to checkrefs.pl not being able
to handle proper quotes in XML.

Patch by: @Nescio
Differential revision: D3493
Comments by: @Stan
This was SVN commit r25037.
2021-03-12 06:52:26 +00:00
Freagarach d46d0032ca Clean attack lines in templates.
- Listing all damage types everywhere is not needed anymore, therefore
0-damage lines are purged.
- Trailing zeros are removed from <Attack> node lines (e.g. <MaxRange>,
<Spread>), per @bb.
- Attack nodes in templates that were effectively replaced by all their
children are deleted too.
- Clean up the confusing and haphazard attack situation in the fauna
templates.
- The now obsolete template_unit_fauna_wild_defensive_fox.xml is
deleted.
- All animals got an attack range that's at half their footprint length
+ 1 and an attack <PrepareTime> that's half their <RepeatTime>, for
consistency.

Patch by: @Nescio
Differential revision: D3342
This was SVN commit r25036.
2021-03-12 06:43:47 +00:00
Freagarach 96ab4a2de6 Fix ownership changing assertion with a garrison holder with multiple garrisoned entities.
In lieu of a better solution.

Reverts: 4b951cf4ba

This was SVN commit r25034.
2021-03-11 06:14:13 +00:00
Imarok 7376e43e06 Fix typos in log and warn messages
Patch by: LudovicRousseau
Refs: #6098

Differential Revision: https://code.wildfiregames.com/D3659
Differential Revision: https://code.wildfiregames.com/D3660
This was SVN commit r25033.
2021-03-10 16:50:15 +00:00
Freagarach 4b951cf4ba Handle ownership changes of a garrisoned entity in cmpGarrisonable.
Makes sure GarrisonHolders don't need to needlessly listen to global
ownership changes anymore.
Also fixes dying entities on turret points.

Refs. #6081
Differential revision: D3648
This was SVN commit r25031.
2021-03-08 07:26:09 +00:00
Freagarach d3c3072c83 Give the Garrisonable component the power to set garrisoned on an entity with UnitAI, instead of leaving it to UnitAI.
Since the only way of garrisoning is using `cmpGarrisonable`.
025a00340e introduced the `this.isGarrisoned`-flag, its meaning was
discussed in https://code.wildfiregames.com/D1403.

Refs. #5979, #6081
Differential revision: D2379
Comments by: @elexis, @Stan, @wraitii
This was SVN commit r25030.
2021-03-08 07:19:06 +00:00
Freagarach c310d4afcd Use seperate message to handle skirmish replacements.
Meaning GarrisonHolders won't listen for GlobalEntityRenamed messages
uselessly for the rest of the match after init.

Refs. #6081
Differential revision: D3627
This was SVN commit r25029.
2021-03-08 07:01:17 +00:00
wraitii 637e44cfd7 Hotkey search - lowercase comparison.
It is better to do case-insensitive search.
Improves on a4852c4c01, though the sensitivity is only an issue since
09ad8bfbe5

Tested by: nwtour
Reported by: nwtour
Differential Revision: https://code.wildfiregames.com/D3647
This was SVN commit r25027.
2021-03-07 15:29:19 +00:00
wraitii 839cd0ec12 Update the replay cache to consider modification time.
This makes the cache work consistently if replays are changed
externally.

Patch by: nwtour
Differential Revision: https://code.wildfiregames.com/D3615
This was SVN commit r25026.
2021-03-07 08:55:27 +00:00
Freagarach e24e48f32d Fix AutoGarrison UnitAI order.
Typo introduced in e18001e897.
Found by PetraAI.

Differential revision: D3643
Fixes #6089
Comment by: @wraitii
This was SVN commit r25025.
2021-03-07 06:54:28 +00:00
Freagarach b48cd5244f Fix PushOrderFront with construction.
POF introduced in afd1eaee0d.
Placing foundations takes another route, for which was warned in the
original ticket but not done nonetheless.
This fixes that route.

Differential revision: D3642
Comments by: @wraitii
Fixes #6090

This was SVN commit r25024.
2021-03-07 05:55:57 +00:00
wraitii 09ad8bfbe5 Customize hotkey categories & ordering, prepare for translation.
- adds JSON files to specify the human-readable categorization, name and
description of hotkeys.
- clean up code

Translation support via messages.json not yet added - the strings need
another pass and that avoids translators doing redundant work. See D3641

Refs #5867, Refs #5996

Differential Revision: https://code.wildfiregames.com/D3596
This was SVN commit r25023.
2021-03-06 18:11:41 +00:00
wraitii 3b3a297cca Fix checkrefs following D11 / 1c9efa6fb5
Fixes D11 / 1c9efa6fb5.

The problem is that some GUI pages were simply named "page.xml" which
the regex didn't like.

Accepted By: Nescio
Differential Revision: https://code.wildfiregames.com/D3644
This was SVN commit r25022.
2021-03-06 13:57:11 +00:00
Freagarach afd1eaee0d Allow players to push orders to the front of the queue.
Differential revision: D3605
This was SVN commit r25020.
2021-03-06 06:12:07 +00:00
Freagarach 979636cc57 Ungarrison entities using cmpGarrisonable.
Follow-up to e18001e897.
This moves responsibilities even further to the garrisoning entity.

Fixes the garrison flag when renaming entities cannot garrison (#5906).
Allows easy fixing of #6087.

Ticket: #6081
Differential revision: D3628
Comments by: @Stan, @wraitii (also in length on IRC)
This was SVN commit r25019.
2021-03-06 06:07:32 +00:00
vladislavbelov 76af18b23a Removes deprecated gl_*Matrix builtins from GLSL shaders.
Tested By: Freagarach, Stan
Differential Revision: https://code.wildfiregames.com/D3635
This was SVN commit r25018.
2021-03-05 22:32:32 +00:00
wraitii 373b8b6ff1 Fix 4b7b9325ac - idle units are frozen in walk anim.
Fixes 4b7b9325ac

Differential Revision: https://code.wildfiregames.com/D3640
This was SVN commit r25017.
2021-03-05 18:34:06 +00:00
wraitii 2be7479265 Fix quickloading/quicksaving following d4c2cf4430
Fixes d4c2cf4430.

Differential Revision: https://code.wildfiregames.com/D3636
This was SVN commit r25016.
2021-03-05 13:36:27 +00:00
wraitii 4718690f71 Make attacker data explicitly optional in status effects.
Reviewed By: Freagarach
Differential Revision: https://code.wildfiregames.com/D3633
This was SVN commit r25015.
2021-03-05 09:40:23 +00:00
Freagarach b4fd4ab655 Combine attacker data in "data"-object in attack-related code.
Allowing for easier introduction of new parameters.
Split from D781, (D368).

Differential revision: D2269
Comments by: @Angen, @Stan, @wraitii
Idea accepted by: @wraitii
This was SVN commit r25013.
2021-03-05 06:32:44 +00:00
wraitii 4b7b9325ac Fix a rare case of unit 'gliding' while moving.
Fixes a1dc9cadd8: if the speed doesn't change, UnitMotion doesn't update
the visual actor. Unfortunately, if another component has in the
meantime reset the animation to 'Idle', the unit will now move while
Idle. This can happen when leaving formation to do something else,
though it'srare.

This fixes that by instead always calling VisualActor, which does its
own checking to avoid redundancy. It's a bit less efficient, but not too
much.
Note that this relies on UnitMotion::UpdateMovementState being called
after any UnitAI code that could reset the animation to IDLE.

Differential Revision: https://code.wildfiregames.com/D3619
This was SVN commit r25011.
2021-03-04 18:32:48 +00:00
wraitii 007bf75264 Fix map previews/descriptions in the lobby game list.
Map previews are broken in the lobby game list, except for maps with
specific previews (such as biome RMs). Descriptions were broken in
general. The error lies in 1ae4f497e8, which forgot to add the xml
extension.

Differential Revision: https://code.wildfiregames.com/D3632
This was SVN commit r25010.
2021-03-04 18:31:33 +00:00
wraitii 765a40ac5c Fix compilation with --without-audio
Compilation --without-audio was broken since D3108 / 876f6d5e50

Patch by: nwtour
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D3631
This was SVN commit r25009.
2021-03-04 17:36:24 +00:00
vladislavbelov 40399011f7 Fixes revealed missed include after e104b41be2.
This was SVN commit r25008.
2021-03-04 08:55:49 +00:00
wraitii cfaddf51f9 Remove 'New' tag on Atlas Valleys
Missed in 68b81f63b1.

Reported by: langbart
This was SVN commit r25007.
2021-03-04 08:40:04 +00:00
vladislavbelov 8fe9e420ee Fixes removed include after 2e4639e6dc.
This was SVN commit r25005.
2021-03-03 23:07:50 +00:00
vladislavbelov 2e4639e6dc Removes unused containers included in headers.
This was SVN commit r25004.
2021-03-03 23:01:08 +00:00
vladislavbelov c29423c723 Fixes revealed missed includes after e104b41be2.
This was SVN commit r25003.
2021-03-03 22:38:59 +00:00
vladislavbelov e104b41be2 Cleanups includes for cassert and streams.
This was SVN commit r25002.
2021-03-03 22:26:49 +00:00
wraitii d4c2cf4430 Increase MP Command delay to 4 turns, decrease MP turns to 200ms.
To hide network latency, MP turns send commands not for the next turn
but N turns after that (introduced in c684c211a2).
Further, MP turn length was increased to 500ms compared to 200ms SP
turns (introduced in 6a15b78c98).
Unfortunately, increasing MP turn length has negative consequences:
- makes pathfinding/unit motion much worse & unit behaviour worse in
general.
- makes the game more 'lag-spikey', since computations are done less
often, but thus then can take more time.

This diff essentially reverts 6a15b78c98, instead increasing
COMMAND_DELAY from 2 to 4 in MP. This:
- Reduces the 'inherent command lag' in MP from 1000ms to 800ms
- Increases the lag range at which MP will run smoothtly from 500ms to
600ms
- makes SP and MP turns behave identically again, removing the
hindrances described above.

As a side effect, single-player was not actually using COMMAND_DELAY,
this is now done (can be used to simulate MP command lag).

Refs #3752

Differential Revision: https://code.wildfiregames.com/D3275
This was SVN commit r25001.
2021-03-03 21:02:57 +00:00
Freagarach 5e6b775d1a [Gameplay] - Search for resources near a current location before the init-pos.
This should bring the behaviour back to pre-A24 and means entities will
stray a lot less when gathering.
The entity will search close to the current position, which is mostly
next to a dropsite.
When there is nothing found there, the entity searches nigh the initPos.

Differential revision: D3607
Comments by: @wraitii
Tested by: @Nescio
This was SVN commit r25000.
2021-03-03 18:24:16 +00:00
Freagarach 97addf2aa7 Autocontinue after gathering a treasure.
Follow-up to ea96e81098.
Also adds the ability to gather near a position (e.g. when ungarrisoning
with a rally point set on a treasure that is gone).
Gathering treasures should now behave exactly the same as prior to the
split.

Differential revision: D3580
Comments by: @wraitii
This was SVN commit r24999.
2021-03-03 18:20:49 +00:00
s0600204 c879308ad6 Use pkgconfig to find libpng
Should hopefully resolve an issue raised on IRC by @spcman and @Xavi92

Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D3610
This was SVN commit r24998.
2021-03-03 16:11:41 +00:00
s0600204 2d9db5ade6 Bump miniupnpc version built on MacOS
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D3630
This was SVN commit r24997.
2021-03-03 16:06:43 +00:00
Stan 1c7f2661ce Add missing file in previous commit.
This was SVN commit r24996.
2021-03-03 15:18:44 +00:00
Stan c16d961cd2 Enable support for powerpc64 systems. New problems with NVTT will be addressed in another diff.
Patch by: @tpearson-raptor
Comments by: @q66
Refs:
https://github.com/void-linux/void-packages/blob/master/srcpkgs/0ad/patches/ppc64.patch

Differential Revision: https://code.wildfiregames.com/D1619
This was SVN commit r24995.
2021-03-03 15:13:47 +00:00
wraitii a4223c87f6 Fix NoPCH following cb346e207b
Broken in cb346e207b

Differential Revision: https://code.wildfiregames.com/D3629
This was SVN commit r24994.
2021-03-03 11:08:57 +00:00
Freagarach 298d459e45 Do not initialise null values in cmpGarrisonHolder.
Saves some serialisation data (refs #3834).

Ticket: #5979
Differential revision: https://code.wildfiregames.com/D3468
Comments by: @Angen, @Stan
This was SVN commit r24993.
2021-03-03 10:18:57 +00:00
Freagarach bf988bfde5 Add resources "component test".
To test more the interaction between components.

Differential revision: D3339
This was SVN commit r24992.
2021-03-03 08:57:06 +00:00
Freagarach bd1ec429a4 Let order use solely their message.
Improves consistency in UnitAI.

Differential revision: D3624
Approved by: @wraitii
This was SVN commit r24991.
2021-03-03 08:21:00 +00:00
Freagarach 17a7f691c0 Fix tests broken between latest rebase and commit of ea96e81098.
Reported by: CI.
This was SVN commit r24990.
2021-03-03 08:18:42 +00:00
Freagarach ea96e81098 Split treasures from ResourceSupply.
Removes some hardcoding and allows for easier modding of treasures.

Refs.: #5888
Differential revision: D3303
Comments by: @Imarok, @Nescio, @Stan, @wraitii
This was SVN commit r24989.
2021-03-03 07:47:38 +00:00
s0600204 0de47dd1ec Pass an install location to the fmt build on MacOS
Similar to what all the other sections do.


Differential Revision: https://code.wildfiregames.com/D2689
This was SVN commit r24987.
2021-03-02 23:40:48 +00:00
vladislavbelov 143fdf551f Moves glGetError under config to prevent a performance drop on some platforms.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D3620
This was SVN commit r24986.
2021-03-02 21:24:34 +00:00
vladislavbelov 7ea57932c4 Small style fixes for framebuffer clears.
This was SVN commit r24985.
2021-03-02 21:21:08 +00:00
vladislavbelov 94ba80d0cb Removes useless framebuffer clears by glClear.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D3622
This was SVN commit r24984.
2021-03-02 21:20:26 +00:00
wraitii cb346e207b Refactor all usage of RegisterFunction to ScriptFunction::Register
- Replace ScriptInterface::RegisterFunction with
ScriptFunction::Register
 - Mostly removing unused cmpPrivate*
 - Some usage introduces specific getters (mapgenerator, AIWorker,
XmppClient,...)
 - Several passthrough functions are simply removed in favour of calling
the original, reducing duplication
 - Make use of ScriptRequest/ScriptInterface capabilities where
relevant.
- Make JSI_* headers only expose necessary functions, lightening them
considerably and reducing duplication
 - Reuse namespaces in JSI_* implementations directly, reducing visual
noise there

Follows f3aedf88a6

Differential Revision: https://code.wildfiregames.com/D3626
This was SVN commit r24983.
2021-03-02 20:01:14 +00:00
wraitii 869076ebc5 Replace double division with multiplication/division
As noted by Vladislavbelov in d8ea401a95.
(Likely leads to identical assembly with optimisation & current values)

This was SVN commit r24982.
2021-03-02 18:27:06 +00:00
wraitii 2838873c0a Fixes & improvements to FunctionWrapper
- HandleValue needed to explicitly pass UndefinedHandleValue for
'default' arguments.
- Allow passing ScriptInterface as first argument.
- Statically check that a getter is provided for object methods instead
of crashing at runtime
- A few stylistic improvements

Differential Revision: https://code.wildfiregames.com/D3625
This was SVN commit r24981.
2021-03-02 16:55:22 +00:00
wraitii d8ea401a95 Decouple LOS resolution from terrain resolution
Introduce a LOS_TILE_SIZE, to replace usage of TERRITORY_TILE_SIZE in
the LOS code.
This makes it possible to change the resolution of LOS/Terrain without
affecting the other component.

Additional refactoring:
- LosTile has been renamed LosRegion (it's more comparable to the
hierarchical pathfinder regions/spatial subdivisions)
- LosState explicitly refers to "los vertices" instead of terrain
vertices.

Refs #5566

Differential Revision: https://code.wildfiregames.com/D3076
This was SVN commit r24980.
2021-03-02 16:44:40 +00:00
wraitii 1c9efa6fb5 Implement Single-Player campaigns - Barebones tutorial campaign included.
This implements necessary tooling to create a simple SP campaign.
The architecture is intended to be easily extensible in the future.

'Campaign Run' contains the metadata of a campaign, e.g. maps
played/won. It's saved in the user folder under
saves/campaigns/*.0adcampaign
Campaign templates are JSON files in campaigns/

Campaigns can specify which Menu interface they will use. This is
intended to allow more complex layouts/presentation.
For now, a simple list interface is provided. This allows making
campaigns without any fancy art required (and effectively mimics AoE1's
campaign interface).

The behaviour on game end is also intended to be extensible, supporting
things such as carrying over units between scenarios - for now, it
simply records won games.

GameSetup is not available for now - scenarios are triggered with the
settings defined in the map/default settings. Improving on this requires
refactoring the gamesetup further.

The load/save game page has been extended slightly to support
showing/hiding campaign games (campaign gamed are saved under saves/
directly, there is no strong motivation to do otherwise at this point)

Closes #4387

Differential Revision: https://code.wildfiregames.com/D11
This was SVN commit r24979.
2021-03-02 15:43:44 +00:00
wraitii b7ff2107ea Partial revert of d038b3c4f2 / REJECT_ORDER with FinishOrder()
Fixes d038b3c4f2, by partially reverting it.

If the new order is rejected, PushOrder() will call FinishOrder. If
there are no more orders on the queue, this calls SetNextState("idle"),
with the intention os switching the unit to IDLE. However, this only
works from within an FSM call, and thus does nothing if a new command
gets rejected.

The problem is that this.order/this.orderQueue is already replaced by
the point the order is rejected when called via ReplaceOrder. Ideally,
this would not happen (but doing so isn't trivial).

The current code avoids having 2 different ways to reject an order, thus
isn't a complete revert of d038b3c4f2. It triggers an IDLE re-entry that
wasn't there before if the unit is IDLE when it receives the rejected
order, which at the moment basically never happens.

Refs #5771 (reopened)

Reported by: gameboy
Comments by: Freagarach, Angen
Differential Revision: https://code.wildfiregames.com/D3618
This was SVN commit r24978.
2021-03-02 15:18:39 +00:00
Freagarach e18001e897 Let entities garrison using cmpGarrisonable.
Followup to f4c9305eee.
Moves the logic for garrisoning from cmpGarrisonHolder to the entity
that is being garrisoned.
Also fixes
https://wildfiregames.com/forum/topic/36863-teleportation-feature-in-a24/?do=findComment&comment=418441
while at it (setting garrisoned before transferring orders on
transform).

Differential revision: D3280
Refs: #5906
Comments by: @Stan, @wraitii
This was SVN commit r24977.
2021-03-02 15:06:16 +00:00
wraitii a64536b45f Fix MSVC unknown pragma warning
Follows f3aedf88a6.

Reported by: Stan
Reviewed By: Stan
Differential Revision: https://code.wildfiregames.com/D3623
This was SVN commit r24976.
2021-03-02 15:00:33 +00:00
wraitii 5e5ea5cba5 Fix replayprofile/ graphing tool for Profiler1
All modern browsers block ajax request to local file.
This changes extract.pl to generate a single HTML file with data
embedded.
This is now the default behaviour, --to-json to export, --from-json to
load exported.

Patch by: nwtour
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D3621
This was SVN commit r24975.
2021-03-02 08:35:39 +00:00
Freagarach 23aa59e3d4 Let domestic animals flee when attacked.
Since slaughter kills animals in one strike since 3d61c227f3, domestic
animals can now be set to flee when attacked by anything else than
slaughter, like area damage or stray missiles.

Original patch by: @elexis
Differential revision: D193
Comments by: @mimo, @wraitii
This was SVN commit r24973.
2021-03-02 06:18:56 +00:00
Freagarach f020a145f1 Fix Iberian starting walls on Skirmish maps.
Typo caused by b57abe806c, pointed out by @Sundiata in
https://wildfiregames.com/forum/topic/36706-why-alpha-24-is-not-nice/page/4/?tab=comments#comment-418337.

Patch by: @Nescio
Differential revision: D3616
This was SVN commit r24972.
2021-03-02 06:14:23 +00:00
Stan bcd292d6c9 Make forge smoke only visible when the forge is researching.
Add missing particle sparks.

Thread:
https://wildfiregames.com/forum/topic/27329-visual-feedback-for-researching

This was SVN commit r24971.
2021-03-02 00:01:00 +00:00
Stan ac72fb4486 Fix compilation of Atlas on UNICODE BUILDS
Patch by: @madpilot
Tested by: nwtour
Differential Revision: https://code.wildfiregames.com/D1593
This was SVN commit r24970.
2021-03-01 23:32:23 +00:00
wraitii f3aedf88a6 Introduce C++ templates replacements for DEFINE_INTERFACE_X and RegisterFunction macros
The new methods:
- aren't included in ScriptInterface.h directly, lightening that header
- don't use boost CPP
- don't need argument types or number or constness to be specified
- can work with object methods somewhat transparently
- support optional cmptPrivate (allowing removal of many UNUSED macro)
- support optional const ScriptRequest&, which is safer.

This first diff changes only some of the JSI files & the component
manager. Further diffs will update other files and finally delete the
current code.

Differential Revision: https://code.wildfiregames.com/D2818
This was SVN commit r24969.
2021-03-01 20:52:24 +00:00
vladislavbelov 9ed3b88d25 Guarantees no memset for allocation of DynamicArena::Block
Differential Revision: https://code.wildfiregames.com/D3609
This was SVN commit r24968.
2021-03-01 20:35:30 +00:00
wraitii 502b229655 Check for missing auras in GUI Interface
Improve the explicitedness of the following error.

Reviewed By: Freagarach
Differential Revision: https://code.wildfiregames.com/D3614
This was SVN commit r24967.
2021-03-01 17:54:46 +00:00
wraitii 6dc0ffd86f Add a 'debug' catalog & PEP8 the long string file
- Adds a function to generate a 'debug' catalog. This prepends 'X_X '
to strings, to make it obvious in-game which are translated and which
aren't, while still remaining usable.
 - cleans up the code and formats to PEP8 properly (except for line
lengths).

Differential Revision: https://code.wildfiregames.com/D3617
This was SVN commit r24966.
2021-03-01 16:37:33 +00:00
Freagarach d6e0a9963d Remove corral aura which was not supposed to be committed in c888844b3a.
Spotted by: @wraitii
This was SVN commit r24964.
2021-02-28 21:00:05 +00:00
Freagarach c888844b3a Decay/Regenerate option for resources.
Allows entities to change their resource amount over time, possibly with
some constraint.

This is a not-so-bare minimum, but can certainly be improved and/or
extended later.

Part of: #1973
Original patch by: @smiley
Redone by: @Stan
Standing on the shoulders of giants: @Freagarach
(Revisions: 59; Inlines: 209)
Differential revision: D1718
Comments by: @Angen, @elexis, @Imarok, @Langbart, @nani, @Nescio,
@smiley, @Stan, @wraitii

This was SVN commit r24963.
2021-02-28 20:14:53 +00:00
wraitii df18102e96 Add an 'Evaluate' RL endpoint, intended for dynamic game balancing
This adds a new endpoint to the RL interface for evaluating custom
JavaScript. When combined with the ability to create arbitrary
modifiers, this provides the required functionality for exploring
quantitative game balancing.

Patch By: irishninja
Fixes #5981

Differential Revision: https://code.wildfiregames.com/D3479
This was SVN commit r24962.
2021-02-28 12:16:32 +00:00
wraitii 2e2ef6f3fe Increase safety of UnitAI formation code
- PushOrderFront could lead to an infinite loop if walking fails.
- Move units in formation before issuing the move order (or the
formation may not exist).

Differential Revision: https://code.wildfiregames.com/D3411
This was SVN commit r24961.
2021-02-28 10:11:30 +00:00
Freagarach 0e6cf11d86 Resupport more garrisoned slots per entity.
Basically removed in 3521c8f51e, now brought back :) (But split from the
population space.)

Differential revision: D2056
Comments by: @Angen, @Nescio, @Stan, @wraitii
This was SVN commit r24960.
2021-02-28 10:02:03 +00:00
Freagarach 41a5650a62 Allow garrisoned entities to upgrade.
Since its introduction in b2f4b0f494 garrisoned entities were not
allowed to upgrade (b2f4b0f494#inline-4821) but that is not needed (at
least since 4fadd75ace).

Changing templates to anything not being able to garrison will still
fail (#5906) but that can also be done with this code.

Differential revision: D3251
Comment by: @bb
This was SVN commit r24958.
2021-02-28 06:47:36 +00:00
Freagarach f4c9305eee Move some functionality from GarrisonHolder to Garrisonable.
Take some responsibility from GarrisonHolder to where it belongs
(Garrisonable).

Differential revision: D3223
Comments by: @Stan, @wraitii
This was SVN commit r24957.
2021-02-28 06:37:05 +00:00
Freagarach d038b3c4f2 Properly discard orders.
Instead of manually calling FinishOrder(). Also, `{ "discardOrder": true
}` is changed to a const `false`.

Differential revision: D3283
Fixes: #5771
Comments by: @Angen, @Stan, @wraitii
This was SVN commit r24956.
2021-02-28 06:29:53 +00:00
Freagarach e5ee028313 Only cancel (un)packing when in the correct state.
Differential revision: D3285
This was SVN commit r24955.
2021-02-28 05:51:55 +00:00
Freagarach c33d1192bc Only stop moving when state requests that.
In our current UnitAI implementation, the states are responsible for
whether we are moving or not. If a request to stop moving is made from
outside the state that initiated the moving order that is (mostly)
wrong. This fixes that.

Differential revision: D3289
Comment by: @wraitii
This was SVN commit r24954.
2021-02-28 05:40:08 +00:00
Freagarach e7158ae6b1 Unify UnitAI and AnimalAI.
18b317bc19 (#563) introduced an ANIMAL-state from a separate
AnimalAI-component (introduced in e19146cf25).
This patch merges that separate state and brings the ROAMING and FEEDING
(renamed to LINGERING) under the INDIVIDUAL.IDLE-state.

This enables e.g. city-building mods to have human units that linger and
roam or animals that behave like humans.

The specific values for animals might need tweaking after this.

Differential revision: D2646
Fixes: #1832, #5593
Comments by: @Angen, @Langbart, @Nescio, @Stan, @wraitii
Refs.: #3919

This was SVN commit r24953.
2021-02-27 20:13:40 +00:00
wraitii 113fefeeb7 Netcode: Identify controller client via a secret key
The 'controller' of an MP game (the host in general, though dedicated
servers would change that) is currently whoever first tells the server
that it is. This can be abused since it relies on trusting the clients.

This changes that logic: the server defines a 'controller secret', and
the first client to sent the correct controller secret is the
controller. This is safe assuming the secret is unknowable enough (the
current solution wouldn't pass strict cryptography tests, but it's
likely good enough).

Reverts 1a3fb29ff3, which introduced the 'trust the clients' mechanic,
as a change over 'the first local IP is controller'.

Necessary step towards dedicated server, if we want to use the regular
gamesetup (Refs #3556)

Differential Revision: https://code.wildfiregames.com/D3075
This was SVN commit r24952.
2021-02-27 17:44:59 +00:00
vladislavbelov 32c3f4fb90 Early return in PreprocessorWrapper in case of failed include resolve.
This was SVN commit r24951.
2021-02-27 17:21:02 +00:00
Imarok 2ce0c2b988 Remove unneeded check in JSInterface_GameView.cpp
Differential Revision: https://code.wildfiregames.com/D3608
This was SVN commit r24950.
2021-02-27 16:52:51 +00:00
wraitii bdda96a2e7 Prevent using privileged ports on *nix from the GUI
Ports 1-1023 are privileged and shouldn't be accepted by the GUI.

Patch by: DynamoFox
Differential Revision: https://code.wildfiregames.com/D3574
This was SVN commit r24949.
2021-02-27 16:40:42 +00:00
wraitii 20b1d98a84 Fix compilation following 52fcee9c91
52fcee9c91 broke compilation because spawnedRadius is not an integer.

This was SVN commit r24948.
2021-02-27 11:12:21 +00:00
wraitii e839fc29c7 Fix i18n for common map trigger scripts.
Patch by: nwtour
Differential Revision: https://code.wildfiregames.com/D3570
This was SVN commit r24947.
2021-02-27 10:34:11 +00:00
wraitii c3f74494b4 Fix GUI hotkey/map/reference strings not being translated.
Fixes ae9ea5b859, a4852c4c01, bbd808349f

Differential Revision: https://code.wildfiregames.com/D3535
This was SVN commit r24946.
2021-02-27 10:27:26 +00:00
wraitii 52fcee9c91 Fix division by 0 error in PickSpawnPoint
The spawn code should not assume that obstructions will never be
0-sized.

Reported by: Zack
Fixes #6039

Differential Revision: https://code.wildfiregames.com/D3583
This was SVN commit r24945.
2021-02-27 10:21:04 +00:00
wraitii c6f50b253f Fix *nix tarballs to extract in a subfolder.
Also incorporate retry improvements by Stan

Reported by: madPilot
Differential Revision: https://code.wildfiregames.com/D3585
This was SVN commit r24944.
2021-02-27 10:19:31 +00:00
wraitii 0363ff112e Fix water wind speed computation
Fixes 2a485c5e3b

(the calculation resulted in mismatched wind speed & wave orientation)

Differential Revision: https://code.wildfiregames.com/D3551
This was SVN commit r24943.
2021-02-27 10:08:00 +00:00
wraitii f902b23255 Add Bellaz89 to the programming credits
For contributions to d07f271d60 notably.

Differential Revision: https://code.wildfiregames.com/D3591
This was SVN commit r24942.
2021-02-27 09:33:26 +00:00
Imarok 4eadb3eb9d The SetCameraTarget script function should not change the orientation
Reviewed by: Freagarach
Differential Revision: https://code.wildfiregames.com/D3569
This was SVN commit r24940.
2021-02-27 09:01:20 +00:00
Stan 68b81f63b1 Bump version to alpha 25.
Last alpha 24 commit was [[SVN:24937]]. [[SVN:24938]] was because the CI
wasn't turned off.

Comments by: @wraitii, @Freagarach, @Nescio,
Differential Revision: https://code.wildfiregames.com/D3571
This was SVN commit r24939.
2021-02-27 08:48:30 +00:00
3072 changed files with 54322 additions and 35805 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
{
"phabricator.uri" : "https://code.wildfiregames.com/",
"repository.callsign" : "P"
"repository.callsign" : "P",
"load": ["build/arclint/pyrolint"]
}
+20
View File
@@ -3,6 +3,7 @@
"(^binaries/system/)",
"(^build/premake/premake5/)",
"(^source/third_party/)",
"(test_[^.]+.cpp$)",
"(^libraries/)"
],
"linters": {
@@ -14,6 +15,25 @@
"3": "disabled",
"5": "disabled"
}
},
"licence-year": {
"type": "licence-year"
},
"json": {
"type": "json",
"include": "/\\.json$/"
},
"eslint": {
"type": "eslint",
"bin": ["eslint", "build\\arclint\\dummies\\eslint.bat", "build/arclint/dummies/eslint.php"],
"include": "/\\.js$/",
"config": "build/arclint/configs/eslintrc.json"
},
"cppcheck": {
"type": "cppcheck",
"bin": ["cppcheck", "build\\arclint\\dummies\\cppcheck.bat", "build/arclint/dummies/cppcheck.php"],
"include": "/\\.(h|cpp)$/",
"flags": ["--max-configs=40", "--language=c++", "--std=c++17", "-Isource/", "--suppress=unknownMacro"]
}
}
}
-11
View File
@@ -1,11 +0,0 @@
[Source]
bears = CPPCheckBear, LicenseYearBear
language = c++
files = source/**.(cpp|h)
ignore = source/third_party
[JS]
bears = ESLintBear, JSHintBear
eslint_config = build/coala/lint-config/eslintrc.json
jshint_config = build/coala/lint-config/jshintrc.json
files = binaries/data/**.js
+6
View File
@@ -42,6 +42,12 @@ in particular, let us know and we can try to clarify it.
/build
Various (unspecified)
/build/arclint
GPL version 2 (or later) - see license_gpl-2.0.txt
/build/arclint/pyrolint
Apache version 2 - see license_apache2.txt within that directory
/build/premake/premake5
BSD
+43 -17
View File
@@ -53,6 +53,9 @@ bpp = 0
; Preferred display (for multidisplay setups, only works with SDL 2.0)
display = 0
; Enable Hi-DPI where supported, currently working only for testing.
hidpi = false
; Allows to force GL version for SDL
forceglversion = false
forceglprofile = "compatibility" ; Possible values: compatibility, core, es
@@ -79,19 +82,28 @@ waterrefraction = true
waterreflection = true
shadows = true
shadowquality = 0 ; Shadow map resolution. (-2 - Very Low, -1 - Low, 0 - Medium, 1 - High, 2 - Very High)
shadowquality = 0 ; Shadow map resolution. (-1 - Low, 0 - Medium, 1 - High, 2 - Very High)
; High values can crash the game when using a graphics card with low memory!
shadowpcf = true
shadowsfixed = false ; When enabled shadows are rendered only on the
shadowsfixeddistance = 300.0 ; fixed distance and without swimming effect.
; Increases details closer to the camera but decreases performance
; especially on low hardware.
shadowscascadecount = 1
shadowscascadedistanceratio = 1.7
; Hides shadows after the distance.
shadowscutoffdistance = 300.0
; If true shadows cover the whole map instead of the camera frustum.
shadowscovermap = false
texturequality = 5 ; Texture resolution and quality (0 - Lowest, 1 Very Low, 2 - Low, 3 - Medium, 4 - High, 5 - Very High, 6 - Ultra)
vsync = false
particles = true
fog = true
silhouettes = true
showsky = true
novbo = false
; Uses a synchonized call to a GL driver to get an error state. Useful
; for a debugging of a system without GL_KHR_debug.
gl.checkerrorafterswap = false
; Disable hardware cursors
nohwcursor = false
@@ -124,6 +136,12 @@ antialiasing = "disabled"
sharpening = "disabled"
sharpness = 0.3
; Quality used for actors.
max_actor_quality=200
; Whether or not actor variants are selected randomly, possible values are "full", "limited", "none".
variant_diversity = "full"
; Quality level of shader effects (set to 10 to display all effects)
materialmgr.quality = 2.0
@@ -156,7 +174,7 @@ server.threads = "6" ; Enough for the browser's parallel co
; See keys.txt for the list of key names.
; > SYSTEM SETTINGS
exit = "Ctrl+Break", "Super+Q", "Alt+F4" ; Exit to desktop
exit = "" ; 'Custom' exit to desktop, SDL handles the native command via SDL_Quit.
cancel = Escape ; Close or cancel the current dialog box/popup
confirm = Return ; Confirm the current command
pause = Pause, "Shift+Space" ; Pause/unpause game
@@ -200,6 +218,7 @@ quickload = "Shift+F8"
reset = "R" ; Reset camera rotation to default.
follow = "F" ; Follow the first unit in the selection
rallypointfocus = "" ; Focus the camera on the rally point of the selected building
lastattackfocus = "Space" ; Focus the camera on the last notified attack
zoom.in = Plus, NumPlus ; Zoom camera in (continuous control)
zoom.out = Minus, NumMinus ; Zoom camera out (continuous control)
zoom.wheel.in = WheelUp ; Zoom camera in (stepped control)
@@ -259,6 +278,7 @@ nonmilitaryonly = "Alt+Y" ; Add only non-military units to the sel
idleonly = "I" ; Select only idle units
woundedonly = "O" ; Select only wounded units
remove = Ctrl ; Remove units from selection
idlebuilder = Semicolon ; Select next idle builder
idleworker = Period, NumDecimal ; Select next idle worker
idlewarrior = Slash, NumDivide ; Select next idle warrior
idleunit = BackSlash ; Select next idle unit
@@ -305,16 +325,20 @@ kill = Delete, Backspace ; Destroy selected units
stop = "H" ; Stop the current action
backtowork = "Y" ; The unit will go back to work
unload = "U" ; Unload garrisoned units when a building/mechanical unit is selected
unloadturrets = "U" ; Unload turreted units.
leaveturret = "U" ; Leave turret point.
move = "" ; Modifier to move to a point instead of another action (e.g. gather)
attack = Ctrl ; Modifier to attack instead of another action (e.g. capture)
attackmove = Ctrl ; Modifier to attackmove when clicking on a point
attackmoveUnit = "Ctrl+Q" ; Modifier to attackmove targeting only units when clicking on a point
garrison = Ctrl ; Modifier to garrison when clicking on building
occupyturret = Ctrl ; Modifier to occupy a turret when clicking on a turret holder.
autorallypoint = Ctrl ; Modifier to set the rally point on the building itself
guard = "G" ; Modifier to escort/guard when clicking on unit/building
patrol = "P" ; Modifier to patrol a unit
repair = "J" ; Modifier to repair when clicking on building/mechanical unit
queue = Shift ; Modifier to queue unit orders instead of replacing
pushorderfront = "" ; Modifier to push unit orders to the front instead of replacing.
orderone = Alt ; Modifier to order only one entity in selection.
batchtrain = Shift ; Modifier to train units in batches
massbarter = Shift ; Modifier to barter bunch of resources
@@ -327,6 +351,8 @@ rotate.cw = RightBracket ; Rotate building placement preview clockwise
rotate.ccw = LeftBracket ; Rotate building placement preview anticlockwise
snaptoedges = Ctrl ; Modifier to align new structures with nearby existing structure
toggledefaultformation = "" ; Switch between null default formation and the last default formation used (defaults to "box")
flare = K ; Modifier to send a flare to your allies
flareactivate = "" ; Modifier to activate the mode to send a flare to your allies
; Overlays
showstatusbars = Tab ; Toggle display of status bars
devcommands.toggle = "Alt+D" ; Toggle developer commands panel
@@ -360,7 +386,7 @@ noconfirmation = Shift ; Do not ask confirmation when deleting a game
8 = Comma ; add eighth unit type to queue
[hotkey.session.timewarp]
fastforward = Space ; If timewarp mode enabled, speed up the game
fastforward = "Ctrl+Space" ; If timewarp mode enabled, speed up the game
rewind = "Shift+Backspace" ; If timewarp mode enabled, go back to earlier point in the game
[hotkey.tab]
@@ -393,6 +419,7 @@ timeelapsedcounter = false ; Show the game duration in the top right corn
ceasefirecounter = false ; Show the remaining ceasefire time in the top right corner
batchtrainingsize = 5 ; Number of units to be trained per batch by default (when pressing the hotkey)
scrollbatchratio = 1 ; Number of times you have to scroll to increase/decrease the batchsize by 1
flarelifetime = 6 ; How long the flare markers on the minimap are displayed in seconds
woundedunithotkeythreshold = 33 ; The wounded unit hotkey considers the selected units as wounded if their health percentage falls below this number
attackrange = true ; Display attack range overlays of selected defensive structures
aurasrange = true ; Display aura range overlays of selected units and structures
@@ -405,6 +432,7 @@ snaptoedgesdistancethreshold = 15 ; On which distance we don't snap to edges
disjointcontrolgroups = "true" ; Whether control groups are disjoint sets or entities can be in multiple control groups at the same time.
defaultformation = "special/formations/box" ; For walking orders, automatically put units into this formation if they don't have one already.
formationwalkonly = "true" ; Formations are disabled when giving gather/attack/... orders.
howtoshownames = 0 ; Whether the specific names are show as default, as opposed to the generic names. And whether the secondary names are shown. (0 - show both; specific names primary, 1 - show both; generic names primary, 2 - show only specific names, 3 - show only generic names)
[gui.session.minimap]
blinkduration = 1.7 ; The blink duration while pinging
@@ -429,13 +457,6 @@ enemy = "150 20 20" ; Color of enemies when diplomacy colors are e
[joystick] ; EXPERIMENTAL: joystick/gamepad settings
enable = false
deadzone = 8192
[joystick.camera]
pan.x = 0
pan.y = 1
rotate.x = 3
rotate.y = 2
zoom.in = 5
zoom.out = 4
[chat]
timestamp = true ; Show at which time chat messages have been sent
@@ -445,7 +466,7 @@ extended = true ; Whether to display the chat history
[lobby]
history = 0 ; Number of past messages to display on join
room = "arena24" ; Default MUC room to join
room = "arena25" ; Default MUC room to join
server = "lobby.wildfiregames.com" ; Address of lobby server
tls = true ; Whether to use TLS encryption when connecting to the server.
verify_certificate = false ; Whether to reject connecting to the lobby if the TLS certificate is invalid (TODO: wait for Gloox GnuTLS trust implementation to be fixed)
@@ -453,8 +474,8 @@ terms_url = "https://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/
terms_of_service = "0" ; Version (hash) of the Terms of Service that the user has accepted
terms_of_use = "0" ; Version (hash) of the Terms of Use that the user has accepted
privacy_policy = "0" ; Version (hash) of the Privacy Policy that the user has accepted
xpartamupp = "wfgbot24" ; Name of the server-side XMPP-account that manage games
echelon = "echelon24" ; Name of the server-side XMPP-account that manages ratings
xpartamupp = "wfgbot25" ; Name of the server-side XMPP-account that manage games
echelon = "echelon25" ; Name of the server-side XMPP-account that manages ratings
buddies = "," ; Comma separated list of playernames that the current user has marked as buddies
rememberpassword = true ; Whether to store the encrypted password in the user config
@@ -473,7 +494,7 @@ delay = 200 ; Duration in milliseconds that is waited b
enabledmods = "mod public"
[modio]
public_key = "RWRcbM/EwV7bucTiQVCcRBhCkYkXmJEO7s4ktyufkB+gW/NxHhOZ38xh" ; Public key corresponding to the private key valid mods are signed with
public_key = "RWTVElEmCfAMGk/jtMc2I9/ElBvoJituKdbDWqqj6D69qz2cKexU4gv+" ; Public key corresponding to the private key valid mods are signed with
disclaimer = "0" ; Version (hash) of the Disclaimer that the user has accepted
[modio.v1]
@@ -485,6 +506,8 @@ name_id = "0ad"
duplicateplayernames = false ; Rename joining player to "User (2)" if "User" is already connected, otherwise prohibit join.
lateobservers = everyone ; Allow observers to join the game after it started. Possible values: everyone, buddies, disabled.
observerlimit = 8 ; Prevent further observer joins in running games if this limit is reached
observermaxlag = 10 ; Make clients wait for observers if they lag more than X turns behind. -1 means "never wait for observers".
autocatchup = true ; Auto-accelerate the sim rate if lagging behind (as an observer).
[overlay]
fps = "false" ; Show frames per second in top right corner
@@ -506,6 +529,9 @@ musicgain = 0.2
ambientgain = 0.6
actiongain = 0.7
uigain = 0.7
mindistance = 1
maxdistance = 350
maxstereoangle = 0.62 ; About PI/5 radians
[sound.notify]
nick = true ; Play a sound when someone mentions your name in the lobby or game
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<page>
<include>common/styles.xml</include>
</page>
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<page>
<include>common/styles.xml</include>
<include>regainFocus/pushWithPopOnInit.xml</include>
</page>
@@ -0,0 +1 @@
Engine.PushGuiPage("regainFocus/page_emptyPage.xml", {}, () => Engine.PopGuiPage());
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<objects>
<script file="gui/regainFocus/pushWithPopOnInit.js"/>
</objects>
@@ -1,19 +0,0 @@
namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
##
# NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file
# and use a converter tool like trang to generate the Relax NG XML (.rng) file
##
element Textures {
element File {
attribute pattern { text }? &
attribute format { "dxt1" | "dxt3" | "dxt5" | "rgba" | "alpha" }? &
attribute mipmap { "true" | "false" }? &
attribute normal { "true" | "false" }? &
attribute alpha { "none" | "player" | "transparency" }? &
attribute filter { "box" | "triangle" | "kaiser" }? &
attribute kaiserwidth { xsd:float }? &
attribute kaiseralpha { xsd:float }? &
attribute kaiserstretch { xsd:float }?
}*
}
@@ -1,11 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<element name="Textures" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<a:documentation/>
<!--
NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file
and use a converter tool like trang to generate the Relax NG XML (.rng) file
-->
<a:documentation/>
<zeroOrMore>
<element name="File">
<interleave>
@@ -1,36 +0,0 @@
namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
##
# NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file
# and use a converter tool like trang to generate the Relax NG XML (.rng) file
##
##
# Types #
##
flag = "0" | "1"
start = SoundGroup
SoundGroup = element SoundGroup {
element Gain { xsd:float }? &
element Looping { flag }? &
element Omnipresent { flag }? &
element HeardBy { "owner" }? &
element Distanceless { flag }? &
element Pitch { xsd:float }? &
element Priority { xsd:float }? &
element RandOrder { flag }? &
element RandGain { flag }? &
element GainUpper { xsd:float }? &
element GainLower { xsd:float }? &
element RandPitch { flag }? &
element PitchUpper { xsd:float }? &
element PitchLower { xsd:float }? &
element ConeGain { xsd:float }? &
element ConeInner { xsd:float }? &
element ConeOuter { xsd:float }? &
element Threshold { xsd:float }? &
element Decay { xsd:float }? &
element Sound { text }+ &
element Path { text }
}
@@ -1,15 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<define name="flag">
<a:documentation/>
<!--
NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file
and use a converter tool like trang to generate the Relax NG XML (.rng) file
-->
<a:documentation/>
<a:documentation/>
<!-- Types # -->
<a:documentation/>
<choice>
<value>0</value>
<value>1</value>
+22 -11
View File
@@ -1,12 +1,26 @@
/**
* Check the mod compatibility between the saved game to be loaded and the engine
* Check the mod compatibility between the saved game to be loaded and the engine.
* This is a wrapper around an engine function to allow mods to to fancier or specific things.
*/
function hasSameMods(modsA, modsB)
{
if (!modsA || !modsB || modsA.length != modsB.length)
if (!modsA || !modsB)
return false;
// Mods must be loaded in the same order. 0: modname, 1: modversion
return modsA.every((mod, index) => [0, 1].every(i => mod[i] == modsB[index][i]));
return Engine.AreModsPlayCompatible(modsA, modsB);
}
/**
* Print the shorthand identifier of a mod.
*/
function modToString(mod)
{
// Skip version for play-compatible mods.
if (mod.ignoreInCompatibilityChecks)
return mod.name;
return sprintf(translateWithContext("Mod comparison", "%(mod)s (%(version)s)"), {
"mod": mod.name,
"version": mod.version
});
}
/**
@@ -14,10 +28,7 @@ function hasSameMods(modsA, modsB)
*/
function modsToString(mods)
{
return mods.map(mod => sprintf(translateWithContext("Mod comparison", "%(mod)s (%(version)s)"), {
"mod": mod[0],
"version": mod[1]
})).join(translate(", "));
return mods.map(mod => modToString(mod)).join(translate(", "));
}
/**
@@ -26,7 +37,7 @@ function modsToString(mods)
function comparedModsString(required, active)
{
return sprintf(translateWithContext("Mod comparison", "Required: %(mods)s"),
{ "mods": modsToString(required) }) + "\n" +
sprintf(translateWithContext("Mod comparison", "Active: %(mods)s"),
{ "mods": modsToString(active) });
{ "mods": modsToString(required) }
) + "\n" + sprintf(translateWithContext("Mod comparison", "Active: %(mods)s"),
{ "mods": modsToString(active) });
}
@@ -9,9 +9,11 @@
<sprite name = "ModernScrollBack">
<image backcolor="43 42 40"
size="0 0 100% 100%"
border="true"
bordercolor="0 0 0"
/>
<image backcolor="0 0 0" size="0 0 100% 1"/>
<image backcolor="0 0 0" size="0 100%-1 100% 100%"/>
<image backcolor="0 0 0" size="0 0 1 100%"/>
<image backcolor="0 0 0" size="100%-1 0 100% 100%"/>
<image texture = "global/modern/scrollback.png"
real_texture_placement = "0 0 15 128"
size = "0 0 100% 100%"
@@ -147,6 +149,18 @@
- Box -
==========================================
-->
<sprite name = "ModernDarkBox">
<image backcolor = "12 12 12 100"
size = "0 0 100% 100%-1"
/>
</sprite>
<sprite name="ModernDarkBoxDisabled">
<effect grayscale=""/>
<!-- background -->
<image backcolor = "12 12 12 100"
size = "0 1 100% 100%-1"
/>
</sprite>
<sprite name="ModernDarkBoxGold">
<!-- borders -->
<image texture = "global/modern/gold-separator.png"
@@ -162,6 +176,17 @@
size = "0 1 100% 100%-1"
/>
</sprite>
<sprite name="ModernDarkBoxGoldBorder">
<!-- borders -->
<image texture = "global/modern/gold-separator.png"
real_texture_placement = "0 0 806 1"
size = "0 0 100% 1"
/>
<image texture = "global/modern/gold-separator.png"
real_texture_placement = "0 0 806 1"
size = "0 100%-1 100% 100%"
/>
</sprite>
<sprite name="ModernDarkBoxGoldDisabled">
<effect grayscale=""/>
<!-- borders -->
@@ -178,6 +203,18 @@
size = "0 1 100% 100%-1"
/>
</sprite>
<sprite name="ModernDarkBoxGoldBorderDisabled">
<effect grayscale=""/>
<!-- borders -->
<image texture = "global/modern/gold-separator.png"
real_texture_placement = "0 0 806 1"
size = "0 0 100% 1"
/>
<image texture = "global/modern/gold-separator.png"
real_texture_placement = "0 0 806 1"
size = "0 100%-1 100% 100%"
/>
</sprite>
<sprite name="ModernDarkBoxWhite">
<!-- borders -->
<image texture = "global/modern/white-separator.png"
@@ -193,6 +230,17 @@
size = "0 1 100% 100%-1"
/>
</sprite>
<sprite name="ModernDarkBoxWhiteBorder">
<!-- borders -->
<image texture = "global/modern/white-separator.png"
real_texture_placement = "0 0 806 1"
size = "0 0 100% 1"
/>
<image texture = "global/modern/white-separator.png"
real_texture_placement = "0 0 806 1"
size = "0 100%-1 100% 100%"
/>
</sprite>
<sprite name="ModernDarkBoxWhiteInvalid">
<!-- borders -->
<image texture = "global/modern/white-separator.png"
@@ -217,14 +265,11 @@
size = "0 1 100% 100%"
/>
</sprite>
<sprite name = "ModernDarkBoxGoldNoTop">
<sprite name="ModernDarkBoxBottomGold">
<image texture = "global/modern/gold-separator.png"
real_texture_placement = "0 0 806 1"
size = "0 100%-1 100% 100%"
/>
<image backcolor = "12 12 12 100"
size = "0 0 100% 100%-1"
/>
</sprite>
<!--
==========================================
@@ -513,9 +558,22 @@
<sprite name="BlackBorderOnGray">
<image backcolor="darkgray"
size="0 0 100% 100%"
border="true"
bordercolor="black"
/>
<image backcolor="0 0 0" size="0 0 100% 1"/>
<image backcolor="0 0 0" size="0 100%-1 100% 100%"/>
<image backcolor="0 0 0" size="0 0 1 100%"/>
<image backcolor="0 0 0" size="100%-1 0 100% 100%"/>
</sprite>
<sprite name="GrayBackground">
<image backcolor="darkgray"
size="0 0 100% 100%"
/>
</sprite>
<sprite name="BlackBorder">
<image backcolor="0 0 0" size="0 0 100% 1"/>
<image backcolor="0 0 0" size="0 100%-1 100% 100%"/>
<image backcolor="0 0 0" size="0 0 1 100%"/>
<image backcolor="0 0 0" size="100%-1 0 100% 100%"/>
</sprite>
<!--
==========================================
@@ -28,9 +28,10 @@
font="sans-bold-stroke-14"
scrollbar="true"
scrollbar_style="ModernScrollBar"
sprite="ModernDarkBoxGoldNoTop"
sprite_selectarea="ModernDarkBoxWhite"
sprite_heading="ModernDarkBoxGoldNoBottom"
sprite="ModernDarkBox"
sprite_overlay="ModernDarkBoxBottomGold"
sprite_selectarea="ModernDarkBox"
sprite_selectarea_overlay="ModernDarkBoxWhiteBorder"
textcolor="white"
textcolor_selected="white"
text_align="left"
@@ -41,8 +42,10 @@
font="sans-bold-stroke-14"
scrollbar="true"
scrollbar_style="ModernScrollBar"
sprite="ModernDarkBoxGoldNoTop"
sprite_selectarea="ModernDarkBoxWhite"
sprite="ModernDarkBox"
sprite_overlay="ModernDarkBoxBottomGold"
sprite_selectarea="ModernDarkBox"
sprite_selectarea_overlay="ModernDarkBoxWhiteBorder"
sprite_heading="ModernDarkBoxGoldNoBottom"
sprite_asc="ModernArrowUp"
sprite_desc="ModernArrowDown"
@@ -59,16 +62,20 @@
text_align="left"
text_valign="center"
button_width="16"
sprite="ModernDarkBoxGold"
sprite_disabled="ModernDarkBoxGoldDisabled"
sprite="ModernDarkBox"
sprite_disabled="ModernDarkBoxDisabled"
sprite_overlay="ModernDarkBoxGoldBorder"
sprite_overlay_disabled="ModernDarkBoxGoldBorderDisabled"
sprite2="ModernDropDownArrow"
sprite2_disabled="ModernDropDownArrowDisabled"
sprite2_pressed="ModernDropDownArrowHighlight"
buffer_zone="8"
dropdown_size="225"
minimum_visible_items="3"
sprite_list="BlackBorderOnGray"
sprite_selectarea="ModernDarkBoxWhite"
sprite_list="GrayBackground"
sprite_list_overlay="BlackBorder"
sprite_selectarea="ModernDarkBox"
sprite_selectarea_overlay="ModernDarkBoxWhiteBorder"
textcolor_selected="white"
textcolor_disabled="140 140 140 255"
scrollbar="true"
@@ -125,10 +132,12 @@
textcolor="white"
text_align="left"
text_valign="center"
sprite="ModernDarkBoxGold"
sprite="ModernDarkBox"
sprite_overlay="ModernDarkBoxGoldBorder"
/>
<style name="ModernInput"
sprite="ModernDarkBoxWhite"
sprite="ModernDarkBox"
sprite_overlay="ModernDarkBoxWhiteBorder"
sprite_selectarea="color:150 0 0"
textcolor="white"
textcolor_selected="white"
-291
View File
@@ -1,291 +0,0 @@
namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
##
# NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file
# and use a converter tool like trang to generate the Relax NG XML (.rng) file
##
start = object | objects | setup | sprites | styles
##
# Types #
##
# xsd:boolean could be used instead of this definition,
# though it considers "1" & "0" as valid values.
bool = "true" | "false"
align = "left" | "center" | "right"
valign = "top" | "center" | "bottom"
wrapmode = "repeat" | "mirrored_repeat" | "clamp_to_edge"
coord = xsd:string { pattern = "-?\d*\.?\d+%?([\+\-]\d*\.?\d+%?)*" }
clientarea = list { coord, coord, coord, coord }
# color can be a name or "R G B A" format string
rgba = list { xsd:integer { minInclusive = "0" maxInclusive = "255" },
xsd:integer { minInclusive = "0" maxInclusive = "255" },
xsd:integer { minInclusive = "0" maxInclusive = "255" },
xsd:integer { minInclusive = "0" maxInclusive = "255" }?}
ccolor = rgba | xsd:string { pattern = "[A-Za-z]+" }
size = list { xsd:decimal, xsd:decimal }
pos = list { xsd:decimal, xsd:decimal }
rect = list { xsd:decimal, xsd:decimal, xsd:decimal, xsd:decimal }
##
# Defines #
##
unique_settings =
attribute name { text }?,
[ a:defaultValue = "empty" ] attribute type { text }?,
attribute style { text }?
# This could probably be made more specific/strict
# with more information regarding the use/meaning
# of these attributes.
base_settings =
attribute absolute { bool }?&
attribute enable { bool }?&
attribute ghost { bool }?&
attribute hidden { bool }?&
attribute size { clientarea }?&
attribute z { xsd:decimal }?
# Defaults are not put in here, because it ruins the concept of styles.
ex_settings =
attribute anchor { valign }?&
attribute auto_scroll { bool }?&
attribute buffer_zone { xsd:decimal }?&
attribute buffer_width { xsd:decimal }?&
attribute button_width { xsd:decimal }?&
attribute checked { bool }?&
attribute clip { bool }?&
attribute dropdown_size { xsd:decimal }?&
attribute dropdown_buffer { xsd:decimal }?&
attribute minimum_visible_items { xsd:nonNegativeInteger }?&
attribute enabled { bool }?&
attribute font { text }?&
attribute format_x { text }?&
attribute format_y { text }?&
attribute fov_wedge_color { ccolor }?&
attribute hotkey { text }?&
attribute cell_id { xsd:integer }?&
attribute independent { bool }?&
attribute input_initvalue_destroyed_at_focus { bool }?&
attribute mask { bool }?&
attribute mask_char { xsd:string { minLength = "1" maxLength = "1" } }?&
attribute max_length { xsd:nonNegativeInteger }?&
attribute maxwidth { xsd:decimal }? &
attribute multiline { bool }?&
attribute offset { pos }?&
attribute placeholder_text { text }?&
attribute placeholder_color { ccolor }?&
attribute readonly { bool }?&
attribute scrollbar { bool }?&
attribute scrollbar_style { text }?&
attribute scroll_bottom { bool }?&
attribute scroll_top { bool }?&
attribute selected_column { text }?&
attribute selected_column_order { text }?&
attribute sortable { bool }?&
attribute sound_closed { text }?&
attribute sound_disabled { text }?&
attribute sound_enter { text }?&
attribute sound_leave { text }?&
attribute sound_opened { text }?&
attribute sound_pressed { text }?&
attribute sound_selected { text }?&
attribute sprite { text }?&
attribute sprite2 { text }?&
attribute sprite_asc { text }?&
attribute sprite_heading { text }?&
attribute sprite_bar { text }?&
attribute sprite_background { text }?&
attribute sprite_desc { text }?&
attribute sprite_disabled { text }?&
attribute sprite_list { text }?&
attribute sprite2_disabled { text }?&
attribute sprite_not_sorted { text }?&
attribute sprite_over { text }?&
attribute sprite2_over { text }?&
attribute sprite_pressed { text }?&
attribute sprite2_pressed { text }?&
attribute sprite_selectarea { text }?&
attribute square_side { xsd:decimal }?&
attribute textcolor { ccolor }?&
attribute textcolor_disabled { ccolor }?&
attribute textcolor_over { ccolor }?&
attribute textcolor_pressed { ccolor }?&
attribute textcolor_selected { ccolor }?&
attribute text_align { align }?&
attribute text_valign { valign }?&
attribute tooltip { text }?&
attribute tooltip_style { text }?
##
# Objects #
##
objects = element objects { (script | object)* }
script =
element script {
text &
attribute file { text }? &
attribute directory { text }?
}
object =
element object {
((object
| action
| \attribute
| column
| \include
| item
| repeat
| script
| translatableAttribute)*
| text),
unique_settings,
base_settings,
ex_settings
}
action =
element action {
text,
attribute on { text },
attribute file { text }?
}
\attribute =
element attribute {
(keep | translate)*,
attribute id { text }
}
column =
element column {
translatableAttribute?,
(
attribute id { text }&
attribute color { ccolor }?&
attribute heading { text }?&
attribute width { text }?&
attribute hidden { bool }?
)
}
\include =
element include {
attribute file { text }|
attribute directory { text }
}
item =
element item {
text,
attribute enabled { bool }?
}
keep = element keep { text }
repeat =
element repeat {
object+,
attribute count { xsd:nonNegativeInteger },
attribute var { text }?
}
translate = element translate { text }
translatableAttribute =
element translatableAttribute {
text,
(
attribute id { text }&
attribute comment { text }?&
attribute context { text }?
)
}
##
# Styles #
##
styles = element styles { style* }
style =
element style {
attribute name { text },
base_settings,
ex_settings
}
##
# Setup #
##
setup = element setup { (icon | scrollbar | tooltip | color)* }
scrollbar =
element scrollbar {
attribute name { text }&
attribute width { xsd:decimal }&
attribute alwaysshown { bool }?&
attribute maximum_bar_size { xsd:decimal }?&
attribute minimum_bar_size { xsd:decimal }?&
attribute scroll_wheel { bool }?&
attribute show_edge_buttons { bool }?&
attribute sprite_button_top { text }?&
attribute sprite_button_top_pressed { text }?&
attribute sprite_button_top_disabled { text }?&
attribute sprite_button_top_over { text }?&
attribute sprite_button_bottom { text }?&
attribute sprite_button_bottom_pressed { text }?&
attribute sprite_button_bottom_disabled { text }?&
attribute sprite_button_bottom_over { text }?&
attribute sprite_bar_vertical { text }?&
attribute sprite_bar_vertical_over { text }?&
attribute sprite_bar_vertical_pressed { text }?&
attribute sprite_back_vertical { text }?
}
icon =
element icon {
attribute name { text }&
attribute size { size }&
attribute sprite { text }&
attribute cell_id { text }?
}
tooltip =
element tooltip {
attribute name { text }&
attribute sprite { text }?&
attribute anchor { valign }?&
attribute axis_color { ccolor }?&
attribute axis_width { xsd:decimal { minInclusive = "0" } }?&
attribute buffer_zone { xsd:decimal }?&
attribute font { text }?&
attribute maxwidth { xsd:decimal }?&
attribute offset { pos }?&
attribute textcolor { ccolor }?&
attribute delay { xsd:integer }?&
attribute use_object { text }?&
attribute hide_object { bool }?
}
color =
element color {
rgba,
attribute name { text }
}
##
# Sprites #
##
sprites = element sprites { sprite* }
sprite =
element sprite {
(effect?, image+),
attribute name { text }
}
image =
element image {
effect?,
(
attribute texture { text }?&
attribute size { clientarea }?&
attribute texture_size { clientarea }?&
attribute real_texture_placement { rect }?&
attribute cell_size { size }?&
attribute backcolor { ccolor }?&
attribute bordercolor { ccolor }?&
attribute border { bool }?&
attribute z_level { xsd:float }?&
attribute fixed_h_aspect_ratio { xsd:decimal }?&
attribute round_coordinates { bool }?&
attribute wrap_mode { wrapmode }?
)
}
effect =
element effect {
attribute add_color { ccolor }?,
attribute grayscale { empty }?
}
+42 -34
View File
@@ -1,12 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<start>
<a:documentation/>
<!--
NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file
and use a converter tool like trang to generate the Relax NG XML (.rng) file
-->
<a:documentation/>
<choice>
<ref name="object"/>
<ref name="objects"/>
@@ -236,6 +230,31 @@
<ref name="bool"/>
</attribute>
</optional>
<optional>
<attribute name="flare_texture_count">
<data type="nonNegativeInteger"/>
</attribute>
</optional>
<optional>
<attribute name="flare_render_size">
<data type="nonNegativeInteger"/>
</attribute>
</optional>
<optional>
<attribute name="flare_animation_speed">
<data type="nonNegativeInteger"/>
</attribute>
</optional>
<optional>
<attribute name="flare_interleave">
<ref name="bool"/>
</attribute>
</optional>
<optional>
<attribute name="flare_lifetime_seconds">
<data type="nonNegativeInteger"/>
</attribute>
</optional>
<optional>
<attribute name="font"/>
</optional>
@@ -253,11 +272,6 @@
<optional>
<attribute name="hotkey"/>
</optional>
<optional>
<attribute name="cell_id">
<data type="integer"/>
</attribute>
</optional>
<optional>
<attribute name="independent">
<ref name="bool"/>
@@ -273,6 +287,11 @@
<ref name="bool"/>
</attribute>
</optional>
<optional>
<attribute name="mouse_event_mask">
<text/>
</attribute>
</optional>
<optional>
<attribute name="mask_char">
<data type="string">
@@ -383,6 +402,9 @@
<optional>
<attribute name="sprite_list"/>
</optional>
<optional>
<attribute name="sprite_list_overlay"/>
</optional>
<optional>
<attribute name="sprite2_disabled"/>
</optional>
@@ -392,6 +414,12 @@
<optional>
<attribute name="sprite_over"/>
</optional>
<optional>
<attribute name="sprite_overlay"/>
</optional>
<optional>
<attribute name="sprite_overlay_disabled"/>
</optional>
<optional>
<attribute name="sprite2_over"/>
</optional>
@@ -404,6 +432,9 @@
<optional>
<attribute name="sprite_selectarea"/>
</optional>
<optional>
<attribute name="sprite_selectarea_overlay"/>
</optional>
<optional>
<attribute name="square_side">
<data type="decimal"/>
@@ -721,9 +752,6 @@
<ref name="size"/>
</attribute>
<attribute name="sprite"/>
<optional>
<attribute name="cell_id"/>
</optional>
</interleave>
</element>
</define>
@@ -831,31 +859,11 @@
<ref name="rect"/>
</attribute>
</optional>
<optional>
<attribute name="cell_size">
<ref name="size"/>
</attribute>
</optional>
<optional>
<attribute name="backcolor">
<ref name="ccolor"/>
</attribute>
</optional>
<optional>
<attribute name="bordercolor">
<ref name="ccolor"/>
</attribute>
</optional>
<optional>
<attribute name="border">
<ref name="bool"/>
</attribute>
</optional>
<optional>
<attribute name="z_level">
<data type="float"/>
</attribute>
</optional>
<optional>
<attribute name="fixed_h_aspect_ratio">
<data type="decimal"/>
-11
View File
@@ -1,11 +0,0 @@
namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
##
# NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file
# and use a converter tool like trang to generate the Relax NG XML (.rng) file
##
element page {
element include {
text
}*
}
-6
View File
@@ -1,11 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<element name="page" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0">
<a:documentation/>
<!--
NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file
and use a converter tool like trang to generate the Relax NG XML (.rng) file
-->
<a:documentation/>
<zeroOrMore>
<element name="include">
<text/>
@@ -0,0 +1,11 @@
var g_IncompatibleModsFile = "gui/incompatible_mods/incompatible_mods.txt";
function init(data)
{
Engine.GetGUIObjectByName("mainText").caption = Engine.TranslateLines(Engine.ReadFile(g_IncompatibleModsFile));
}
function closePage()
{
Engine.PopGuiPage();
}
@@ -0,0 +1,6 @@
[font="sans-bold-20"]You tried to start the game with incompatible or missing mods![/font]
[font="sans-16"]
Solve the compatibility issue by disabling invalid mods or enabling required dependencies. You can then save & start the game.
Incompatible mods will appear in red in the list of enabled mods (bottom panel). Dependencies can be added by enabling them in the upper panel.
[/font]
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<objects>
<script directory="gui/common/"/>
<script directory="gui/incompatible_mods/"/>
<!-- Add a translucent black background to fade out the menu page -->
<object type="image" sprite="ModernFade"/>
<object type="image" style="ModernDialog" size="50%-350 50%-200 50%+350 50%+200">
<object type="text" style="ModernLabelText" size="50%-128 -18 50%+128 14">
<translatableAttribute id="caption">Incompatible mods</translatableAttribute>
</object>
<object name="mainText" type="text" style="ModernTextPanel" size="20 20 100%-20 100%-52">
</object>
<object name="btnClose" type="button" style="ModernButtonRed" size="18 100%-45 100%-18 100%-17" hotkey="cancel">
<translatableAttribute id="caption">Ok</translatableAttribute>
<action on="Press">closePage();</action>
</object>
</object>
</objects>
@@ -32,6 +32,7 @@
>
<action on="Press">displayMods();</action>
<action on="TextEdit">displayMods();</action>
<translatableAttribute id="placeholder_text" context="placeholder text for input field to filter mods">Filter</translatableAttribute>
</object>
<object name="modsAvailableList"
+133 -87
View File
@@ -51,11 +51,27 @@ var g_ModsDisabled = [];
var g_ModsEnabledFiltered = [];
var g_ModsDisabledFiltered = [];
/**
* Cache mod compatibility recomputed when some mod is enbaled/disabled.
*/
var g_ModsCompatibility = [];
/**
* Name of the mods installed by the ModInstaller.
*/
var g_InstalledMods;
var g_HasIncompatibleMods;
var g_FakeMod = {
"name": translate("This mod does not exist"),
"version": "",
"label": "",
"url": "",
"description": "",
"dependencies": []
};
var g_ColorNoModSelected = "255 255 100";
var g_ColorDependenciesMet = "100 255 100";
var g_ColorDependenciesNotMet = "255 100 100";
@@ -63,15 +79,19 @@ var g_ColorDependenciesNotMet = "255 100 100";
function init(data, hotloadData)
{
g_InstalledMods = data && data.installedMods || hotloadData && hotloadData.installedMods || [];
g_HasIncompatibleMods = Engine.HasIncompatibleMods();
initMods();
initGUIButtons(data);
if (g_HasIncompatibleMods)
Engine.PushGuiPage("page_incompatible_mods.xml", {});
}
function initMods()
{
loadMods();
loadEnabledMods();
recomputeCompatibility();
validateMods();
initGUIFilters();
}
@@ -87,9 +107,21 @@ function loadMods()
deepfreeze(g_Mods);
}
/**
* Return fake mod for mods which do not exist
*/
function getMod(folder)
{
return !!g_Mods[folder] ? g_Mods[folder] : g_FakeMod;
}
function loadEnabledMods()
{
g_ModsEnabled = Engine.ConfigDB_GetValue("user", "mod.enabledmods").split(/\s+/).filter(folder => !!g_Mods[folder]);
if (g_HasIncompatibleMods)
g_ModsEnabled = Engine.GetEnabledMods().concat(Engine.GetIncompatibleMods())
.filter(folder => folder != "mod");
else
g_ModsEnabled = Engine.GetEnabledMods().filter(folder => !!g_Mods[folder]);
g_ModsDisabled = Object.keys(g_Mods).filter(folder => g_ModsEnabled.indexOf(folder) == -1);
g_ModsEnabledFiltered = g_ModsEnabled;
g_ModsDisabledFiltered = g_ModsDisabled;
@@ -104,6 +136,7 @@ function validateMods()
function initGUIFilters()
{
Engine.GetGUIObjectByName("negateFilter").checked = false;
Engine.GetGUIObjectByName("modCompatibleFilter").checked = true;
displayModLists();
}
@@ -111,9 +144,11 @@ function initGUIFilters()
function initGUIButtons(data)
{
// Either get back to the previous page or quit if there is no previous page
let cancelButton = !data || data.cancelbutton;
Engine.GetGUIObjectByName("cancelButton").hidden = !cancelButton;
Engine.GetGUIObjectByName("quitButton").hidden = cancelButton;
let hasPreviousPage = !data || data.cancelbutton;
Engine.GetGUIObjectByName("cancelButton").hidden = !hasPreviousPage;
Engine.GetGUIObjectByName("quitButton").hidden = hasPreviousPage;
// Turn 'save' off, it will be enabled on any change.
Engine.GetGUIObjectByName("saveConfigurationButton").enabled = false;
Engine.GetGUIObjectByName("toggleModButton").caption = translateWithContext("mod activation", "Enable");
}
@@ -122,43 +157,47 @@ function saveMods()
sortEnabledMods();
Engine.ConfigDB_CreateValue("user", "mod.enabledmods", ["mod"].concat(g_ModsEnabled).join(" "));
Engine.ConfigDB_WriteFile("user", "config/user.cfg");
Engine.GetGUIObjectByName("saveConfigurationButton").enabled = false;
}
function startMods()
{
sortEnabledMods();
Engine.SetMods(["mod"].concat(g_ModsEnabled));
Engine.RestartEngine();
saveMods();
if (!Engine.SetModsAndRestartEngine(["mod"].concat(g_ModsEnabled)))
Engine.GetGUIObjectByName("message").caption = coloredText(translate('Dependencies not met'), g_ColorDependenciesNotMet);
}
function displayModLists()
{
g_ModsEnabledFiltered = displayModList("modsEnabledList", g_ModsEnabled);
g_ModsDisabledFiltered = displayModList("modsDisabledList", g_ModsDisabled);
g_ModsEnabledFiltered = displayModList("modsEnabledList", g_ModsEnabled, true);
g_ModsDisabledFiltered = displayModList("modsDisabledList", g_ModsDisabled, false);
}
function displayModList(listObjectName, folders)
function displayModList(listObjectName, folders, enabled)
{
let listObject = Engine.GetGUIObjectByName(listObjectName);
if (listObjectName == "modsDisabledList")
{
let sortFolder = folder => String(g_Mods[folder][listObject.selected_column] || folder);
let sortFolder = folder => String(getMod(folder)[listObject.selected_column] || folder);
folders.sort((folder1, folder2) =>
listObject.selected_column_order *
sortFolder(folder1).localeCompare(sortFolder(folder2)));
}
folders = folders.filter(filterMod);
if (!enabled && Engine.GetGUIObjectByName("modCompatibleFilter").checked)
folders = folders.filter(folder => g_ModsCompatibility[folder]);
let selected = listObject.selected !== -1 ? listObject.list_name[listObject.selected] : null;
listObject.list_name = folders.map(folder => g_Mods[folder].name).map(name => g_InstalledMods.indexOf(name) == -1 ? name : coloredText(name, "green"));
listObject.list_folder = folders;
listObject.list_label = folders.map(folder => g_Mods[folder].label);
listObject.list_url = folders.map(folder => g_Mods[folder].url || "");
listObject.list_version = folders.map(folder => g_Mods[folder].version);
listObject.list_dependencies = folders.map(folder => g_Mods[folder].dependencies.join(" "));
listObject.list_name = folders.map(folder => colorMod(folder, getMod(folder).name || "", enabled));
listObject.list_folder = folders.map(folder => colorMod(folder, folder, enabled));
listObject.list_label = folders.map(folder => colorMod(folder, getMod(folder).label || "", enabled));
listObject.list_url = folders.map(folder => colorMod(folder, getMod(folder).url || "", enabled));
listObject.list_version = folders.map(folder => colorMod(folder, getMod(folder).version || "", enabled));
listObject.list_dependencies = folders.map(folder => colorMod(folder, getMod(folder)?.dependencies.join(" ") || "", enabled));
listObject.list = folders;
listObject.selected = selected ? listObject.list_name.indexOf(selected) : -1;
@@ -166,6 +205,21 @@ function displayModList(listObjectName, folders)
return folders;
}
function getModColor(folder, enabled)
{
if (!g_ModsCompatibility[folder])
return enabled ? g_ColorDependenciesNotMet : "gray";
if (g_InstalledMods.indexOf(getMod(folder).name) != -1)
return "green";
return false;
}
function colorMod(folder, text, enabled)
{
let color = getModColor(folder, enabled);
return color ? coloredText(text, color) : text;
}
function reloadDisabledMods()
{
g_ModsDisabled = Object.keys(g_Mods).filter(folder => g_ModsEnabled.indexOf(folder) == -1);
@@ -176,16 +230,20 @@ function enableMod()
let modsDisabledList = Engine.GetGUIObjectByName("modsDisabledList");
let pos = modsDisabledList.selected;
if (pos == -1 || !areDependenciesMet(g_ModsDisabledFiltered[pos]))
if (pos == -1 || !g_ModsCompatibility[g_ModsDisabledFiltered[pos]])
return;
g_ModsEnabled.push(g_ModsDisabledFiltered.splice(pos, 1)[0]);
reloadDisabledMods();
recomputeCompatibility();
Engine.GetGUIObjectByName("saveConfigurationButton").enabled = true;
if (pos >= g_ModsDisabledFiltered.length)
--pos;
displayModLists();
Engine.GetGUIObjectByName("message").caption = "";
modsDisabledList.selected = pos;
}
@@ -205,7 +263,8 @@ function disableMod()
break;
}
g_ModsDisabled.push(disabledMod);
if (!!g_Mods[disabledMod])
g_ModsDisabled.push(disabledMod);
// Remove mods that required the removed mod and cascade
// Sort them, so we know which ones can depend on the removed mod
@@ -214,53 +273,35 @@ function disableMod()
sortEnabledMods();
for (let i = 0; i < g_ModsEnabled.length; ++i)
if (!areDependenciesMet(g_ModsEnabled[i]))
if (!areDependenciesMet(g_ModsEnabled[i], true))
{
g_ModsDisabled.push(g_ModsEnabled.splice(i, 1)[0]);
--i;
}
Engine.GetGUIObjectByName("saveConfigurationButton").enabled = true;
recomputeCompatibility(true);
displayModLists();
Engine.GetGUIObjectByName("message").caption = "";
modsEnabledList.selected = Math.min(pos, g_ModsEnabledFiltered.length - 1);
}
function applyFilters()
{
// Save selected rows
let modsDisabledList = Engine.GetGUIObjectByName("modsDisabledList");
let modsEnabledList = Engine.GetGUIObjectByName("modsEnabledList");
let selectedDisabledFolder = modsDisabledList.list_folder[modsDisabledList.selected];
let selectedEnabledFolder = modsEnabledList.list_folder[modsEnabledList.selected];
// Remove selected rows to prevent a link to a non existing item
modsDisabledList.selected = -1;
modsEnabledList.selected = -1;
displayModLists();
// Restore previously selected rows
modsDisabledList.selected = modsDisabledList.list_folder.indexOf(selectedDisabledFolder);
modsEnabledList.selected = modsEnabledList.list_folder.indexOf(selectedEnabledFolder);
Engine.GetGUIObjectByName("globalModDescription").caption = "";
}
function filterMod(folder)
{
let mod = g_Mods[folder];
let mod = getMod(folder);
let negateFilter = Engine.GetGUIObjectByName("negateFilter").checked;
let searchText = Engine.GetGUIObjectByName("modGenericFilter").caption;
if (searchText &&
folder.indexOf(searchText) == -1 &&
mod.name.indexOf(searchText) == -1 &&
mod.label.indexOf(searchText) == -1 &&
(mod.name || "").indexOf(searchText) == -1 &&
(mod.label || "").indexOf(searchText) == -1 &&
(mod.url || "").indexOf(searchText) == -1 &&
mod.version.indexOf(searchText) == -1 &&
mod.description.indexOf(searchText) == -1 &&
mod.dependencies.indexOf(searchText) == -1)
(mod.version || "").indexOf(searchText) == -1 &&
(mod.description || "").indexOf(searchText) == -1 &&
(mod.dependencies || "").indexOf(searchText) == -1)
return negateFilter;
return !negateFilter;
@@ -271,12 +312,6 @@ function closePage()
Engine.SwitchGuiPage("page_pregame.xml", {});
}
function areFilters()
{
let searchText = Engine.GetGUIObjectByName("modGenericFilter").caption;
return searchText && searchText != translate("Filter");
}
/**
* Moves an item in the list up or down.
*/
@@ -285,7 +320,7 @@ function moveCurrItem(objectName, up)
// Prevent moving while filters are applied
// because we would need to map filtered positions
// to not filtered positions so changes will persist.
if (areFilters())
if (Engine.GetGUIObjectByName("modGenericFilter").caption)
return;
let obj = Engine.GetGUIObjectByName(objectName);
@@ -302,30 +337,34 @@ function moveCurrItem(objectName, up)
g_ModsEnabled[idx] = g_ModsEnabled[idx2];
g_ModsEnabled[idx2] = tmp;
g_ModsEnabledFiltered = displayModList("modsEnabledList", g_ModsEnabled);
g_ModsEnabledFiltered = displayModList("modsEnabledList", g_ModsEnabled, true);
obj.selected = idx2;
}
function areDependenciesMet(folder)
function areDependenciesMet(folder, disabledAction = false)
{
let guiObject = Engine.GetGUIObjectByName("message");
for (let dependency of g_Mods[folder].dependencies)
{
if (isDependencyMet(dependency))
continue;
guiObject.caption = coloredText(
sprintf(translate('Dependency not met: %(dep)s'), { "dep": dependency }),
g_ColorDependenciesNotMet);
// If we disabled mod it will not change satus of incompatible mods
if (disabledAction && !g_ModsCompatibility[folder])
return g_ModsCompatibility[folder];
if (!g_Mods[folder])
return false;
for (let dependency of getMod(folder).dependencies)
{
if (!isDependencyMet(dependency))
return false;
}
guiObject.caption = coloredText(translate('All dependencies met'), g_ColorDependenciesMet);
return true;
}
function recomputeCompatibility(disabledAction = false)
{
for (let mod in g_Mods)
g_ModsCompatibility[mod] = areDependenciesMet(mod, disabledAction);
}
/**
* @param dependency is a mod name or a mod version comparison.
*/
@@ -335,8 +374,8 @@ function isDependencyMet(dependency)
let [name, version] = operator ? dependency.split(operator[0]) : [dependency, undefined];
return g_ModsEnabled.some(folder =>
g_Mods[folder].name == name &&
(!operator || versionSatisfied(g_Mods[folder].version, operator[0], version)));
getMod(folder).name == name &&
(!operator || versionSatisfied(getMod(folder).version, operator[0], version)));
}
/**
@@ -380,42 +419,49 @@ function sortEnabledMods()
{
let dependencies = {};
for (let folder of g_ModsEnabled)
dependencies[folder] = g_Mods[folder].dependencies.map(d => d.split(g_RegExpComparisonOperator)[0]);
dependencies[folder] = getMod(folder).dependencies.map(d => d.split(g_RegExpComparisonOperator)[0]);
g_ModsEnabled.sort((folder1, folder2) =>
dependencies[folder1].indexOf(g_Mods[folder2].name) != -1 ? 1 :
dependencies[folder2].indexOf(g_Mods[folder1].name) != -1 ? -1 : 0);
dependencies[folder1].indexOf(getMod(folder2).name) != -1 ? 1 :
dependencies[folder2].indexOf(getMod(folder1).name) != -1 ? -1 : 0);
g_ModsEnabledFiltered = displayModList("modsEnabledList", g_ModsEnabled);
g_ModsEnabledFiltered = displayModList("modsEnabledList", g_ModsEnabled, true);
}
function selectedMod(listObjectName)
{
let listObject = Engine.GetGUIObjectByName(listObjectName);
let otherListObject = Engine.GetGUIObjectByName(listObjectName == "modsDisabledList" ?
let isPickedDisabledList = listObjectName == "modsDisabledList";
let otherListObject = Engine.GetGUIObjectByName(isPickedDisabledList ?
"modsEnabledList" : "modsDisabledList");
let toggleModButton = Engine.GetGUIObjectByName("toggleModButton");
let modSelected = listObject.selected != -1;
if (modSelected)
let isModSelected = listObject.selected != -1;
if (isModSelected)
{
otherListObject.selected = -1;
toggleModButton.onPress = listObjectName == "modsDisabledList" ? enableMod : disableMod;
toggleModButton.onPress = isPickedDisabledList ? enableMod : disableMod;
}
Engine.GetGUIObjectByName("visitWebButton").enabled = modSelected && !!getSelectedModUrl();
toggleModButton.caption = listObjectName == "modsDisabledList" ?
const isFiltering = Engine.GetGUIObjectByName("modGenericFilter").caption;
Engine.GetGUIObjectByName("visitWebButton").enabled = isModSelected && !!getSelectedModUrl();
toggleModButton.caption = isPickedDisabledList ?
translateWithContext("mod activation", "Enable") :
translateWithContext("mod activation", "Disable");
toggleModButton.enabled = modSelected;
Engine.GetGUIObjectByName("enabledModUp").enabled = modSelected && listObjectName == "modsEnabledList" && !areFilters();
Engine.GetGUIObjectByName("enabledModDown").enabled = modSelected && listObjectName == "modsEnabledList" && !areFilters();
toggleModButton.enabled = isPickedDisabledList ? isModSelected && g_ModsCompatibility[listObject.list[listObject.selected]] || false : isModSelected;
Engine.GetGUIObjectByName("enabledModUp").enabled = isModSelected && listObjectName == "modsEnabledList" && !isFiltering;
Engine.GetGUIObjectByName("enabledModDown").enabled = isModSelected && listObjectName == "modsEnabledList" && !isFiltering;
Engine.GetGUIObjectByName("globalModDescription").caption =
listObject.list[listObject.selected] ?
g_Mods[listObject.list[listObject.selected]].description :
getMod(listObject.list[listObject.selected]).description :
'[color="' + g_ColorNoModSelected + '"]' + translate("No mod has been selected.") + '[/color]';
if (!g_ModsEnabled.length)
Engine.GetGUIObjectByName("message").caption = coloredText(translate('Enable at least 0ad mod'), g_ColorDependenciesNotMet);
if (!Engine.GetGUIObjectByName("startButton").hidden)
Engine.GetGUIObjectByName("startButton").enabled = g_ModsEnabled.length > 0;
}
/**
@@ -427,8 +473,8 @@ function getSelectedModUrl()
let modsDisabledList = Engine.GetGUIObjectByName("modsDisabledList");
let list = modsEnabledList.selected == -1 ? modsDisabledList : modsEnabledList;
let folder = list.list_folder[list.selected];
return folder && g_Mods[folder] && g_Mods[folder].url || undefined;
let folder = list.list[list.selected];
return folder && getMod(folder) && getMod(folder).url || undefined;
}
function visitModWebsite()
+21 -7
View File
@@ -19,8 +19,8 @@
style="ModernInput"
size="16 0 176 100%"
>
<action on="Press">applyFilters();</action>
<action on="TextEdit">applyFilters();</action>
<action on="Press">displayModLists();</action>
<action on="TextEdit">displayModLists();</action>
<translatableAttribute id="placeholder_text">Filter</translatableAttribute>
</object>
@@ -31,13 +31,27 @@
style="ModernTickBox"
size="186 0 206 100%"
>
<action on="Press">applyFilters();</action>
<action on="Press">displayModLists();</action>
</object>
<object type="text" size="208 0 100% 100%" text_align="left" textcolor="white">
<translatableAttribute id="caption">Negate</translatableAttribute>
</object>
</object>
<object size = "100%-200 40 100%-20 64">
<object name="modCompatibleFilter"
type="checkbox"
checked="false"
style="ModernTickBox"
size="16 0 36 100%"
>
<action on="Press">displayModLists();</action>
</object>
<object type="text" size="40 0 100% 100%" text_align="left" textcolor="white">
<translatableAttribute id="caption">Filter compatible</translatableAttribute>
</object>
</object>
<object
name="globalModDescription"
type="text"
@@ -67,7 +81,7 @@
auto_scroll="true"
>
<action on="SelectionChange">selectedMod(this.name);</action>
<action on="SelectionColumnChange">applyFilters();</action>
<action on="SelectionColumnChange">displayModLists();</action>
<action on="MouseLeftDoubleClickItem">enableMod();</action>
<!-- List headers -->
@@ -101,7 +115,7 @@
</object>
<object name="modsEnabledList"
style="ModernList"
style="ModernSortedList"
type="olist"
size="0 25 100%-32-2-2 100%"
font="sans-stroke-13"
@@ -198,8 +212,8 @@
<action on="Press">saveMods();</action>
</object>
<object name="startModsButton" type="button" style="ModernButtonRed" size="100%-196 100%-44 100%-16 100%-16">
<translatableAttribute id="caption">Start Mods</translatableAttribute>
<object name="startButton" type="button" style="ModernButtonRed" size="100%-196 100%-44 100%-16 100%-16">
<translatableAttribute id="caption">Save and Restart</translatableAttribute>
<action on="Press">startMods();</action>
</object>
</object>
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<page>
<include>common/modern/setup.xml</include>
<include>common/modern/styles.xml</include>
<include>common/modern/sprites.xml</include>
<include>modmod/styles.xml</include>
<include>incompatible_mods/incompatible_mods.xml</include>
</page>
@@ -0,0 +1,27 @@
!!ARBfp1.0
TEMP colorTex;
TEX colorTex, fragment.texcoord[0], texture[0], 2D;
TEMP grayscale;
MOV grayscale.r, 0.3;
MOV grayscale.g, 0.59;
MOV grayscale.b, 0.11;
MOV grayscale.a, 0.0;
PARAM colorAdd = program.local[1];
PARAM colorMul = program.local[2];
PARAM grayscaleFactor = program.local[3];
TEMP colorGray;
DP3 colorGray.rgb, colorTex, grayscale;
MOV colorGray.a, colorTex.a;
TEMP color;
LRP color, grayscaleFactor, colorGray, colorTex;
MUL color, color, colorMul;
ADD color, color, colorAdd;
MOV result.color, color;
END
@@ -6,7 +6,7 @@ TEMP position;
DP4 position.x, transform[0], vertex.position;
DP4 position.y, transform[1], vertex.position;
DP4 position.z, transform[2], vertex.position;
MOV position.z, 0.0;
MOV position.w, 1.0;
MOV result.position, position;
@@ -1,16 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="arb">
<vertex file="arb/gui_text.vp">
<vertex file="arb/canvas2d.vp">
<stream name="pos"/>
<stream name="uv0"/>
<uniform name="transform" loc="0" type="mat4"/>
</vertex>
<fragment file="arb/gui_text.fp">
<fragment file="arb/canvas2d.fp">
<uniform name="tex" loc="0" type="sampler2D"/>
<uniform name="colorAdd" loc="1" type="vec4"/>
<uniform name="colorMul" loc="2" type="vec4"/>
<uniform name="grayscaleFactor" loc="3" type="float"/>
</fragment>
</program>
@@ -1,15 +0,0 @@
!!ARBfp1.0
TEMP tex_color;
TEX tex_color, fragment.texcoord[0], texture[0], 2D;
PARAM add_color = program.local[1];
TEMP color;
MOV color, add_color;
MAD color.rgb, color, tex_color.a, tex_color;
MOV color.a, tex_color.a;
MOV result.color, color;
END
@@ -1,16 +0,0 @@
!!ARBvp1.0
PARAM transform[4] = { program.local[0..3] };
TEMP position;
DP4 position.x, transform[0], vertex.position;
DP4 position.y, transform[1], vertex.position;
DP4 position.z, transform[2], vertex.position;
MOV position.w, 1.0;
MOV result.position, position;
MOV result.texcoord[0], vertex.texcoord[0];
END
@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="arb">
<vertex file="arb/gui_add.vp">
<stream name="pos"/>
<stream name="uv0"/>
<uniform name="transform" loc="0" type="mat4"/>
</vertex>
<fragment file="arb/gui_add.fp">
<uniform name="tex" loc="0" type="sampler2D"/>
<uniform name="color" loc="1" type="vec4"/>
</fragment>
</program>
@@ -1,5 +0,0 @@
!!ARBfp1.0
TEX result.color, fragment.texcoord[0], texture[0], 2D;
END
@@ -1,16 +0,0 @@
!!ARBvp1.0
PARAM transform[4] = { program.local[0..3] };
TEMP position;
DP4 position.x, transform[0], vertex.position;
DP4 position.y, transform[1], vertex.position;
DP4 position.z, transform[2], vertex.position;
MOV position.w, 1.0;
MOV result.position, position;
MOV result.texcoord[0], vertex.texcoord[0];
END
@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="arb">
<vertex file="arb/gui_basic.vp">
<stream name="pos"/>
<stream name="uv0"/>
<uniform name="transform" loc="0" type="mat4"/>
</vertex>
<fragment file="arb/gui_basic.fp">
<uniform name="tex" loc="0" type="sampler2D"/>
</fragment>
</program>
@@ -1,18 +0,0 @@
!!ARBfp1.0
TEMP tex_color;
TEX tex_color, fragment.texcoord[0], texture[0], 2D;
TEMP grayscale;
MOV grayscale.r, 0.3;
MOV grayscale.g, 0.59;
MOV grayscale.b, 0.11;
MOV grayscale.a, 0.0;
TEMP color;
DP3 color.rgb, tex_color, grayscale;
MOV color.a, tex_color.a;
MOV result.color, color;
END
@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="arb">
<vertex file="arb/gui_grayscale.vp">
<stream name="pos"/>
<stream name="uv0"/>
<uniform name="transform" loc="0" type="mat4"/>
</vertex>
<fragment file="arb/gui_grayscale.fp">
<uniform name="tex" loc="0" type="sampler2D"/>
</fragment>
</program>
@@ -1,7 +0,0 @@
!!ARBfp1.0
PARAM color = program.local[0];
MOV result.color, color;
END
@@ -1,14 +0,0 @@
!!ARBvp1.0
PARAM transform[4] = { program.local[0..3] };
TEMP position;
DP4 position.x, transform[0], vertex.position;
DP4 position.y, transform[1], vertex.position;
DP4 position.z, transform[2], vertex.position;
MOV position.w, 1.0;
MOV result.position, position;
END
@@ -1,14 +0,0 @@
!!ARBfp1.0
TEMP tex_color;
TEX tex_color, fragment.texcoord[0], texture[0], 2D;
PARAM add_color = program.local[1];
TEMP color;
MOV color, add_color;
MUL color.a, color.a, tex_color.a;
MOV result.color, color;
END
@@ -1,16 +0,0 @@
!!ARBvp1.0
PARAM transform[4] = { program.local[0..3] };
TEMP position;
DP4 position.x, transform[0], vertex.position;
DP4 position.y, transform[1], vertex.position;
DP4 position.z, transform[2], vertex.position;
MOV position.w, 1.0;
MOV result.position, position;
MOV result.texcoord[0], vertex.texcoord[0];
END
@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="arb">
<vertex file="arb/gui_solid_mask.vp">
<stream name="pos"/>
<stream name="uv0"/>
<uniform name="transform" loc="0" type="mat4"/>
</vertex>
<fragment file="arb/gui_solid_mask.fp">
<uniform name="tex" loc="0" type="sampler2D"/>
<uniform name="color" loc="1" type="vec4"/>
</fragment>
</program>
@@ -1,15 +0,0 @@
!!ARBfp1.0
TEMP tex_color;
TEX tex_color, fragment.texcoord[0], texture[0], 2D;
PARAM add_color = program.local[1];
PARAM mul_color = program.local[2];
TEMP color;
ADD color, tex_color, add_color;
MUL color, color, mul_color;
MOV result.color, color;
END
@@ -1,16 +0,0 @@
!!ARBvp1.0
PARAM transform[4] = { program.local[0..3] };
TEMP position;
DP4 position.x, transform[0], vertex.position;
DP4 position.y, transform[1], vertex.position;
DP4 position.z, transform[2], vertex.position;
MOV position.w, 1.0;
MOV result.position, position;
MOV result.texcoord[0], vertex.texcoord[0];
END
@@ -3,17 +3,12 @@
<technique>
<require shaders="arb"/>
<pass shader="arb/gui_add"/>
</technique>
<technique>
<require shaders="fixed"/>
<pass shader="fixed:gui_add"/>
<pass shader="arb/canvas2d"/>
</technique>
<technique>
<require shaders="glsl"/>
<pass shader="glsl/gui_add"/>
<pass shader="glsl/canvas2d"/>
</technique>
</effect>
@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<effect>
<technique>
<require shaders="arb"/>
<pass shader="arb/gui_grayscale"/>
</technique>
<technique>
<require shaders="fixed"/>
<pass shader="fixed:gui_grayscale"/>
</technique>
<technique>
<require shaders="glsl"/>
<pass shader="glsl/gui_grayscale"/>
</technique>
</effect>
@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<effect>
<technique>
<require shaders="arb"/>
<pass shader="arb/gui_solid_mask"/>
</technique>
<technique>
<require shaders="fixed"/>
<pass shader="fixed:gui_solid"/>
</technique>
<technique>
<require shaders="glsl"/>
<pass shader="glsl/gui_solid_mask"/>
</technique>
</effect>
@@ -1,25 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<effect>
<technique>
<require shaders="arb"/>
<pass shader="arb/gui_text">
<blend src="src_alpha" dst="one_minus_src_alpha"/>
</pass>
</technique>
<technique>
<require shaders="fixed"/>
<pass shader="fixed:gui_text">
<blend src="src_alpha" dst="one_minus_src_alpha"/>
</pass>
</technique>
<technique>
<require shaders="glsl"/>
<pass shader="glsl/gui_text">
<blend src="src_alpha" dst="one_minus_src_alpha"/>
</pass>
</technique>
</effect>
@@ -0,0 +1,15 @@
#version 110
uniform sampler2D tex;
uniform vec4 colorAdd;
uniform vec4 colorMul;
uniform float grayscaleFactor;
varying vec2 v_uv;
void main()
{
vec4 colorTex = texture2D(tex, v_uv);
vec3 grayColor = vec3(dot(vec3(0.3, 0.59, 0.11), colorTex.rgb));
gl_FragColor = clamp(mix(colorTex, vec4(grayColor, colorTex.a), grayscaleFactor) * colorMul + colorAdd, 0.0, 1.0);
}
@@ -0,0 +1,14 @@
#version 110
uniform mat4 transform;
attribute vec2 a_vertex;
attribute vec2 a_uv0;
varying vec2 v_uv;
void main()
{
v_uv = a_uv0;
gl_Position = transform * vec4(a_vertex, 0.0, 1.0);
}
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="glsl">
<vertex file="glsl/gui_text.vs">
<vertex file="glsl/canvas2d.vs">
<stream name="pos"/>
<stream name="uv0"/>
<attrib name="a_vertex" semantics="gl_Vertex"/>
<attrib name="a_uv0" semantics="gl_MultiTexCoord0"/>
</vertex>
<fragment file="glsl/gui_text.fs"/>
<fragment file="glsl/canvas2d.fs"/>
</program>
@@ -1,13 +0,0 @@
#version 110
uniform sampler2D tex;
uniform vec4 color;
varying vec2 v_tex;
void main()
{
vec4 t = texture2D(tex, v_tex);
gl_FragColor.rgb = t.rgb + color.rgb * t.a;
gl_FragColor.a = t.a;
}
@@ -1,15 +0,0 @@
#version 110
uniform mat4 transform;
varying vec2 v_tex;
attribute vec3 a_vertex;
attribute vec2 a_uv0;
void main()
{
gl_Position = transform * vec4(a_vertex, 1.0);
v_tex = a_uv0;
}
@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="glsl">
<vertex file="glsl/gui_add.vs">
<stream name="pos"/>
<stream name="uv0"/>
<attrib name="a_vertex" semantics="gl_Vertex"/>
<attrib name="a_uv0" semantics="gl_MultiTexCoord0"/>
</vertex>
<fragment file="glsl/gui_add.fs"/>
</program>
@@ -1,10 +0,0 @@
#version 110
uniform sampler2D tex;
varying vec2 v_tex;
void main()
{
gl_FragColor = texture2D(tex, v_tex);
}
@@ -1,15 +0,0 @@
#version 110
uniform mat4 transform;
varying vec2 v_tex;
attribute vec3 a_vertex;
attribute vec2 a_uv0;
void main()
{
gl_Position = transform * vec4(a_vertex, 1.0);
v_tex = a_uv0;
}
@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="glsl">
<vertex file="glsl/gui_basic.vs">
<stream name="pos"/>
<stream name="uv0"/>
<attrib name="a_vertex" semantics="gl_Vertex"/>
<attrib name="a_uv0" semantics="gl_MultiTexCoord0"/>
</vertex>
<fragment file="glsl/gui_basic.fs"/>
</program>
@@ -1,12 +0,0 @@
#version 110
uniform sampler2D tex;
varying vec2 v_tex;
void main()
{
vec4 t = texture2D(tex, v_tex);
gl_FragColor.rgb = vec3(dot(t.rgb, vec3(0.3, 0.59, 0.11)));
gl_FragColor.a = t.a;
}
@@ -1,15 +0,0 @@
#version 110
uniform mat4 transform;
varying vec2 v_tex;
attribute vec3 a_vertex;
attribute vec2 a_uv0;
void main()
{
gl_Position = transform * vec4(a_vertex, 1.0);
v_tex = a_uv0;
}
@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="glsl">
<vertex file="glsl/gui_grayscale.vs">
<stream name="pos"/>
<stream name="uv0"/>
<attrib name="a_vertex" semantics="gl_Vertex"/>
<attrib name="a_uv0" semantics="gl_MultiTexCoord0"/>
</vertex>
<fragment file="glsl/gui_grayscale.fs"/>
</program>
@@ -1,8 +0,0 @@
#version 110
uniform vec4 color;
void main()
{
gl_FragColor = color;
}
@@ -1,13 +0,0 @@
#version 110
uniform sampler2D tex;
uniform vec4 color;
varying vec2 v_tex;
void main()
{
vec4 t = texture2D(tex, v_tex);
gl_FragColor.rgb = color.rgb;
gl_FragColor.a = t.a*color.a;
}
@@ -1,15 +0,0 @@
#version 110
uniform mat4 transform;
varying vec2 v_tex;
attribute vec3 a_vertex;
attribute vec2 a_uv0;
void main()
{
gl_Position = transform * vec4(a_vertex, 1.0);
v_tex = a_uv0;
}
@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<program type="glsl">
<vertex file="glsl/gui_solid_mask.vs">
<stream name="pos"/>
<stream name="uv0"/>
<attrib name="a_vertex" semantics="gl_Vertex"/>
<attrib name="a_uv0" semantics="gl_MultiTexCoord0"/>
</vertex>
<fragment file="glsl/gui_solid_mask.fs"/>
</program>
@@ -1,12 +0,0 @@
#version 110
uniform vec4 colorAdd;
uniform vec4 colorMul;
uniform sampler2D tex;
varying vec2 v_texcoord;
void main()
{
gl_FragColor = (texture2D(tex, v_texcoord) + colorAdd) * colorMul;
}
@@ -1,14 +0,0 @@
#version 110
uniform mat4 transform;
varying vec2 v_texcoord;
attribute vec3 a_vertex;
attribute vec2 a_uv0;
void main()
{
gl_Position = transform * vec4(a_vertex, 1.0);
v_texcoord = a_uv0;
}
@@ -1,71 +0,0 @@
namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
##
# NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file
# and use a converter tool like trang to generate the Relax NG XML (.rng) file
##
element actor {
attribute version { xsd:positiveInteger }, (
element group {
element variant {
attribute name { text }? &
attribute file { text }? &
attribute frequency { xsd:nonNegativeInteger }? &
element mesh {
text
}? &
element textures {
element texture {
attribute file { text }? &
attribute name { text }
}*
}? &
element decal {
attribute width { xsd:float } & # X
attribute depth { xsd:float } & # Z
attribute angle { xsd:float } &
attribute offsetx { xsd:float } &
attribute offsetz { xsd:float }
}? &
element particles {
attribute file { text }
}? &
element color { list {
xsd:nonNegativeInteger, # R
xsd:nonNegativeInteger, # G
xsd:nonNegativeInteger # B
} }? &
element animations {
element animation {
attribute name { text } &
attribute id { text }? &
attribute frequency { xsd:nonNegativeInteger }? &
attribute file { text }? &
attribute speed { xsd:nonNegativeInteger } &
attribute event { xsd:decimal { minInclusive = "0" maxInclusive = "1" } }? &
attribute load { xsd:decimal { minInclusive = "0" maxInclusive = "1" } }? &
attribute sound { xsd:decimal { minInclusive = "0" maxInclusive = "1" } }?
}*
}? &
element props {
element prop {
(attribute actor { text }? &
attribute attachpoint { text } &
attribute minheight { xsd:float }? &
attribute maxheight { xsd:float }? &
attribute selectable { "true" | "false" }?)
}*
}?
}*
}* &
element castshadow { # flag; true if present
empty
}? &
element float { # flag; true if present
empty
}? &
element material {
text
}?
)
}
+256 -187
View File
@@ -1,194 +1,263 @@
<?xml version="1.0" encoding="UTF-8"?>
<element name="actor" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<a:documentation/>
<!--
NOTE: To modify this Relax NG grammar, edit the Relax NG Compact (.rnc) file
and use a converter tool like trang to generate the Relax NG XML (.rng) file
-->
<a:documentation/>
<attribute name="version">
<data type="positiveInteger"/>
</attribute>
<interleave>
<zeroOrMore>
<element name="group">
<zeroOrMore>
<element name="variant">
<interleave>
<optional>
<attribute name="name"/>
</optional>
<optional>
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<define name="qualityLevels">
<choice>
<data type="nonNegativeInteger">
<param name="maxInclusive">255</param>
<param name="minInclusive">0</param>
</data>
<choice>
<value>low</value>
<value>medium</value>
<value>high</value>
</choice>
</choice>
</define>
<define name="qualitySettings">
<optional>
<attribute name="minquality">
<a:help>Minimum quality - this is inclusive.</a:help>
<ref name="qualityLevels"/>
</attribute>
</optional>
<optional>
<attribute name="maxquality">
<a:help>Maximum quality - this is exclusive.</a:help>
<ref name="qualityLevels"/>
</attribute>
</optional>
</define>
<define name="group">
<element name="group">
<ref name="qualitySettings"/>
<zeroOrMore>
<element name="variant">
<ref name="qualitySettings"/>
<interleave>
<optional>
<attribute name="name"/>
</optional>
<optional>
<attribute name="file"/>
</optional>
<optional>
<attribute name="frequency">
<data type="nonNegativeInteger"/>
</attribute>
</optional>
<optional>
<element name="mesh">
<text/>
</element>
</optional>
<optional>
<element name="textures">
<zeroOrMore>
<element name="texture">
<interleave>
<optional>
<attribute name="file"/>
</optional>
<attribute name="name"/>
</interleave>
</element>
</zeroOrMore>
</element>
</optional>
<optional>
<element name="decal">
<interleave>
<attribute name="width">
<data type="float"/>
</attribute>
<!-- X -->
<attribute name="depth">
<data type="float"/>
</attribute>
<!-- Z -->
<attribute name="angle">
<data type="float"/>
</attribute>
<attribute name="offsetx">
<data type="float"/>
</attribute>
<attribute name="offsetz">
<data type="float"/>
</attribute>
</interleave>
</element>
</optional>
<optional>
<element name="particles">
<attribute name="file"/>
</optional>
<optional>
<attribute name="frequency">
<data type="nonNegativeInteger"/>
</attribute>
</optional>
<optional>
<element name="mesh">
<text/>
</element>
</optional>
<optional>
<element name="textures">
<zeroOrMore>
<element name="texture">
<interleave>
<optional>
<attribute name="file"/>
</optional>
<attribute name="name"/>
</interleave>
</element>
</zeroOrMore>
</element>
</optional>
<optional>
<element name="decal">
<interleave>
<attribute name="width">
<data type="float"/>
</attribute>
<!-- X -->
<attribute name="depth">
<data type="float"/>
</attribute>
<!-- Z -->
<attribute name="angle">
<data type="float"/>
</attribute>
<attribute name="offsetx">
<data type="float"/>
</attribute>
<attribute name="offsetz">
<data type="float"/>
</attribute>
</interleave>
</element>
</optional>
<optional>
<element name="particles">
<attribute name="file"/>
</element>
</optional>
<optional>
<element name="color">
<list>
<group>
<data type="nonNegativeInteger"/>
<!-- R -->
<data type="nonNegativeInteger"/>
<!-- G -->
<data type="nonNegativeInteger"/>
</group>
<!-- B -->
</list>
</element>
</optional>
<optional>
<element name="animations">
<zeroOrMore>
<element name="animation">
<interleave>
<attribute name="name"/>
<optional>
<attribute name="id"/>
</optional>
<optional>
<attribute name="frequency">
<data type="nonNegativeInteger"/>
</attribute>
</optional>
<optional>
<attribute name="file"/>
</optional>
<attribute name="speed">
</element>
</optional>
<optional>
<element name="color">
<list>
<group>
<data type="nonNegativeInteger"/>
<!-- R -->
<data type="nonNegativeInteger"/>
<!-- G -->
<data type="nonNegativeInteger"/>
</group>
<!-- B -->
</list>
</element>
</optional>
<optional>
<element name="animations">
<zeroOrMore>
<element name="animation">
<interleave>
<attribute name="name"/>
<optional>
<attribute name="id"/>
</optional>
<optional>
<attribute name="frequency">
<data type="nonNegativeInteger"/>
</attribute>
<optional>
<attribute name="event">
<data type="decimal">
<param name="minInclusive">0</param>
<param name="maxInclusive">1</param>
</data>
</attribute>
</optional>
<optional>
<attribute name="load">
<data type="decimal">
<param name="minInclusive">0</param>
<param name="maxInclusive">1</param>
</data>
</attribute>
</optional>
<optional>
<attribute name="sound">
<data type="decimal">
<param name="minInclusive">0</param>
<param name="maxInclusive">1</param>
</data>
</attribute>
</optional>
</interleave>
</element>
</zeroOrMore>
</element>
</optional>
</optional>
<optional>
<attribute name="file"/>
</optional>
<attribute name="speed">
<data type="nonNegativeInteger"/>
</attribute>
<optional>
<attribute name="event">
<data type="decimal">
<param name="minInclusive">0</param>
<param name="maxInclusive">1</param>
</data>
</attribute>
</optional>
<optional>
<attribute name="load">
<data type="decimal">
<param name="minInclusive">0</param>
<param name="maxInclusive">1</param>
</data>
</attribute>
</optional>
<optional>
<attribute name="sound">
<data type="decimal">
<param name="minInclusive">0</param>
<param name="maxInclusive">1</param>
</data>
</attribute>
</optional>
</interleave>
</element>
</zeroOrMore>
</element>
</optional>
<optional>
<element name="props">
<zeroOrMore>
<element name="prop">
<interleave>
<optional>
<attribute name="actor"/>
</optional>
<attribute name="attachpoint"/>
<optional>
<attribute name="minheight">
<data type="float"/>
</attribute>
</optional>
<optional>
<attribute name="maxheight">
<data type="float"/>
</attribute>
</optional>
<optional>
<attribute name="selectable">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
</interleave>
</element>
</zeroOrMore>
</element>
</optional>
</interleave>
</element>
</zeroOrMore>
</element>
</define>
<define name="actorDef">
<interleave>
<attribute name="version">
<data type="positiveInteger"/>
</attribute>
<zeroOrMore>
<ref name="group"/>
</zeroOrMore>
<optional>
<element name="castshadow">
<ref name="qualitySettings"/>
<!-- flag; true if present -->
<empty/>
</element>
</optional>
<optional>
<element name="float">
<ref name="qualitySettings"/>
<!-- flag; true if present -->
<empty/>
</element>
</optional>
<optional>
<element name="material">
<ref name="qualitySettings"/>
<text/>
</element>
</optional>
</interleave>
</define>
<start>
<choice>
<element name="actor">
<ref name="actorDef"/>
</element>
<element name="qualitylevels">
<interleave>
<attribute name="version">
<data type="positiveInteger"/>
</attribute>
<oneOrMore>
<element name="actor">
<optional>
<element name="props">
<zeroOrMore>
<element name="prop">
<interleave>
<optional>
<attribute name="actor"/>
</optional>
<attribute name="attachpoint"/>
<optional>
<attribute name="minheight">
<data type="float"/>
</attribute>
</optional>
<optional>
<attribute name="maxheight">
<data type="float"/>
</attribute>
</optional>
<optional>
<attribute name="selectable">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
</interleave>
</element>
</zeroOrMore>
</element>
<attribute name="quality">
<a:help>The quality level to use for this actor. This is the maximum value at which this version of the actor will be used. If not specified, the maximum possible value is assumed.</a:help>
<ref name="qualityLevels"/>
</attribute>
</optional>
</interleave>
</element>
</zeroOrMore>
<choice>
<attribute name="inline">
<empty/>
</attribute>
<attribute name="file">
<text/>
</attribute>
<ref name="actorDef"/>
</choice>
</element>
</oneOrMore>
<optional>
<element name="inline">
<ref name="actorDef"/>
</element>
</optional>
</interleave>
</element>
</zeroOrMore>
<optional>
<element name="castshadow">
<!-- flag; true if present -->
<empty/>
</element>
</optional>
<optional>
<element name="float">
<!-- flag; true if present -->
<empty/>
</element>
</optional>
<optional>
<element name="material">
<text/>
</element>
</optional>
</interleave>
</element>
</choice>
</start>
</grammar>
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<actor version="1">
<castshadow/>
<group>
<variant name="decal_campaign_argolis">
<decal angle="45" depth="25" offsetx="0" offsetz="0" width="100"/>
<textures><texture file="campaigns/labels/greece_argolis.png" name="baseTex"/></textures>
<textures>
<texture file="campaigns/labels/greece_argolis.png" name="baseTex"/>
</textures>
</variant>
</group>
<material>terrain_base.xml</material>
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<actor version="1">
<castshadow/>
<group>
<variant name="decal_campaign_attica">
<decal angle="45" depth="25" offsetx="0" offsetz="0" width="100"/>
<textures><texture file="campaigns/labels/greece_attica.png" name="baseTex"/></textures>
<textures>
<texture file="campaigns/labels/greece_attica.png" name="baseTex"/>
</textures>
</variant>
</group>
<material>terrain_base.xml</material>
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<actor version="1">
<castshadow/>
<group>
<variant name="decal_campaign_boeotia">
<decal angle="45" depth="25" offsetx="0" offsetz="0" width="100"/>
<textures><texture file="campaigns/labels/greece_boeotia.png" name="baseTex"/></textures>
<textures>
<texture file="campaigns/labels/greece_boeotia.png" name="baseTex"/>
</textures>
</variant>
</group>
<material>terrain_base.xml</material>
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<actor version="1">
<castshadow/>
<group>
<variant name="decal_campaign_chalcis">
<decal angle="45" depth="25" offsetx="0" offsetz="0" width="100"/>
<textures><texture file="campaigns/labels/greece_chalcis.png" name="baseTex"/></textures>
<textures>
<texture file="campaigns/labels/greece_chalcis.png" name="baseTex"/>
</textures>
</variant>
</group>
<material>terrain_base.xml</material>
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<actor version="1">
<castshadow/>
<group>
<variant name="decal_campaign_corinthia">
<decal angle="45" depth="25" offsetx="0" offsetz="0" width="100"/>
<textures><texture file="campaigns/labels/greece_corinthia.png" name="baseTex"/></textures>
<textures>
<texture file="campaigns/labels/greece_corinthia.png" name="baseTex"/>
</textures>
</variant>
</group>
<material>terrain_base.xml</material>
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<actor version="1">
<castshadow/>
<group>
<variant name="decal_campaign_delphi">
<decal angle="45" depth="25" offsetx="0" offsetz="0" width="100"/>
<textures><texture file="campaigns/labels/greece_delphi.png" name="baseTex"/></textures>
<textures>
<texture file="campaigns/labels/greece_delphi.png" name="baseTex"/>
</textures>
</variant>
</group>
<material>terrain_base.xml</material>
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<actor version="1">
<castshadow/>
<group>
<variant name="decal_campaign_eretria">
<decal angle="45" depth="25" offsetx="0" offsetz="0" width="100"/>
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<actor version="1">
<castshadow/>
<group>
<variant name="decal_campaign_laconia">
<decal angle="45" depth="25" offsetx="0" offsetz="0" width="100"/>
<textures><texture file="campaigns/labels/greece_laconia.png" name="baseTex"/></textures>
<textures>
<texture file="campaigns/labels/greece_laconia.png" name="baseTex"/>
</textures>
</variant>
</group>
<material>terrain_base.xml</material>
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<actor version="1">
<castshadow/>
<group>
<variant name="decal_campaign_megara">
<decal angle="45" depth="25" offsetx="0" offsetz="0" width="100"/>
<textures><texture file="campaigns/labels/greece_megara.png" name="baseTex"/></textures>
<textures>
<texture file="campaigns/labels/greece_megara.png" name="baseTex"/>
</textures>
</variant>
</group>
<material>terrain_base.xml</material>
@@ -1,56 +1,45 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<?xml version="1.0" encoding="utf-8"?>
<actor version="1">
<castshadow/>
<group>
<variant frequency="1" name="trunk-a">
<mesh>gaia/tree_acacia_a.dae</mesh>
<props>
<prop actor="flora/trees/acacia_top_a.xml" attachpoint="root"/>
<prop actor="flora/trees/acacia_branches_a.xml" attachpoint="root"/>
</props>
</variant>
<variant frequency="1" name="trunk-b">
<mesh>gaia/tree_acacia_b.dae</mesh>
<props>
<prop actor="flora/trees/acacia_top_b.xml" attachpoint="root"/>
<prop actor="flora/trees/acacia_branches_b.xml" attachpoint="root"/>
</props>
</variant>
<variant frequency="1" name="trunk-c">
<mesh>gaia/tree_acacia_c.dae</mesh>
<props>
<prop actor="flora/trees/acacia_top_c.xml" attachpoint="root"/>
<prop actor="flora/trees/acacia_branches_c.xml" attachpoint="root"/>
<variant frequency="1" name="Acacia">
<props>
<prop actor="flora/trees/acacia_top.xml" attachpoint="root"/>
</props>
</variant>
<variant frequency="1" name="trunk-d">
<mesh>gaia/tree_acacia_d.dae</mesh>
<props>
<prop actor="flora/trees/acacia_top_d.xml" attachpoint="root"/>
<prop actor="flora/trees/acacia_branches_d.xml" attachpoint="root"/>
</props>
</variant>
<variant frequency="1" name="trunk-e">
<mesh>gaia/tree_acacia_e.dae</mesh>
<props>
<prop actor="flora/trees/acacia_top_e.xml" attachpoint="root"/>
<prop actor="flora/trees/acacia_branches_e.xml" attachpoint="root"/>
</props>
<textures>
<texture file="gaia/acacia.png" name="baseTex"/>
</textures>
</variant>
</group>
<group>
<variant name="trunk-texture">
<textures><texture file="gaia/tree_dead.dds" name="baseTex"/></textures>
<!-- Need to keep the variant names in sync with the children. -->
<variant frequency="1" name="Variant-01">
<mesh>gaia/trees/trunks/acacia_01.dae</mesh>
</variant>
<variant frequency="5" name="Variant-02">
<mesh>gaia/trees/trunks/acacia_02.dae</mesh>
</variant>
<variant frequency="6" name="Variant-03">
<mesh>gaia/trees/trunks/acacia_03.dae</mesh>
</variant>
<variant frequency="1" name="Variant-04">
<mesh>gaia/trees/trunks/acacia_04.dae</mesh>
</variant>
<variant frequency="1" name="Variant-05">
<mesh>gaia/trees/trunks/acacia_05.dae</mesh>
</variant>
<variant frequency="10" name="Variant-06">
<mesh>gaia/trees/trunks/acacia_06.dae</mesh>
</variant>
<variant frequency="1" name="Variant-07">
<mesh>gaia/trees/trunks/acacia_07.dae</mesh>
</variant>
<variant frequency="2" name="Variant-08">
<mesh>gaia/trees/trunks/acacia_08.dae</mesh>
</variant>
<variant frequency="1" name="Variant-09">
<mesh>gaia/trees/trunks/acacia_09.dae</mesh>
</variant>
</group>
<material>basic_trans_wind.xml</material>
<material>trans_wind.xml</material>
</actor>
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<actor version="1">
<castshadow/>
<group>
<variant frequency="1" name="acacia-branches-mesh-a">
<mesh>gaia/tree_acacia_branches_a.dae</mesh>
</variant>
</group>
<group>
<variant frequency="1" name="acacia-dead-branches">
<textures><texture file="gaia/tree_dead_branches.png" name="baseTex"/></textures>
</variant>
</group>
<material>basic_trans_wind.xml</material>
</actor>
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<actor version="1">
<castshadow/>
<group>
<variant frequency="1" name="acacia-branches-mesh-b">
<mesh>gaia/tree_acacia_branches_b.dae</mesh>
</variant>
</group>
<group>
<variant frequency="1" name="acacia-dead-branches">
<textures><texture file="gaia/tree_dead_branches.png" name="baseTex"/></textures>
</variant>
</group>
<material>basic_trans_wind.xml</material>
</actor>
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<actor version="1">
<castshadow/>
<group>
<variant frequency="1" name="acacia-branches-mesh-c">
<mesh>gaia/tree_acacia_branches_c.dae</mesh>
</variant>
</group>
<group>
<variant frequency="1" name="acacia-dead-branches">
<textures><texture file="gaia/tree_dead_branches.png" name="baseTex"/></textures>
</variant>
</group>
<material>basic_trans_wind.xml</material>
</actor>
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<actor version="1">
<castshadow/>
<group>
<variant frequency="1" name="acacia-branches-mesh-d">
<mesh>gaia/tree_acacia_branches_d.dae</mesh>
</variant>
</group>
<group>
<variant frequency="1" name="acacia-dead-branches">
<textures><texture file="gaia/tree_dead_branches.png" name="baseTex"/></textures>
</variant>
</group>
<material>basic_trans_wind.xml</material>
</actor>
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<actor version="1">
<castshadow/>
<group>
<variant frequency="1" name="acacia-branches-mesh-e">
<mesh>gaia/tree_acacia_branches_e.dae</mesh>
</variant>
</group>
<group>
<variant frequency="1" name="acacia-dead-branches">
<textures><texture file="gaia/tree_dead_branches.png" name="baseTex"/></textures>
</variant>
</group>
<material>basic_trans_wind.xml</material>
</actor>
@@ -2,20 +2,20 @@
<actor version="1">
<castshadow/>
<group>
<variant name="a">
<textures>
<texture file="gaia/acacia_thorns_1.png" name="baseTex"/>
</textures>
</variant>
<variant name="b">
<textures>
<texture file="gaia/acacia_1.png" name="baseTex"/>
</textures>
<variant frequency="1" name="Acacia Bush">
<mesh>gaia/acacia_bush_small_1.dae</mesh>
</variant>
</group>
<group>
<variant frequency="4" name="1">
<mesh>gaia/acacia_bush_small_1.dae</mesh>
<variant frequency="1" name="Thorns-01">
<textures>
<texture file="gaia/acacia_bush_thorns_01.png" name="baseTex"/>
</textures>
</variant>
<variant frequency="1" name="Thorns-02">
<textures>
<texture file="gaia/acacia_bush_thorns_02.png" name="baseTex"/>
</textures>
</variant>
</group>
<material>basic_trans_wind.xml</material>
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<actor version="1">
<castshadow/>
<group>
<variant frequency="1" name="Acacia Top">
<textures>
<texture file="gaia/acacia.png" name="baseTex"/>
</textures>
</variant>
</group>
<group>
<!-- Need to keep the variant names in sync with the parent. -->
<variant frequency="1" name="Variant-01">
<mesh>gaia/trees/leaves/acacia_01.dae</mesh>
</variant>
<variant frequency="5" name="Variant-02">
<mesh>gaia/trees/leaves/acacia_02.dae</mesh>
</variant>
<variant frequency="6" name="Variant-03">
<mesh>gaia/trees/leaves/acacia_03.dae</mesh>
</variant>
<variant frequency="1" name="Variant-04">
<mesh>gaia/trees/leaves/acacia_04.dae</mesh>
</variant>
<variant frequency="1" name="Variant-05">
<mesh>gaia/trees/leaves/acacia_05.dae</mesh>
</variant>
<variant frequency="10" name="Variant-06">
<mesh>gaia/trees/leaves/acacia_06.dae</mesh>
</variant>
<variant frequency="1" name="Variant-07">
<mesh>gaia/trees/leaves/acacia_07.dae</mesh>
</variant>
<variant frequency="2" name="Variant-08">
<mesh>gaia/trees/leaves/acacia_08.dae</mesh>
</variant>
<variant frequency="1" name="Variant-09">
<mesh>gaia/trees/leaves/acacia_09.dae</mesh>
</variant>
</group>
<material>basic_trans_wind.xml</material>
</actor>
@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<actor version="1">
<castshadow/>
<group>
<variant frequency="1" name="acacia-top-mesh-a">
<mesh>gaia/tree_acacia_top_a.dae</mesh>
</variant>
</group>
<group>
<variant frequency="2" name="acacia-top-texture-a">
<textures><texture file="gaia/tree_carob_c.dds" name="baseTex"/></textures>
</variant>
<variant frequency="1" name="acacia-top-texture-b">
<textures><texture file="gaia/tree_baobab_b.dds" name="baseTex"/></textures>
</variant>
</group>
<material>basic_trans_wind.xml</material>
</actor>
@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<actor version="1">
<castshadow/>
<group>
<variant frequency="1" name="acacia-top-mesh-b">
<mesh>gaia/tree_acacia_top_b.dae</mesh>
</variant>
</group>
<group>
<variant frequency="2" name="acacia-top-texture-a">
<textures><texture file="gaia/tree_carob_c.dds" name="baseTex"/></textures>
</variant>
<variant frequency="1" name="acacia-top-texture-b">
<textures><texture file="gaia/tree_baobab_b.dds" name="baseTex"/></textures>
</variant>
</group>
<material>basic_trans_wind.xml</material>
</actor>
@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<actor version="1">
<castshadow/>
<group>
<variant frequency="1" name="acacia-top-mesh-c">
<mesh>gaia/tree_acacia_top_c.dae</mesh>
</variant>
</group>
<group>
<variant frequency="2" name="acacia-top-texture-a">
<textures><texture file="gaia/tree_carob_c.dds" name="baseTex"/></textures>
</variant>
<variant frequency="1" name="acacia-top-texture-b">
<textures><texture file="gaia/tree_baobab_b.dds" name="baseTex"/></textures>
</variant>
</group>
<material>basic_trans_wind.xml</material>
</actor>
@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<actor version="1">
<castshadow/>
<group>
<variant frequency="1" name="acacia-top-mesh-d">
<mesh>gaia/tree_acacia_top_d.dae</mesh>
</variant>
</group>
<group>
<variant frequency="2" name="acacia-top-texture-a">
<textures><texture file="gaia/tree_carob_c.dds" name="baseTex"/></textures>
</variant>
<variant frequency="1" name="acacia-top-texture-b">
<textures><texture file="gaia/tree_baobab_b.dds" name="baseTex"/></textures>
</variant>
</group>
<material>basic_trans_wind.xml</material>
</actor>
@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<actor version="1">
<castshadow/>
<group>
<variant frequency="1" name="acacia-top-mesh-e">
<mesh>gaia/tree_acacia_top_e.dae</mesh>
</variant>
</group>
<group>
<variant frequency="2" name="acacia-top-texture-a">
<textures><texture file="gaia/tree_carob_c.dds" name="baseTex"/></textures>
</variant>
<variant frequency="1" name="acacia-top-texture-b">
<textures><texture file="gaia/tree_baobab_b.dds" name="baseTex"/></textures>
</variant>
</group>
<material>basic_trans_wind.xml</material>
</actor>
@@ -1,36 +1,29 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<actor version="1">
<castshadow/>
<group>
<group>
<variant frequency="1" name="trunk-b">
<mesh>gaia/tree_oak_new_b.dae</mesh>
</variant>
<variant frequency="1" name="trunk-c">
<mesh>gaia/tree_oak_new_c.dae</mesh>
</variant>
<variant frequency="1" name="trunk-d">
<mesh>gaia/tree_oak_new_d.dae</mesh>
</variant>
<variant frequency="1" name="trunk-e">
<mesh>gaia/tree_oak_new_e.dae</mesh>
</variant>
<variant frequency="1" name="trunk-f">
<mesh>gaia/tree_oak_new_f.dae</mesh>
</variant>
</group>
<group>
<variant name="trunk-texture">
<textures><texture file="gaia/tree_dead.dds" name="baseTex"/></textures>
</variant>
</group>
<group>
<variant name="trunk-texture">
<textures>
<texture file="gaia/tree_dead.dds" name="baseTex"/>
</textures>
</variant>
</group>
<material>basic_trans_wind.xml</material>
</actor>
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<actor version="1">
<castshadow/>
<group>
<variant frequency="1" name="Metal Mine Round Aegean Anatolian">
<props>
<prop actor="particle/sparkle_goldmine.xml" attachpoint="root"/>
</props>
<textures>
<texture file="gaia/metal_round_col_aegean.png" name="baseTex"/>
<texture file="gaia/stonemine_round_spec.png" name="specTex"/>
<texture file="gaia/stonemine_round_normal.png" name="normTex"/>
</textures>
</variant>
</group>
<group>
<variant frequency="1" name="Round Mesh A">
<mesh>gaia/stonemine_round_a.dae</mesh>
</variant>
<variant frequency="1" name="Round Mesh B">
<mesh>gaia/stonemine_round_b.dae</mesh>
</variant>
</group>
<material>no_trans_norm_spec.xml</material>
</actor>
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<actor version="1">
<castshadow/>
<group>
<variant frequency="1" name="Metal Mine Square Aegean Anatolian">
<props>
<prop actor="particle/sparkle_goldmine.xml" attachpoint="root"/>
</props>
<textures>
<texture file="gaia/metal_square_col_aegean.png" name="baseTex"/>
<texture file="gaia/stonemine_square_spec.png" name="specTex"/>
<texture file="gaia/stonemine_square_normal.png" name="normTex"/>
</textures>
</variant>
</group>
<group>
<variant frequency="1" name="Square Mesh A">
<mesh>gaia/stonemine_square_a.dae</mesh>
</variant>
<variant frequency="1" name="Square Mesh B">
<mesh>gaia/stonemine_square_b.dae</mesh>
</variant>
</group>
<material>no_trans_norm_spec.xml</material>
</actor>
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<actor version="1">
<castshadow/>
<group>
<variant frequency="1" name="Metal Mine Round India">
<props>
<prop actor="props/structures/decals/gravel_savanna_3v3.xml" attachpoint="root"/>
<prop actor="particle/sparkle_goldmine.xml" attachpoint="root"/>
</props>
<textures>
<texture file="gaia/metal_round_col_india.png" name="baseTex"/>
<texture file="gaia/stonemine_round_spec.png" name="specTex"/>
<texture file="gaia/stonemine_round_normal.png" name="normTex"/>
</textures>
</variant>
</group>
<group>
<variant frequency="1" name="Round Mesh A">
<mesh>gaia/stonemine_round_a.dae</mesh>
</variant>
<variant frequency="1" name="Round Mesh B">
<mesh>gaia/stonemine_round_b.dae</mesh>
</variant>
</group>
<material>no_trans_norm_spec.xml</material>
</actor>
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<actor version="1">
<castshadow/>
<group>
<variant frequency="1" name="Metal Mine Square India">
<props>
<prop actor="props/structures/decals/gravel_savanna_3v3.xml" attachpoint="root"/>
<prop actor="particle/sparkle_goldmine.xml" attachpoint="root"/>
</props>
<textures>
<texture file="gaia/metal_square_col_india.png" name="baseTex"/>
<texture file="gaia/stonemine_square_spec.png" name="specTex"/>
<texture file="gaia/stonemine_square_normal.png" name="normTex"/>
</textures>
</variant>
</group>
<group>
<variant frequency="1" name="Square Mesh A">
<mesh>gaia/stonemine_square_a.dae</mesh>
</variant>
<variant frequency="1" name="Square Mesh B">
<mesh>gaia/stonemine_square_b.dae</mesh>
</variant>
</group>
<material>no_trans_norm_spec.xml</material>
</actor>
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<actor version="1">
<castshadow/>
<group>
<variant frequency="1" name="Metal Mine Round India">
<props>
<prop actor="props/structures/decals/gravel_sahara_3v3.xml" attachpoint="root"/>
<prop actor="particle/sparkle_goldmine.xml" attachpoint="root"/>
</props>
<textures>
<texture file="gaia/metal_round_col_sahara.png" name="baseTex"/>
<texture file="gaia/stonemine_round_spec.png" name="specTex"/>
<texture file="gaia/stonemine_round_normal.png" name="normTex"/>
</textures>
</variant>
</group>
<group>
<variant frequency="1" name="Round Mesh A">
<mesh>gaia/stonemine_round_a.dae</mesh>
</variant>
<variant frequency="1" name="Round Mesh B">
<mesh>gaia/stonemine_round_b.dae</mesh>
</variant>
</group>
<material>no_trans_norm_spec.xml</material>
</actor>
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<actor version="1">
<castshadow/>
<group>
<variant frequency="1" name="Metal Mine Square India">
<props>
<prop actor="props/structures/decals/gravel_sahara_3v3.xml" attachpoint="root"/>
<prop actor="particle/sparkle_goldmine.xml" attachpoint="root"/>
</props>
<textures>
<texture file="gaia/metal_square_col_sahara.png" name="baseTex"/>
<texture file="gaia/stonemine_square_spec.png" name="specTex"/>
<texture file="gaia/stonemine_square_normal.png" name="normTex"/>
</textures>
</variant>
</group>
<group>
<variant frequency="1" name="Square Mesh A">
<mesh>gaia/stonemine_square_a.dae</mesh>
</variant>
<variant frequency="1" name="Square Mesh B">
<mesh>gaia/stonemine_square_b.dae</mesh>
</variant>
</group>
<material>no_trans_norm_spec.xml</material>
</actor>
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<actor version="1">
<castshadow/>
<group>
<variant frequency="1" name="Metal Mine Round Temperate">
<props>
<prop actor="particle/sparkle_goldmine.xml" attachpoint="root"/>
</props>
<textures>
<texture file="gaia/metal_round_col_temperate.png" name="baseTex"/>
<texture file="gaia/stonemine_round_spec.png" name="specTex"/>
<texture file="gaia/stonemine_round_normal.png" name="normTex"/>
</textures>
</variant>
</group>
<group>
<variant frequency="1" name="Round Mesh A">
<mesh>gaia/stonemine_round_a.dae</mesh>
</variant>
<variant frequency="1" name="Round Mesh B">
<mesh>gaia/stonemine_round_b.dae</mesh>
</variant>
</group>
<material>no_trans_norm_spec.xml</material>
</actor>
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<actor version="1">
<castshadow/>
<group>
<variant frequency="1" name="Metal Mine Square Temperate">
<props>
<prop actor="particle/sparkle_goldmine.xml" attachpoint="root"/>
</props>
<textures>
<texture file="gaia/metal_square_col_temperate.png" name="baseTex"/>
<texture file="gaia/stonemine_square_spec.png" name="specTex"/>
<texture file="gaia/stonemine_square_normal.png" name="normTex"/>
</textures>
</variant>
</group>
<group>
<variant frequency="1" name="Square Mesh A">
<mesh>gaia/stonemine_square_a.dae</mesh>
</variant>
<variant frequency="1" name="Square Mesh B">
<mesh>gaia/stonemine_square_b.dae</mesh>
</variant>
</group>
<material>no_trans_norm_spec.xml</material>
</actor>

Some files were not shown because too many files have changed in this diff Show More