1
0
forked from mirrors/0ad
Commit Graph

25373 Commits

Author SHA1 Message Date
Atrik 426693ebef Default hotkeys changes
Reassign 'Toggle mouse grab' to F3 to avoid conflicts with gameplay hotkeys

Unassign 'Show status bars' often toggled by mistake by new players and confused for a selection bug

Assign 'Bird eye view' to Shift+Tab
2025-11-26 16:42:18 +01:00
Vantha ccd1046d67 Parallelize the execution of range queries
Use futures to spawn several threads that concurrently work through the
active range queries each turn instead of doing everything serially on
the main thread -- similar to how the pathfinder computes pathfinding
requests asynchronously. This significantly increases performance.
Note: It still can't run in parallel to the rest of the simulation update since
the range computations depend on the state of the simulation (like the
position of units).
2025-11-26 16:10:29 +01:00
real_tabasco_sauce a32a28a5e3 Add capture animations for citizens
Fixes #8557
2025-11-25 17:41:55 +01:00
Vantha ab49af1b1c Correct the name of the Germans' sandbox map 2025-11-25 10:52:37 +01:00
Vantha 36e93989d4 Correct some settings of the Germans' sandbox map 2025-11-25 10:29:30 +01:00
Ralph Sennhauser 7452bf882f Add test for loading players templates
Checks that those templates can be loaded, i.e. are adhering to the
schema.

Refs: #8540
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-11-22 08:41:02 +01:00
phosit 9a526bcae1 Throw error when simulation script can't be loaded
When a script in "simulation/helpers/" contained an error. Files in
"simulation/components" aren't loaded. The return value of
`LoadDefaultScripts` indicated an error but was ignored. The simulation
still tried to start.

Now instead of returning a ignoreable error code the error is thrown. In
the common path the error is implicitly rethrown to the JS-function
which tried to start the game.

fixes: #8133
2025-11-20 19:38:36 +01:00
phosit 977bf5c0d1 Don't pass the AppHooks as pointer
It's not permitted to pass a nullptr to the `app_hooks_update`. So a
reference should be used.

CppCheck says one shouldn't take pointer to a temporary.
2025-11-20 19:38:33 +01:00
phosit b17c2fb80f Use designatet initializers for AppHooks
CppCheck wasn't able to handle `{0}`. C++20 allows to use designated
initializers.
2025-11-20 19:37:50 +01:00
phosit 3c9b4b922e Make getCameraProperty a lambda
A lambda is more explicit which argument it takes.
2025-11-18 20:02:06 +01:00
phosit 5b1ce0957d Make getEnvironmentProperty a lambda
A lambda is more explicit which argument it takes.
2025-11-18 20:02:06 +01:00
phosit 3d26b9123a Make getTerrainProperty a lambda
A lambda is more explicit which argument it takes.
2025-11-18 20:02:06 +01:00
Vantha 44984699f1 Remove some invalid entries from messages.json
'StatusName', 'ApplierTooltip' and 'ReceiverTooltip' are attributes of status
effects, which are defined in JSON files (and already extracted
correctly from there), not XMLs.
2025-11-18 11:34:10 +01:00
Vantha 7032293207 Add context and comment attributes where useful
Add context and comment attributes to all translated XML elements in the
simulation that can specify any string -- unlike "Rank", which has to be
"Basic", "Advanced", or "Elite".
Most of them aren't used right now, but they can be in the
future and by mods, without touching the schemas again.

Fixes #8540
2025-11-18 11:34:10 +01:00
Stan 84d4dbc506 Use Future for the userreporter
Previously we relied on a raw thread.
Pull Request: #8537
Reviewed by: @phosit
Refs: #5874
2025-11-17 21:45:00 +01:00
Ralph Sennhauser 5609492731 Add Atlas support to Appimage
Include the shared library libAtlasUI.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-11-15 16:29:01 +01:00
Vantha faa049fe4b Don't set up command and selection panels twice
In the (common) case that the player controls all selected units or is
an observer, the 'Selection' and 'Command' panels were set up ahead and
then in the for loop again, which was wasteful.
2025-11-14 10:59:45 +01:00
Vantha 83fc0dbca8 Only load command buttons that will be displayed
There are currently 19 entity commands in total, but only the first 6
possible (depends on the active selection, e.g. patrolling isn't
possible if no units are selected) ones are ever displayed as buttons
(defined by g_SelectionPanels.Command.getMaxNumberOfItems)  However,
when updating (once per turn or whenever the selection changes),
g_SelectionPanels.Command.getItems always called `getInfo` on all of
them, even though all data computed after the first 6 wasn't read or
used anywhere later. So, stopping immediately after the 6th and never
returning an array longer than 6 saves all of the dead time without
affecting the outcome in any way.

It's important to mention, that this issue isn't exclusive to the
'Command' selection panel: the getItems methods of the other panels can
also return an array longer than their getMaxNumbertOfItems value
(that's why they specify it in the first place). However, for the
command panel this happens for many common selections and seemingly to
by far the largest extent. For the other panels it happens much more
rarely, only for especially large and obscure selections, and even then
does not have nearly as big of an impact. So, modifying the other
getItems methods as well (to never return too many items) is probably
not worth it, and the more robust solution is to instead keep the
safeguard system of getMaxNumbertOfItems.
2025-11-14 10:59:45 +01:00
phosit 6bdcab11b9 Don't forward declare CompiledModule
When using `std::unordered_map` it's types have to be complete.
2025-11-13 19:50:38 +01:00
Ralph Sennhauser 68a7abb3b3 Add C++ feature test pipeline
This adds the feature check code found on cppreference [1] and a Jenkins
pipeline to generate a feature status list for all platforms.

Aggregate a summary and upload it to docs.wildfiregames.com

[1] https://en.cppreference.com/w/cpp/experimental/feature_test.html

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-11-12 18:28:59 +01:00
Ralph Sennhauser 9ffbf15ee1 Fix -Wunnecessary-virtual-specifier warnings
Commit 3eee3a444d added final keyword to
simulation classes but left virtual keywords in place.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-11-11 21:35:01 +01:00
Ralph Sennhauser 66738c12a1 Suppress false positive in cppcheck
```
source/simulation2/components/CCmpRangeManager.cpp:1953:18: error: Out of bounds access in 'm_LosRevealAll[MAX_LOS_PLAYER_ID+1]', if 'm_LosRevealAll' size is 16 and 'MAX_LOS_PLAYER_ID+1' is 17 [containerOutOfBounds]
   m_LosRevealAll[MAX_LOS_PLAYER_ID+1] = enabled;
                 ^
source/simulation2/components/CCmpRangeManager.cpp:1967:21: error: Out of bounds access in 'm_LosRevealAll[MAX_LOS_PLAYER_ID+1]', if 'm_LosRevealAll' size is 16 and 'MAX_LOS_PLAYER_ID+1' is 17 [containerOutOfBounds]
  if (m_LosRevealAll[MAX_LOS_PLAYER_ID+1] || player == -1)
                    ^
```

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-11-11 21:35:01 +01:00
Ralph Sennhauser 9ea5a789a7 Fix EntityMap::iterator
Fixes cppcheck error
```
source/simulation2/system/EntityMap.h:104:11: error: Reference to local variable returned. [returnReference]
   return ptr;
```

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-11-11 21:35:01 +01:00
phosit 354ed957dc Extend appdata.xml for 0.28.0 2025-11-11 18:09:41 +01:00
joeybadz c6b8593bdf Remove duplicate fertility festival tech in German tech tree 2025-11-11 02:50:33 +01:00
Vladislav Belov c0ea17f06e Replaces choosedDeviceIt by chosenDeviceIt 2025-11-11 01:51:16 +01:00
Vladislav Belov 485200342d Disables Vulkan devices sorting by default
Currently we always choose the best device. But it's not always
desirable. A more safe approach is to use the default device (with
index 0). The only downside of that is if a user didn't adjust
settings then the game might run on an integrated GPU instead of a
discrete one. In the future it'll be solved by selecting GPU in
options: #8529

Fixes #8455
2025-11-11 01:50:58 +01:00
obelix 479995bc6f Change BuildTime of Gaul Arrow Ship 2025-11-11 00:14:34 +01:00
obelix 90847e0591 Change BuildTime of Brit Arrow Ship 2025-11-11 00:14:34 +01:00
Vantha 19f6dd031d Improve the SpecificName of Celtic civilians
While "Brogiacos" and "Tegesacos" fit in terms of meaning, they are only
reconstructed words, "Ambactos" on the other hand is attested and
actually historically relevant.
2025-11-10 22:55:42 +01:00
Ralph Sennhauser 4f6d4a91b0 Fix -Wtautological-overlap-compare in stun test
Fix the minimal check for an invalid IP returned.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-11-10 11:41:52 +01:00
Ralph Sennhauser 32edc28cda Fix reloading config for cinema
This fixes 7df7566d7c, which added
automatic switching off silhouettes in cinema mode while resetting the
value when leaving cinema mode. Reloading can only be done for a given
config namespace.

Fixes: #7552
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-11-10 06:45:24 +01:00
Vladislav Belov c4bc6c9627 Adds an option to destroy Vulkan old swapchain before
Now it's possible to destroy the old swapchain before creating a new
one. It might make the swapchain creation a bit slower but with a
lower memory peak.
2025-11-10 00:06:52 +01:00
Vladislav Belov 8a64182ca2 Waits Vulkan device idle also on window resize
Fixes the case when a swapchain was recreated on resize rather than
by VK_ERROR_OUT_OF_DATE_KHR.
2025-11-10 00:06:51 +01:00
Vladislav Belov de36c75023 Deletes Vulkan resources on swapchain recreation
The change tries to minimize a memory peak during a window resizing.

Refs #6864
2025-11-10 00:06:41 +01:00
Vantha be83ba4029 Provide context for the translation of "Germans" 2025-11-09 22:52:32 +01:00
Vantha 5d4eab73f9 Improve the description of the Germans' civ bonus
Importantly, the word "Germans" is removed since it is prone to being
translated incorrectly and the other civ bonus descriptions don't
contain the civ's name either.
2025-11-09 22:52:32 +01:00
Vantha f38bc89611 Add SpecificNames to the Germanic units
The names are in Proto-Germanic and mostly taken from Wiktionary.
They can be confirmed by directly searching the individual
Proto-Germanic terms online.

Champion Cavalry: "Aþalaridjô" (noble+rider)
Cavalry Spearman: "Gaizaridjô" (spear+rider)
Cavalry Javelineer: "Skeutaridjô" (quick+rider)
Worker: "Būraz" (dweller, farmer) -- deliberately decided against the most literal translation,
	which would be "Arbijaz", because that seems to be more connected to serfdom and the unit
	rather represents a generic commoner.
Infantry Swordsman: "Swerdamannaz" (sword+man)
Infantry Spearman: "Gaizamannaz" (spear+man)
Infantry Clubman: "Kulbawigô" (staff/club+warrior)
Infantry Javelineer: "Gaizawerpanaz" (spear/javelin+thrower)
Infantry Slinger: "Slingwanaz" (swinger/slinger)
Scout Ship: "Skeutabaitaz" (quick+boat)
Fishing Boat: "Fiskārijaz" (fisherman)
Fire Ship: "Brandabaitaz" (fire+boat)
Arrow Ship: "Harjaskipą" (army/war+ship)
Wagon: "Wagnaz" (direct translation)
Priest: "Gudjô" (direct translation)
Ram: "Rammabagmaz" (strong+tree/beam)
Trader: "Kaupô" (direct translation, also part of the word used for the market)
Merchant(ship): "Mangārī" (direct translation, very similar to "Kaupô")
2025-11-09 22:52:32 +01:00
Vantha 05b1ac4559 Correct an overlooked 'Women' to 'Workers' 2025-11-09 22:52:32 +01:00
Vantha a71688fc2c Remove incorrect Germanic SpecificName
The SpecificName tag is meant to contain the name in the civ's native
language, Proto-Germanic for the Germans.
"Kriegsschiff", "Übungsbereich" and "Stadttor" on the other hand are
modern German words.
2025-11-09 22:52:32 +01:00
Vantha 4d9fc0bb53 Convert wrong Germanic SpecificNames to GenericNames
SpecificNames are meant to contain the names in the civ's native
language. The English names are supposed to in be the GenericName tag.
2025-11-09 22:52:32 +01:00
Vladislav Belov 8b1b1d28f8 Fixes missing Vulkan application version
Missing after dc830ccf55.
2025-11-09 12:58:16 +01:00
Stan 93706ae37c Add credits for Obskurias 2025-11-07 21:42:00 +00:00
phosit 2748a45fc6 Remove ScriptEvent with only one parameter
The effect is the same when the second parameter is defaulted.
2025-11-05 14:39:44 +01:00
phosit 7ccea4ace9 Remove *WithReturn duplication
This has been introduced in 1ed64439ea.
2025-11-05 14:39:44 +01:00
Vantha 75feace618 Add a sandbox map for the Germans 2025-11-04 11:09:34 +01:00
phosit 9588da1d94 Add Boiorix as the codename for Release 28 2025-11-02 21:18:44 +01:00
phosit d786ac2dce Suppress wrong positive of cppcheck in Game.cpp 2025-11-01 17:52:35 +01:00
phosit ef016884ab Pass debugOptions on construction of CSimulation2
The functions to set them explicitly are removed. This makes the
interface of `CSimulation2` smaller.

Also serializationtest and rejointest can't be active at the same time.
Add a warning about that and use a `std::variant`.
2025-11-01 17:31:54 +01:00
phosit 10afb7d856 Pass ooslog-activate flag on construction
This deduplicates the activation logic and removes the only
`m_EnableOOSLog` mutation.
2025-11-01 16:35:39 +01:00