Use `<filesystem>` instead of `truncate` and remove `truncate`
portability wrapper.
Add a helper function `StatusFromSystemError` to convert error_code to
`Status`.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Drop the use of lowlevel interfaces and consitently use the cpp
interface decupling it from systm dependent code.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
`this.events` is only valid during one turn. When it is used in the next
turnn it might be outdated. So it makes no sense to keep it alive untill
the next turn.
There is a workaround for an old bug with the use of wxCollapsiblePane.
As the widget itself is no longer in use, just remove the now dead code.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The terrain selection notebook is painful to navigate with a large
amount of tabs. Further the control is broken on macOS. As such replace
the wxNotebook with a wxChoicebook.
Fixes: #8705
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Interdependent content width in terrain selection panel results in GTK
throwing warnings. Don't expand the grid cell content.
Also wrap the grid to keep spacing consistent and not variable for the
terrain buttons.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
iwyu 0.26 now want's full declaration of TYPE in case of
std::vector<TYPE>, which is good as it allows the header to be
self standing.
There are some other changes suggested in part of the headers not being
updated when they should have been and some due to changes in iwyu
itself.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Add the header to iwyu mappings as private as the wx documentation
doesn't suggest otherwise.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
A regex-based
search across the codebase confirms there are no other instances
of "Man" that should be renamed to "Manager".
Variables were not renamed.
This commit performs code cleanup to improve
code clarity and consistency:
Remove redundant 'virtual' keywords from methods that are already marked
with 'final' or 'override', as well as reducing redundant 'override
final's to 'final'.
Previously, TreeSection was drawn before TrainerSection.
Reversing the order ensures TrainerSection layout is resolved first,
which fixes scroll state being computed against an incomplete
structree page render.
Fixes#8893
Instead of storing a single flat list of positions and data per
building, RallyPoint now stores them keyed by player ID. This lets
mutual allies independently set and display rally points on each
other's structures.
The GUI now allows selecting allied buildings with a rally point
and only shows the viewing player's own rally point data.
GuiInterface gets an OnUpdate handler to keep displayed positions
in sync when rally point targets move.
GetRallyPointCommands now takes raw position and data arrays instead
of a component reference. The network command field is also renamed
from "entities" to "structures".
Fixes#3115
The function was used as a fallback for when a platform specific approach
isn't available. Given that it effectively is a roundabout way to derive
it from argv[0] which we use as a generic fallback anyway just remove
it.
This further allows to make cxxtest optional.
Refs: #8618
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This is more reliable than argv[0] which is effectively used via
unix_ExecutablePathname. Also drop the fallback as it effectively is the
same as the generic fallback and blocks making cxxtest optional.
On FreeBSD the procfs is not mounted by default, so use a syscall
instead.
Refs: #8618
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The fallback is of little value and blocks making cxxtest an optional
build dependency. While at it use realpath instead of readlink.
Refs: #8618
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Remove stale NAN and INFINITY, both have equivalents since C++11 and
cleanup headers in wposix source file.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
I forgot to finish CSubmitScheduler synchronization in
7c84c23114. Even ++m_FrameID was
forgotten. And it worked at the time. A proper synchronization is
described in renderer/backend/Vulkan/SwapChain.h.
The disabled test are all broken one way or another. The maps used in
the tests got renamed. The pathfinder component got some performance
improvements which now require to call UpdateGrid() once before use.
Finally for the InitAttributes to be deep frozen they need to be an
object, so initialize them.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
test_hash depends on modmod for xml schemas. InitAttributes need to be
set as deep freezing expects them to be a valid object. The map used got
renamed at some point. Finally prior to running the sim PreInitGame()
and InitGame() need to be called.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Don't declare empty constructor and destructor, avoid c-style cast and
remove TODO about a bug that can't be reproduced any longer.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Unused and since C++17 not really valuable with std::aligned_alloc
(_aligned_malloc and _aligned_free in case of MSVC) available. We also
have an other similar interface with "lib/sysdep/vm.h".
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
KEY_DOWN means we need to check for the "down" values instead of "char"
value which differer for numpad.
Ref: #501
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
9 isn't a valid playerID, setting this value causes a JS error
and corrupting the viewport.
Further limit selectable max playerID to what the mapSettings say.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
In many places there are missing gaps/borders and where there are there
are almost random values used (2/3/4/5/8/10/15).
Add missing and standardize on using gaps 5 and 10 pixel only.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
getTotalQueueTime(queue) calculates total remaining
queue time of a production building.
getBuildingsSortedByQueueTime(entities), sorts building selection
by their queued training time and filter invalid entities
Removes the resource availability guard from the Training selection
panel onPress handler to align mouse interaction with hotkey behavior
The `closePageCallback` isn't forwarted to the function calling it. Now
it's possible again to continue a saved campaign.
The error was introduced in 76b6725272.
Since C++11 a C typedef'ed union can be forward declared, so the wrapper
is no longer needed.
While at it switch signatures to refs and convert C style casts.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Add registerGlobalGuiPageHotkeys() to
common/functions_utility.js to selectively register
GUI page hotkeys
Allow active GUI pages to close using their corresponding hotkey
Move page_hotkeys.xml from gui/hotkeys/ to gui/
Update page_hotkeys.xml references in MainMenuItems and MenuButtons
Add default tipScrolling fallback in TipsPage when no initData is provided
Now we should use material passes instead of context and defines to
select a needed shader. It allows us to reduce the number of
shader combinations we use and reduce memory consumption.
All shaders were selected by context (set of defines) which increases
the number of needed permutations. For example: we don't need to know
about shadows when rendering silhouettes.
We were unnecessary passing all combinations of our scene shader context
even if we don't need it as for shadows and silhouettes for terrain
rendering. Since we only need to draw a solid color.
When the returned value of the compare function is `0` the order is
preserved. Before the sort, the order between joining clients and
non-joining clients differ.
Additionally sorting by name should make the order consintent.
The AI only noticed for changes to `isIdleConfirmed`. That is done to
avoid recursions and don't send to many messages. But when the AI is
deserialized it get's `isIdle` from the simulation. Leading to an OOS.
When the returned value of the compare function is `0` the order is
preserved. Before the sort, the order between joining clients and
non-joining clients differ.
Now everything important (which is used later on) is included in the
comparison. If still `0` is returned it's not importent which element is
taken.
Another solution would be to have one array per category.
The metadata where written every the turn of deserialization. When on
the non rejoining client it was only written when that AI makes a turn
and handles the events.
On a rejoined client the data isn't the same anymore. But it's equal.
Likely this is because the data isn't aquired at the same turn.
This could also be solved more generally by copying all data which is
pushed to the AI. Or by using the same serializer for AI as for the rest
of the simulation.
Clients which didn't late-join only get a change to `uptadeTerritories`
when the ai playes a turn. When joining clients do it at the turn when
they deserialize the ai they might be ahead of the others. That would
lead to an out of sync.
`entityObj` is not available on clients which just have rejoined. As not
all clients have access to it the data shouldn't be used for anything
elaborate.
The information where a unit is and which resource it provides wasn't
available on joining clients. Now the `resourceMap` is reset when a
resource is destroide.
It would be performance intensive when the `resourceMap` would be reset
when any unit would be destroied. To prevent this the `SharedScript`
remembers which entities are resourcesources.
When destroying a builder it might not be known anymore what it was able
to build. Now the entityIDs of the builder is stores. So that it can
easily be looked up and removed.
On newly deserialized clients there is no property for the destroied
entities. Because of that the metadata of the entity wasn't remembered
in the event and wasn't destroied.
`GetFullRepresentation` doesn't reset `this.changes` to `null`. So when
a message arrives the ai-interface will not be informed.
The ai-interface calls `GetFullRepresentation` and removed the dirty
flag from the ai interface.
This two behaviors lead to the error that the ai never receives messages
from entities which exist at game start.
The assignement has to be done for new dropsite but must not always be
done as it sends a command.
Serialized data shouldn't be too complicated. Because of that the `ent`
property is removed.
The progressive load timeout was hardcoded to 10ms, causing the CPU
to be mostly idle during map loading. This commit replaces the fixed
value with a dynamic budget derived from the display refresh rate
when VSync is enabled, or from the configured adaptivefps.menu limit
otherwise.
Fixes: #8774
Commit 6a8366b99a added additional
libraries to the report but didn't consider gloox be optional. Address
this false assumption allowing to build pyrogenesis without lobby
support.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
When observing a player with camera follow enabled, the camera would
jump to newly trained units as they executed their
rally point commands, which were just rendering the "Follow Player"
feature frustrating.
This removes the `lobby.tls` option from the in-game settings, as
connecting to the official lobby without TLS isn't possible anymore. The
`lobby.tls` setting itself stays available for debugging purposes and
can still be set via the command line or in the user.cfg configuration
file.
This shifts the responsibility of updating the actual size more towards
IGUIObject, and enables only ever doing it when the value is actually
needed. This allows us to remove the delay of size changed
notifications, since the value is now already recalculated as
infrequently as possible anyways.
All of that ensures that the actual size (returned by GetActualSize) is
always up-to-date e.g. when reading it from the parent, which was
previously broken.
Fixes#8200
When using the lobby, after constructing `CNetServer` the public IP has
to be queried. The consructor knows whether the lobby is used, so do it
in the constructor.
The init-attributes can only be changed before the worker runs. It isn't
used before the worker runs. This changes it so that it has to be passed
when the server starts.
With this the `m_InitAttributesQueue` can be removed.
It has to be called before `SetupConnection` is called. Now the
server-data is setup during the constructor.
When connecting using the lobby, the data isn't known at construction
time. Then it is done at the start of `TryToConnectWithSTUN`.
CNetClient and CNetServer are constructed for a single match. The
password of a game can not be changed after creating the match. When the
password is passed to the constructor it's not possible to invoke the
functions in the wrong order and the `ENSURE` can be "checked at
compile-time" so to say.
This reduces the stutter when a client joins.
The decompression isn't put on the task manager. As the client would
have to wait for that either way. Also a new polling loop would have to
be introduced.
The compression code is moved to the file transferer so all data send
through it gits compressed.
Refs: #4210
Previously, while `scrollbar` was set to true, the text was always
vertically aligned to the top, no matter what its `text_valign` was, by
the scrolling logic. However, this was done even when the text's caption
was so short that no scrollbar was required in the first place (and not
rendered). Falling back to the specified `text_valign` value in that case
instead seems like the expected behavior.
On a few occasions in the GUI, the text was supposed to be aligned to
the top in either case, but still set `text_valign` to a different value
(for whatever reason), which didn't have any effect previously. But
now since it does, the values have to be corrected to specify what is
actually desired.
Presumably since 094a7c2268, when a game played as part of a campaign
ended (by the player winning or loosing), after closing the victory
dialog by pressing "Stay", the session UI became completely unresponsive,
so that no buttons could be clicked. The cause for this was that the
child page campaigns/default_menu/endgame/page.xml was never closed, so
remained invisibly open above the session GUI and blocked all of the
inputs.
Additionally the Campaign session class tried to close the
page_session.xml page, which was not supposed to happen, it was
introduced by mistake in 094a7c2268 replacing the logic to close the
campaigns/default_menu/endgame/page.xml child page again.
Since ec19e5d663 German Support Wagons cannot train Units anymore so
that Wagon Trains cannot unlock this ability as well.
Reported by @xordspar0
Fixes#8799
When merging twin formations, the calls to AddMembers()
and RemoveMembers() got inverted. RemoveMembers()
calls UnsetFormationController() on each member, which overwrites
the formation controller reference just set by AddMembers() to
INVALID_ENTITY.
Encountered in the test-suite run. This is just a workaround; the
implementation needs to be reworked/replaced to accommodate
alignment-sensitive architectures.
Since the completion is checked using the promise the `onTick` function
can be removed.
This replaces the `AutoStart` `AutoStartClient` and `AutoStartHost` by
async functions.
The functions can now return something to the engine. That is used to
inform the engine which page to open. That was previously done in
JavaScript. Which is ugly because it doesn't know whether it's in
visual-mode.
In-Game the Germans Cimbrian Clubman unit is erroneously declared
Builder and Worker
This removes these two Classes from the visible Classes
Fixes: #8806
Code is implemented relating to selecting the building starting from the surface and making Height functional.
Inbefore Height does not do anything and it is set by how tall the building is 3D wise.
Fixes: #8781
0ace1b44b2 added setting some animation into a controller state,
but formation controllers don't have any animations.
Probably some code intended for individuals has been copied there
by mistake.
This likely caused the visual system to reevaluate the actor somehow
because the animation didn't exist.
Fixes#8817
Previously, edges where bundled collected first then sorted in 4 AA and 1 unaligned bucket. We can separate the unaligned edges right away, which is a little faster.
Also make sure Vertex::pred is initialized.
Update the font alias regex pattern from:
(mono|sans)-(bold-|italic-)?(stroke-)?[0-9]{1,3}
to:
[a-z]+-(bold-|italic-)?(stroke-)?[0-9]{1,3}
Previously the pattern only allowed the `mono` and `sans` font families.
This change generalizes the pattern to accept any lowercase font family
name, making it compatible with the font alias convention described in:
https://gitea.wildfiregames.com/0ad/0ad/wiki/Adding_font_support
This allows new fonts to be registered through aliases without modifying
the regex each time a new family is introduced.
This patch implements a way for minimap-type GUI objects to request the rendering
of the minimap texture each frame. If it wasn't requested the minimap
texture isn't rendered at all and the objects only request it while they are
being displayed. This saves unnecessary work and fixes a bug where the
minimap briefly showed the revealed map after a cinema path ended
playing, since it isn't updated every frame (only 2x per second).
The whole map is revealed when starting to play a cinema path and
then hidden again when it finished (if necessary).
This patch fixes the ugly fade in at the start and fade out after
the end previously caused by this.
This patch introduces a new class for managing the cinema overlay (two
black bars) and cutscene mode. This makes it more extensible for the
future, e.g. allowing to display text on the bars.
Since <include> elements can only be placed inside an <object>, this
patch needs to restructure session.xml a bit and also adds some
explanation comments while at it.
This patch splits "cutscene mode" (disabling silhouttes, territory
borders and other visual overlays) from the cinema manager component
and moves it to the renderer, since it doesn't influence the simulation
anyway. The mode can now be independently controlled by the GUI. This
is done so it can also be used for other narrative elements like speech
or dialogue in the future. Cutscene mode is still always enabled while
cinema paths are playing, though.
By design, this also fixes the issue that range overlays weren't hidden
during cutscene mode.
It was previously stored at the end of the array of per-player flags and
set by calling SetLosRevealWholeMap with the player ID -1. However, ever
since the introduction of observer mode in 883f307b40, -1 is the player
ID of observers everywhere else including for GetLosRevealWhole:
GetLosRevealWhole(-1) always returns true in order to reveal the map to
observers, however, the cinema manager, for example, called it meaning
to find out whether the whole map is revealed to all players.
To fix this and avoid confusion about this in the future, this patch
splits this flag from the per-player flag array and introduces new
functions to set and retrieve it.
This name is more descriptive.
And the plan is to split off the extra player value of the vector into
an own flag in the future, and LosRevealAllForAll would have been a poor
name for that.
The other civs use structures/wallset_palisade, but the Han have a
special one, structures/han/wallset_palisade, which the trigger script
didn't disable.
Fixes#8763
Add default hotkeys for unit selection by class and for placing common buildings,
building on the previous buildings and units hotkeys work.
Several existing bindings are reassigned to avoid conflicts and group related actions
on consistent key combinations.
Reword the text on the splashscreen to sound more inviting and increase
the dialog size to ensure there's enough space for the message in all
languages.
Fixes#8682
Chat lines with different text heights were being positioned incorrectly
because each line's position was calculated using its own height rather
than the cumulative height of all previous lines.
This caused overlapping text and inconsistent vertical spacing when
messages had varying font sizes or line counts.
Now properly track cumulative height as we iterate through lines to
ensure each message appears at the correct vertical position regardless
of individual line heights.
ARB is a legacy backend which uses old assembly shaders. It makes
writing shaders more complex. According to the stats
https://feedback.wildfiregames.com we small amount of players with
ARB.
Fixes#8533
The error dialog only showed "Failed to connect to server. The
connection request timed out." while since 78900842b1 it was supposed to
display a longer, more detailed message with a link to the FAQ. But this
never worked.
Previously (only) setting `multiply` and/or `add` to zero in a tech
modification caused warnings saying the format wasn't recognised.
With this patch, those cases are now handled as one would expect.
Since 067a7abc72 a simulation is required when loading a non generated
map.
This breaks the serializationtest as it doesn't pass the simulation to
the secondary map-reader.
Use ProductionQueue.RemoveItem() instead of direct StopBatch() calls
to ensure both components stay in sync when entity training lists
change due to ownership changes.
Fixes#8691
Old and documented default is 0, tho the implementation changed at some
point to 1 in it's default config. As such explicitly set it to 0 so it
stays as is independent of stylistic version.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
It's better to construct a js-array from a `JS::RootedValueVector`.
Because it is more strongly typed and the index doesn't has to be
specified when appending an element.
Some usages are replaced with `JS::RootedValueArray`.
Fixes: #8702
Simplify building selection hotkeys to use template basename instead of full path
Allow Shift hotkey to add buildings in cyclic selection hotkeys and also units in unit class selection hotkeys
Add support for remove unit class from selection
When entities in formations were renamed (e.g., during promotion),
the formation would immediately recalculate all member positions,
and queue movement orders causing visible shuffling.
Changes:
1. Transfer existing offsets movement to the renamed entity
to maintain current formation structure
2. Schedule offset recalculation for the next tick to allow proper
reordering after all systems have updated
This preserves formation integrity during renames while allowing
eventual optimal position recalculation.
Fixes#8656
The 0 tolerance to prevent the "waltzing" that was set before this
cannot happen anymore as we now since check for being at destination
before sending a move request in UnitAI. Adding a new small tolerance
now prevents some small movement adjustments of formation members
near their destination.
Fixes#8592
-Seeresses "Soldier" class removed as they are support units.
-Seeresses given correct vision value.
-Seeresses are unaffected by healer discount.
-germans no longer access archery spread tech since they have no archers.
As for any invalid argument reject them and cleanly exit with failure
status.
Fixes: #7687
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Requested in #8244 for scripting purposes and automated testing. Extend
the original design by adding a means to pass an exit status. This also
comes in handy in case one wants to cleanly error out from JS on parsing
errors of command line arguments as reported in #7967.
Fixes: #8244
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
While in combat, if units are promoted and the promotion results
in a change in their attack range, this could trigger some errors
as 'this.template[type]' had a chance to be undefined when performing
a 'RepeatRangeCheck'.
Fixes#8670
The gendered citizen feature changed stat counter names in
3592814aa8 which are submitted to echelon
for rated games with the game report, the change in name for the property
means it no longer matches the database column name effectively breaking
rated games.
Translate the property name on the fly.
Fixes: #8687
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This saves a sizeable amount of disk space during the build, by not creating
a very large libjs_static.a (~1.5 GB) that contains a copy of all the symbols
in the object files generated during the build.
Upstream bug: https://bugzilla.mozilla.org/show_bug.cgi?id=2008085
Upstream commit: https://hg.mozilla.org/mozilla-central/rev/a924182c4e55
Note that the upstream commit doesn't apply cleanly to Spidermonkey 128.13.0,
it had to be rebased.
Intended as replacment for mongoose, which due to license change can't
be updated anymore.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Add support for multi-level priority sorting of entity classes
in formations.
fixes#7547
Change formation template's default sorting order
using multi-level sorting.
fixes#6873
5741f77c6e and b5256ce014 added new translatable strings for game
settings, but missed adding them to
binaries/data/mods/public/l10n/messages.json to get them properly
extracted into the PO-templates for translation. This commit fixes that.
Up to now `eslint-plugin-brace-rules` was used to enforce a common brace
style for JavaScript code. This plugin was however updated the last time
over 9 years ago and will be incompatible with ESLint v10, as that
[removes `context.getSourceCode()`][1], the plugin relies on.
To keep the eslint config working with ESLint v10, this replaces
`eslint-plugin-brace-rules` with the [`@stylistic/brace-style`][2] rule
from `@stylistic/eslint-plugin`, a package we already use.
While `@stylistic/brace-style` doesn't offer an option to format braces
in exactly the same way as before, the "allman" style seems to be the
one closest to the existing code.
[1]: https://eslint.org/blog/2025/11/eslint-v10.0.0-alpha.0-released/#removed-deprecated-rule-context-members
[2]: https://eslint.style/rules/brace-style
Some translatable strings in XML files have leading and trailing line
breaks and tabs. As these characters are significant in text in XML
files, they don't belong there.
Refs: #8649
Shows the reason for the role change in the status message. This is
mostly relevant for communicating the reason and possibly duration for a
moderator or bot muting a user.
Refs: #5679
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Previously on non Windows Platforms the Programm would not get its
icon, as the *.rc is not used on e.g. Linux.
Use an xpm File for non Windows Platforms. Use the convenience macro
from wxWidgets to load the icon in a single call.
The icon was converted using GIMP 3.0.6. To avoid `-Wwrite-strings` the
static char* was converted to a const char*.
Prefix output of DbgXMPP so it is clearly assosiated. Furhter avoid
newlines in debug statements.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
As long as there's no entity under the cursor, 11 calls were made per
tick with an undefined entity ID, which are now caught.
In general, an "entity state" can very well be null if the passed ID
is undefined, invalid or no entity with the ID exists (anymore). This
last case is only noticed by the GuiInterface and currently used to
detect destroyed entities.
`LoadScripts` and `LoadDefaultScripts` have to be called imediately
after the `CSimulation2` constructor.
By doing the necesarry work in the constructor and removing
`LoadScripts` and `LoadDefaultScripts` the interface of `CSimulation2`
is simplified.
The `onTick` of the register-page was still running when connecting to
the lobby. This lead to an error when the `connect` message was
received.
With this commit returning from the login-page will always return to the
entrance-page. Previously it returned to the register-page when it was
opened by through that page.
This change reduces the disk space requirement by 50%, from 1.1 GB down to 564 MB.
It is relevant when building 0AD in resource-constrained environments (e.g. in CI).
Formation controllers now display their movement paths when enabling
UnitMotion debug overlay.
Key changes:
- Formation controllers show long paths in blue and short paths in green
- Formation controllers path are rendered if selecting
some of the formation's members
- Prevent the gui from making redundant calls to SetMotionDebugOverlay
Existing limitations (not regressions):
- Paths are often cleared before entities complete them
- Formation members have short paths that rarely get rendered
It was added in 670f1e5d42 and, while not illegal, was inconsistent with the
rest of the header file, which caused compiler warnings.
As a quick solution the override keyword is simply removed again.
In the long run, it would be good to still modernise the style of all files
in that directory (at once).
After 734386ce9f the new font system calculate height and cap height,
previously was having some magic number. Now we are using cap height
divide 2 to give a more nice space.
Remove an extra pixel in the buffer and improves background color for
better reading and eye care.
This also support the change console font option added in d549cbeeaaFixes: #8351
The NSIS script incorrectly passes the default installation dir as
argument for the auto-uninstaller of previous installs.
This is supposed to avoid moving the uninstaller to a temp file, but it
is unclear why that was done, as this leaves the uninstaller behind.
More importantly, now that we have changed the default installation
directory, the auto-uninstall tries to remove the previous install from
the new location, which does nothing and leaves behind several GB on the
disk.
-Make clubmen champion macemen and remove buiding ability to ensure they are not mistaken for CS units.
-Decrease obstruction size of houses (clunky to place in staff match)
-Encampents only allowed in own/neutral territory
-'fear' icon used for Lugius vision aura instead of movement speed.
- Make covered wagons unable to research house techs and train civilians.
Currently CRenderingOptions are initialized only once on the application
start. It means changed m_GPUSkinning wasn't reset on the switch to Atlas.
Fixes#8596
This wasn't possible because init functions are called inside each
other and the outer one overwrites the result of the inner one.
Now the outer result doesn't overwrite the inner result but stores it to
the pointed to location.
By moving the common `goto done;` ouf of the if-block 5586802b86 changed
the code so that the loader suspend after each task.
This normally isn't a problem as it will continue in the next frame. But
when entering atlas it is treated as an error.
A discussion on the forums had the result, that the name Neareastern
Badlands should be changed as it contains an eurocentric view on Anatolia.
Fixes#8590
This behavior is a remnant of the very first implementaion of
formations, when there weren't different types of yet, only
box for fighting and column for walking.
Now that we have different types of selectable formations, however, this
behavior is no longer desired, it also caused a lot of ugly reordering
when giving walk commands. See the issue for more details.
Fixes#8580
Engine.GetTextWidth has been deprecated since e845da025a
Idea:
If you look at a dropdown as just a text field (its header) that can
change caption like any other, then getPreferredHeaderTextSize is the
equivalent to getPreferredTextSize (present on buttons and text fields).
Fixes#8493
Some tasks are invoked multiple times. Normally those tasks are broken
up inside a loop and had to be continued there. With coroutines that is
easier as it's possible to suspend inside a loop.
Coroutines which are lambdas should not capture anythig as the lifetime
of the captured values might end before the coroutine completes. For
that purpose `std::bind_front` is used.
Co-authored-by: @Vantha
Add 'isIdleConfirmed' flag to distinguish between
entering IDLE state and being confirmed idle.
Only send 'MT_UnitIdleChanged' messages after the
100ms timer elapses while still idle,
preventing spurious notifications for units
that instantaneously enter and leave IDLE.
This prevent the GUI to display a flickering idle count
in most cases, for example.
Refs : #8591
Remove the ResetIdle method that was causing issues with the
'Stop units' command in formation combat
The method was originally added to prevent formation members
from appearing idle during patrol waypoints, but formation
controllers or its members no longer enter idle states
even without it
The ResetIdle method was sending MT_UnitIdleChanged messages
causing formation members to bug when using stop commands
Fixes: #8546
Co-authored-by: @Vantha
Centralize all calls to move units into formation in UnitAI
Allowing additional checks to be done
before calling members to reform formation
Fixes : #8545
Revised Formation methods and when they do call
on reforming formation
Fixes : #7328
Don't order formation members to go to a point
if the controller is stuck
Instead make the controller jump to the member
who is closest to the destination
Fixes : #8543
Correct 'filter(member)' instead of 'filter(ent)'
in GetClosestMemberToPosition (ex GetClosestMember)
Fixes : #5120
All functions had a `LDR_` prefix. The prefix is removed.
Functions and globals which are only used in Loader.cpp are now
contained in an anonymous namespace.
There was a comment implying that `wchar_t*` is more iteroperable then
`std::wstring`. When there is no allocator `std::wstring` won't work,
sure. But when there is no allocator other things in Pyrogenisis will
also not work.
And for the progress there was just no reason to use a return parameter.
Commit b90280855f added support for
multiplayer saved games changing the signature of StartNetworkHost
without updating all callers.
Fixes: #7684
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
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
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).
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
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.
'StatusName', 'ApplierTooltip' and 'ReceiverTooltip' are attributes of status
effects, which are defined in JSON files (and already extracted
correctly from there), not XMLs.
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
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.
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.
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>
Commit 3eee3a444d added final keyword to
simulation classes but left virtual keywords in place.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
```
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>
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: #8529Fixes#8455
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.
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>
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.
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.
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ô")
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.
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`.
The test takes about 0.5s in release build and about 2s in debug build,
hardly qualifying as slow. As such enable it.
About the noise, it's of little interest anyway so don't spam.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The removal of the VFS cache in 89e339dd16
meant there is no longer a user. As such also clean out the generic
parts with the Landlord and a LRU policies.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Bumping the minimum version of macOS to 10.15 for spidermonky [1] also
allows us to use std::filesystem instead of boosts implementation.
[1] f14a98e26f
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Boost 1.89 no longer offers the deprecated library for boost_system [1], so
drop it from the list of libraries to link against. This effectively
bumps the minimum required boost version to 1.69 [2].
[1] 7a495bb46d
[1] 2fa0a00583Fixes: #8471
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
In >=wxWidgets-3.3 there is a new static check for literal message
ids[1] so that xgettext would reliable work to extract strings to
translate. As we don't translate Atlas at all nor use xgettext just
disable the check to allow building against >=wxWidgets-3.3.
[1] https://wxwidgets.org/help/msgid-literals/
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
It's not possible to format warnings. "a hotkey" is used instead.
Also when the hoplite icon is pressed, without using batches, the
warning doesn't restate that the hopplite should be pressed.
The <minimap> element in resource templates previously included a <type>
child element that was required by CCmpMinimap.cpp. This commit removes
the <type> field from the minimap schema in CCmpMinimap.cpp and from all
affected templates, making the minimap component resource-agnostic and
simplifying template definitions.
Refs: #8170
The user language and start menu folder name were saved, which goes
against recommendations in the NSIS documentation.
The installation directory was also saved, which might make sense,
but prevents us from dropping the "alpha" label.
Reviewed-At: https://gitea.wildfiregames.com/0ad/0ad/pulls/8476Fixes: #7594
When a patch version is released, it must declare compatibility with the
previous patch versions of the same main release. This allows players to
keep replaying their games and to keep playing online with users of
other patches of the same main release.
This should have anticipated for dae7a8c394
If the region analysis at the start of the game fails, the bot can't
actually play and the managers aren't initialised. And to prevent errors
from the update functions, the OnUpdate at the root had an early return
if the entity count was 0. However, in some edge cases the region
analysis can fail even if the AI has entities.
This patch fixes this potential error by storing the result of the
region analysis directly and checking that instead.
When the region analysis fails, that's usually because the AI doesn't
have any units or CCs at all.
Previously, the whole game crashed when serializing because this.noBase
was still undefined.
Add back some functionality that got dropped with the move to a custom
runner in 39ea3b6ea5
Add option --list to print all available test grouped by suite.
Add option --suite to limit the run to a specific testsuite.
Add option --test to limit the run to a specific test.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The extra space is part of the name and prevents the build tarball to be
excluded from archived artifacts.
Reported-By: Itms <itms@wildfiregames.com>
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
tar --no-same-owner is only default for non root users, therefore if
extracting as root owner ship is by the user id creating the archive.
This is an issue if extracting happens in a container and cleanup
outside the container by a non root user like on our CI when building
the appimage. Therefore package the tar archives for fcollada and nvtt
with owner and group root.
Fixes: #8440
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Kushite expert cavalry spearman uses advanced cavalry spearman rider mo
del when gathering meat.
This commit changes so its expert counterpart is used instead of advanc
ed and art looks consistent.
Fixes#7649
The great hall of the Germans used the icon of the syssition, which contains
the Spartan civ emblem, which in turn contains a red Greek uppercase
lambda (Λ) for "Lacedaemon". This is obviously incorrect to use for the Germans.
So this patch instead creates a new, generic hall icon for the great
hall out of the syssition icon by just removing the lambda from it. That
way they remain similar and players can recognise them both as
halls and champion-training structures.
Removing all entities when loading a game isn't implemented. So the
setting should not be selectable: #8413.
It seems this was tried in b36782388b. But it removed the ai-item
instead of the removed-player-item. That lead to an additional error:
#8425.
Fixes: #8413Fixes: #8425
Patch by @elexis.
The package sent in fa85527baf / #2420 plus this missing return causes the NetServerTurnManager
to be stalled forever if a client succeeds to send this package on disconnect.
In NotifyFinishedClientCommands, Disconnect calls OnDisconnect calls UninitialiseClient calls m_ClientsData.erase,
but then m_ClientsData[client].readyTurn = turn; reinserts the disconnected client, making the turnmanager wait forever for the disconnected client.
refs https://wildfiregames.com/forum/topic/134742-bug-game-incredibly-slowfreeze-at-start-because-because-of-1-player/
The --libdir switch got lost at some point, which is useful for running
tests with a system build.
Further allow to switch the type of output at runtime avoiding an
unnecessary rebuild.
Finally allow to specify an output file, this means there is no need to
redirect stdout which might break the CI in case the tests write
something to stdout like in case of LOGERROR resulting the test result
not being valid xml.
Ref: #7534
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The `isSavedGame` attribute has been introduced in ea12766834. The
variable has been turned in a member variable in 3a6540110b this
occurrence was missed when rebasing.
Fixes: #8417
Entities with a production queue when queueing or unqueueing items for
will set an appropriate animation which is desired for structures, like
the forge producing smoke, but not so for units as it interferes with
UnitAi animation state.
Units don't have animations for training or researching so the idle
animation will be set in that case instead. If such a unit is in motion
this results in the unit gliding. To avoid this just skip setting an
animation for entities having a UnitAI.
Reported-by: wowgetoffyourcellphone
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
In case a healer is currently healing and is part of a selection ordered
to attack the healer gets moved along but the fsm state isn't changed
which leads to healer healing while gliding to the target.
Introduce a WalkToTargetRange function which does transition state in
addition by issuing an order instead.
Fixes: #6134
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
When loading a savegame more settings are loaded then normally. Thous
settings (such as TriggerScripts) can't be changed from the
matchsetting-screen.
With this commit the saved matchsettings.mp.json isn't overritten when
loading a savegame.
Fixes: #7632
Filtering the maps sometimes changes the selection. Also it's not
required to filter the maps as the setting is already selected and
frozen.
This reuses the code which is used by campains since there the map might
also be frozen.
Fixes: #7682
Add a Dockerfile having all needed tooling. Using a container also means
those are the libs that will end up being used in the AppImage.
Then add a script for building pyrogenesis either form git or from
extracted source tarballs and for assembling the AppImage and finally
creating the AppImage.
Add building the AppImage to the "bundles" pipeline.
Also add a wrapper script to use podman to drive the whole process
for convenience for local builds.
Ref: #7577
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Commit fe192fe58f added one extra level,
so we have to layout the parent of the parent now to actually layout the
sidebar.
Fixes: #8388
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Each sprite is comprised of dynamically scaled 9 slices stored in a designated directory.
Base, over, pressed, and disabled variants are combined into a button style called
'BrownButton'.
The sprites have a native/maximum total resolution of 266 x 74 pixels.
(which is larger than any other button sprites)
Brightness of the base sprite is kept neutral so that it fits on both
light and dark backgrounds.
Disable compression and mipmapping as they don't work well with sliced
sprites.
-During each attack on a low preference target unless player-directed, update the range query and find a new target.
-Adjust behavior for elephants to work better versus infantry.
fixes#1488
Use `std::ranges::max` so that only one iteration is needed to find the
texture of highest priority.
Using `std::ranges::max` with an empty range is undefined behavior. So
there has to be a special case.
Adds a 1/125 chance for a corpse to undergo a decay movement in a given frame.
This allows a probability passed from the template to determine the sinking behavior of the entity.
Fixes#7548
Naval Redux 2.1
1 Greatly streamline the tech tree after some criticism it was too lengthy.
2 Move Scout ship to Village Phase
3 Tweak some ship costs
4 Implement some ideas from @Real_T_S
5 Acquiesce to all of @Real's demands
Their return values (undefined) were unused since 2cccd9825d, which is why they
didn't break anything. But due to the latest GetGUIObjectByName API
changes, they triggered some errors. They can be fully removed safely
now.
Fixes#8340
this commit fix and error in HWDetect when the libraries versions use
only MAJOR.MINOR like zlib in some linux os that is "1.3" that need
char[4] (1.3\0) conversion from Script::ToJSVal.
this commit create an overload template that matches "references to
array of uknown bound" and forward it to existing const char* / const
wchar_t* specializations.
this bug was reported by Vantha.
The first header was used to include the SpiderMonkey JS API at once,
with safeguards and preprocessor defines. Nowadays, SpiderMonkey
provides modular headers allowing us to include what we use, refs #8086.
Some defines have to be moved to compiler options but it is apparently
a mistake from the SM developers:
https://bugzilla.mozilla.org/show_bug.cgi?id=1987876
Now that size uses float when emulating positioning, it was getting a
different value, like 0.008. This commit fixed that issue by using
std::floor to remove small noise.
Symmetrical for LEFT with std::ceil.
The size is now float number, because of this code calculates the
required size, we should always ceiling the value to the next int to
remove any error or unwanted behavior in images or subpixel
calculations.
When scaling the GUI, GetCapHeight was incorrectly accounting for
m_Scale which caused text to be hidden due to improper clipping
calculations.
This commit corrects the CapHeight calculation by ensuring that the
division by m_Scale is applied, allowing text to be displayed correctly
at all GUI scale levels.
When not provided, the number of players on autostart was set to 2,
which is incorrect for skirmishes and scenarios. This commit makes this
parameter ignored for non-random maps, as well as the other parameters
specific to random maps.
Furthermore, 2 is already set as a default number of players for random
maps (in the `PlayerCount` gamesettings attribute), setting it in
autostart code is redundant.
Fixes#8325
Refs #7269
The issue was that the rright value was 100%.
That's why the buttons would always extend across the full width of the
screen.
Replacing the value right in the XML would result in an invalid size, so
we can remove it from there and create a full, separate size in the code
each time (Object.assign just edits it), since the top and bottom values
specified in the XML were overwritten anyway.
And since the left margin of 3 is fixed, we better move it to the parent
object to avoid a constant like that in the code.
Fixes#8322
The gendered civilian change made this unit native to its civil center,
but inherited templates in the proof-of-concept strategic map were not
adapted.
Fixes#8337
`groupedDistance` is the "distance between neighboring players" but it
was used as the radius.
Then there was a special case when the team size is big and the
`groupedDistance` was to small.
With this commit the `groupedDistance` is actually used as
"distance between neighboring players" and removes the special casing.
Change the stronghold placement.
Preqiously the angle between the center of the strongholds where equal.
Now the distance between strongholds is equal.
This is done so that big teams have more space.
wxWidgets can use X11 APIs or the GUI toolkits GTK or QT on Linux, with
pure Wayland only the option to use the toolkits remains for
wxGetKeyState().
wxGetKeyState() is only usable for modifier keys with either toolkit and
so we need to bookkeep ourself.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Tooltips for map sizes were introduced in 8cfd494b88 when 'Giant'
received the same sentence as 'Very Large'.
This commit fixes the tooltip for Giant Maps by giving them a proper
sentence, which might avoid confusion.
Commit 8b11f6a151 requires InitAttributes to be available, which isn't
the case for the secondary context in serialization test. So clone
InitAttributes to make it available.
```
ERROR: JavaScript error: simulation/helpers/Commands.js line 89
InitAttributes is not defined
reveal-map@simulation/helpers/Commands.js:89:7
ProcessCommand@simulation/helpers/Commands.js:932:23
ERROR: Failed to call ProcessCommand() global script function
```
Reported-by: phosit <phosit@autistici.org>
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Adds a randomly male and female Civilian unit which replaces the old "Female Citizen" for each civ.
New actors, new portraits, some new body textures, but the same stats as the old Female Citizen.
Updates maps, technologies, skirmish templates, et al. including the Tutorials.
Co-Authored By: Itms
Reviewed By: Vantha
`TaskManager` and `Future` where coupled together. When a task is pushed
a future is returned. Also the `Future::Wrap` function was inconvenient
to use.
Now `TaskManager::PushTask` doesn't return a `Future` anymore. This
alows to use different `Future`-like types.
Also it's possible to easily use the `Future` with a different type that
implements a `PushTask` function.
There is a call to `warn` in this function. That caused infinite
recursion.
Everywhere the function is imported it's aliased as `aiWarn`. So just
export it with that name and remove the aliasing.
Introduced in: #8255
We do not see benefit in enabling cheats for certain players but not for the rest.
The AI cheats irrespective of the CheatsEnable property.
This patch uses InitAttributes to check if cheats are enabled making it
slightly harder to workaround it from js.
See SetLosRevealAll in CCmpAIManager and PETRA.Config.prototype.Cheat.
refs 996a32125c / #879 (AI reveal los);
refs 202a02568b / #1555 (cheat codes, cheatsEnable for AI);
refs 25293ce0cc (AIDiff GatherRateMultiplier),
refs f6e0c4c5a4 / #2019 (no more cheatsEnable for AI),
refs 3246b02cda (SetTradeRateMultiplier)
refs de72510c60 / #6302 (move from InitGame.js to petra/config.js)
Remove manual memory management throughout the SoundManager subsystem
in favor of unorderedmap.
Key changes:
- Eliminate manual new/delete calls and potential memory leaks
- Update all sound item classes to use SoundManager factory
- Modernize resource management in OggData and related components
- Ensure exception-safe memory handling across the audio pipeline
This refactoring improves code maintainability, reduces crash risk from
memory errors, and aligns with modern C++ best practices.
As per the docs[1]: Note that since wxWidgets 2.9.1 you are strongly
encouraged to create the windows which are added to wxStaticBoxSizer as
children of wxStaticBox itself.
wxWigets 3.3 added a warning to that end.
[1] https://docs.wxwidgets.org/3.2/classwx_static_box_sizer.html
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
We don't gain anything using a span here, so just don't.
```
source/graphics/Font.cpp:535:35: error: Out of bounds access in 'tempDstRow[3]', if 'tempDstRow' size is 2 and '3' is 3 [containerOutOfBounds]
const float dstAlpha{tempDstRow[3] / 255.0f};
^
source/graphics/Font.cpp:543:14: error: Out of bounds access in 'tempDstRow[2]', if 'tempDstRow' size is 2 and '2' is 2 [containerOutOfBounds]
tempDstRow[2] = static_cast<u8>(std::round(((b * srcAlpha + tempDstRow[2] * dstAlpha * (1.0f - srcAlpha)) / outAlpha)));
^
source/graphics/Font.cpp:544:14: error: Out of bounds access in 'tempDstRow[3]', if 'tempDstRow' size is 2 and '3' is 3 [containerOutOfBounds]
tempDstRow[3] = static_cast<u8>(std::round(outAlpha * 255.0f));
^
```
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
With C++20 the custom container PS:span, which was a backport of
std::span is no longer needed.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The method's point is to calculate a text's height and width if it was written
in a single line -- no matter how long the caption, even if it's wider
than the window.
With v3.12.0 shfmt changed the behavior of the `--simplify` option to
ignore any EditorConfig when it's provided. Therefore, this option is
now moved to the EditorConfig as suggested by the shfmt author. See
https://github.com/mvdan/sh/issues/1173 for details.
Make include-what-you-use happy with some files in source/tools/atlas
and fix what needs to be fixed.
Update premake script to include missing deps and drop various extra
paths for simplification.
Don't always include wx/wx.h via precompiled.h in case PCH is disabled.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Fix ERROR: JavaScript error where 'difficulty' is not defined on line
247 of config.js.
The bug was introduced in commit 062be89694 where two issues occurred:
this.difficulty was incorrectly set to the entire difficultyLevel module
instead of the difficulty parameter value.
Later comparisons used undefined difficulty variable instead of the
imported difficultyLevel module
Make include-what-you-use happy with some files in source and fix what
needs to be fixed.
Add markers to precompiled.h header includes to avoid
include-what-you-use wanting them to be removed.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
GetGUIObjectByName was previously made stricter, logging an
error if it doesn't find the target object.
This commit deals with the resulting error-causing (invalid) calls,
by deleting them if they're unnecessary or converting them to the new
TryGetGUIObjectByName (which doesn't log any errors).
It previously failed silently and just returned undefined which would often
only cause errors later on. Printing an error as soon as that happens helps
with debugging, by directly catching typos, for example.
For cases where the queried object may not exist, a new Engine function
called TryGetGUIObjectByName is introduced. It doesn't log any errors
and behaves exactly as GetGUIObjectByName used to.
Make include-what-you-use happy with some files in source and fix what
needs to be fixed.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
For the memleak warning actually wx will free it for us, so just
suppress the warning.
```
source/soundmanager/data/SoundData.cpp:48:29: error: Iterators of different containers 'CSoundData::sSoundData' and 'sSoundData' are used together. [mismatchingContainers]
if ((itemFind = CSoundData::sSoundData.find( theData->GetFileName().string() )) != sSoundData.end())
^
source/soundmanager/data/SoundData.cpp:62:28: error: Iterators of different containers 'CSoundData::sSoundData' and 'sSoundData' are used together. [mismatchingContainers]
if ((itemFind = CSoundData::sSoundData.find(itemPath.string())) != sSoundData.end())
^
source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Terrain/Terrain.cpp:145:3: error: Memory leak: buf [memleak]
}
^
```
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
While std::is_pod is required it is not sufficient so use
std::is_integral as condition which is.
Further replace the static_assert with a requires and use the new endian
support to avoid use preprocessor.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
wxWigets 3.0 does stuff that is deprecated in C++20, namely bitwise
operation between different enumeration types. wxWidgets 3.2 has
widespread support and in fact 3.3 was release recently so 3.4 won't be
that far off anymore either. Requiring 3.2 will allow us to do several
cleanups.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Current GCC doesn't warn here, so add -Wno-stringop-overflow,
-Wno-attribute-warning, -Wno-restrict and -Wno-array-bounds to the list
of warnings for old GCC.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
mozilla/LinkedList.h uses __PRETTY_FUNCTION__ in debug builds, even when
using MSVC, so just define it to allow building with C++20.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The implicit conversion form sting literal to char* for C compatibility
was removed with C++11, seems MSVC caught up with this in C++20.
Use explicit cast instead where needed and change API to const char*
otherwise.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Was done for Android support but the cleanup didn't revert to the
original version and at least clang-20 warns -Wmain
Ref: f4625e69af
Ref: 20d23eb340
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
C++20 removed a sizable portion of valid places to use volatile
specifier. As mongoose is on the way out just add the warning to the
list of suppressed warnings. Further add a warning already suppressed
when using GCC to the list of suppressed warnings with Clang.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
std::is_pod is deprecated in C++20 and as such triggers
-Wdeprecated-declarations when built with C++20, "is_standard_layout &&
is_trivial" is the equivalent, so migrate to that.
While at it replace runtime dispatch with compile time and reduce the
required trait for memcpy to what is really needed.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with some files in source/tools/atlas
and fix what needs to be fixed.
Define ATLASDLLIMPEXP in a regular header instead of a PCH header and
dedupe its definition.
wxWidgets uses WX_ATTRIBUTE_PRINTF this days, so remove the workaround
for ATTRIBUTE_PRINTF.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
- Explicitly delete move constructor and move assignment operator to
avoid risk of memory leaks
- Remove unused class and typo
- Use same invocation of ScriptInterface as elsewhere
The addition of seagulls made fish selection boxes large, leading to clumbsiness when trying to select fish. Using the footprint for the selection box makes for a more intuitive selection.
Those functions were added to the C11 standard as an extension under the
name wcsnlen_s and strnlen_s. Also supported under that name in Windows.
Renaming avoids a possible name conflict with the posix functions of the
same name. Further this new name follows the pattern of names of the
other "secure" functions.
Fixes: #8274
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with some files in source/tools/atlas
and fix what needs to be fixed.
Drop the wxWidgets specific handling of precompiled headers in some
places, it isn't consistently used which it would have to to have meaning
and was mostly for early VS implementation of precompiled headers and a
lot of time has gone by since.
Drop Borland C++ compiler specific quirk, that compiler was
discontinued long ago and doesn't support modern C++.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with some files in source/tools/atlas
and fix what needs to be fixed.
Add "source" to include path for AtlasUI target to allow for absolute
includes. In the future all but one should be removed.
Drop check for at least boost 1.40.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with some files in source/simulatation2
and fix what needs to be fixed.
source/simulation2/system/ComponentTest.h uses cxxtest, so add cxxtest
to the deps for simulation2 target.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with some files in source/simulation2
and fix what needs to be fixed.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with files in source/scriptinterface and
fix what needs to be fixed.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with some files in source/simulation2
and fix what needs to be fixed.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Modules don't expose global symbols. Because of that not all functions
have to be cramed in to one class. The functions can now be split in a
more readable way.
Ref: #8081
Make include-what-you-use happy with some files in source/ps and fix
what needs to be fixed.
Delete source/ps/FutureForward.h as it is no longer used.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
New `[locale='xx']...[/locale]` markup lets GUI text sections render
with a locale-specific font (e.g. CJK) while the rest of the caption
keeps the current game font.
guiObject.caption = "Hello [locale='ja']世界[/locale], how do you
[locale='zh']感覺[/locale]" This is ideal for language pickers and
similar UI where you want the language name shown in its own script.
This commit unlocks richer, self-explanatory international UI while
keeping the legacy text behaviour unchanged.
With stronghold each team is placed on a hill.
With stronghold placement the hills are bigger. On tiny maps the ramps
might overlap and enemies might not be reachable. To prevent that the
ramps are shortened and the angle is changed to point more towards the
center of the map.
Refs: #7717
Make include-what-you-use happy with some files in source/simulation2
and fix what needs to be fixed.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Units which are able to build can't reach the center, to build the
placed foundation and the collectors can't build.
This might help Petra a bit and avoid players placing foundations that
cannot be built.
Make include-what-you-use happy with some iles in source/ps and fix what
needs to be fixed.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with some files in source/lib and fix
what needs to be fixed.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Naval Ballistae cannot be researched by the Kushites, who don't have
access to siege ships. Hence their unique Flaming Projectiles technology
cannot depend upon Naval Ballistae.
This removes the dependency and increases the cost of the unique tech.
Fixes: #8046
Patch-By: rene
Reviewed-By: Itms
Reviewed-At: https://gitea.wildfiregames.com/0ad/0ad/pulls/8056
Make include-what-you-use happy with files in source/graphics and fix
what needs to be fixed.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with some files in source/ps and fix
what needs to be fixed.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with files in source/renderer and
fix what needs to be fixed.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
On *nix the conversion of timeval and timespec to double needs to use
the actual unit in use instead of the unrelated clock resolution.
Fixes: aa3bd08513Fixes: #8215
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
<cstdint> since C++11 defines all those int types and macros, therefore
drop extra definitions in source/lib.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with some files in source/lib and fix
what needs to be fixed.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with files in source/network and
fix what needs to be fixed.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
If there are multiple commits with bad copyrights then only the results
for one was printed and immediately returned failure. This change
collects all and returns success or failure after.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The old trick to get needed commits doesn't work anymore. The context in
gitea unlike on github doesn't carry the number of commits, therefore
just fetch a fixed depth of 100 which is to reason should be enough.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Building the workspace with `--without-pch` fails on MSVC:
source/lib/sysdep/os/win/acpi.cpp(123): error C3861: 'isalpha':
identifier not found
The pre-compiled header normally brings in `<cctype>`, but when PCH
generation is disabled the translation unit must include the header
explicitly.
Add the missing `#include <cctype>` to
`source/lib/sysdep/os/win/acpi.cpp`.
No functional change; the code now compiles cleanly with or without PCH.
The test loading the `mod` mod uses the bold variant that is present in
`_test.minimal`. Removing the need for the `mod` mod allows packagers to
build and run tests from the `unix-build` tarball without needing the
`unix-data` one.
The setup for this test suite defines the italic variant of the sans
serif font, but this variant is not present in `_test.minimal` and is
not used in any test, so remove that as well.
Modernized COggData::FetchDataIntoBuffer and OggStream
interface:
- Replaced raw buffer pointer with std::vector<u8> in COggData
- Updated GetNextChunk to use PS::span<u8>
- Removed manual new/delete and memset usage
- Replaced long with ALsizei for m_Frequency to match OpenAL API
- Simplified type usage with size_t where appropriate
- Eliminated unnecessary casting and improved code clarity
These changes improve safety, readability, and bring the
code closer to modern C++ standards.
Replaced the raw C array for m_Buffer with std::array
to improve bounds safety and code clarity.
- Used .data() and .at() for buffer access
- Added check for bufferCount exceeding OGG_MAX_BUFFER_COUNT
- Left FetchDataIntoBuffer unchanged to avoid breaking external usage
(e.g. CStreamItem)
This refactor improves safety while keeping external API stable.
OggData now manages its own buffer size and count directly,
instead of relying on SoundManager to provide those values.
- Removed unused GetBufferCount() and GetBufferSize()
- Use default values for buffer size and count in OggData
- Documented buffer settings for clarity
This change centralizes control in OggData and improves encapsulation.
The AddDataBuffer method was declared but never defined
in any implementation of CSoundData or its derived classes.
It is also not used anywhere in the codebase, so this
commit removes the dead declaration to clean up the
interface.
This commit renames ogg to m_OggStreamPtr for clarity and consistency
with naming conventions. Additionally, it moves the m_Format and
m_Frequency fields to the private section to ensure proper
encapsulation.
Local variables like pcmout have been renamed to PCMOut to match style
conventions, and all member fields now follow a consistent m_ prefix
style, placed at the end of the class definition for clarity.
These changes help improve code readability, enforce privacy, and align
with the rest of the codebase's naming standards.
This commit updates the OggData-related classes to use uniform brace
initialization ({}) for member variables where applicable. Brace
initialization improves clarity and prevents potential narrowing
conversions or unintended behavior caused by default constructor
ambiguity.
This change improves consistency and aligns with modern C++ best
practices, especially in C++11 and later where brace initialization is
recommended for safer initialization semantics.
The OggStream interface no longer needs the Close() method.
OpenOggNonstream returns a smart pointer (OggStreamPtr),
so resource cleanup is automatically handled by the destructor.
OggStreamImpl now calls ov_clear in its destructor, making
manual cleanup unnecessary. This commit removes the Close()
method from the interface and its implementation.
Make include-what-you-use happy with some files in source/graphics and
fix what needs to be fixed.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
657be906fe allowed the use of boost filesystem v4, so this should have
been updated as well. As boost filesystem v2 is irrelevant as it was
removed in boost-1.50 so just remove the wrapper function altogether.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with some files in source/graphics and
fix what needs to be fixed.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with some files in source/lib and fix
what needs to be fixed.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Split public and private stuff into their own sections and do parsing of
libs in a helper function analog to the parse helper function for
includes and document public funcions using LDoc. Finally make setting
the static flag a function.
Ref: #8135
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Only used for timespec which is in <ctime> since C++17. All other uses
were already obsolete with C++11 so remove the header wrapper.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Copy some wtime internals to wfilesystem.cpp with internal linkage only,
this code has had no use outside of wfilesystem and was only added to
wtime in case other use cases could be found. This will allow removing
posix_time and affiliated code.
wfilesystem will become obsolete with the move to <filesystem>
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Is a Posix function and available on macOS since version 10.12, has better
granularity than gettimeofday. Add missing header <time.h> where
clock_gettime is specified.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Does only include <errno.h> with the exception on Windows but only if
not using MSVC and even then depends on whether boost is included first
or not.
Use <cerrno> which was added in C++11 and is based of of Posix instead
of a particular cerrno.h of a particular C library.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Why
Passing 0 as the width to `CGUIText` meant "no wrapping".
Buttons and text objects therefore treated every caption as a
single unbroken line, ignoring embedded new-line characters and
overflowing their allotted space.
What
`GetPreferredTextSize` in both `CButton` and `CText` now forwards
`m_pGUI.GetWindowSize().Width` instead of 0.
With a real width the underlying `CGUIText::GetSize()` can measure
the caption using normal word-wrap rules, restoring correct
multi-line behaviour and preventing layout glitches.
Fixes: #8193
FreeBSD could hang indefinitely when the debug-adapter process
terminated because we closed the TCP socket without first calling
`shutdown()`. On that platform (and similarly on Linux and macOS)
a peer that is still blocked in `recv` will not be woken up unless
a full‐duplex shutdown is performed.
This patch adds `shutdown(fd, SHUT_RDWR)` in `DapInterface.cpp`
for Linux, *BSD, and macOS builds, preventing the observed hang.
Only maps where `minDist` and `maxDist` differ get changed by this
commit. That is only "Deep Forest".
This has been around since `placePlayerBaseBerries` got introduced in
921850cdef.
`get` is used to get a property of `args` or a default if the property
doesn't exist.
`args` was bound to `get` so it obscured dataflow.
`get` was usefull when there wasn't a `??` operator.
Make include-what-you-use happy with some files in source/renderer and
fix what needs to be fixed.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit enables proper property enumeration and inspection for GUI
proxy objects in debugging sessions using the SpiderMonkey Debugger API.
Interface (IGUIProxyObject):
- Added a pure virtual method getPropsNames() to expose cached property
names from the GUI object implementation.
Proxy handler (JSI_GUIProxy):
- Implemented ownPropertyKeys() to enumerate all visible properties of
the proxy, including: -- Built-in GUI fields: "name", "parent",
"children". -- Dynamic settings stored in m_Settings. -- Script event
handlers prefixed with "on" from m_ScriptHandlers. -- Function
properties returned by getPropsNames().
- Implemented getOwnPropertyDescriptor() to synthesize descriptors for
debugger queries: -- Returns undefined if the property is not defined.
-- Returns a read-only enumerable descriptor otherwise.
- Both methods are marked final and override SpiderMonkey's
BaseProxyHandler.
Why:
- SpiderMonkey’s Debugger API requires ownPropertyKeys and
getOwnPropertyDescriptor for proxy objects to be introspectable in dev
tools like VS Code.
- Without these, properties of GUI objects are hidden during debugging.
- This change improves the developer experience by making all meaningful
GUI object fields visible and explorable at runtime.
Adds initial support for the Debug Adapter Protocol (DAP) to
SpiderMonkey via debugger.js. This JavaScript-based implementation
enables external debuggers (e.g., VS Code) to interact with the JS
runtime using the DAP interface.
Implemented DAP requests and events:
- attach
- initialize (capabilities)
- stopped event
- threads
- scopes
- variables (globalThis pending)
- continue
- stepIn
- stepOut
- setBreakpoints
- Handling of debugger statements
This forms the foundation for interactive debugging of in-game scripts,
providing smoother integration with developer tools.
Spidermonkey provide a mechanics to debug all comportaments and real
from a different place with JS code this allow us to reuse the current
scriptinterface but addind the new Debugger object definition only for
debugging without change any code from other place like GUI &
simulation.
Debugger Adapter Interface is a protocol that commons IDE implement to
being able for debugging, the concept is to provide sockets connections
with c++ but the Dap implementation in JS that allow us to extend for
more Request / Events that DAP provide.
Because Dap Interface its implemented with JS we need to handle message
in the main thread so we are calling in the main loop before GUI
messages
Drop reference build as it makes no sense for incremental builds, fix
warnings in test reporting and finally log build warnings per run which
prevents third partly library builds to leak into the report and failing
the CI.
Ref: #7367
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make use of build matrix, drop reference build as it makes no sense for
incremental builds, fix warnings in test reporting and finally log build
warnings per run which prevents third partly library builds to leak into
the report and failing the CI.
Ref: #7367
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Goal
----
Avoid corrupting the dynamic font-atlas on Vulkan by blocking any
re-uploads until the command buffer that created / last updated the
texture has actually been submitted.
What changed
------------
* **Queue-aware textures**
* Added `queueSubmitAware` flag to `IDevice::CreateTexture*` APIs.
* `Vulkan::CTexture` now stores two booleans:
- `m_QueueSubmitAware` – opt-in per texture.
- `m_PendingQueueSubmit` – set to *true* the moment an upload
is recorded, cleared once the submit scheduler has flushed.
* `CRingCommandContext::ScheduleUpload` marks the texture as
pending (`SetPendingQueueSubmit(true)`).
* **Device-side watcher**
* `Vulkan::CDevice` keeps a
`m_TextureUploadWatcherQueue`. Each frame it checks textures that
were uploaded ≥ `NUMBER_OF_FRAMES_IN_FLIGHT` frames ago and
clears their pending flag.
* New helpers
`ScheduleTextureUploadWatch `,
`ProcessTextureUploadWatchQueue()`.
* **Font code**
* Atlas texture is now created with
`queueSubmitAware = true`.
* `CFont::UploadTextureAtlasToGPU()` early-outs when
`IsPendingQueueSubmit()` returns *true*, instead of tracking a
submit-handle or the manual `m_IsLoadingTextureToGPU` flag
(removed).
Why this is better
------------------
The logic to wait for a flush is localised inside the rendering
backend, so `CFont` only needs to ask *“is my texture busy?”*.
This removes the fragile submit-handle bookkeeping and works even if
the scheduler issues multiple submits per frame in future.
Result
------
Atlas uploads are deferred until the previous submit completes,
eliminating the intermittent glyph corruption on the Vulkan backend
while leaving GL and the dummy backend unchanged.
The build.log is created and found, but no warnings are collected.
Redirect stderr so the warnings end up in the log in the first place.
Fixes: #8159
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
5e4b49f65f introduced a warning, silence it as it's in spidermonkey and
only leaks while on vs2017.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with some files in source/renderer and
fix what needs to be fixed.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Allow override PKG_CONFIG_PATH via env, making it possible to easily
inject alternative library builds for testing or bisecting. This was
only possible when the premake script didn't override it which it
unconditionally did on macos.
Also don't expose the variable holding the path directly but offer a
function to append to the path instead.
Ref: #8135
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This header was used to overcome macos openal vs openal-soft header name
difference, for the migration to openal 1.1 and to pass arguments to the
linker on windows in the past. None of this is used anymore so dissolve
the header.
Also fix related headers so one can run include-what-you-use on the
changed files.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
`JSNatives` passed to SpiderMonkey must not throw exceptions. Most
callbacks are wrapped in `ScriptFunction::ToJSNative`.
This commit adds exception handling to `ScriptFunction::ToJSNative` so
that exceptions thrown in the wrapped callbacks are catched and rethrown
as JavaScript `Error`s.
Replace `ENSURE` with recoverable error handling. Introduce a new error
type so that it's distinguishable from other errors.
When such an error occurs the program exits with `EXIT_FAILURE`.
Fixes: #7475
Make include-what-you-use happy with some files in source/renderer and
fix what needs to be fixed.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Mods can add more resources than the summary screen’s fixed layout
handled, which crashed with:
ERROR: JavaScript error: gui/summary/layout.js:269 headerGUI is null
This patch doubles the column templates (9 → 18) and updates the
iteration logic so extra headers no longer resolve to null. It removes
the need for copy-paste XML edits when mods grow the resource list.
Known limitations
-----------------
* Column count is still static; a future change should generate the
layout from g_Resources at run-time.
* UI tested at 1080p and 4 K; very small resolutions might require a
horizontal scroll solution.
Make include-what-you-use happy with files in source/maths and fix what
needs to be fixed.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with most of the files in source/gui and
fix what needs to be fixed after including missing compile flags.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
For cross compiling there is a need to specify an alternative binary for
pkg-config. It's customary to use the environment variable PKG_CONFIG for
this.
Ref: #8135
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
If a human player is set to “Removed” in Game Setup, leaves to the
main menu, and re-enters, they are auto-assigned back to the same
slot but still flagged as removed, triggering an instant defeat when
the match starts.
GameSettingsController::onLoad already reconciles **playerAI** against
current player assignments, but the analogous check for the new
**playerRemoved** setting was missing. The flag therefore survived
persisted-settings reloads.
This mirrors the existing AI-conflict logic and resets the flag
whenever a human player occupies the slot.
Bug reported by *elexis*.
Commit d888b10931 remove those headers which have the side effect of
suppressing some warnings on Windows using vs2017. Keep those headers
around for till vs2019+.
Add additional suppressions where needed for spidermonkey headers.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with a part of the files in source/gui
and fix what needs to be fixed after including missing compile flags.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Exporting HOSTTYPE prevents cross compilation as HOSTTYPE is used to
override target host arch instead of detecting it from chosen compiler.
This then results in the wrong arch specific source files to be
included. So just don't set it by default and let it to the user to set
it if he so chooses.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The workflow was run before the addition of white-space error check, so
the trailing white-space made it in.
This commit unblocks the CI.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Increase vision range to avoid continuous firing for most structures.
Ref: #6708
Rename onager template to 'siege_onager_unpacked' to follow existing
naming conventions.
Normal maps contain redundant color information and the engine supports
compression algorithms (like DXT5n) optimized for that.
It has previously only been enabled for the water normal maps.
Pull Request: #8114
This improves the styling of the header of the profiler2 UI, by applying
the following changes:
- change the spinner animation to actually look like a spinner
- ensure open reports don't overflow the nav bar
- reduce the size of the server port input field
- add some paddings to make everything look more pleasing
`onchange()` triggers only when an element looses focus. For the graph
smoothing in the profiler2 UI we want to have the smoothing applied
immediately when modifying the slider, so let's use `oninput()` instead.
Remove external_libraries headers for icu and tinygettext, as they
neither add any workarounds needed and as quite a few other libraries
don't have such a header either. As for the warnings suppressed, this is
no longer needed as they were fixed and with vs2019 added support for
-isystem or equivalent would make this useless eitherway.
Further make include-what-you-use happy with files in source/118n and
fix what needs to be fixed after.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Declare "lib/posix/posix.h" as source for <strings.h>
Make include-what-you-use happy with files in source/ps/{XMB,XML} and
fix what needs to be fixed after including missing compile flags.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with files in source/gui/ObjectTypes and
fix what needs to be fixed after.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with files in source/gui/ObjectBases and
fix what needs to be fixed after.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Replace repeated LOGWARNING calls with ONCE(LOGWARNING) in
JSInterface_CGUISize.cpp and JSInterface_Main.cpp.
Why – The old behaviour printed a warning every time the deprecated
API was used, cluttering the log and annoying modders. We still want to
nudge them toward the new APIs (object.size = {...} and
guiObject.GetPreferedTextSize/getTextSize), but a single reminder is
enough.
What changed
CGUISimpleSetting<CGUISize>::DoFromJSVal now wraps the deprecation
message in ONCE(...).
Engine.GetTextSize warning is likewise wrapped.
Impact – Functionality is unchanged; only the frequency of the
warnings is throttled to one per session, making the transition less
intrusive and more user-friendly.
Various environment variables may have an impact on what premake will
do, properly report them in the output and consolidate others.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Use a colon instead of a backslash to seperate domain from repo. The
backslash only works for pushing and for pulling lfs will complain about
"batch request: missing protocol"
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Fixes a typo introduced in fd847c2a23 where the code
incorrectly modified chatSubmitButton.size instead of
chatInput.size, effectively collapsing the input field's
width to zero.
This change ensures the chat input field resizes correctly
based on the button's position.
Thanks to Langbarg for noticing the issue.
Refs: #8138
Fixes a bug where chat overlay text wrapping changed
unexpectedly when earlier messages expired.
The issue was caused by Object.assign modifying the size
object in place, which did not trigger proper recalculation
for getTextSize in subsequent frames.
Replacing it with direct assignment ensures the size object
is recompute, allowing correct layout behavior.
Bisected to: fd847c2a23
Thanks to Langbarg for identifying the root cause.
Ref: #8043Fixes: #8138
Users using ssh are suddenly asked for a username and password for lfs,
add a note as to why that is and how to avoid it to the .lfsconfig in
hope they will see it.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Adds a runtime warning to `Engine.GetTextSize` indicating that the API
is deprecated and will be removed in a future version.
This API does not simulate GUI rendering accurately, as it treats markup
tags like [color], [font], or [icon] as visible characters. This leads
to incorrect size measurements in modern GUI layouts.
New recommended alternatives:
- Use `Engine.GetGUITextSize(...)` for accurate measurement of raw text
blocks, fully simulating GUI rendering.
- Use `guiObject.getTextSize()` when working within a specific GUI
object, as it accounts for maxWidth, padding (bufferZone), and object
constraints.
A warning is now emitted at runtime to guide developers toward these
updated APIs.
Updates GUI code to apply the correct usage of `guiObject.getTextSize()`
and `guiObject.GetPreferedTextSize()`.
- `guiObject.getPreferedTextSize()` is now used when the goal is to compute the
bounding box of a text string to dynamically resize or layout a GUI
object accordingly. It simulates how the text would be rendered,
accounting for markup and layout rules.
- `guiObject.getTextSize()` remains in use when text is being measured
within a fixed-size GUI element (e.g., a button or label). It respects
internal constraints like buffer zone and maxWidth, and is typically
used to align other elements based on its visual appearance.
These changes ensure more accurate text sizing and consistent layout
behavior across GUI components.
Introduces (CButton|CText).getPreferredTextSize, a new method for estimating
the natural width of a caption if the object had no width constraints.
Unlike .getTextSize, which reports the size after applying current
layout constraints (e.g., fixed width or anchors), getPreferredTextSize
answers the question: "How wide would this object need to be to display
the caption on a single line?"
This is particularly useful for modders and layout logic that wants to
dynamically size elements *before* assigning a fixed width or anchoring.
Make include-what-you-use happy with files in source/collada and
fix what needs to be fixed after. Also switch quote with bracket include
where appropriate.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Previously the param type was `void*` now the type has to be specified
as template parameter of the `CFsm`.
With this commit some casts can be removed.
Gcc 15 generates the following warning:
../../../source/ps/ModIo.cpp: In static member function ‘static bool ModIo::ParseModsResponse(const ScriptInterface&, const std::string&, std::vector<ModIoModData>&, const PKStruct&, std::string&)’:
../../../source/ps/ModIo.cpp:738:41: warning: loop variable ‘prop’ of type ‘const std::string&’ {aka ‘const std::__cxx11::basic_string<char>&’} binds to a temporary constructed from type ‘const char* const’ [-Wrange-loop-construct]
738 | COPY_STRINGS_ELSE_CONTINUE("", el, "name", "name_id", "summary")
| ^~~~
../../../source/ps/ModIo.cpp:738:41: note: use non-reference type ‘const std::string’ {aka ‘const std::__cxx11::basic_string<char>’} to make the copy explicit or ‘const char* const&’ to prevent copying
../../../source/ps/ModIo.cpp:749:41: warning: loop variable ‘prop’ of type ‘const std::string&’ {aka ‘const std::__cxx11::basic_string<char>&’} binds to a temporary constructed from type ‘const char* const’ [-Wrange-loop-construct]
749 | COPY_STRINGS_ELSE_CONTINUE("", modFile, "version", "filesize");
| ^~~~
../../../source/ps/ModIo.cpp:749:41: note: use non-reference type ‘const std::string’ {aka ‘const std::__cxx11::basic_string<char>’} to make the copy explicit or ‘const char* const&’ to prevent copying
../../../source/ps/ModIo.cpp:756:41: warning: loop variable ‘prop’ of type ‘const std::string&’ {aka ‘const std::__cxx11::basic_string<char>&’} binds to a temporary constructed from type ‘const char* const’ [-Wrange-loop-construct]
756 | COPY_STRINGS_ELSE_CONTINUE("filehash_", filehash, "md5");
| ^~~~
../../../source/ps/ModIo.cpp:756:41: note: use non-reference type ‘const std::string’ {aka ‘const std::__cxx11::basic_string<char>’} to make the copy explicit or ‘const char* const&’ to prevent copying
../../../source/ps/ModIo.cpp:762:41: warning: loop variable ‘prop’ of type ‘const std::string&’ {aka ‘const std::__cxx11::basic_string<char>&’} binds to a temporary constructed from type ‘const char* const’ [-Wrange-loop-construct]
762 | COPY_STRINGS_ELSE_CONTINUE("", download, "binary_url");
| ^~~~
../../../source/ps/ModIo.cpp:762:41: note: use non-reference type ‘const std::string’ {aka ‘const std::__cxx11::basic_string<char>’} to make the copy explicit or ‘const char* const&’ to prevent copying
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
During hotloading the `ScriptRequest` was constructed from a
`JSContext*`. That requires that already an other `ScriptRequest` is
active. Which isn't always the case.
Now The `ScriptRequest` is constructed from a `ScriptInterface&`.
Storing a `ScriptInterface&` in the `ModuleLoader::Result` allows to
remove the `m_Result` as it is retrieved from the `ScriptInterface`.
After Stan suggesting change in a review comment just enable the rule
'keyword-spacing' [1] and fix violations so this is no longer a topic in
spirit of #7812.
[1] https://eslint.style/rules/keyword-spacing
Ref: #7245
Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Some gloox headers need workarounds to be included, so mark the header
"lib/external_libraries/gloox.h" as source for all gloox symbols and
collect all headers we use under it.
Further make include-what-you-use happy with files in source/lobby and
fix what needs to be fixed after.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Move -Wall to where the other warnings are enabled so everything is in
one place.
Fixes: #5329
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Remove '-Wno-switch' and '-Wno-invalid-offsetof' as they do no longer
suppress any existing warnings. Also group warning disablers together.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The CI warns but doesn't fail, explicitly cast to float and while at it
use constant for PI/2.
```
source\graphics\cameracontroller.cpp(303): warning C4305: 'argument': truncation from 'double' to 'float'
```
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Replaces the for(;;) loop in GetNextChunk with a clearer while
(bytesRead < size) loop for better readability and intent.
Other improvements:
- Uses constexpr for constant audio format parameters
- Replaces C-style cast with reinterpret_cast
- Ensures consistent use of static_cast for type conversions
- Improves comment formatting
This refactor maintains the original logic while aligning with modern
C++ best practices.
Replaces a raw memcpy call with std::copy_n in VorbisBufferAdapter::Read
for improved type safety and readability. This ensures cleaner buffer
copying using standard C++ algorithms, avoiding manual pointer
arithmetic on void*.
The change is functionally equivalent but aligns better with modern
C++17 practices.
This commit updates the Ogg-related classes to use uniform brace
initialization ({}) for member variables where applicable. Brace
initialization improves clarity and prevents potential narrowing
conversions or unintended behavior caused by default constructor
ambiguity.
This change improves consistency and aligns with modern C++ best
practices, especially in C++11 and later where brace initialization is
recommended for safer initialization semantics.
Introduce a new `Open` method in `OggStreamImpl` that encapsulates the
logic for opening Ogg Vorbis files. This method replaces the previous
`Open` method and utilizes `std::runtime_error` for error reporting
instead of returning error codes. The constructor has been updated to
call this new method, ensuring files are opened upon instantiation. The
changes streamline the code and improve error handling.
OpenOggStream was previously used to stream Ogg files directly from the
file system. It operated on raw file paths (OsPath) and assumed
uncompressed, unarchived files, which made it unsuitable for working
with files inside archives or VFS layers.
However, its usage has been fully replaced by OpenOggNonstream, which:
- Reads the entire file into memory (non-streaming),
- Works with virtual file systems (VFS),
- Supports both archived and compressed assets,
Is already used consistently across debug and release builds.
There are no remaining references to OpenOggStream in the codebase, so
this commit removes the unused function and its associated logic.
This commit introduces support for std::optional<T> in
Script::FromJSVal. When a JavaScript value is undefined or null, the
resulting optional is set to std::nullopt; otherwise, the value is
converted and wrapped.
This change allows components to cleanly handle optional script values
without needing manual null checks or exception handling in C++.
As a direct application of this feature, the Identity component now uses
std::optional<std::wstring> for the return value of GetCiv(). This
resolves a bug where formation templates (e.g., those inheriting from
template_formation.xml) do not explicitly define a civ. After commit
03f7903fec, the code assumed GetCiv() would always return a valid
string, leading to undefined behavior when it was missing.
With this update:
- GetCiv() returning undefined results in an empty optional.
- The Identity component defaults to an empty civilization string ("")
when the civ is not defined.
- This avoids crashes or actor parsing errors for civ-less templates and
improves robustness in script-C++ interaction.
Closes: #8107Fixes: #8091
Previously, if a JavaScript function returned a value that failed to
convert to the requested C++ type (e.g., from JS undefined to
std::wstring), the ScriptInterface would fail silently, making debugging
difficult.
This commit improves the error reporting in the script system by logging
the name of the JavaScript function being called when a type conversion
failure occurs. This makes it easier to trace and fix issues arising
from script-side inconsistencies or missing return values.
The improved logging is particularly useful for debugging errors such as
undefined civ values from GetCiv() when used via m_Script.Call<T>().
As the Gitea LFS server does not abstract access to LFS remotes
(see https://github.com/go-gitea/gitea/issues/17715), it is necessary to
explicitly set the main repository as LFS storage, including for forks.
Add a way to tell whether `ReloadChangedFiles` actually catched events
by returning `INFO::SKIPPED` when it didn't.
Unlike GUI apps, you have to explicitely tell macOS to punp events in
console apps thus add a loop in the tests.
Reported by wow on irc:
ERROR: JavaScript error:
gui/session/match_settings/MatchSettingsDialog.js line 55 undefined has
no properties
rebuild@gui/session/match_settings/MatchSettingsDialog.js:55:3
init@gui/session/session.js:320:3
reallyStartGame@gui/loading/loading.js:22:9 ERROR: GUI page
'page_session.xml': Failed to call init() function
Suppressing boost warnings is already covered by how we include
libraries if there are actually still any of them relevant.
Then the v2 vs v3 stuff is obsolete as boost ships with filesystem v4
this days.
Lastly injecting a namespace alias via pch header is questionable, so
just don't.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
It is possible to modify sizes by setting the properties directly.
(Without having to create a copy of it)
This allows to shorten those passages quite a bit without any functional change.
Previously, modifying individual CGUISize properties (left, top, right,
bottom) via JavaScript had no effect unless the entire size object was
copied, modified, and reassigned—resulting in verbose and error-prone
code.
This update introduces proper JavaScript property accessors, enabling
direct reading and writing of CGUISize members. The result is a more
intuitive and scriptable API.
Key Changes:
- Implemented JavaScript get/set accessors for each CGUISize property,
directly interacting with the native object.
- Retained support for string assignments to CGUISize
- Maintained the GUISize JS object for backward compatibility, also
marked as deprecated.
- Improved CGUISimpleSetting<CGUISize> to allow partial updates via
direct property access.
- allow assigning size from object with pixel and percent values
You can now assign size using an object with properties like:
size = {
left: number, right: number, top: number, bottom: number,
rleft: number, rright: number, rtop: number, rbottom: number
}
- One or more properties can be specified, the missing properties with
fill as zero.
- Assignment triggers an immediate update event.
Delayed Setting Notifications:
- Introduced a mechanism for delayed setting notifications, currently
only used in CGUISimpleSetting<CGUISize>, to avoid redundant
recalculations.
- Ensured that getComputedSize triggers any pending delayed
notifications before returning the size.
This change significantly enhances the developer experience and brings
the behavior in line with typical expectations for direct property
manipulation in JavaScript.
A new hotkey "hotkey.camera.togglebirdseyeview" allows to switch
between regular view and bird's eye (top-down) view.
When bird's eye view gets toggled on, the camera moves above the scene;
When bird's eye view gets toggled off, the camera moves back to the
default vertical rotation angle;
When bird's eye view is on, vertical rotation is disallowed.
This rules can all be enabled without any code changes, meaning we
already follow them properly.
Ref: #8068
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Previously, the engine only loaded the last mod’s `config/mod.cfg` file,
causing earlier mods' configuration settings to be ignored. This broke
the expectation of stackable mod behavior and affected features relying
on custom config, such as font overrides.
This commit updates the mod mounting and configuration process to:
- Mount each mod's files before attempting to load its config.
- Reload each mod's `config/modname.cfg` via `g_ConfigDB.Reload(CFG_MOD)`
after mounting.
- Merge configuration keys into the CFG_MOD namespace:
- If a key exists, its value is updated.
- If not, the key is added.
This behavior now aligns with the VFS override system, where later mods
take precedence but earlier mods still contribute.
Also adds `_test.mods` for validation.
Fixes edge cases for mod authors who rely on consistent and layered
configuration overrides.
Related: #6383, #1810Fixes: #8060
Premake 5.0.0-alpha12 (released in August 2017) introduced the
`cppdialect` directive, which provides a cleaner and more portable way
to specify the C++ standard across compilers and platforms.
Previously, we used manual per-action buildoptions:
filter "action:vs*" buildoptions { "/std:c++17" }
filter "action:not vs*" buildoptions { "-std=c++17" }
This workaround was necessary due to the limitations of older Premake
versions (particularly Premake 4), which lacked built-in support for
setting the C++ language standard.
Now that we're using a newer version of Premake 5, we can simplify this
setup by using:
cppdialect "C++17"
This results in cleaner, more maintainable build scripts with consistent
behavior across toolchains.
Previously the number of graph colors was limited, which resulted in the
reuse of colors if many different profiling regions or reports were
displayed. This commit changes so unique colors are generated for
each region/graph, by utilizing the beauty of the golden ratio.
The ModifiersManagers needs to reset caches and recompute modifiers when changing ownership. However, the code only did this for global modifiers for the new player entity, not the old player entity. This meant we would not reset all modifiers, and could OOS (#7996) or lead to incorrect values.
Fixes#7996
Reported by: Itms
Some have their editor configured to remove trailing whitespace and
editing such a file would "fix" it, adding an unrelated change.
Fix whitespace violations excluding third party libs and generated files
like glad or patches.
Enable pre-commit hook trailing-whitespace to enforce it in the future.
Fixes: #8016
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Disabled rules are the same as not listed rules of which there are many,
keep them out of the config.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
They way the project is structured this isn't really usable for now but
might change with move to ESM modules.
See: https://eslint.org/docs/latest/rules/no-unused-vars
Ref: #8068
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
They way the project is structured this isn't really usable for now but
might change with move to ESM modules.
See: https://eslint.org/docs/latest/rules/no-undef
Ref: #8068
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
To improve visual consistency during dynamic font rendering, especially
on lower-end machines or during low FPS moments, we now preload a set of
common Latin letters, digits, and punctuation glyphs immediately after a
font is loaded by the FontManager.
This reduces the likelihood of users seeing empty or missing characters
on the first frame after a font is used, minimizing visual glitches
during simulation.
The preloaded characters include:
- Uppercase and lowercase Latin letters (A–Z, a–z)
- Digits (0–9)
- Common punctuation and symbols (e.g., .,;:!?()[]{}<> etc.)
This change helps smooth the user experience and avoids blank spaces
during the initial rendering of text in performance-constrained
scenarios.
This removes the padding from the start and the end of the frequency
graphs, to remove the inaccurate steps it caused.
It also improves the smoothness of the frequency and frame-to-frame
graphs by painting each graph as a single line, instead of one line per
data point.
Before premake 5.0.0-beta3 if --cc wasn't specified the gnu make default
was used unless overridden via env.
Now premake always chooses a compiler sidestepping gnu make choice. So
use the premake pick unless explicitly overridden via CC in env or via
option to premake.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The gmake action has a separate idea as to what the default toolset
should be, add that to the patch fixing the default for BSD.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Eslint maintains a list of rules it recommends, split them into own
section for easy identification.
Further sort the rules and don't use magic values for severity.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Because its a function `GenerateMap` is renamed to `generateMap`.
Allows to rewrite the libraries as modules and to remove the costum
`Engine.LoadLibrary` mechanism in the future.
The rule 'no-negated-in-lhs' was deprecated in eslint 3 [1], replace it
according to recommendation with 'no-unsafe-negation' and enable all
extras as our code already conforms.
[1] https://eslint.org/docs/latest/rules/no-negated-in-lhs.html
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This makes 5.0.0-beta5 the minimally supported version as the gmake2
action was renamed to gmake while gmake was renamed to gmakelegacy. So
from now on gmake action is to be used.
Clear out all old version dependent code.
Fixes: #7789
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Also extend it by compairsion operators <= and >=
This will probably also be useful for checking versions of dependencies.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
After FreeType integration in dfb4598186 font height and line spacing
were incorrectly applied. That caused UI elements like capture, health,
and resource stats to appear misaligned or invisible.
Commit c2d529b975 standardized font height usage, removed lineSpace, and
introduced GetCapHeight + Descender for better vertical alignment.
However, affected texts used a font-stroke-12 with a GUI size of 12,
which now renders lower in the container due to stroke and metric
offset. Increasing the size to 14 ensures the text is properly visible
and aligned.
This adjusts for the actual space font-stroke-12 occupies in rendering.
Fixes: #7962
This reverts commit dc156c3f24.
The original commit addressed incorrect UI alignment caused by improper
handling of font height and linespacing after FreeType integration
(introduced in 734386ce9f).
However, commit c2d529b975 corrected the root issue by standardizing
font metrics:
- Proper use of FreeType's height
- Removal of lineSpace
- Introduction of getCapHeight and Descender for accurate vertical
alignment
As a result, the UI offset workaround is now obsolete and must be
reverted to reflect the correct baseline behavior.
This reverts commit 52ee6ad470.
The original commit addressed incorrect UI alignment caused by improper
handling of font height and linespacing after FreeType integration
(introduced in 734386ce9f).
However, commit c2d529b975 corrected the root issue by standardizing
font metrics:
- Proper use of FreeType's height
- Removal of lineSpace
- Introduction of getCapHeight and Descender for accurate vertical
alignment
As a result, the UI offset workaround is now obsolete and must be
reverted to reflect the correct baseline behavior.
Previously, `height` was derived from a manually chosen glyph (typically
"I", Standard Cap Height) using FontBuilder, and `lineSpacing` was used
inconsistently for layout logic as a height.
Now, with the FreeType-based system:
- `height` uses `face->size->metrics.height`, which includes the
recommended line height with internal leading/line gap as defined by
the font designer.
- `lineSpacing` was removed
- `GetCapHeight` uses the standard cap height + ascender to have a
visual virtual alignment
This change standardizes font metric usage:
- Use `height` for vertical layout and line progression.
- Use `GetCapheight` in layout engines like `CGUIText` or `CGUIString`,
This ensures better alignment across fonts and consistent spacing in
multiline text rendering.
Fixes: #7962
Fixes the issue that they noticably stick out horizontally when placed on slopes.
(thanks to the previous commit these values will be adopted by the "special/actor" template when loading it in)
Reviewed-By: Itms
Reviewed-On: https://gitea.wildfiregames.com/0ad/0ad/pulls/7542
Optionally let actor templates define their own anchor types.
These override the default value defined in the template.
Useful for actors without their own entity template.
Reviewed-By: Itms
Reviewed-On: https://gitea.wildfiregames.com/0ad/0ad/pulls/7542
During the eslint 8 cycle the formatting rules were split out [1],
deprecating the corresponding rules in core.
This replaces all rules that where moved to @stylistic/eslint-plugin [2]
and accounts for the difference in the indenting rule behaviour.
To allow the pre-commit import hack to continue to work with the
stylisitc plugin for a recent nodejs version to be used.
[1] https://eslint.org/blog/2023/10/deprecating-formatting-rules/
[2] https://eslint.style/packages/default
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Not all modules should be able to load all other modules. A predicate
function can to be passed to the `ScriptInterface`. That function
returns whether the module is allowed to loat the module. If no
predicate is passed in no modules can be loaded through that
`ScriptInterface`.
- With modules JavaScript code can be split up into multiple files. We
already implemented such a mechanism (`Engine.LoadLibrary`) in
multiple parts of the engine. The advantage of using modules is
that it's standart (JS-devs are familiar with it) and it doesn't
has to be implemented multiple times.
Note that `Engine.LoadLibrary` loads all files in a directory
while the new `import` only loads one file.
- With modules seemingly global variables are local to that
script/module. We already implemented such a mechanism
(`ScriptInterface::LoadScript`).
Requires HEAD to point to --to <commitish> for the files to be in the
state for copyright.py to produce expected results. Which isn't the case
in the gitea workflow.
Also use plumbing commands to on one hand make it more robust and on the
other hand to avoid bad files only in --from <commitish> to leak into
the check.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit primarily corrects an inaccurate comment and resolves a
hidden bug in the VisualActor shadow logic, while preserving the current
behavior.
Previously, the DisableShadows option removed both casting and receiving
shadows. However, the internal logic ignored this setting in some cases,
causing shadows to appear even when explicitly disabled in XML
templates.
This change introduces the ability to control CastShadows and
ReceiveShadows independently via template settings, defaulting both to
true unless explicitly specified.
In addition, previews are updated to receive shadows but not cast them,
improving visual volume effects without affecting lighting behavior.
All documentation pages are made subpages of a page Documentation, this
helps browse documentation not directly tied to source code.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The FreeType font loader was directly passing filesystem-style paths
(e.g., mod.zip/...) to FT_New_Face, which does not support paths inside
ZIP archives. As a result, FreeType failed to open the font, triggering
a crash when the engine attempted to use an invalid face object.
This patch changes the font loading logic to:
Use the VFS to read the .ttf font file into memory (shared_ptr<u8> and
size).
Load the font using FT_New_Memory_Face with the in-memory buffer,
ensuring compatibility with zipped mods.
Previously, opening a map that referenced a deleted or missing terrain
caused a severe crash with multiple error dialogs, forcing users to kill
the process. This change restores the previous behavior where missing
terrains are gracefully handled: a warning is logged and the terrain is
substituted with a fallback placeholder (ErrorTexture from
TextureManager).
This significantly improves UX for developers and modders working with
outdated or broken maps, aligning behavior with expectations from
earlier versions of the editor.
Extends the current Windows pipeline to also build for AMD64. While at
it use a matrix build.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The BIT macro is compile time only anyway. Takes care of the warning
"C4334 - <<': result of 32-bit shift implicitly converted to 64 bits".
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make what could be considered a legendary hack less brittle.
C4312: 'reinterpret_cast': conversion from 'long' to 'void *' of greater size
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
In premake we check for wxWidgets on Windows to see if we can build
Atlas, this check wasn't adopted when adding support for Win64.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Those warnings aren't enabled for gcc and clang currently either, so
just disable them for msvc as well.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Mongoose is on the way out, and it's not like the same issue isn't
present for other 64bit platforms, we just don't have those warnings
enable there.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The target file is checked in into vcs so this tool isn't used during
build and as such better lives in source/tools.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
All linting was ported to pre-commit or gitea workflows, the only thing
left is an adapter to output to Phabricator which is no longer in use.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This option allows to build the spidermonky archive hosted by WFG from
the upstream firefox tarball.
First this serves as documentation as to how the taball is created and
by integrating it into the regular build process allows to easely bump
spidermonky version for local testing.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
In f3ac9e9669 the fail condition was broken causing it to allow building on restricted areas.
Add a test to ensure correct behavior for this case.
Reported by: @wowgetoffyourcellphone
Pull Request: #8021
Atlas has no notion of player removal. Each entity would trigger an error in Player.js
Reported by: @trompetin17
Reviewed by: @trompetin17
Pull Request: #8006
This replaces the old arclint eslint setup 1:1 rule wise, only porting
the configuration to a format recent eslint can read.
Further remove the arclint setup as it is no longer of use.
Thanks to Stan for reviewing all needed fixes to Javascript code to
allow for adding this without compromises.
Fixes: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This fixes 'no-trailing-spaces', 'semi', 'prefer-const' that made it in
since and 'no-shadow', 'no-multi-assign', 'no-invalid-this' as well as
'no-undef-init' in profiler.
Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Variables declared with `var` are also accible after accessing the
scope. This lead to shadowing because variables with the same name are
declared in a later scope.
Ref: #7812
Since variables declared with `var` don't respect all scopes, when used
in a loop it doesn't create a new variable each iteration. The
initializer value is always assigned to the same variable. That makes
problems when the variable is used in a callback. To work around that
the variable is copied in to a IIFE.
When not using `var` the iife isn't required.
Ref: #7812
This commit introduces optional debugging visuals for font glyph
rendering. When enabled, each glyph is drawn with a surrounding debug
box to aid in visual inspection of glyph layout, spacing, and atlas
behavior.
Usage examples (via console):
// Enable debug box rendering
Engine.ConfigDB_CreateValue("user","fonts.debugBox", true);
// Set debug box color (R G B)
Engine.ConfigDB_CreateValue("user","fonts.debugBoxColor", "35 0 35");
This feature is intended for developers working on font layout or atlas
generation logic, and has no effect on normal gameplay or UI rendering
when disabled.
This removes all global code and fixes eslint warnings 'no-shadow' and
'no-undef-init'. Leave other possible improvement style wise for an
other time.
Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Eslint doesn't like the global return and fails to parse the trigger
script file. Rewrite the script to avoid this and any globals while at
it. Also use OnInitGame as the execution with an IIFE in global scope
wouldn't guarantee when it will be executed or whether the timer
component is already registered.
Further don't concat the warning string as the extraction script for
translation expects a literal.
Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
As noted on #7979, we run into OOMs since commit af32d386b9. The reason is that the default incremental GC budget is unlimited, which actually doesn't perform incremental GCs. Our settings can lead to situation where the incremental GCs don't actually sweep, thus not freeing memory.
SM has a mechanism to avoid OOM anyways with LAST_DITCH GCs, but by default these can only occur ever 30 seconds. Turn this off.
Reported by: langbart
Text rendering appeared blurry due to subpixel positioning when using
LINEAR filtering. Replaced glyph position calculation with std::ceilf()
to ensure integer-aligned drawing coordinates and crisper text.
The renderer instance is created with new, so use delete.
Direct leak of 80 byte(s) in 1 object(s) allocated from:
#0 0x7fd3c932870b in operator new(unsigned long) (/usr/lib/gcc/x86_64-pc-linux-gnu/15/libasan.so.8+0x12870b)
#1 0x55bbedf25fb0 in InitGraphics(CmdLineArgs const&, int, std::vector<CStr8, std::allocator<CStr8> > const&, ScriptContext&, ScriptInterface&) ../../../source/ps/GameSetup/GameSetup.cpp:654
#2 0x55bbed2bb95e in RunGameOrAtlas ../../../source/main.cpp:684
#3 0x55bbed271b28 in main ../../../source/main.cpp:759
#4 0x7fd3c665f3ed in __libc_start_call_main (/lib64/libc.so.6+0x263ed)
Fixes: #7951
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Fixes 'no-invalid-this' by converting to arrow function as thisArg is
only accepted by eslint for inlined function, "free" function might be
used in another context.
Also fixes 'consistent-return' and 'default-case' adn while at it
simplify the logic a bit.
Manual fixes needed for:
eslint --config full.mjs binaries/data/mods/public/simulation/ai/common-api/gamestate.js
Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This refactors validate_dae.py to utilize multiple CPU cores. This makes
it significantly faster. It also improves code quality and adds commands
line options.
Instead of listing files recursively for each directory manually, this
uses the built-in glob functionality of Python's pathlib.Path. As
part of this the found paths are returned as generator instead of a
list. Together this results in easier to read code and better
performance.
This commit enhances text rendering by leveraging FreeType and a dynamic
font atlas. Previously, GUI scaling relied on bitmap fonts, which led to
blurry and distorted text when scaling up. Now, we scale the font size
directly using FreeType, resulting in much sharper and more readable
text at any GUI scale.
Key improvements:
- Replaced bitmap font scaling with true font size scaling via FreeType.
- Reduced glyph cache dependency on fixed positions, relying on shader
scaling instead.
- Switched to float-based glyph positioning for more accurate rendering
and scaling.
These changes ensure clean and consistent text appearance across
different GUI scales.
Manual fixes needed for temporary config braces-rules due to setting up
required plugin:
eslint --no-config-lookup --config brace-rules.mjs
Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Running the markdownlint pre-commit hook as Gitea Action fails for
markdownlint >=0.38.0, as the NodeJS version available in the Act Runner
Docker image so too old for that. To solve this, this commit specifies a
newer NodeJS version to use.
This skips recursive parsing of the parents of an entity, as just its
direct parents are required by the implmentation. It also simplifies how
such calls are cached. This leads to much cleaner and faster code.
A typo in the assignment of the error state lead to checkrefs.py
existing with return code 0, while it should've returned 1 in some
cases. This commit fixes that.
As the fonts specified in the GUI templates don't exist as files on disk
anymore after 734386ce9f we can't check if they're specified correctly
the same way as before anymore. Instead, this commit adds validation
of font names to the GUI Relax NG schema and adds a check whether all
fonts referenced in default.cfg exist in the proper location.
default.cfg contained two sections named "profiler2". That's something
which might be confusing and is not supported by all implementations of
ini file parsers. To remove that ambiguity, this combines these two
sections into one.
After 734386ce9f, CJK fonts are included in mods/mod folder, removing the
need for CJK mods. This commit enables those languages in the release
and the installer.
This improves pathfinding feel as units no longer try to clump on a particular point. However, can lead to oddities if there's a lot of impassable terrain around.
Closes#7791
This fixes a crash when pyrogenesis got compiled with certain
compilers, whenever a command is entered in the console, while no
console.txt log exists.
Fixes#7964
FreeType’s FT_Glyph_To_Bitmap mutates the FT_Glyph by allocating a new
glyph object and overwriting the input pointer. This creates a risk of
memory leaks if the old glyph isn’t released or if ownership is unclear.
To avoid this, we now store the glyph in a UniqueFTGlyph and explicitly
pass it by reference to FT_Glyph_To_Bitmap. After the mutation,
ownership continues to reside in the smart pointer, and cleanup is
guaranteed even in error branches.
For temporary glyphs (e.g., strokes), we still manually call
FT_Done_Glyph, since they are not managed by UniqueFTGlyph. These
changes ensure all glyph memory is correctly released and reduce the
need for repetitive error-path cleanup code.
Striping is trivial, getting the debug symbols if premake just strips
them silently is a pain tho.
Stripping should optionally be done during install, as we don't have an
install target nor an install-strip target, make it a configure option
which is off by default.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The Ptolemaic lighthouse is a pretty unique building. Ever since it got
changed to not reveal all coasts anymore in 04240f05a7 it hasn't been
very useful anymore, as its visibility range was too low to justify
spending the resources on it. To make the lighthouse more attractive
again, this commit increases its visibility range from 200 to 325.
Given that Valgrind is not yet avx512 ready [1] all the more reason to
have easy access to ASAN and friends for compilers that support it.
This commit adds options for ASAN, TSAN and UBSAN. [2]
[1] https://bugs.kde.org/show_bug.cgi?id=383010
[2] https://github.com/google/sanitizers/wiki
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Manual fixes needed for:
eslint --no-config-lookup --rule '"no-new": 1'
Make the handlers that aren't actually handlers calss functions and for
the HotkeyPage suppress the warning as the global init is prone to be
removed at some point.
Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
After 8d993b9250 the generated test_root.cpp is no longer in the source
tree but generated in workspace. The issue of there bing no source is
still valid, so update the path.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This fixes the ability for users with uppercase letters in their
username to change their passwords, which wasn't possible before on
non-Windows platforms. The underlying issue for that is
https://github.com/processone/ejabberd/issues/4377 and in addition some
inconsistent normalization of usernames in password change requests
by gloox. This commit works around that by always using the local JID
part as username for password requests, which got the nodeprep string
profile already applied.
It also fixes a problem that Windows users which were able to change
their passwords, weren't able to login afterwards anymore, unless they
typed their username in all lowercase in the login form. This was caused
by using the all lowercase username as input for the password hash
function, instead of using the username in the user supplied case.
Fixes#7796
If a commit just removes files for cleanup purpose for example the list
of files to check would be empty. Therefore allow no files as arguments
for use in CI.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
A last minute change in #7787 caused the bold and italic identifiers of
fonts to be ignored once it got merged in 734386ce9f and all fonts to
be rendered as regular fonts. This commit fixes that.
This contains some small layout fixes and improvements for the
civilization overview and structure tree pages. Some of these fixes have
fix regressions introduced with 37065ebc71.
The perl script extract.pl just checks for a line matching
'-- include data json--', so making it valid js is can be done just
fine.
Also fix eslint warning is graph.js.
Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Replace premade bitmap fonts with FreeType2 and dynamic texture atlas.
Switched from static, premade bitmap fonts to runtime-generated glyphs using FreeType2.
Glyphs are rendered on demand into a dynamic texture atlas, improving scalability,
font quality, and support for internationalization.
Currently using RGBA format for compatibility across all render
paths while initial support for R8_UNORM is being added.
This prepares for future optimizations in VRAM and performance
Includes groundwork for gamma-corrected blending and future swizzling support.
The Github documentation is difficult to parse, but there is an
asymmetry in the API:
- for a PR event, the event object contains a `pull_request` object
containing `base` and `head` objects
- for a push event, the `before` and `after` SHAs are immediate
children of the event object
<https://docs.github.com/en/webhooks/webhook-events-and-payloads>
Fixes#7730.
The new patch-release pipeline takes a git branch originating from a
release tag, applies the changes since the tag onto the nightly build of
the release, and rebuilds the Windows binary.
All resulting changes are sent to the bundling pipeline which builds for
macOS and creates the tarballs and installers.
There will be two instances of the bundles pipeline: the main one will
keep tracking the main branch and providing biweekly bundles of the next
release, while a new patched-bundles pipeline will be manually used to
generate patch releases.
The remaining ones that can be fixed automatically.
eslint --no-config-lookup --fix --rule '"prefer-const": 1'
Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This disables the default issue type in Gitea and replaces it with a
link to the help and feedback section in the forums. That's a measure to
discourage players to use Gitea as a tool to seek support.
New files in the repository are naively added using `svn add --force`
which adds all unversioned files according to the documentation.
However, this iterates through the entire repository and takes about 12
minutes. Using `svn status` and parsing through the results only takes a
couple seconds.
The call to `svn delete` on deleted files does not work if filenames
contain spaces. This happens in particular when we fix spaces in
filenames, as the pipeline doesn't understand file renames.
This allows the compiler to skip stack guards on some functions, leading to better performance at limited security expanse.
Examples of such functions include isqrt64 and ComponentManager::PostMessage.
For consistency with other commandline args containing '-' which can't
make use of the dot notation disable the rule for affected lines.
eslint --no-config-lookup --fix --rule '"dot-notation": 1'
Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Manual fix needed, remove all assignments to undefined and rely on the
default state.
eslint --no-config-lookup --rule '""no-undef-init: 1'
Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Manual fix needed, using 'noop' comment to silence warnings and convert
for loop to a probably more readable while loop.
eslint --no-config-lookup --rule '"no-empty": 1'
Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This fixes all issues eslint can safely do automatically. Drastically
reducing the number of open style issues reported.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Remove the need to train 3 Traders before researching Diaspora, which
will now be researched directly from the Market instead of the Civic
Center. To compensate, increase cost by +100 food, +200 metal, and
+10 research time, matching the three resources used to produce
Traders, but in smaller quantities.
Fixes#7381
This allows selecting multiple reports to load at once in the file
chooser dialog. Reports will be loaded in parallel and the last one to
finish loading will be the active one.
This removes a duplicate call of on_report_loaded() when loading a
profiling report. This second call caused loading reports to fail,
whenever it took longer than 5 seconds. While that was probably a
measure to prevent reports loading too long and taking up too much
resources, it didn't achieve that goal, as the actual loading of the
report din't get aborted.
This replaces the previous arclint linter for checking the copyright
year in license headers with a gitea workflow job.
As the date of last edit might differ from commit date due to reverts
the copyright linter is run against a base commit.
The python script doing the heavy lifting is written by @Dunedan.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Co-Authored-by: Dunedan <dunedan@phoenitydawn.de>
Fix nvtt build to support cmake-4, while at it also fix other
related outstanding cmake issues in nvtt.
Fixes: #7538Fixes: #7764
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Adds possibility to control the frame time by setting the frame
frequency by a command line argument (`-fixed-frame-frequency`). It's
mostly useful for a trailer recording and graphics debugging.
This removes the static text "Gatherers: current" from the
resource and population counter tooltips. This string was static and
only changed its color depending on whether units were assigned to
collect a certain resource. That information is however already
available in the counter display itself.
It allows to reduce the number of allocations per-frame for
ShaderDefines. For example, on Acropolis Bay it goes down from
2.7k to 0.9k for the whole map view.
We don't really need std::vector for it. Because materials and
particularly shaders shouldn't have so many parameters.
Don't try to muddle through, if the files expected to be present can't
be copied it's a hard failure.
Further abort with error code for failed commands so it can be caught by
the CI.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
If running premake fails during update workspace then update workspace
needs to exit with an error as well so the CI will actually report an
error.
According to Itms testing with powershell passing the original error is
unreliable, so just exit with one.
Fixes: #7642
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Shrinking GCs dump the JITted code, which leads to redundant recompilations, lowers performance, and makes profiling JS more difficult.
They may still happen if the runtime is at risk of OOM.
The cache would take the value post-player-modification, which is incorrect. This would usually just make caching fail, but could trigger worse problems if the post-player value is also used in other situations.
One such situation leads to an OOS for britons.
Thanks to elexis for the thorough investigation.
Fixes#7634
With the introduction of multiplayer loading screen tips, categories of
tips and probabilities of how often to show tips from a certain category
got introduced. The original probabilities ended up showing multiplayer
tips in 60% of the cases. As the number of multiplayer tips is still
fairly small, this resulted in very repetitive occurrence of the same
multiplayer tips over and over when loading multiplayer matches.
This commit changes that to give single-player tips a higher probability
for multiplayer matches. It also adds showing tips from the "Beginner"
category for multiplayer games, as there are regularly new players who
start their experience with 0 A.D. by playing multiplayer matches with
friends, instead of playing single-player matches and who'll therefore
benefit from those tips being shown for multiplayer matches as well.
New small metal mine models and actors.
New sparkle particles.
Remove refs to old metal ore mines from existing maps.
Fix refs to temperate_small_01_01, which should have been temperate_small_01
According to our stats `GL_ARB_fragment_program_shadow` is supported
by all our GL users. Also we're going to remove OpenGL ARB in A29. So
I remove ARBShadersShadow completely.
A multi player loading screen will have possibility of showing single
and multi player tips while multi player tips are in favor.
Tips are now separated by categories. During loading those category
have an occurrence probability, where we are choosing a random category
based on chance and not by complete randomness. From there we just
picking a random tip from that category.
This fixes the pulling of objects from LFS in the checkrefs workflow. To
do so three steps were necessary:
- Don't fail immediately when encountering missing objects in LFS
- Fix the remote URL of the fork repository
- Fix the authentication for the LFS storage of the fork repository
The option was missing, so player placement was not shown in the game
description part of the game setup, and it was not shown in the objectives
page in-game.
SpiderMonkey 98 introduced a size heuristic for the nursery GC region
(https://phabricator.services.mozilla.com/D136637). As this heuristic
uses a wall-clock time duration, it results in a severe performance
regression on slower systems for our use case.
This commit adds a workaround to turn off that heuristic, by telling
SpiderMonkey that a "page load" (something which doesn't have a meaning
in the context of pyrogenesis) is in progress, as that heuristic is
disabled for page loads.
Co-Authored by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Fixes#7714
Since 0eed117e6d exceptions from the map generation script are rethrown
in the main thread but not all of them are catched.
This defect is already fixed in the engine with 82513c9104Fixes: #7620
Profiler2 currently explicitly considers 'frame' for frames, which is a bit annoying in replays as state hashes are computed outside of these. It's better to just rely on RecordFrameStart() calls.
Up to now the chat autocompletion did complete words, even if there were
multiple candidates which matched available. So if for example the
autocomplete list contained "bar" and "baz" and a user typed "ba",
autocompletion would complete it to "bar", ignoring that "baz" was
available as possibly desired result as well. In practice this lead to
people regularly getting completions they didn't intend to get. This
commit fixes that by only completing text, if there is only a single
candidate available.
After 78900842b1, the following message was shown to clients when the
host disconnected during game setup:
"Lost connection to the server.
[Invalid value undefined]"
This patch fixes that.
The context option enabling strict mode was removed in sm-117 [1]
requiring to use the compiler option for the same purpose instead.
[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1621603
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The event property github.event.push.before seems to not be supported
and therefore the workflow as is fails on main.
Ignoring the trigger means a slight loss in coverage but as it still
fully checks PRs we are mostly good.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Add a workflow for linting and add a cppcheck job.
The job is using cppcheck provided by package manager. Existing errors
are suppressed to get going with CI linting, ideally tho the suppression
list would be empty. Some of the suppressed errors are only found with
more recent cppcheck than what is available in the runner.
Also remove old arclint cppcheck setup.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
A shell utilities function library starting with a first utility
function for getting the number of online CPUs.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Theere is now an `Engine.startAtlas` property that will start Atlas
when it's returned from the root page. The `Engine.RestartInAtlas`
function is removed.
There are a few version of boost which deprecated global placeholders
but do not yet support std placeholders. Simply suppress warning for
those cases.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Use the single Debian 12 container image and inject CC, CXX and LDFLAGS
instead.
Further do the lfs checkout on the agent instead of inside the container
avoiding full rebuilds due to version mismatch.
Then split the debug and release builds using separate workspaces and
record warnings by build preventing gcc warnings leaking into clang
warnings.
Based on zero warning policy and incremental builds using a reference
build doesn't make sense. Removing that we can also drop an additional
generic workspace.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Debian 12 (bookworm) will soon be oldstable.
Most importantly this version comes with cmake-3.25, which will allow us
to use SDL3, cpp-httplib, fcollada fork and possibly others in the
future.
This also comes with gcc-12 and clang-14 by default, both implementing
almost all of c++17 and most of c++20.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The most notable changes are:
- improved performance thanks to using `lxml` instead of `xmllint` for
validating the templates
- improved performance by parallelizing the validation across multiple
threads
- more meaningful output for detected validation errors
- easier to call from other scripts (like checkrefs.py)
When TLS for XMPP connections to the multiplayer lobby got implemented,
there was a bug in gloox [1] preventing the certificate verification to
succeed. This bug got fixed in gloox 1.0.22 five years ago, so it's safe
to enable certificate verification by default now.
[1]: https://web.archive.org/web/20200522184941/https://bugs.camaya.net/ticket/?id=280
Since 40762c257d there is a callback passed to the "onPress" function of
the `g_MainMenuItems`. If the "onPress" function is a bound
`Engine.OpenChildPage` with only the filename bound to it, the callback
becomes the second argument.
The second argument is cloned to pass it to the child page. Cloning the
callback crashed the engine.
Users may generate key presses that don't map to a distinct SDL scancode
and will be mapped SDL_SCANCODE_UNKNOWN instead. Using the same ID for
unmapped hotkeys means any such key press will execute unset hotkeys. As
luck would have it in #7644 this leads to calling "Custom exit to
desktop" if the hotkey is unbound as is the default.
So simply use a code for unused hotkeys that doesn't map to any SDL
scancodes.
Fixes: #7644
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Add a unique disconnect reason for timeouts of connection attempts.
Rewrite the displayed error message and provide a link directly to the FAQ entry.
(The old message was very misleading and only brought players on the
wrong track during troubleshooting)
When the root page gets closed the engine quits instead or crashing.
The root pages are changed to use that mechanism to quit the engine.
This removes the need of `Engine.Exit` for the GUI.
Don't hardcode the number of parallel jobs in Windows based pipelines
but allow setting the desired number in the environment.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Allow the number of concurrent build jobs in Unix build pipelines be
specified in the environment via the JOBS variable.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Remove the world population setting from the game setup.
Add a dropdown for choosing the "Population Cap Type".
(-> containing Player Population, World Population, Team Population)
Use a single "Population Cap" dropdown adapting to the pop cap types.
Move all population data into a single .json file.
New system component "PopulationCapManager" for distributing pop caps.
Resolves: #6918
The xmlvalidator logic is only used by the checkrefs.py script, so this
moves it to the same directory to have it co-located and avoid having to
modify sys.path to import it.
By default ruff excludes all files in directories named "dist" from
linting (https://docs.astral.sh/ruff/settings/#exclude). This caused the
Python scripts in `source/tools/dist/` to not get linted. This commit
fixes that and adjusts their style to fit our ruff rules.
The Linux agent now runs Docker in rootless mode for additional
security. Operations inside containers must be run as root to match the
underprivileged user running Docker.
If you run as root then created files will be owned by root, this is
expected behaviour and not messing with permissions as stated in the
error message.
Running in a container the root user may map to the user starting the
container while all other users would need mapping to be able to work
with a bind mounted a checkout.
Further Debian patches out the root check to be able to build on their
builder.
Given the above remove the check.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Add checks for sprites, styles, scrollbars, tooltips, and colors.
And too for entire objects referenced by the "use_object" attribute.
(even though that is currently unused)
The UPnP implementation included a combination of two subtle bugs, which
resulted in failure to create port forwardings every time after the
first one.
When using UPnP, the internet gateway to create the port forwardings at
needs to discovered. As that takes a while, the its root descriptor URL
was supposed to be cached after successful discovery in the user config
in "network.upnprootdescurl". However, instead of caching the root
descriptor URL, the control URL got cached. That caused following
requests to the root descriptor URL to fail, as they ended up at the
control URL instead. As such requests might also fail when the network
topology changed, the code was supposed to fall back to discovering the
internet gateway again when the cached one didn't work. However, due to
the inner workings of miniupnpc the request using the cached root
descriptor URL didn't result in an error, so the new discovery was never
triggered. As the wrong value was persisted in the user config there was
also no way to get out of this situation again.
This commit fixes both of these bugs.
As far as I can tell these bugs existed since the introduction of the
caching of the root descriptor URL in 0ba25e9968, which means creating
port forwardings using UPnP has been broken since Alpha 15.
When adding a port forwarding via UPnP, pyrogenesis first needs to
discover the internet gateway to create the forwarding at. To do so, it
utilizes miniupnpc to send an SSDP request and waits 10 seconds until it
processes the responses and continues to add the port forwarding.
As that happens asynchronously it means if players hosting games rely on
UPnP for port forwarding and if their pyrogenesis instance doesn't have
the address of their internet gateway cached, it takes more than 10
seconds after starting to host a game, before players can join. However,
waiting for 10 seconds is completely unnecessary, because the internet
gateway responds immediately to the SSDP request. Therefore, this commit
reduces the time to wait for responses from 10 seconds to 2 seconds,
which is the timeout miniupnpc uses internally as well, when discovering
internet gateways.
Up to know the UPnP logic ignored the port a user was hosting a game on
and always added a port forwarding for the default port UDP 20595. This
commit fixes that, so a port forwarding is added for the actual port a
game is hosted on.
As it turns out we don't need that special logic for handling the "long"
locale properly and everything continues to work as before without it.
The only difference is that the number format not being the one from
en_us anymore when using the "long" locale, but the one of the
system-wide configured language, which should be an even better user
experience than before.
The debug serializer currently outputs data even for components where `Serialize = null`.
This leads to useless data being output, especially in OOS debug states which makes diffing more annoying.
Noted in #7634
Move the lines from the .txt to the .xml .
Add separate objects for each paragraph and icon.
Position the icons depending on the paragraph length in the current
language.
This eliminates potential for breakage during translation.
Fixes#7484
Gcc-14 triggers a warning for substitute_esc_chars in
json_spirit_reader_template.h if optimizations are enabled.
../../../source/third_party/jsonspirit/json_spirit_reader_template.h:138:62:
/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/char_traits.h:427:56: warning: ‘void* __builtin_memcpy(void*, const void*, long unsigned int)’ accessing 9223372036854775808 or more bytes at offsets 0 and 0 may overlap up to 9223372036854775809 bytes at offset -1 [-Wrestrict]
427 | return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n));
for with lto enabled
/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/char_traits.h:427:56: warning: ‘__builtin_memcpy’ specified bound between 9223372036854775808 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
427 | return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n));
This looks like another incarnation of bugs like:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100366
Add quirk to avoid the warning
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Premake v5.0.0-beta4 replaces the LinkTimeOptimization flag with a
function linktimeoptimization, use it if available to avoid deprecation
warning.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
jquery 1 is for support of old version of browsers not even maintained
this days.
Updating prevents occasional hangs for me.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
- OARS content rating have been updated to version 1.1
- Touch Screens, Keyboard, Mouse have been marked as supported
- Laptop screens and bigger are marked as required to the minimum width of 1024 required by the game
- Fixes the device compatibility page on GNOME Software.
- added a "0AD" keyword to fix an issue with Flathub search feature where searching for "0AD" instead of "0 A.D." returns no results.
Code within CONFIG_ENABLE_BOOST is required to compile pyrogenesis.
As boost is required in many other places, making it truly optional in
the one case where there is currently a guard is meaningless.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Either a return value or an exception has to be stored. With
`std::variant` it's more explicit.
Also the return value is never empty, so there is no need for
`std::optional` anymore.
Those bugs stood out to me as I was experimenting with migrating petra
to ES6 classes. Since this give the code stronger typing, those kind of
errors stand out immediately.
For example, autoResearch is a function, thus referring to it by name
will always return the same result. In other cases the referenced
variables simply don't exist.
When marking a tag dirty, the obstruction manager checks it has not already done so. This is un-necessary when the global state is marked dirty, and this check is rather slow since we do it once per entity, effectively leading to an o(n^2) runtime.
235ea5cfb4 updated the languages supported by 0 A.D., but missed
updating them for the installer. This commit makes up for that and
updates the languages for the installer as well.
This is a workaround to avoid disabling GL storage buffers completely.
Because they might not work or might lead to a decreased performance.
We need to investigate that further when we have a local reproduce.
On Danubius removing the usages was forgotten in e01ea16ae5.
In Coast Range and Migration they were newly introduced.
There are also some whitespace changes in Coast Range.
This fixes an oversight from d655455304. During a code deduplication, a
check was removed. When looking at the lobby as a dialog (while in
gamesetup), it should be impossible to try to join a game.
This is an oversight from 415304db8a and #6660.
This forgotten template cropped up in #7525. It does not contain the
needed components to interact correctly with the player.
Fetch third party tarballs for source packages so they will be bundled
in source release tarballs.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Used to prefetch all required tarballs to build pyrogenesis later
without network access as is common for Linux package build and some
other CI environments.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
On low vertical resolutions when playing games with 8 players in 4
different teams, the summary will overflow the available vertical space.
This commit ensures that in such a case the buttons below the summary
are still clickable by ensuring they stay always on top of the summary.
This makes using STUN mandatory for games hosted using the multiplayer
lobby. The motivation for that is a reduction in complexity, because
right now if STUN is disabled we use a home-grown STUN-like logic, which
got implemented before Pyrogenesis got STUN support.
That home-grown logic relies on a custom ejabberd module (mod_ipstamp),
which inserts the external IP-address of a host in the response messages
when a host registers a game. Originally mod_ipstamp was also used to
inform all potential players of a hosts IP-address, however that has
already been removed to let hosts to only share their IP-address with
players actually joining their game.
Removing the home-grown logic and instead always relying on STUN removes
complexity in Pyrogenesis and the lobby server and also eases hosting
games for players, as they don't have to figure out anymore whether they
need to enable STUN or not.
These changes shouldn't negatively impact the ability of Pyrogenesis to
handle different types of NAT or broken networks. There is one
difference though: While the custom logic using mod_ipstamp utilized TCP
as transport protocol, the STUN implementation in Pyrogenesis currently
uses UDP. That doesn't allow hosts with UDP-connectivity issues to
resolve their external IP-address anymore, however without
UDP-connectivity they aren't able to successfully host games anyway, as
the actual game updates are transferred using UDP as well.
Reading `second` on the end of the range is undefined behavior. Invoking
`test.find` in the test never evaluates to the past the end iterator.
GCC doesn't know that and issues a "maybe-uninitialized" warning.
If the new entity did not have Promotion, we would fail to do so.
Not doing this caused ghost units to appear when promoting inside a GarrisonHolder.
Fixes#7472, reported by Langbart.
GCC thinks `m_Buf + m_BufLen` can be outside the bound of `m_Buf`.
That is because `m_BufLen + len < CHUNK_SIZE` can evaluate to `true`
even if `m_BufLen` is bigger than `CHUNK_SIZE` due to wrapping. Tell GCC
that it's not possible.
This removes Catalan and Scottish Gaelic as supported languages, as they
now both have a coverage of less than 80% and adds Galician and
Portugese which both have 100% coverage right now.
b90280855f added an additional label to the bottom of the game setup
page for indicating that a game is started from a saved state. This
reduced the space available for tooltips and looked oddly placed.
This commit changes that, by resizing the `SavedGameLabel` and
`GameSettingWarning` objects dynamically so they only take the space
necessary to display their caption. It also tweaks the vertical margins
of the tooltip to allow more lines to be shown at once.
While this still doesn't allow to show all tooltips on low resolutions,
it's now better than with Alpha 26.
CParamNodes can be quite large, thus we usually cache the JS::Value when
converting them. The AIInterface makes heavy use of it as detected in #7404.
However, the cached values are re-frozen everytime, which is a
significant waste of time on a large number of templates.
Instruments is macOS only, so don't try to enable it on other platforms.
Also don't quote ${JOBS} as it might be unset and passing an empty
string to "mach build" may result in configure failing.
Fixes: #7470
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This avoids collisions in the user report, fixes#7174.
Update the user report version to account for the new build version
format, fixes#7173.
The build version displayed in the GUI is kept at 5 characters for
main menu clutter concerns.
With curl 8.10 [1] calling curl_multi_remove_handle retruns
CURLM_BAD_EASY_HANDLE iff the handle was removed already and no other
easy handle were registered. This resulted in ENUSRE triggering a
segfault during shutdown as reported. This was fixed upstream after
8.11.1 [2].
Do a runtime version check and for affected version allow
CURLM_BAD_EASY_HANDLE.
[1] curl ba235ab269080dc66e35835c829f7ac4290dbc1d
[2] curl 713182bd196bba014ba77f71176fea3de2236724
Fixes: #7295
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Script component wrapper attempted to subscribe to messages before the
script component has been registered.
This defect existed since 7c2e9027c2 but was never noticed since there
is no script component wrapper which subscribes to messages. (Only the
script component it wrapps does.)
RPI4 returns `false` for `textureCompressionBC` because it doesn't
support formats above BC3. As the Vulkan specification requires to
support all BC formats to have `true` for `textureCompressionBC`.
Ideally the AI would try to carry on and recover gracefully but the code is setup in such a way that this seems like it would lead to a lot of different bugs down the line.
With help from @langbart on QA and code.
Fixes#7425
The current code could end up with savegameID being undefined, false, a filename string, or null depending on the code path taken.
Adapt C++ in consequence.
Observers have the ability to change the currently displayed player, and this broke the logic of commit f3f695b90e.
By instead storing the displayed player in CmpOverlayRenderer, we can remove the workaround to set a 'dirty' flag as well.
Docks are generic and have all ship entities. This comes to play notably when
they are captured. This is currently not the case for special docks (Crannog and
Cothon). For consistency they are given ship entities that are trainable by
other civilizations.
Also, the Crannog was not updated with the naval overhaul and still had the
trireme and bireme entities. They are now removed.
Fixes#7426
This increases the height StoneButtons and TabButtons, so that a
double-spaced caption does fit on them without significant overflow.
Exempt from that are the StoneButtons resembling lists in the main menu
and the in-game menu, as changing their height didn't feel right and we
don't need double-spaced captions for them anyway, as they're wide
enough.
The height of StoneButtons got increased from 28px to 32px, while the
height of TabButtons got increased from 30px to 34px.
Since 71a61d5f50, formations regularly regroup. However, units already at their correct offset should remain idle. This doesn't happen as we cannot check if we are at destination.
This exposes that and handles things properly... Unfortunately UnitAI has already left the IDLE state at this point, so we still get counted as no-longer idle for a turn.
To fix this, try and detect that particular situation without triggering infinite loops.
- Apply Scale
- Rename mesh from Circle to viking_longship
- Remove useless material
- Add prop-projectile-prop point
Reported by: @Langbart
Fixes#7424
based on a patch by: aeonios
`off` means that the territory visibility cannot be changed
`hidden` means that it's hidden by default but can be enabled
`visible` means it's visible by default
This improves the alignment of the items of the top menu in-game. Icons
are now better centered and don't overflow anymore and the build label
text doesn't stack on low resolutions anymore either.
The intent of this branch was to not change the names when a saved game
is loaded. So that one can see who was where in the saved game.
It was implemented wrong: The names didn't change when no savegame was
loaded and changed when a saved game was loaded.
This commit make the soved game case and no saved game case consistent.
Defect introduced in b90280855f.
There is no way to show the `PlayerColor` as disabled. As the player
color is vilible without this it can simble be hidden when it is
disabled.
Defect introduced in b90280855f.
`PlayerData` didn't contain the playerNames when serialized because they
should not be loaded when a new game is made. This lead to the issue
that client didn't receive the initial player names of saved games.
Now `fromInitAttributes` gets as a second parameter whether the
initAttributus are from persistent settings.
Defect introduced in b90280855f.
`GameSettingsWarning` where only rendered when the settings change. When
a saved game is loaded it's possible this setting is enablet without the
setting being changed.
Defect introduced in b90280855f.
When loading a saved game the user can't change the maps but when
receiving the initAttributes from the host the map is "changed".
Defect introduced in b90280855f.
It's a bit hard for contributors to figure out what ruff-format is
unhappy about if all they get is a return status of non zero. Enable
printing a diff with suggested changes with the pre-commit hook.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Instead of using the file modification date, this uses the MD5 hash of
the file holding the content of the splash screen for the version check.
This ensures the splash screen isn't unintentionally shown again when
just the modification date of the file changes.
Fixes#4399
This improves the layout of the summary screen, so text and displayed
values fit better. By doing so this also removed the need to specify a
"verticalOffset" for values, as they get vertically centered now.
When running 0ad with a language other than English, there are various
places where text doesn't properly fit. This adjusts the UI in a bunch
of these places to better accommodate longer strings as they appear in
other languages than English and to make the UI look more uniform in
general.
Fix normal map orientation for Terrains
- Terrains use "OpenGL" style normal maps, while 3D assets use "DirectX" style normal maps. So, fix all of the normal maps I can find with incorrect style normal maps.
- Set most terrains to angle="0" for more accurate shading. This negatively affects "tile" terrains, which we want to have a 45 degree angle, but helps all other terrains. aegean_paving_01 is an example of a permanent fix for this, which I will work on with Stan for R28.
- Adds a couple of really nice paving terrains for a new "Italy" terrain set.
- Adds a nicer "furrows" normal map for farmland terrain
- Improved persian city tile normal by @wraitii
New AO maps for statues by @nifa (which fixes the Discobolus ao error)
New quiver for Persian Immortal
Remove bad smoothing for Chinese rice hat
Remove some noise from a couple of structure skins
Add garrison flag prop points to Greek theaters
Make garrisoned flags unselectable. Requested by @real_tabasco_sauce
Update han_ricehat.dae
Only the sender and the recipients receive the chat messages.
This commit only has an affecto on messages where the addressee(s) are
selected through the dropdown. Addressee(s) selected with a "/" command
are still sent to evevyone and filteret by the receiver.
`Engine.SetViewedPlayer` and `Engine.SetPlayerID` could be used to
reveal the map from GUI scripts and the in game console.
This is prevented by querying the simulation whether this player is
allowed to call thous functions.
These two vulnerabilities were introduced with their respective
features:
20e7d2224a introduced SetPlayerID to allow controlling other players
using the developer overlay.
a2f7d4d82a introduced SetViewedPlayer to allow observers to change the
perspective.
Also drop build version component as we never used it in earlier
releases either. This will also make replays et al be stored in a
directory 0.27.0 similar to earlier releases.
The build version component was introduced in 028ec40165
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The font size in the error message dialog for incompatible save games
was way larger than usual. This fixes that, by removing the arbitrarily
applied font size.
Fix `NetServerTurnManager` from pausing the simulation forever after a
client sent a bad hash to it and disconnects before the bad hash has
been processed.
A client that sends a wrong simulation hash to the `NetServer` and
disconnects before the server compares that hash causes a message box to
appear and the game to be paused forever.
94e5d88169 introduced the bug by missing to delete `m_ClientStateHashes
upon `UninitialiseClient.
This causes `m_ClientData[hashPair.first].isOOS = true` to insert a
client with blank values that the `NetServerTurnManager` will wait
forever and hence the message box about an OOS with no players being OOS
is shown (the playername is emptystring).
5ebf2020b0 exposed the bug by making observers able to lag behind,
providing a longe enough timeframe for this to occur.
Fix:
Deleting `m_ClientStateHashes` upon disconnect solves the broken
message box and the pausing.
Adding a category to newoption calls groups our options together instead
of mixing them with premake General options in --help output.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
-Increase default arrow firepower for buildings, decrease garrisoned firepower.
-Add a 20% building damage by by phase.
-Give the fortress a minimum range.
-Allow murder holes to be researched from the fort.
-Sentries uses a multiplicative bonus instead of adding 1 arrow.
-adds a new tech to the fort to increase its default arrows by 6.
-lets building arrows target the closest unit by default.
-adds player control of building arrows.
-adds a tooltip to explain how to control arrows.
-Uses "F" for focus fire and concurrently use "F" for force-attack, since "C" is capture.
- Fix pinyin on The Art of War technology
- Add Doric SpecificName of the Agoge
- Add SpecificNames of Town and City phases, as well as of overlooked
Village phase (the latter for Structure Tree purposes)
- Add SpecificName for the Mauryan wonder
This moves the lobby menu item to the top of the multiplayer menu to
make it easier to find for new players and as it's probably to most used
item in that menu anyway.
Grab upstream patches adding support for building premake on riscv64
[1], loongarch64 [2], and e2k [3].
[1] 82c9d90495940e2d0d574e1c7849e9698f23b090
[2] 928397f72c00979d57ec4688cb1fb26ec7f2449b
[3] 5c524b6d53307bcb4ba7b02c9dba20100df68943
Fixes: #7346
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Instead of removing units from the roster, we provide actors so they can be reskinned into more historically accuracte units.
Add an auxiliary spear cavalry actor and portrait
Improve the auxiliary javelin cavalry actor and portrait
Add a levy auxiliary spearman actor and portrait to replace triari
Add a champion "first cohort legionary" to replace the extraordinarius and its portrait
-Part one of updates to roman reforms.
-account for the use of antesignanus instead of lanciarius
-train the onager from the army camp and add non-random arrow balance.
The option --atlas is oddly different than any other feature flag,
change it to be in line with the others and enable it by default. The
new option is --without-atlas.
As the WX binaries aren't precompiled for Windows automagically disable
atlas there for users running the batchfile through filemanger if WX is
missing.
On *nix not providing a valid wx-config whith enabled atlas is
considered an error.
Fixes: #6401
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The number of options is increasing, add a --help option to print usage
and available options.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Enable the Tips and Tricks page to show multiple images for each tip.
Add a small GUI panel below the image for switching between them.
Only show it when the current tip has more than one images.
Introduce tipfiles.json to assign images to the text files.
(And stop of relying on file naming)
Add a tip about wonders, and make some slight changes to other texts.
Improve existing tip images and add a bunch of new ones.
-Cavalry Javelineer moved to the front of the cavalry in the CC to match other civs.
-Allow the barracks to train both types of the immortal and ensure the unlock tech applies to the archer.
This account is only used for fixing technical bugs in translations and
not doing translations themselves, so let's exclude it from the credited
translators.
According to #6936 some lower devices (especially virtual ones) might
report more memory than regular ones. So we can't use the memory
amount as a score for now.
After the git migration update-workspace.sh doesn't build libraries
anymore. Remove variables and options no longer of use.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This patch addresses issues concerning a1796ed71f:
Allow for a more elegant implementation of observer flares.
And still display flares even if the sender is lagging behind:
Split off flares from simulation commands.
Remove the new, problematic 'observer commands' entirely.
Provide an engine function 'SendNetworkFlare' to the JS interface.
-> which sets off the (pretty ordinary) transmission process.
Add a new type of net messages exclusively for flares
-> contains the flare's position and its sender's GUID.
This is the version used for Windows already and contains the fix for
building against spidermonkey on all Linux distributions.
Backport patch to fix running on *BSD. Also make clang default on *BSD
as a toolset will always added to generated makefiles in beta3, so it
won't magically do what we expect when not adding --cc explicitly.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
With the removal of the premake sources all exclude directives in
.pre-commit-config.yaml are obsolete, so remove them.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Markdown linter requires a heading and the heading not ending in a dot,
make the readmes not trigger a violation.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Let the gerousia train heroes as in com mod
move the champ move speed tech to the syssiton in p1, make it cheaper as in com mod.
let the syssition provide 10 pop space to improve feasibility early in the game.
make the agoge a civ bonus.
increase the champion base attack rate from 1.0 to 0.9 so that the unit is inherently better than other champ spearmen, not just from upgrades availablity.
Currently we don't mix storage images and storage buffers in the same
shader. Also we don't sample textures when we use storage buffers.
In the future we need to avoid shifting descriptor sets.
This adds a patch for a bug in SpiderMonkey, preventing compilation of
SpiderMonkey with Python >=3.12.8 and Python >=3.13.1. The bug is
tracked upstream in https://bugzilla.mozilla.org/show_bug.cgi?id=1935621
This replaces all links pointing to trac with their corresponding links
to gitea. Also replace http with https while at it.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
We use a shader with 64 bones by default to consume less uniform memory.
But if we meet bigger skeletons we batch and handle them afterwards.
In the future we need to sort the input models to have less changes for
bound buffers. Also we might want to skin up to 4 models per a single
dispatch.
The idea is similar to the storage images but we need a separate
descriptor set in Vulkan and a program interface to gather used buffer
in GL.
For Vulkan we also need to track buffers to free used descriptor sets.
Ranged units -25% dps in the form of attack rate
Melee units decreased armor (5h5p->3h3p for CS infantry)
Melee units 50% more damage
Building and siege hack armor adjusted to compensate
Since 7d6a0c695a we use gmake2 instead of gmake, add a check in case
someone calls premake without the wrapper script update-workspace
telling them to use gmake2 instead as support for gmake was removed.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
- Reduced the MaxGatherers value for the smallest trees with 100 or
less wood from the default (8) to 6 or 4.
- The affected trees are Bush (4), Atlas Cedar Sapling (4), Cretan Date
Palm (Short) (6), and Fir Sapling (4).
- Small trees with 100 or less wood that already had a MaxGatherers
value lower than the default (8), such as Bamboo (Single) (1) and
Baobab Sapling (2), were left unchanged.
ChainPlacer.js creates a new array that it fills with the -1 value before computing its clumps. This is slow.
By simply storing values differently, we can avoid doing that altogether, leading to faster mapgen.
Hard to say in general but I think this might be about 3-4% faster on a typical map.
The migration to git broke the translation of language names in the
credits, as the translators.json, necessary for extracting the language
strings wasn't present anymore when running update_templates.py. This
commit should fix this.
- Shallow-freezing of objects is never used in our codebase, so remove
that code path.
- Deep-freeze is bugged in recent versions of SpiderMonkey (see bug
https://bugzilla.mozilla.org/show_bug.cgi?id=1930258). Until a fix
and/or a better API is provided, reimplement this feature by
recusively freezing object properties.
- Add tests for the deepfreeze function.
The shell option "set -e" has a tricky, but standard, behaviour:
Anything called on the left side of a || or && token ignores "set -e",
so failure in a command in a subshell called on the left side of "|| die"
does not prevent the execution of the following commands in the subshell.
Adding explicit "|| die" calls after each command that could fail (and
should interrupt the process) works around this behaviour, by emulating
the intuitive "set -e" behaviour.
Unless minimal cflags is set add -Og or equivalent to CXXFLAGS for debug
build configuration.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
FORTIFY_SOURCE relies on optimizations being enabled which is only the
case for the release configuration. Therefore remove it from the debug
configuration as to prevent the compiler issuing a warning on each
invocation.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
DEBUG is unused by pyrogenesis and unconditionally adding it to defines
prevents building against a non debug version of spidermonkey. This will
allow building only one copy of spidermonkey, which can be trivially be
replaced with the other depending on needs independent of pyrogenesis
debug or release build.
This also allows to build either build configuration against system
spidermonkey, which obviously is either one build type or the other.
Requires a compilecheck until the pc file gets fixed upstream.
A comment in the spidermonkey build.sh says on FreeBSD spidermonkey
debug configuration doesn't even build and so pyrogenesis debug build
wasn't possible either.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
During the removal of glooxwrapper the function GetJID was mapped to
getID. This results in NetClient querying for host jid not getting the
right value which prevents hosting a game in the lobby.
Reported-by: Dunedan
Refs: #7203
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This uses ./build/workspaces/default as location for generated build
files as well as build products. Using the name "default" to avoid the
dilemma gcc vs clang vs premake generator. Doesn't impact scripts
already using --outpath and allows running premake5 --help without a
wrapper.
Also update .gitignore to make using arbitrary workspaces cleaner.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This option doesn't handle includes, further we rely on system includes
and pkg-config to locate dependencies.
For systems where installing into local is reasonable this paths should
already be in system/ld paths. So in practice this offers no value.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This option is needed to be able to use more than 2GB on 32bit Windows
builds.
Having to explicitly enable this turns out to be a pitfall. Release
builds are done with this option enabled and when then building from
source and running out of memory it's not immediately obvious what the
reason is.
The documented intent is that this behaviour might be useful to find
memory leaks. The large-address-aware enabled build already perfectly
serves this role this days and the memory pressure is an important
reason for the ongoing Windows 64bit build efforts. Also there are
arguably better tools for this purpose.
Refs: commit a8403bd7e5
Refs: issue #1619
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This wrapper was meant to support multiple C++ ABIs with a single
pre-built gloox library wrap as a C library. A new ABI change was
rejected a few years back, so this will probably take a while for it to
be on the table again. With the bug tracker and mailing list currently
unavailable and known TLS issues we might have replaced gloox by then
anyway.
Supporting multiple ABIs with the current setup isn't an issue either
and is already done for 32bit vs 64bit ABI on Windows.
Therefore use gloox types directly in lobby code instead of wrapper
types and delete the wrapper and build-integration.
Migrate to override where applicable, as it helped avoid subtle
differences in signatures and finding missing inheritance of LogHandler.
Finally use version check instead of os check to work around Windows
using the 1.1 development branch instead of releases.
Fixes: #7198
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Querring the audio device name may fail. The name is only used for the
sake of logging it for debugging. Avoid querry failure to be fatal and
insted just log the issue.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
With version 1.24.0 alcIsExtensionPresent() has dropped case insensitive
string comparison [1], use upper case names.
The internal strings are uppercase since the first git commit importing
openal 17 years ago.
[1] upstream commit 785f794141d62a4c308db26aa4a4819e6a92525e
Report: https://wildfiregames.com/forum/topic/125203-crash-on-start-due-to-soundmanager
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Some return values can be assigned to a `const auto`, somewhere `dir` is
mutated so the whole result has to be assigned to a non `const` variable
and once only dir is used, so structured binding isn't used there.
When building a JS::Value from CParamNode, strings have been "interned"
since the conversion was written in dd501b2a5a. This means that the JS
string object could be used outside a JS realm, and also that those
strings could be compared efficiently instead of char-by-char.
This was unnecessary, and the only place in the code where we used
"interned" strings. The upgrade to SpiderMonkey 45 (64b477625d) changed
the name of related methods, and some of them are removed from the
public API in SM 102, so stop pinning and atomizing those strings.
Additionally, the switch of CParamNode to utf8 in 35ed55cfd6 missed one
of the two utf16 handlings, so fix that as well.
In `RunGameOrAtlas` only one of thous flags is used. Using a `bool` is
simpler and less error-prone.
Also reset the variable earlier, so it's easyer to reason about it.
Previously, only merchantmen were able to collect treasures on the sea.
This patch enables all types of ships to do so:
fishing boats, merchantmen, and warships (except fireships).
When a non-incremental build is needed for a PR, the current code cleans
up workspaces and retries, but this leaves the build error in the
console output. This marks the build as unstable, as if warnings were
present.
Instead, let the build fail and instead reschedule a clean build, which
will override the build status in Gitea.
This patch gives observers the possibility to see and send flares.
Players keep their color after resigning and "true" observers flare in white.
Observers render all flares; the ones sent by any player or observer.
Player continue to only see their allies' flares.
The flare notification option is converted into a dropdown.
-> adding the possibility to only receive them as observer.
Modify our cxxtest module so that it generates sources in the
configured build directory instead of the source tree. This simplifies
cleaning build output and .gitignore.
Make test_root.cpp a build target so it doesn't have to be generated on
each run. This means no more building and linking into test target
unless needed either. Unfortunately there is no source for test_root.cpp
and an update to cxxtest might require a manual make clean.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Propagation mousewheel event was introduce to have the opportunity to
parent handle this event if an only if the child doenst handle and the
parent set a handler for that event.
The error foundedd by elexis inside a game relay on the message waw
propagated outsie IGUIObjects to CGUI.cpp that shouldnt be at the
beggin. I forget to stop the propagation when all objects in the tree
was validated, because of that the message was propagate to CGUI.cpp
andd then hanle by camera.
the fix suggest to only propagate the event in the GUI tree, not outside
the GUI tree
Now that we are propagating mousewheel events to parent we need to
explicitly mark that the event was handle in JS and shouldnt be handle
by parent.
this error was informed by Elexis
This PR introduces a new ScrollPanel component with the following
capabilities:
- Scroll Orientation Support: Allows scrolling in horizontal, vertical,
or both directions, providing flexibility for different use cases.
- Partial Object Rendering: Supports partial rendering of objects that
are only partially visible within the scroll boundaries, improving
visual accuracy and performance.
- Boundary-Constrained Mouse Interaction: Handles mouse events strictly
within the panel's visible boundaries, preventing interaction with
objects outside the scrollable area.
- Minimum Internal Size (min_width, min_height): Introduces support for
virtual space management, allowing the panel to maintain a minimum
internal size independent of its actual on-screen dimensions. Even
when the panel is resized, this ensures that the content respects a
defined virtual space (with min_width and min_height), effectively
simulating a larger internal canvas. This is particularly useful for
large content or scenarios where a more extensive scrollable area is
required than the current visible panel.
Cherry-pick upstream patch adding support for -idirafter [1] which
allows us to work around the issue of some distributions bundling the
icu headers with spidermonkey resulting in a conflict.
Further add support to our premake pkgconfig module to allow using this
feature and make use of it for when building with --with-system-mozjs.
[1] premake-core baf145dc388509c953a01bcd964835e2027208bf
Fixes: #5868
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
In `Future` there is a notion of cancelation / stop-request. The task
callback doesn't have such a notion.
Some tasks (like the map-generation) are stopable. It did that in a
thread unsave way.
A task is canceled when the future is destroied or when `CancelOrWait`
is called on it.
With pch enabled WIN32 gets defined for cxxtests xmlformatter.h but not
without resulting in a build failure ctime_r not found which was only
added with C23.
Explicitly define WIN32 for Windows target, to force the intended
code path.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
After 486509d5b9 we no longer use the
bundled sources, remove them.
Also remove the build.sh for building the bundled sources and update
.gitignore.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The script assumes glad got cloned into glad subdirectory. This is the
case if you follow the procedure outlined in the README, however if you
are using system glad or or glad installed via pip this assumption
doesn't hold.
Therefore relax the requirement on where to get glad from. While at it
add shell option errexit and make the script callable from repository root.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Use patch by Debian [1] replacing python in shebang with python3 and fixing
some warnings with recent python versions.
The reason being some use an alias of python for python3 instead of the
customary symlink. Aliases are only expanded in interactive shells
unless expansion is explicitly enabled.
[1] https://sources.debian.org/patches/cxxtest/4.4%2Bgit171022-2/python3.patch/
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This moves the nightly build to a new Windows autobuilder running a
recent Windows Server version. In this new environment, the Jenkins
agent runs as a normal user connected through SSH. This fixes#7148.
Use the opportunity to use svn directly instead of Jenkins' scm step,
which hangs for 30 min.
Tooltip shouldnt receive any mouse event direct, there is a edge case
when you have a big tooltip and the object that need that tooltip is in
the bottom left, at this moment tooltip is in the same position of the
mouse, current code was returning the tooltip, and the code hide the
tooltip, and find again there is another object that needs the tooltip
and show again. To fix this is just than simple to set a tooltip like
ghost because shouldnt receive any mouse event.
Treat premake like any other dependency and package it separately, this
makes it much easier to bump it in future by making it easier to track
modifications if any.
Moving it to libraries as it is handled the same as other packages. An
argument could be made to have it in build due to it's special nature.
The issue with that approach would be how to handle clean-workspace.sh.
If we split it out we would need a separate clean-premake.sh script and
if we have it cleaned by clean-workspace we through away the download
and already built binary.
Also bump version to 5.0.0-beta2 and backport patch for macOS fix
instead of the Makefile changes. The same fix is needed for gcc-14
(reported upstream), so add a patch injecting unistd.h for Unixes.
Fixes: #6816Fixes: #6632
Refs: #6847
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
- Switched to CMake for configuring and building the doxygen Website.
- Set the minimum requirements to CMake >=3.18.4 and Doxygen >=1.9.1.
- Rewrite the LICENSE.txt and docs README.txt to markdown.
- Add the folder which is used in the README to gitignore.
- Add a custom style to the doxygen website based on the docs webpage.
- Update CI to use the new Doxygen Build process.
Closes#7052
- Generate entity.rng as part of the nightly build, refs #6976.
- Generate docs from a checkout of the nightly build.
- Publish them to docs.wildfiregames.com.
Instead of looking up the location of spirv-reflect for every shader,
this is now being done once and cached for all shaders. This results in
shader compilation being slightly faster.
Instead of compiling SPIR-V shaders twice, once with debug info and once
without, this uses `spirv-opt` to remove the debug info from the SPIR-V
shaders with debug info. This results in notable performance gains, as
stripping the debug info from existing shaders is much faster than
compiling them.
As a result of this change the contents of the non-debug shaders change
once. That's because shaders with debug info contain much more
instructions and therefore more result ids. Stripping the debug
info from shaders results in different result ids being used as when
generating ones without debug info. While that doesn't result in a
difference in the functionality of the shaders, it's a difference in
their binary representation, causing their content hashs and therefore
file names to change. After that one-time change the result ids are
reproducible again.
Commit 4e9e950c8f increased the chicken
size by 1.5x, which made them noticeably larger than foxes and caused
their movement speed to fall out of sync.
This is a correction Langbart proposed on Phabricator after the commit
to moderate the chicken upscaling to 1.3x and adjust their speed for
better synchronization.
Authored-by: @Langbart
Original source: https://code.wildfiregames.com/rP27910#61427
"bind.hpp" was moved in boost-1.39. [1]
Placeholders were moved in boost 1.60. [2]
Since boost 1.73 placeholders defined in global namespace are
deprectared. [3]
Boost 1.76 added support for using std::placeholders with
boost::bind. [4]
This change uses the new, cough, location of the header and
std::placerholders for boost 1.76 plus to silence the deprecation
warning there.
Following commits are from https://github.com/boostorg/bind.git
[1] 8f507b9aeca643ca78e6a712b6d300720627c0ed
[2] db56733e4ed2125944b89e01cf36a9e451dd36f5
[3] 2797f0dc33caaae126a416bf613bd11267ba3353
[4] c85b31e3d200dda2a73cf0027a82c6d8e29066f8
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The gmake action is long deprecated and subject for removal in the
future. Switch to gmake2.
A major benefit is gmake2 is much better at parallelizing, and so on a
16 core I get a speed up of over a 30%.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
After 26994b156b just removing the
libraries/source directory will delete files under version control
needed to build the packages.
Use git clean instead to get back to a clean slate.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This patch introduces phase emblems on both sides of the player's name
band in the middle panel. The emblems represent the current phase of
the selected player's civilization: I (Village), II (Town), III (City).
This information is also added to the associated tooltip and is
displayed only to mutual allies and observers.
Fixes#6849
See also: https://wildfiregames.com/forum/topic/107851-introduce-badge-to-indicate-the-phase-6849/
Instead of redefining the VkDescriptorType enum for every shader, only
define it once. This avoids unnecessary computation and slightly
increases performance.
Fixed a bug where hotkeys were not being reset properly, ensuring that
all hotkeys are now cleared when expected.
Corrected improper use of forEach with string character access,
replacing it with a valid iteration method over characters.
Removed unnecessary and dead code to improve code cleanliness and
maintainability.
- Players now receive flare chat notifications mentioning the sender's name.
- Clicking the notification moves the camera to the flare's location.
- The feature can be toggled in the game options and is enabled by default.
Fixes#6212
"-rdynamic" is a linker flag. The gcc frontend gracefully ignores it but
not clang. Remove it from CXXFLAGS and only leave it in LDFLAGS.
Fixes: #5582
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
With the migration to gitea the links in the help menu of Atlas need to
be updated to point to the new locations.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
At least on Linux this resulted in the help menu in Atlas not being
populated. This fixes the issue.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
b2cdb1e6b4 broke compiling of SPIR-V shaders on Windows, as the output
of `spirv-reflect` contains CRLF as line separators there. This commit
fixes that.
Now It's not hardcoded what is done if a button is pressed. The caller
can decide that.
Previously one had to call this function and then overwrite the on Press
attribute of each button.
Rename "Visibitily" to "Visibility" in setButtonCaptionsAndVisibility.
During the mogration to git e9d1cb6cc7 removed the
`lint-translations.sh` script which was used together with
`check_translations.py` to lint POT- and PO-files. By doing so it
removed a valuable option to find problems in translations.
This commit undos that by merging the functionality of the removed
`lint-translations.sh` and `check_translations.py` into the latter
one. The new logic is easier to maintain, produces less false-positives
and has some unit test coverage.
This drops the program name from the SPIR-V shader file name, which
allows deduplicating shaders belonging to different programs. While that
has no significant impact on compilation performance it reduces the
number of required SPIR-V shaders.
One downside this has it that it's not directly visible from the file
name of a shader anymore to which program it belongs.
The category 'Game Session' didn't have any more space for upcoming new
entries.
Changes:
-Split 'Game Session' into 'Display', 'Chat & Notifications', and
'Gameplay'.
-Move some options out of 'General'.
-Updated the option categories' and some individual options' tooltips.
For the sake of vendored cxxtest. Distributions are advised to use
system cxxtest anyways.
From the package description:
This is a convenience package which ships a symlink to point the
/usr/bin/python interpreter at the current default python3. It may
improve compatibility with other modern systems, whilst breaking some
obsolete or 3rd-party software.
As this is a Debian Buster based CI and the package is only available
from Debian Bullseye forward do the symlinking manually instead.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Add option to build-source-libs and premake to uses system provided
cxxtest.
Closes: #5792
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Update source build.sh to use upstream tarball and drop any custom
patches at the same time.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
To disable tests we carry a patch which allows disabling test by
appending DISABLED to the test function name. Instead just do as
upstream says and prepend the test function so it won't be recognized as
a test any longer.
The docs suggest to prepend x but anything will do. Continue to use
DISABLED_ but as prefix which is actually already in use in one case.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
GlCanvas currently doesn't support runtime selection of GDK backend [1].
Therefore to run Atlas under Wayland wxWidgets needs to be built with
GLCANVAS_EGL which is usually not the case to support X11 at the same
time.
Check if the EGL backend is available and if not and running under
Wayland force use of XWayland with the GLX backend.
[1] https://github.com/wxWidgets/wxWidgets/issues/22325Closes: #6939
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
It's now possible te get an exception from a function in a task.
The interface is like std::future: if you call .Get() you will get the
result (as before) or the exception will be thrown.
For each program this parallelizes the generation of shaders by program
combinations. This leads to significantly faster shader generation on
systems with multiple CPU-cores. The resulting shaders are identical to
the ones prior to this change.
This ensures the file names of SPIR-V program combinations and shaders
are reproducible. Up to now they only were if the order of program
combinations in the rules.json didn't change, as the file names
contained the position of the program combination in the rules.json.
With this change files names of program combinations will be named based
on the details of the combination used to create them and the file names
of shaders will be based on their content respectively.
Changing the file names avoids wrong shaders when partially rebuilding
them after a new combination for a program got added in between the
other combinations in rules.json and removes the need for keeping track
of identical shaders in the script. It's also a preparation for being
able to build shaders in parallel, while also keeping the result
reproducible.
- Small popup page accessible from the main menu via Learn to Play.
- Lets the player read through the tips with 'Previous' and 'Next' buttons.
- Tips continue to be shown on the loading screen.
-> but there without the scrolling ability.
- Added two new hotkeys for quicker tip changing (item.prev and item.next)
-> set to the left and right arrows respectively by default.
- Responsible scripts are placed in gui/reference/tips/.
- The tip text files have been moved to gui/reference/tips/texts/.
- Tip image files have been moved to art/textures/ui/tips/.
- Added a series of new sprites (textures in art/textures/ui/tipdisplay/)
-> comprises a title decoration, a bullet point sprite, and a new button
style.
This fixes -Wdeprecated-copy with FreeBSD's clang17.
This commit reverts a change from 8a32b0b3d4, where a private copy
assignment operator was deleted, whereas it was needed to explicitly
declare the copy constructor, refs #5294.
Added in aa44bac652, the "atomic" accumulated timer is based on a
structure that mixes atomic and non-atomic access, which is not fit to
be converted to std::atomic.
Additionally, it is only used in a single situation where benchmarking
is not essential to us.
The compare-and-switch operation in this situation does not need to be
atomic.
This class must be copyable, so the CAS'd flag cannot be adapted to use
std::atomic.
Gray out the "Cutoff distance" slider on the "Graphics (advanced)" tab
of the game settings screen when this distance is ignored because the
"Cover whole map" configuration option is ON.
This allows build-archives.sh to fall back to vendored spirv-reflect if
it can't be found in PATH.
Also update error messages to suggest additional alternatives.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Usually not available in Linux Distributions as it isn't customary to
package the SDK but only the bits needed as separate packages.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The script build-archive.sh sets a variable SPIRV_REFLECT, even respects
it if it's set in env but without support from the compile.py script for
it there isn't much point.
This commit adds support SPIRV_REFLECT in compile.py and and adds a
fallback to use vendored spirv-reflect for when the envvar is unset and
the tool can't be found in PATH
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
build-archives.sh generates output in archives, add it as well as the
rules files for spirv shaders which might be fetched during build to
gitignore.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Due to "set -e" the script terminates when the required tools aren't
found and the arguably helpful messages later on won't be printed.
Make the initial check for tools non fatal and allow for the later check
to take care of missing tools.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Currently you have to fetch translations first so they can be filtered
by build-archives.sh without the script failing.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
A total of 16 possible AI names are added to four civilizations.
Athenians: Callias, Chabrias, Conon, Ephialtes, Nicias, Phocion, and
Pisistratus
Britons: Cassivellaunus, Imanuentius, and Mandubracius
Iberians: Litennon
Spartans: Anaxandridas, Cleomenes, Eurybiades, Gylippus, and
Leotychidas
The lists are sorted alphabetically.
As compile.py only creates shaders for program combinations which don't
have already existing shaders on disk, this removes all SPIR-V shaders
prior to rebuilding them to ensure they actually do get recreated.
This refactors the script for cleaning the translations to get the
same result by doing less. This is achieved by the following changes:
- Use glob-patterns for finding the files to clean more efficiently,
without the need to exclude collected files again.
- Only write files which are supposed to be modified (previously all
portable object files did get rewritten by this script, no matter if
it did change something or not).
- Stop searching for sections in files to clean up, once they are
already passed.
This commit enables a bunch of unrelated ruff rules, which only require
minimal changes to the code base to enable them.
The rules enabled by this commit are:
- check the use of datetime objects without timezone (DTZ005)
- check the performance of try-except in loops (PERF203)
- check the number of function arguments (PLR0913)
- check for mutable class defaults (RUF012)
- check for the use of secure hashing algorithms (S324)
- check for raising base exceptions (TRY002)
- check for raising other exceptions where TypeErrors should be raised
(TRY004)
This ensures the same Python target version used for `ruff format`
is used for `ruff check` as well. It also allows ruff, even if it's not
run through pre-commit, to use the correct target Python version.
Previously when checking if two SPIR-V shaders are identical the
hashs of their file content would be compared and afterwards their
(unhashed) file contents as well. Comparing the file contents isn't
necessary, as the hash function used is a cryptographic one, which
guarantees the hash can be used as a representative of the hashed data.
The icon/portrait of the middle panel when a single entity was selected
was very subtly (4 px) overflowing its lane and invading that of the
entity's name. This change fixes that by:
- Raising the top of the middle panel by 4 px to leave room for the
portrait/icon. This avoids having to shrink it and lose quality.
- Distributing the 4 px of difference in height in the statistics area
by lowering 1 px the top bar, 1 px the middle bar (if any), and 3 px
the bottom bar (if any). The rest of the elements are lowered 4 px,
and therefore remain in the same place.
- Increasing the height of the minimap panel by 4 px so that it remains
aligned with the middle panel, vertically centering the minimap, and
making the necessary adjustments to the position of its buttons.
Additionally, a couple of minor changes are applied:
- The separators between the statistics area and the attack/resistance
and resources area, and between the attack/resistance and resources
area and the entity name area, which had different heights, are set
to the same height/thickness.
- The attack/resistance icon, which was very close to the entity
icon/portrait, is moved 1 px to the right, and the
resourceCarryingText (in the same area), which was very far from the
resourceCarryingIcon, is also moved 3 px to the right.
Fixes#7029
- Left-clicking the portrait of a unit will make the camera follow that
unit (before: no action). A tooltip informs the player of this
possibility.
- Left-clicking the portrait of a structure will make the camera focus on
that structure (before: no action). A tooltip informs the player of
this possibility.
- Double-clicking a hero/treasure icon will make the camera follow that
hero/treasure (before: just focus on that hero/treasure).
- Some minor related changes.
Fixes#6879
While the desired options for indent size and style are Python's
defaults, let's make it explicit by specifying it in the EditorConfig.
As part of this, this also removes unnecessary inline formatting options
for Python files.
This simplifies the XML parsing, by iterating over the DOM tree only
once. Curiously this doesn't result in significant performance gains.
As the keywords are now found in the order they appear in the
document instead of the order they are mentioned in messages.json, the
order of a few strings in the PO-templates changes caused by the changes
in this commit.
This simplifies the code structure, by removing the extractors package,
which only contained a single module, the extractors module. This module
is now located in the i18n_helper package.
The ini-file extractor has been broken since the transition to Python 3
and nobody noticed, because it isn't used nowadays. Therefore, let's
remove it.
This increases the performance of updating the PO-templates
significantly by adding a cache for the building of mask patterns. In
non-representative tests it increased the performance of updating the
PO-templates by >25%.
This increases the number of workers to use when fetching translations
from Transifex from 5 (the default) to 12. While the Transifex CLI
allows up to 20 workers, using more workers results in frequent request
throttling, which hurts performance more than it improves it.
Instead of fetching the whole svn repo containing all current
dependencies into source, fetch them individually into subdirectories of
source.
Adds a wrapper script to each package to place the build output where
it's currently expected.
This allows adding and removing dependencies as well as changing origin
of those packages on a case by case basis.
It's recommended to run "git clean -dxf libraries/source" to free up
extra space and remove untracked files no longer covered by changes in
.gitignore.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Instead of using Perl to get the absolute path due to readlink -f
implementations differing behaviour use realpath. Since the inclusion
into coreutils this should be a valid alternative.
Also check for [[:space:]] instead of only \s as if that one is an issue
the others are as well.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
During the migration it apparently looked possibly useful at some point,
in the end it remained unused.
Further the clean-source-libs.sh doesn't handle the case where
build-source-libs.sh was invoked with --source-libs-dir.
Finally, when switching to support individual package this becomes very
complex to support.
For all the above reason remove the option.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Adding a hook to pre-commit to enforce a consistent style and remove the
hook check-yaml which only checks if a document is parsable and so
become redundant.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The schema at https://json.schemastore.org/gitea-issue-forms.json
doesn't like empty titles, so just remove the key to the same effect as
a zero length string.
Add document start markers where they are missing.
Use a max line length of 100 as discussed with Dunedan.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Respecting the format of the tooltips of the other panels, include
a short name in bold on the first line of the tooltip to facilitate
a quick understanding of the action, and below, in normal font, a
description with relevant details.
The description of the patrol action is rewritten to make it more
understandable.
Fixes#7016
- Silence a MSVC warning in vulkan.cpp, refs #6987
- Document the patching of gl.h for macOS, from r26094
- Fix shellcheck warnings in the generation script
Currently all files adhere to the same formatting, let's codify it so it
stays like this in the future.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The new script merges existing scripts for downloading translations and
SPIR-V shaders, and also exports game binaries from the latest nightly
build into the git repo.
This allows contributors, especially artists, to obtain a working build
of the game without learning how to build the game for Windows, refs #1814.
The fontbuilder2 README file was already partially formatted with
Markdown, but didn't indicate that via its file extension. This commit
changes that and improves the formatting of the README itself.
This removes the remaining bashisms and changes the shebang.
Also remove command chaining in subshells as this allows for comments
to go where they belong and shellcheck directives to be more specific.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This entirely reverts ee3318309b and removes the [CLEANBUILD] feature,
which needed to be used without omission to be efficient.
Instead, in case of build failure, the CI automatically starts a
non-incremental second build by running `make clean` (or the MSBuild
equivalent) before retrying the build.
This enables some ruff rules for docstrings and comments. The idea is to
not enforce the presence of docstrings, but to ensure they are properly
formatted if they're present.
For comments this adds checks that they don't contain code and verify
the formatting of comments with "TODO" tags.
As part of this, some commented out code which hasn't been touch in the
past 10 years gets removed as well.
The rules enabled enabled by this are:
- check formatting of existing docstrings (D200-)
- check comments for code (ERA)
- check formatting of TODO tags (TD001, TD004-)
Change all non posix constructs except for stacked pushd/popd for the
sake of reviewability.
The reminder will be done in a separate commit.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This explicitly uses UTF-8 encoding when reading or writing files with
Python. This is necessary as the default locale varies between
operating systems.
This enables ruff rules which check for code which can be simplified to
improve readability.
The additionally rules getting enabled by this are:
- remove unnecessary nesting of if-statements (SIM102)
- use contextlib.suppress() for no-op exception handling (SIM105)
- use enumerate() for counting in loops (SIM113)
- use context managers for opening files (SIM115)
This should speed up installation of pre-commit as part of the Gitea
Action a bit, as it caches the Python packages required for it.
The cache functionality of actions/setup-python is unsuitable for this
use case, as we don't have a file with requirements we want to use as
key. Instead, we just want to cache whatever is downloaded via pip from
PyPI and keep it for further invocations. This commit achieves that by
using the same cache key for every workflow run. The cache is being
updated even if pre-commit fails so we always keep the the Python
packages used for installing pre-commit cached.
The Windows autobuilder contains two built versions of wxWidgets. One
corresponds to the oldest supported version of the library, and is used
for CI. However, the nightly build should use a recent version of the
library, compiled with the same toolset as the main game.
This commit adapts the nightly-build pipeline to use the rebuilt recent
copy of wxWidgets.
This enables some ruff rules to check for ambiguous and dead Python
code, which might cause unintended side-effects.
The enabled rules are:
- a bunch of rules related to shadowing of builtin structures (A)
- a bunch of rules checking for unused arguments (ARG)
- a rule checking for useless expressions (B018)
- a rule checking for unbound loop variables (B023)
- a rule checking redefined function parameters (PLR1704)
In all the builds using precompiled headers, an update to libraries will
crash the CI, as those headers will become outdated. It is then
necessary to force a full rebuild of the game by cleaning up the
workspaces.
This commit allows this CI behavior to be triggered by specifying
[CLEANBUILD] in the first line of the commit message.
This will constitute an opportunity to inform users that they need to
clean their workspaces when pulling the update.
This sets some reasonable defaults for all files.
Adds settings for *.sh files, doubles as configuration for shfmt.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This updates shell scripts to use a consistent style that can be enforced
via pre-commit hook.
As for choosing tabs over spaces, some arguments are:
- tabs can help people with visual impairment
- tabs allow for indenting heredocs in bash
- tabs are the default for the tool shfmt
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This removes the executable bits from files which aren't supposed to
have them.
Also removes shebangs for files which aren't supposed to be executable.
In the ruff config file added in #6954 explicitly selecting the ruff
rules to check was missed, resulting in ruff only checking a very small
subset of its available rules. That hasn't been desired, so this is the
first of a series of commits enabling more rules. In this PR all rules
whose violations can be either automatically fixed by ruff or are
trivial to fix manually get enabled. For the follow up PRs it's intended
to focus on one area of rules per PR to gradually improve the Python
code quality.
This updates CODEOWNERS to remove owners for the lobby bot code, which
isn't included in this repository anymore. It also adds me for some
areas where I can help with PR reviews.
This replaces the existing arclint linter to ensure the project name
does only include a non-breaking space with a pre-commit hook. The regex
to check is slightly different to account for escaped non-breaking
spaces in JavaScript files and to avoid some false-positives.
When running clang-format which reorders headers, those are the ones
that came up as missing.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Getting and building libraries is now clearly separated from preparing
workspaces.
Some disk space is automatically reclaimed and cleanup is streamlined.
Up to now Pyrogenesis didn't check if lobby related XMPP stanzas were
sent by the lobby bots. This meant that every user could send forged
data, like the list of games, to be displayed by another user. This
change fixes that by checking such stanzas come from the expected lobby
bots.
Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5216
This was SVN commit r28197.
72f0fdb41b broke the deferred sending of XMPP stanzas for changes to the
game settings during game setup. This change fixes it and decreases the
interval to send game setting updates from 2000ms to 500ms to have
updates faster visible in the multiplayer lobby.
One reason why this bug might have been gone unnoticed so far is that
the traffic shaping employed by ejabberd results in a similar behavior
when just looking at the multiplayer lobby through Pyrogenesis:
After exhausting a certain amount of traffic, clients are only allowed
to send a defined amount of bytes per second. This results in game
setting changes taking a moment before they show up in the multiplayer
lobby. Contrary to the desired behavior, this however leads to all
updates being received and processed by XpartaMuPP resulting in
unnecessary load on the server. With this fix Pyrogenesis doesn't
trigger the traffic shaping on ejabberd side anymore, as there is now
much less traffic being sent by Pyrogenesis.
Patch by: @Dunedan
Accepted by: @Stan
Fixes: #6740
Differential Revision: https://code.wildfiregames.com/D5217
This was SVN commit r28196.
Ofthen the `messageBox` is only used for confirmation like: "Do you
really want to overwrite the savegame?"
With this patch the code paths of "overwrite savegame" and "make new
savegame" can be combined.
In some cases there is nothing done when one button is pressed. That is
changed to an early return.
Comments by: @Stan
Differential Revision: https://code.wildfiregames.com/D5274
This was SVN commit r28191.
Fix an issue on newer GNU/Linux and macOS where the build would fail due
to missing unistd includes.
Fixes: #6847
Accepted by: @vv221
Comments by: @sera
Differential Revision: https://code.wildfiregames.com/D4894
This was SVN commit r28187.
Previously private messages and announcements got handled the same way.
This adds a distinct handling for server announcements, which allows
formatting them in a different way. They are now not prefixed with
"Private" anymore and show the announcement subject as well, if one was
set.
Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5268
This was SVN commit r28186.
As log messages aren't supposed to be translatable, this removes the
internationalization of all log messages, which had it enabled.
Patch by: @Dunedan
Accepted by: @Itms
Differential Revision: https://code.wildfiregames.com/D5314
This was SVN commit r28179.
dd65a4e32e had some unintended consequences. Some specific names
apparently
are indeed supposed to be translated. Also using the message context
the translator hint isn't the right place and changes the primary key
used for these strings on Transifex. Instead comments should be used.
To avoid more interruption to translators, we revert the changes for
now and come up with a better patch.
This was SVN commit r28162.
Make it clear that strings for specific names usually don't have to be
translated.
Patch by: @Dunedan
Accepted by: @Stan
Fixes#5563
Differential Revision: https://code.wildfiregames.com/D5310
This was SVN commit r28160.
Up to now the references (lines starting with `#:`) in the portable
object templates generated by `updateTemplates.py` didn't comply with
the PO file format specification. They violated the specification in two
ways:
- White spaces in file names got replaced by non-breaking spaces
(U+00A0), instead of the file names being enclosed by First Strong
Isolate (U+2068) and Pop Directional Isolate (U+2069)
- the references didn't just include the filename and optionally the
line number of the string, as defined in the specification, but also a
non-standard "breadcrumb" component, which made them unnecessary
hard to read in certain cases and difficult to use with tools
expecting properly formatted references
This commit fixes both of these issues by properly encoding white
spaces and removing the breadcrumb component.
Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5309
This was SVN commit r28159.
Up to now the languages and their names shown in the credits came from a
static mapping in `creditTranslators.py`. The language names noted in
there weren't consistent: some where present just in English, some in
their native language and some in both. This also required adjusting the
mapping manually, whenever a new language got added on Transifex,
otherwise its translators wouldn't be credited properly.
This commit resolves both issues, by making the language names
translatable and removing the need for the static mapping in
`creditTranslators.py`.
There is one minor nuisance with this implementation: As the languages
get listed in the credits in the same order as in `translators.json` and
they are ordered by there English name in there, the order might not be
alphabetical in other languages.
Running `creditTranslators.py` for the first time with these changes
will produce a rather large diff for `translators.json`, as not just the
language names will be changed to the English name of the language in
many cases, but the order of languages in the file as well. The first
run of `updateTemplates.py` after that will then add the languages as
new translatable strings.
Patch by: @Dunedan
Accepted by: @Itms
Differential Revision: https://code.wildfiregames.com/D5300
This was SVN commit r28158.
Extracting translatable strings source files did also extract strings
which only consisted of spaces and line breaks. As that doesn't make
much sense, added noise in the portable object templates, for
translators and when linting the translations, this commit omits such
strings when generating the portable object templates.
Patch by: @Dunedan
Accepted by: @Stan, @Itms
Differential Revision: https://code.wildfiregames.com/D5308
This was SVN commit r28157.
While `creditTranslators.py` did already contain logic to remove
duplicate translator names, that logic didn't remove translator names
which only differed in their casing. As the removal was implemented
using an (unordered) `set`, the order of such duplicate names wasn't
deterministic and oscilated between the possible orders with different
invocations of `creditTranslators.py`, creating unnecessary changes to
`translators.json`.
This commit fixes that so that duplicate names are also removed when
they just differ in their casing and prefers the variant with has the
names starting with a capitalized letter.
Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5304
This was SVN commit r28152.
Up to now the "debug" and "long" translations got generated without the
comments present in the portable object files. This lead to the problem
that "dennis-ignore" directives in the comments weren't present in these
translations anymore, causing dennis to report false-positives for the
debug translations. This commit fixes that by keeping the comments in
the debug translations.
Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5303
This was SVN commit r28150.
This moves the check whether a player is the host out of
`LobbyGameRegistrationController` and only creates an instance of it in
`SetupWindow` if the player is the host.
This solves a problem with
`LobbyGameRegistrationController.onGameStart()` getting triggered by
players not being the host and sending unnecessary and invalid
changestate stanzas to XpartaMuPP.
Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5270
This was SVN commit r28148.
When calling `Engine.PushGuiPage` a promise is returned. The promise is
settled when the "child" page is closed. That allows to `await` it
inside `async` functions.
Previously the callback was run right inside the call to
`Engine.PopGuiPage`. Now the continuation of the promise is called at
the end of the "tick".
This won't help performance. It will more likely make things worse.
Since gui pages aren't opened or closed that frequently, it doesn't
matter that much.
Refs: 86c151ebaa
For the engine side:
The promise is stored in the `CGUIManager::SGUIPage` (like previously
the callback). When the promise is fulfilled it enqueues a callback in
the `JobQueue` of the `JSContext`.
Original patch by: @wraitii
Comments by: @wraitii, @Stan, @Polakrity, @lyv, @elexis, @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D3807
This was SVN commit r28145.
This adds updating the translator credits automatically when updating
translations. This has two benefits:
1. Translator credits are up-to-date in SVN-builds, so potential
problems will already show up there.
2. One manual step less during a release.
Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5299
This was SVN commit r28143.
The changes from D5290 broke the script to credit translators, as the
lines with the translators might now include additional information,
like the years of contribution, after the usernames, that would've
been included by `creditTranslators.py` as well.
This commit also slighly hardens the removal of deleted users to from
the credited translators to reduce the likelihood to remove still
existing users.
Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5298
This was SVN commit r28142.
Use the same `CLogger` constructor.
Never take ownership of the streams.
Comments by: @Stan
Differential Revision: https://code.wildfiregames.com/D5203
This was SVN commit r28140.
`CSimulationImpl` doesn't has to be a friend anymore.
Comments by: @Stan
Differential Revision: https://code.wildfiregames.com/D5296
This was SVN commit r28138.
`std::shared_ptr` is intrusive. When a function expects a
`std::shared_ptr` the caller has to use it too and can't store the
element on the stack for example.
Comments by: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D5221
This was SVN commit r28131.
The regex for removing the email address of the last translator from
PO-files contained two bugs causing it not to match:
1. It didn't account for text after the email address and PO-files
from Transifex contain the year of the last translation there.
2. It expected a second `\\n"` at the end of the line, instead of `\n"`.
This commit fixes both of these issues and simplifies the regexes. It
also ensures that the text after the email address is kept as well.
Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5290
This was SVN commit r28130.
Summary:
Most of the times the callback stores a reference to a variable in scope
where the `Future` is in. When the scope is left the reference get's
dangling. `CancelOrWait` is called in multiple places (mostly
destructors) to ensure the callback isn't executed anymore.
This patch deduplicates thous calls to `CancelOrWait`.
Refs: #5874
Comments by: @Stan, @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D5208
This was SVN commit r28128.
As we depend on Babel for i18n tooling nowadays, we can also use its
maintained JavaScript-lexer, instead of the one forked from an old
version of Babel.
Doing so reduces the amount of code we have to maintain, adds new
functionality (like properly handling hexadecimal unicode notations) and
fixes some regex related incompatibilities which makes generating
portable object templates possible with recent Python versions.
The use of `tokenize(…, dotted=False)` is necessary, as we use this
lexer for C++ code as well and detection of most strings in C++ code
fails otherwise. As dotted names weren't supported by version of the
lexer we used until now, this isn't a regression.
Patch by: @Dunedan
Accepted by: @Stan
Differential Revision: https://code.wildfiregames.com/D5293
This was SVN commit r28124.
When the `RL::Interface` is destroied but the engine isn't completely
shoutdown there was a dangling pointer. The time the dangling pointer is
accessable got expanded with 968e55704a.
Whith this patch there no dangling pointer (in that regard).
Accepted by: @vladislavbelov
Comments by: @Stan, @sera
Trac Tickets: #5989
Differential Revision: https://code.wildfiregames.com/D5254
This was SVN commit r28123.
The code didn't call `this.isCircularMap` but checks if it's defined.
The function returned the wrong values for square maps.
Broken in 480228f964
Comments by: @Stan
Differential Revision: https://code.wildfiregames.com/D5288
This was SVN commit r28122.
- Adding the function signature
- Changing `g_Map.ExportMap()` to `return g_Map`
- Changing `Engine.SetProgress(NN)` to `yield NN`
- Changing `const g_Map = ...` to `globalThis.g_Map = ...`
- On some maps using the argument `mapSettings`
Comments By: @asterix, @sera, @Stan
Differential Revision: https://code.wildfiregames.com/D5258
This was SVN commit r28119.
Summary:
Preparation to use the generator based interface.
Removes many globals. (but doesn't reduce their scope by much)
Refs: #4964
Comments By: @sera @elexis
Differential Revision: https://code.wildfiregames.com/D5285
This was SVN commit r28117.
Arabian Oases: Added "new" keyword
Sporades Islands: Added "new" keyword, gave both players a free starting
Scout Ship. Added a capturable CC on the unoccupied north island. Added
2 Gaia Treasure Ships.
Syria: Added some Ruins and Shrines.
Watering Holes: Minor tweaks to grass placement.
Zagros Mountains: Added some Shrines and swapped out the Gaia fields and
farmsteads for capturable Mill_Fields and Mills.
This was SVN commit r28113.
- Put the actual functions in `unknownMapFunctions` instead of just the
names
- Inline some functions
Comments by: elexis
Differential Revision: https://code.wildfiregames.com/D5280
This was SVN commit r28105.
- whitespace changes
- functions were called in a way that they always used the default
arguments
- deduplicate code in initialization of `heighLimits`
- new structure in `myBiome`, so that the painting can be reduced much.
- also initialization instead of push
- use algorithm to calculate the `areas` and the "midpoints" of the
slope.
Comments by: @elexis
Differential Revision: https://code.wildfiregames.com/D5279
This was SVN commit r28104.
The "biomes" where duplicated between alpine_lakes and alpine_valley.
The biomes can now be selected by the game setup page.
This also remove many `var`'s.
Comments by: @Stan, @elexis
Differential Revision: https://code.wildfiregames.com/D5277
This was SVN commit r28099.
- The heights are now a constant array. Instead of pushing the heights
to an array.
- The terrain are now always constructed in one expression. Instead of
calling `.concat` repeatedly.
- The actors and the probability thereof are now also part of the
object. Separation of data and code.
- Player placement is now a iife.
Comments by: @Stan, @sera
Accepted by: @elexis
Differential Revision: https://code.wildfiregames.com/D5272
This was SVN commit r28098.
This way it's clear what's the input and what's the output of the
computation.
All map generation scripts should reman working. They are adopted in a
future commit.
`Engine.SetProgress` and `Engine.ExportMap` can be removed in a future
commit.
Comments by: @marder, @sera, @Stan
Differential Revision: https://code.wildfiregames.com/D5220
This was SVN commit r28093.
Also move the "origin-handling" in to the loop.
Comments by: @sera, @vladislavbelov, @Stan
Differential Revision: https://code.wildfiregames.com/D5189
This was SVN commit r28087.
- Add a new CI docker file
- Fix a typo for checkrefs (Refs https://code.wildfiregames.com/D5266)
- Switch to Clang8
- Unify pipeline reset in a function
- Update the image building pipeline
This was SVN commit r28086.
To avoid the appearance of two Roman numerals at the end of bot names
(e.g. "Artaxshasha II II -> here "Artaxshasha II" was the name itself
and the second "II" was added when the name was chosen for the second
time), remove the addition of Roman numerals entirely.
Instead, if possible, a new name is chosen for each bot. If not, the
suffix "(n)" is added counting the duplicates and warning is displayed.
AINames are added to the Iberians, Gauls, and Mauryas bringing their
totel to at least 8 each in order avoid any duplicates in regular
8-player games.
Credit to Norse_Harold for changing the condition for reusing names to
not use a hardcoded assumption about the maximum number of player slots
Patch by @Vantha
Accepted by @phosit, @wowgetoffyourcellphone
Differential Revision: https://code.wildfiregames.com/D5256
This was SVN commit r28082.
In the Han CC I changed `0.8 * 0.75` to `0.8 - 0.2` so it could also be
described the same way.
Accepted By: @Freagarach
Comments By: @sera, @Stan
Trac Tickets: #6755
Differential Revision: https://code.wildfiregames.com/D5031
This was SVN commit r28065.
The user doesn't have to fiddle with `std::shared_ptr`.
And two (more unrelated) things: use `std::unordered_map`, use a
`std::find_if` in the callback.
Comments By: @vladislavbelov, @Stan
Differential Revision: https://code.wildfiregames.com/D5239
This was SVN commit r28048.
Since 1bccfef6fb the `CSimulation2` uses the `std::shared_ptr` only in
the constructor and stores a `ScriptContext&` (inside it's members).
That's a bit dangerous: A caller might think `CSimulation2` takes
ownership of the `ScriptContext`.
With this commit the caller has to pass an `ScriptContext&` to the
constructor.
Comments By: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D5223
This was SVN commit r28046.
Noticed and patch proposed by @Feldfeld in 480228f964
Doesn't have any consequences as the function is only called via
"scaleByMapAreaAbsolute" in the codebase.
accepted by @Feldfeld @marder
Differential revision: https://code.wildfiregames.com/D5248
This was SVN commit r28042.
The `StateSet` is only used to check if a state is valid. That's useless
since it wouldn't be found in the `TransitionMap` - With the same
outcome.
Accepted By: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D5236
This was SVN commit r28039.
One should always use the variable declaration with the least possible
scope.
This patch cleans up many (but not all) of the `var` in rmgen and
replaces them with `let` or `const`.
The same is done for `let` -> `const`.
comments by: @sera @Stan
Differential revision: https://code.wildfiregames.com/D5214
This was SVN commit r28036.
The hash function introduced in 6faf704731 doesn't work on 32 bit
systems. This one should.
Accepted By: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D5237
This was SVN commit r28033.
Without the "pair" attribute API3..GameState.prototype.canResearch
doesn't check if the other tech is already researched (or is being
researched).
Patch by: @phosit
Accepted by: @wowgetoffyourcellphone
Differential Revision: https://code.wildfiregames.com/D5238
This was SVN commit r28026.
When a wild animal was in a defenseArmy and it was killed, its resource
got into the army as well. This caused a call to GetUnitAIOrder data
which was undefined for the resource.
Fixed by checking for UnitAI-ness and also for attack-ability whilst at
it.
Reported by @seregadushka at the forums:
https://wildfiregames.com/forum/topic/110098-petra-error-winter-is-coming5/.
Investigated and MWE by @Norse_Harold.
Fixes#6899
This was SVN commit r28025.
Warships now use the Unit AI instead of the Building AI. This allows
players to specifically target fire onto desired targets.
Warship combat now revamped with completely new Warship classes, which
soft counter each other, and new behavior for Fire Ships. With an
all-new ship tech tree at the Dock.
Commit includes fixing maps to switch from the old to the new ship
templates. Also includes revamped Cycladic Archipelago skirmish maps and
some other special surprises. And improved/additional ship UI portraits.
New Warship classes:
Scout Ship
Arrow Ship
Ramming Ship
Siege Ship
Forum discussion:
https://wildfiregames.com/forum/topic/104332-naval-overhaul-alpha-27/#comment-539713
Patch by: @wowgetoffyourcellphone
Accepted by: @real_tabasco_sauce
Comments and suggestions by: @borg-, @phosit (more comments and
discussion at the forum link)
Differential Revision: https://code.wildfiregames.com/D5213
Refs #4000 for a sound issue for actors without an attack animation.
This was SVN commit r27996.
In addition to the existing "Shallow" water level two water levels are
added:
- Deep: Only ships can reach other islands
- Rising: The water level changes from Shallow to Deep to a level where
the home islands are flooded.
Accepted By: @real_tabasco_sauce
Comments By: @marder, @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D5139
This was SVN commit r27992.
libxml2 v2.12.1 includes less header indirectly. Also `xmlError*` has to
be changed to `const xmlError*`.
Original Patch By: Riesi
Accepted By: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D5219
This was SVN commit r27980.
The territory decay of these structures didn't make much sense (gameplay
wise) and made those structures a pain to use.
Patch by: @wowgetoffyourcellphone
Accepted by: @real_tabasco_sauce
Differential Revision: https://code.wildfiregames.com/D5215
This was SVN commit r27978.
RandomMap only takes two arguments (baseHeight, baseTerrain) not three.
Originally introduced in 5fe58d80fd.
Noticed by & accepted by @phosit
Differential revision: https://code.wildfiregames.com/D5212
This was SVN commit r27967.
The Function is not restricted to std::function anymore. Move only
function become possible.
Differential Revision: https://code.wildfiregames.com/D4840
This was SVN commit r27962.
This adds an upgrade option for the Persian "Apadana" (will be renamed
later to "Tachara"), where the player can choose to receive a trickle of
a desired resource, like taxes or tribute from their subject peoples.
Call this the "Satrapy Tribute" feature.
Patch by: @wowgetoffyourcellphone
Accepted by: @real_tabasco_sauce
Comments by: @chrstgtr, @borg-
Differential Revision: https://code.wildfiregames.com/D5192
This was SVN commit r27954.
56f15f0869 broke those maps in atlas where g_MapSettings.TeamPlacement
is never initialized.
Bug found by @elexis
Fix not objected by @elexis (comments: committable if 56f15f0869 should
not be reverted and developer time is limited)
Differential revision: https://code.wildfiregames.com/D5200
This was SVN commit r27952.
Needed until / if D5082 lands.
Until then we also still need: `g_PlayerbaseTypes`.
Differential revision: https://code.wildfiregames.com/D5196
This was SVN commit r27946.
The return-slot provided by the `Future` is used for synchronisation.
Refs: #5874
Comments By: @Stan, @vladislavbelov, @wraitii
Differential Revision: https://code.wildfiregames.com/D5001
This was SVN commit r27944.
This means deprecate `createBasesByPattern` in rmgen2 and add new
function `playerPlacementByPattern` in common
Differential revision: https://code.wildfiregames.com/D5194
This was SVN commit r27943.
Move the placement functions and the getTeamArray from rmgen2 to
rmgen-common, so that those maps can use the placement options as well,
without having to load the whole rmgen2 library.
Differential revision: https://code.wildfiregames.com/D4948
This was SVN commit r27941.
After they had been broken in 21e866fcf0
Author / patch by: @lairkers
Troubleshooting / comments by @elexis @Freagarach
Fixes#6831
This was SVN commit r27937.
This fixes an issue revealed by 7350b9042e that affected deserialized
games.
Adding tests further highlighted a bug in the calculations, which is
fixed.
Reviewed By: phosit
Fixes#6883
Differential Revision: https://code.wildfiregames.com/D5181
This was SVN commit r27928.
Makes all farming techs at the Farmstead available in the Village Phase
(I) for the Ptolemies.
Patch by: @borg-
Accepted by: @real_tabasco_sauce, @wowgetoffyourcellphone
Differential revision: https://code.wildfiregames.com/D5180
This was SVN commit r27915.
This creates a slightly larger chicken model, which helps with visual
identification at the start of the match. I have seen multiple let's
plays where finding the initial chickens took too long (in my opinion),
because I believe they are too small for the game world.
Patch by: @wowgetoffyourcellphone
Original model by: @LangBart
Accepted by: @chrstgtr, @real_tabasco_sauce
Differential revision: https://code.wildfiregames.com/D5177
This was SVN commit r27910.
This is a very unique technology that trades in melee citizen-soldier
infantry in exchange for unlocking Legionaries. Legionaries are similar
to Skiritai except they are cheaper.The idea is that these units can
form the bulk of the Roman army, so they should be cheap, but powerful.
Additional champions remain to supplement these units. And for improved
engagement with Centurions, they gain a special second aura just for
Legionaries, called 'Century Maneuvers"
Patch by: @real_tabasco_sauce
Accepted by: @borg-, @wowgetoffyourcellphone
Comments by: @chrstgtr, @Freagarach,
This was SVN commit r27900.
Back by popular demand; patch requested by @borg-. This gives the "War
Dog" Kennel building back to the Britons. Previously removed in Alpha
24. Its removal widely lamented since then.
War Dogs removed from the Briton Stable as a consequence.
Patch by: @wowgetoffyourcellphone
Accepted by: @borg-, @real_tabasco_sauce
Differential revision: https://code.wildfiregames.com/D5153
This was SVN commit r27890.
Ptol bolt shooters have their own prepare time and fire rate, so
following 13c169025c, the ptol bolts were unchanged. This patch brings
this prepare time change to the faster firing bolt shooters.
Patch by: @real_tabasco_sauce
Accepted by: @wowgetoffyourcellphone
Differential revision: https://code.wildfiregames.com/D5150
This was SVN commit r27875.
This mixin is genericized in order to be useful for other units if
desired. It adds a splash attack, but removes some regular attack to
balance. With this, a champion or other unit can be easily
differentiated. In this instance, it is applied to the Macedonians'
champion swordsman, the Thracian Black Cloak. These guys use the very
long Rhomphaia and Sika swords of Thraco-Dacian origin.
Patch by: @wowgetoffyourcellphone
Accepted by: @real_tabasco_sauce, @borg-
Differential revision: https://code.wildfiregames.com/D5145
This was SVN commit r27871.
Celtic women were famous for their ferocity and aggressiveness against
enemies and it was common for them to fight alongside men in battles,
especially if the battle had been lost, the women being a strong last
line of defense.
Patch by: @borg-
Accepted by: @chrstgtr, @real_tabasco_sauce
Differential revision: https://code.wildfiregames.com/D5125
This was SVN commit r27870.
Reduce prepare time for catapults and bolt shooters. Catapults have
recently been nerfed and buffed with a small splash attack. Bolt
shooters are a little underutilized. Both of these units share a
'clunkiness' which is due to their pack/unpack time, minimum range, and
long prepare time. This patch hopes to address part of this clunkiness
by decreasing the prepare time for catas and bolt shooters. This makes
the unit seem more responsive to new commands to attack a different
unit/structure.
Patch by: @real_tabasco_sauce
Accepted by: @wowgetoffyourcellphone
Comments by: @chrstgtr, @Freagarach
Differential revision: https://code.wildfiregames.com/D5131
This was SVN commit r27865.
Adds 1/1/1 armor, but +10 metal cost and -5% speed and slightly slower
acceleration and turning
Patch by: @wowgetoffyourcellphone
Accepted by: real_tabasco_sauce
Comments by: @borg- & @chrstgtr
Differential revision: https://code.wildfiregames.com/D5141
This was SVN commit r27864.
This makes some adjustments to Hippocrates by renaming his auras and
tweaking their effects.
Patch by: @wowgetoffyourcellphone
Accepted by: @borg-, @real_tabasco_sauce
Differential revision: https://code.wildfiregames.com/D5138
This was SVN commit r27857.
Druids increase attack rates of soldiers near them slightly. This
fulfills a decade+ design element in the old Celtic civ design profiles.
Patch by: @borg-
Positive Comments by: @chrstgtr
Accepted by: @real_tabasco_sauce, @wowgetoffyourcellphone
Differential revision: https://code.wildfiregames.com/D5116
This was SVN commit r27836.
Attempts to address Invalid warning messages for capturable farmsteads
and creates a mixin as suggested by @Langbart
Renames the "farmsteads_" template files to "mill_" to eliminate
confusion with standard buildable farmsteads and changes the refs in the
skirmish maps to suit.
Genericizes the name to Rotary Mill instead of Farmstead, again to
eliminate confusion between the two (the former is a capturable map
object, while the latter is a player-buildable structure).
Fixes#6818
Differential revision: https://code.wildfiregames.com/D5113
This was SVN commit r27835.
Catapults and heavy warships received a nerf to their range, which was
also designed to stop infinite targeting of structures outside of vision
range. This was a substantial nerf, from 100 range to 85. This change
compensates for this range reduction by slightly improving their
versatility.
This is not the same splash we have seen in previous alphas, as it is
only a radius of one meter. It also makes them exciting as you could
land some epic shots if your enemy is very tightly bunched.
Patch by: @real_tabasco_sauce
Differential revision: https://code.wildfiregames.com/D5053
Accepted by: @borg-
Comments by: @chrstgtr, @wowgetoffyourcellphone
This was SVN commit r27831.
With the change to the Spartan bonus, it is interesting to add +10%
health to the hoplite tradition tech.
The hoplites dominated warfare for a long time, and it is fair to keep
this bonus somehow.
Patch by: @borg-
Differential revision: https://code.wildfiregames.com/D5098
Accepted by: @real_tabasco_sauce, @wowgetoffyourcellphone
This was SVN commit r27804.
When playing a network game with at least one AI, and an AI dies, after
a while there will be an increasing lag on the system, eventually
freezing the screen for e.g. 4 seconds every 5 seconds.
It turned out that once the AI is dead, the savedEvents grew endlessly.
Causing issues down the line (hashing).
That is now fixed by discarding savedEvents when the AI is defeated.
Patch by: @lairkers
Differential revision: https://code.wildfiregames.com/D5042
Comments by: @phosit, @wraitii
This was SVN commit r27800.
Avoid cases of filenames
Update years in terms and other legal(ish) documents
Don't update years in license headers, since change is not meaningful
Will add linter rule in seperate commit
Happy recompiling everyone!
Original Patch By: Nescio
Comment By: Gallaecio
Differential Revision: D2620
This was SVN commit r27786.
This gives them a new hero (Hippocrates; recruitable from the tempel)
and some unique Naval bonuses.
Patch by: @borg-
Differential revision: https://code.wildfiregames.com/D3727
Accepted by: @real_tabasco_sauce
Comments by: @chrstgtr, @ValihrAnt, @wowgetoffyourcellphone
This was SVN commit r27779.
This differentiates Sparta by giving them P1 champions, a Hero-oriented
team bonus and a new unit.
Sparta should rely heavily on their extremely powerful melee infantry,
hence the focus is on that with choice and upgrade.
Patch by: @borg-
Differential revision: https://code.wildfiregames.com/D4736
Accepted by: @chrstgtr, @real_tabasco_sauce
Comments by: @Langbart, @marder, @wowgetoffyourcellphone
This was SVN commit r27775.
Now a range-based for loop is used to iterate.
Accepted By: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D4953
This was SVN commit r27757.
swprintf_s expected an argument of type char (due to %c). Given an
argument of type wchar.
This fixes N7 and N8 from #5288
Refs #5288
Patch By: @animus
Accepted By: @phosit, @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D4993
This was SVN commit r27751.
We were incorrectly comparing an object to a number.
I don't think this will drastically change the AI behaviour as it's
rather an edge case.
Reviewed By: Freagarach
Differential Revision: https://code.wildfiregames.com/D5030
This was SVN commit r27732.
Since 281bb0b2ec, opening the 'Options' menu in-game will show that
there are pending changes, even if the user has done nothing.
Unfortunately the cinematic logic to hide silhouettes, which comes from
cfd08bbf28, is broken following those changes. We use the configuration
to hide them, which results in us, indeed, changing the configuration.
There isn't really a good short term fix. This change only attemps to
reset the setting if we changed it for a cinematic, which fixes the
issue, but has drawbacks.
Ideally, we would use a superior config level, but we need to be careful
about exposing that to JS.
Reported by: langbart
Fixes#6821
Differential Revision: https://code.wildfiregames.com/D5040
This was SVN commit r27730.
The previous code was constructing un-necessary ScriptRequest objects.
Minor optimisation from not entering/leaving realms.
Differential Revision: https://code.wildfiregames.com/D5026
This was SVN commit r27728.
ScriptFunction::Call_ checks HasProperty, but then JS_CallFunctionName
calls GetProperty. This is redundant and can be simplified.
Reviewed By: phosit
Differential Revision: https://code.wildfiregames.com/D5000
This was SVN commit r27726.
Two changes to the vertex pathfinder that should generally improve
performance:
- Sort unaligned edges by distance like we did aligned edges. This
isn't very scientific, but the idea is generally sound, and empirically
it seems to do OK.
- Relax the optimality by using a weighted heuristic, with weight 4/3
or 5/3 depending on the number of obstacles around. In the worst cases,
A* will return paths that are this many times less optimal, but search
should be faster in general (and sometimes much faster).
Both of these optimisations might increase the constant-cost slightly,
but should decrease the worst-case runtimes.
Differential Revision: https://code.wildfiregames.com/D5034
This was SVN commit r27724.
Who says only players should be able to conduct diplomacy?
Also separation of concerns, more maintainable files.
Differential revision: https://code.wildfiregames.com/D4921
Comments by: @elexis, @Stan
Refs. #5894
This was SVN commit r27722.
- remove `SDL_Delay(100)`
- the progress is now an `std::atomic` (not protected by the mutex
anymore)
Based On Patch By: @vladislavbelov
Accepted By: @wraitii
Differential Revision: https://code.wildfiregames.com/D3676
This was SVN commit r27717.
- Add explicit variables for magic values.
- `let`s to `const`.
- Don't start the regen timer when not needed.
Differential revision: https://code.wildfiregames.com/D4965
Comments by: @Stan
This was SVN commit r27707.
FSM conditions aren't used. So this removes dead code.
Accepted By: @wraitii
Differential Revision: https://code.wildfiregames.com/D4959
This was SVN commit r27702.
Similar trick to D3446 / c87229aa48 - we can short-circuit if we find
units that match our best possible preference.
This is, in particular, almost a 40% wall time improvement on Combat
Demo Huge, but it should apply in a number of more normal cases.
Differential Revision: https://code.wildfiregames.com/D5020
This was SVN commit r27701.
SPECTRE attacks mitigations were added to SpiderMonkey's JIT output in
version 57. Turning these off is a very large speedup, around 10-20%
wall time (on my computer) depending on the map and the situation.
For the most part, from profiling on my machine, this is from memory
fences after JIT -> C++ calls. 0 A.D. does a lot of these.
The SPECTRE class of attack is a timing attack based on speculative
execution to leak sensitive information, and it seems extraordinarily
unlikely that something like this could be successfully mounted using 0
A.D.
Differential Revision: https://code.wildfiregames.com/D5014
This was SVN commit r27699.
Following the AI unthreading in 4df03ed2d2 / D3769, structured clones
are no longer needed to pass the gamestate around.
This is much faster, about 10-15% wall time on an AI 1v1 profile.
This also potentially reduces memory fragmentation and GC needs, as
writing clones allocated a lot of data.
Differential Revision: https://code.wildfiregames.com/D5019
This was SVN commit r27698.
This is unused and makes the function twice as slow as it needs to be.
Differential Revision: https://code.wildfiregames.com/D5015
This was SVN commit r27697.
This functions is amongst the most called in JS, so it's important to
make it speedy.
- Bugfix: if 'originalValue' is falsy, the result was never cached. This
in particular affected the minRange of archers, which is 0. It's a large
optimisation on combatDemoHuge, but the effect elsewhere is less likely
to be noticeable.
- Don't go through the helper to get the player Entity ID, in this case
it's slower.
- Concat is slower than Flat() in this case according to my profiling.
- Some micro-optimisation by strict equality.
Differential Revision: https://code.wildfiregames.com/D5012
This was SVN commit r27696.
FaceTowardsTarget is called quite often by UnitAI, and we can skip some
un-necessary messages as an optimisation.
Differential Revision: https://code.wildfiregames.com/D5005
This was SVN commit r27695.
Mediterranean Bush (dry)
Stone and Rock fences by @Wow
New props for Briton and Gallic formation standards
New Kushite Shields by @Stan
Saharan capturable farmstead
Celtic Shrine (with improved textures)
Royal Palm tree
This was SVN commit r27677.
According to JIT profiling on SM 115, using ForEach is faster than
iterating.
This is a micro optimisation, maybe 2% faster for OnUpdate, which means
we might see an overall improvement < 0.4%.
The reason this is faster here is that Iterating needs to construct an
array to store the result, whereas ForEach just uses the values
directly. This means this probably doesn't apply to iterating if we
don't need both the key/value pair.
Differential Revision: https://code.wildfiregames.com/D5010
This was SVN commit r27674.
CmpPosition::TurnStart checks whether the territory changed underneath
each entityevery turn. The only user of this is TerritoryDecay
(structures, for the most part). It is rather inefficient to have this
done for all entities.
The simplest solution is to listen to position-changed messages in
TerritoryDecay instead. This should hardly ever happen in vanilla 0
A.D., except in Atlas, so it's basically free.
This sort of reverts 19965ce37a (original implementation) and
c44b48bd59.
Accepted By: Freagarach (concept only)
Differential Revision: https://code.wildfiregames.com/D5009
This was SVN commit r27673.
Right now usernames for the lobby can consist solely of numbers and
special characters. This can result in nonsensical usernames and is
prone to be abused. While we can't entirely prevent nonsensical
usernames, we can at least do a bit better.
Therefore, this adjusts the rules for the validation of new lobby
usernames in pyrogenesis. Previously these rules were:
- length: between 1 and 20 characters
- valid characters: lower- and uppercase letters, numbers, ".", "_", "-"
The new rules are:
- length: between 3 and 20 characters
- valid characters: lower- and uppercase letters, numbers, ".", "_", "-"
- must contain at least one letter
These validation changes are relevant for new user registrations only
and don't affect existing users. As this also just adjusts the
client-side validation, users will also still be able to register
usernames according to the old rules, e.g. when using an older version
of 0 A.D., until the same change gets rolled out at a later point in
time server-side as well.
This was SVN commit r27670.
- Move the Crush damage from Splash to direct hit.
- Reduce overall damage slightly
Accepted By: Feldfeld
Differential Revision: https://code.wildfiregames.com/D5008
This was SVN commit r27668.
Summary:
On macOS Ventura (at least version 13.2.1 and above), the game crashes
instantly when clicking on buttons communicating with the lobby.
This issue is solved by upgrading nettle to 3.9 and GNUTLS to 3.8.
Patch by: froissant
Accepted By: wraitii
Trac Tickets: #6807
Differential Revision: https://code.wildfiregames.com/D5018
This was SVN commit r27667.
gcc-13 less often includes cstdint so one might need to include it
manually if needed.
The headers already included in Message.h are included within namespace
AtlasMessage which didn't break by chance, move them out and add
cstdint.
Patch by: @sera
Reviewed by: @phosit
Fixes: #6800
Differential Revision: https://code.wildfiregames.com/D4997
This was SVN commit r27644.
Avoid duplication by moving the function to Transform.js.
Add tests to Transform.js
Add tests to TurretHolder.js
Optimize slightly Trainer.js by removing some useless
Engine.QueryInterface calls.
Refs #6784 (symptoms in TriggerHelper.js are fixed underlying cause not)
`SkirmishReplacer` is called before the Modifier Manager so it does not
suffer the same fate.
Entities using `ChangeEntityTemplate` function are still affected.
Maps calling Engine.AddEntity directly are still affected.
Ideally this should be handled by hotloading components instead of
creating new entities each time. See =>
https://code.wildfiregames.com/D4991
Tested using:
908dd631d9
Differential Revision: https://code.wildfiregames.com/D4984
This was SVN commit r27636.
"fruitBush": "gaia/fauna_deer" was an oversight/ hack and is just bad
practice.
patch by: @real_tabasco_sauce
comments by: @phosit
Differential revision: https://code.wildfiregames.com/D4990
This was SVN commit r27635.
Most of the shaders are explicitely interned by the engine except for
the one called "Model" which is not required (you can have maps with
just terrain for visualization)
The rng files are called by the engine to validate structure.
The game has two overrides for high quality and normal water to be
"ocean" and "default" respectively
The minimap flare folder is hardcoded see #6795
The default material now calls the dummy shader instead of the model one
when in modmod
Move the default skybox, it will be required by _default.xml
The terrain materials are moved as well, for completeness, although they
are currently not referenced.
This commit does not include atlas needed files as it cannot run without
the public mod anyway for now. It will be done in a separate commit when
we have the ingame editor that will require _default.xml for instance.
This commit is also needed to generate the spir-v shaders in the correct
mods, in order to be able to launch the game with mod mod only.
Refs: #6636#5366Fixes: #6294
Differential Revision: https://code.wildfiregames.com/D4906
This was SVN commit r27629.
- Fix Jenkins warnings about leaked credentials.
- Fix one script not loading utf-8 on windows.
- Fix command line arguments not working when inlined on Linux.
This was SVN commit r27621.
Print a warning in the debug output for now, as the logger is not
available at this point.
Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/D4743
This was SVN commit r27612.
As of the `beta2` version of `premake5`, `sysincludedirs` has been
deprecated
and replaced with/renamed to `externalincludedirs`, and continuing to
use it
causes warnings to be emitted.
With this change, we now use `externalincludedirs` when available so as
to
prevent the warnings, falling back to `sysincludedirs` when it's not to
prevent
breakage with pre-`beta2` versions of `premake5`.
Accepted By: sera
Fixes: #6785
Differential Revision: https://code.wildfiregames.com/D4980
This was SVN commit r27606.
This fixes packet loss issues on some VPN solutions.
Patch By: sera
Differential Revision: https://code.wildfiregames.com/D4967
This was SVN commit r27599.
They can't dance either way and this improves their pathfinding behavior
as well as their visual movement.
Comments from @Stan @Freagarach @wraitii @real_tabasco_sauce
Differential Revision: https://code.wildfiregames.com/D4971
This was SVN commit r27587.
Fixes: #6708
Reported by @borg- @andy5995, ticket creation & suggested solutions by
@Langbart
Previous version of the batch accepted by @real_tabasco_sauce, positive
comments from @chrstgtr
Differential Revision: https://code.wildfiregames.com/D4962
This was SVN commit r27585.
Also some cleaning in the statistics tracker.
(`total` is used by the lobby bots and hence not removed.)
References 215a102c27 and #3948.
Differential revision: Don't subtract lifestock from used/gathered
resources.
Tested by: @Langbart
Fixes#6744
This was SVN commit r27562.
Instead of merely walking (totally unwanted in the middle of a fight,
hence I call this a bugfix).
Differential revision: https://code.wildfiregames.com/D4955
This was SVN commit r27561.
When unable to garrison and that is the first rally point, the rest of
the rally point queue is not handled.
The check was introduced in df1d5d2260 because UnitAI didn't guard
garrisoning properly.
Patch by: @Langbart
Differential revision: https://code.wildfiregames.com/D4954Fixes#6746
This was SVN commit r27560.
Reported by: @Langbart
Differential revision: https://code.wildfiregames.com/D4936
Refs. #6385 by fixing a part of it (the attack plan).
This was SVN commit r27551.
Causing units to not show the gathering animation when close to a
dropsite.
We might want to move this stuff to their respective components.
Differential revision: https://code.wildfiregames.com/D4937
Comments by: @Stan
Fixes#6566
This was SVN commit r27550.
As it was too tedious to use and hence unused.
Also nerf it a bit since it may be too strong otherwise.
Patch by: @real_tabasco_sauce
Differential revision: https://code.wildfiregames.com/D4943
Reviewed by: @chrstgtr, @wowgetoffyourcellphone
This was SVN commit r27547.
There is some unit-motion/unitAI bug that makes them not reach the
center and hence idleness.
Refs. #6735 by fixing the specific PetraAI <> catafalque case.
Reported and solution by: @Langbart
This was SVN commit r27544.
Introduced when changing the default behaviour to capturing
(82e2619ece).
Also fixes confusing the AI with catafalques (etc.), noticed by
@Langbart at D4933.
Differential revision: https://code.wildfiregames.com/D4934
Tested by: @Langbart, @phosit
This was SVN commit r27532.
Since it is not nice to make the game unusable (citation needed) we'll
emit a warning, which is less not nice.
Reported by: @Langbart
Differential revision: https://code.wildfiregames.com/D4930
Reviewed by: @Langbart
Fixes#6724
This was SVN commit r27531.
Walls should be more helpful as a defensive feature, currently they only
serve to limit movement.
Wall garrisoning is the primary defensive benefit of walls, but only
allowing eight to garrison in a long wall section means these eight
units are quickly dealt with, especially since they are stationary.
Doubling the wall garrison (by adding another row, not by cramming them
side-to-side) not only looks cooler, but also allows a more sizable army
to occupy walls.
Refs.
https://wildfiregames.com/forum/topic/105534-ai-and-the-walls-dilemma/.
Patch by: @real_tabasco_sauce
Differential revision: https://code.wildfiregames.com/D4914
Comments by: @Stan, @wowgetoffyourcellphone
This was SVN commit r27527.
- They had vertexes groups without weights.
- Both of them were unused one incorrectly so.
- Also fix the material while at it.
Refs #6714
This was SVN commit r27515.
Conflicted with garrisoning, which is used more often.
Reported by @minohaka at D4697, after 82e2619ece.
Differential revision: https://code.wildfiregames.com/D4908
Accepted by: @real_tabasco_sauce
This was SVN commit r27506.
Use tokens for required technologies, allowing `-tech` and easier
replacements.
Fixes requiring `replace=""` when replacing techs.
Also a minor fix in the TemplateParser.js for upgrade requirements.
Refs. 9bb9ff8b16.
Differential revision: https://code.wildfiregames.com/D4912
Comments by: @Stan
This was SVN commit r27505.
This fixes#4705: the TLS connection now works on Windows, also tested
with certificate verification and with TLSv1.2 (so TLSv1.0 can now be
disabled server-side).
Ideally we should have waited for the release of version 1.0.25, but the
development seems to have mostly stopped upstream.
Tested By: maroder
Differential Revision: https://code.wildfiregames.com/D4910
This was SVN commit r27490.
Reduces unnecessary text.
The corral defines the interval and the animal auras define the amount.
Patch by: @Grapjas
Differential revision: https://code.wildfiregames.com/D4896
Comments by: @Langbart, @Stan
Fixes#6687
This was SVN commit r27487.
Done by creating a function for 'objections' and using that for any
unmet requirements.
Patch by: @abian
Differential revision: https://code.wildfiregames.com/D4899
Comments by: @Langbart
Fixes#6694
This was SVN commit r27484.
Also fix an incorrect code comment, and prevent Atlas from being started
with `-dumpSchema`.
Reviewed By: phosit
Differential Revision: https://code.wildfiregames.com/D4903
This was SVN commit r27470.
Add a new patch written by s0600204, replacing the use of `distutils`
with `sysconfig` in the setup of the bundled virtualenv in SpiderMonkey.
Add a patch which is a portion of
https://phabricator.services.mozilla.com/D130410, fixing upstream's bug
1739486 on Fedora.
This fixes build issues on recent Debian and Fedora. This is consistent
with upstream's upcoming changes in ESR102 following the deprecation of
`distutils`.
This cleans up some old SM patches; renames the [[SVN:27442]] unicode
patch; moves a Python-related environment variable inside `build.sh`;
fixes indentation and EOL properties.
Differential Revision: https://code.wildfiregames.com/D4893
This was SVN commit r27460.
It still won't link if the user has a more recent issue than whatever
was vendored with Spidermonkey. Refs:
https://code.wildfiregames.com/D3127.
Fix option --with-system-spidermonkey info oversight when updating in
d8332a2938 and d92a2118b0 and d5db03c303
Reported by @sera, @linkmauve
This was SVN commit r27440.
- Remove crossbow_training.json from the Han academy
- Adjust the cost of poison arrows and poison blades so that the ranged
upgrade should be the one to cost metal, since ranged units currently
dominate most battles.
- Reduce the obstruction area of rice paddies so that they are easier to
place.
Patch by: @real_tabasco_sauce
Accepted by: @chrstgtr, @wowgetoffyourcellphone
Differential Revision: https://code.wildfiregames.com/D4873
This was SVN commit r27406.
Patch by: @real_tabasco_sauce and @vv221
Differential Revision: https://code.wildfiregames.com/D4872
Accepted by: @wowgetoffyourcellphone based on forum discussions
This was SVN commit r27400.
Discussed countless times on the forum.
We try this out this release.
Patch by: @marder
Differential revision: https://code.wildfiregames.com/D4697
Idea accepted by: @asterix, @wowgetoffyourcellphone, @chrstgtr
Comments by: ^ + @Stan
This was SVN commit r27399.
Makes elephants more effective against units and less of a siege weapon.
Animals should not be used as mechanical siege weapons.
Based on a patch by: @Kate
Differential revision: https://code.wildfiregames.com/D4137
Comments by: @marder, @wraitii
This was SVN commit r27391.
- Use reinterpret_cast.
- Use using instead of typedef.
- Use PascalCase for CONDITION and ACTION.
- Use constexpr instead of #define.
Patch by: @phosit
Differential Revision: https://code.wildfiregames.com/D4868
This was SVN commit r27385.
- Move the comments to the header file
- Add a dot at the end of a comment
- Remove some trivial comments
- Improve spelling.
Patch by: @phosit
Differential Revision: https://code.wildfiregames.com/D4861
This was SVN commit r27376.
remove nullptr check before delete. They are redundant.
remove nullptr check after new. They will never be null.
two whitespaces changes forgotten in
https://code.wildfiregames.com/D4800.
Patch by: @phosit
Differential Revision: https://code.wildfiregames.com/D4853
This was SVN commit r27351.
Complex requirements were not properly handled by the parsing code.
This makes it a bit more explicit while also handling multiple techs as
requirements.
Reported by: @wowgetoffyourcellphone
Differential revision: https://code.wildfiregames.com/D4833
This was SVN commit r27350.
These give vision to parts of the map to specified players.
Placed some on the skirmish map Miletus Peninsula as an example.
This was SVN commit r27347.
Improves behaviour after 856e876148 by counting in the capture strength
of garrisoned entities.
Differential revision: https://code.wildfiregames.com/D4799
Comment by: @Silier
This was SVN commit r27322.
Replacing `target` by `position` where applicable.
It gave errors when following a player who flared.
Reported by: @Langbart
Differential revision: https://code.wildfiregames.com/D4824
Comment by: @Silier
Fixes#6303
This was SVN commit r27315.
Summary:
The persistent settings have historically often led to bugs (see A26,
but that's far from the only example).
The trouble is that this usually leads to the game setup being
completely unusable, often requiring clearing the MatchSettings.json
file (or de-activating it in the settings if one knows that is there).
Furthermore, mods can make the persistentSettings take 'bad' values, and
in general this behaviour is prone to unexpected breakage and difficult
to defend against.
This wraps it in a try-catch block to ensure the game remains usable. It
still relays the error with a more useful error message.
Differential Revision: https://code.wildfiregames.com/D4794
This was SVN commit r27314.
If the pathfinding tasks are running, they might reference now-deleted
variables. CancelOrWait prevents this.
Remove `Future::Cancel()` altogether as that was its only use and the
functions seems dangerous.
Introduced with 0ebc08b13c
Patch by: phosit
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D4831
This was SVN commit r27310.
std::optional was not usable when our Future class was introduced, but
it is now, so we can replace SharedStateResult with it, reducing custom
code.
Note that Apple Clang has some incompatibilites with part of the
optional interface, but it isn't used here.
Patch by: phosit
Comments by: vladislavbelov
Accepted by: wraitii
Differential Revision: https://code.wildfiregames.com/D4803
This was SVN commit r27309.
Allows more flexibility in e.g. the Identity requirements and unifies
the checking of requirements.
One can use the script at https://code.wildfiregames.com/P265 to fix
templates.
Differential revision: https://code.wildfiregames.com/D4514
Comments by: @elexis, @Stan
Fixes#6421
This was SVN commit r27245.
Use `mul_round`, refs. 2078abdcc4. (Resources in cost and loot need to
be integers.)
Reported by: @Langbart
Differential revision: D4832
Suggestion by: @Stan
Fixes#6659
This was SVN commit r27243.
- Adjust "Rhinelands (Fall)" biome file to the new Temperate_Autumn
terrains.
- Rename temperate_europe to temperate_summer.
- "Savanna" biome adjustments to the new African Savanna terrains
forthcoming.
- Some Skirmish map adjustments and improvements.
This was SVN commit r27212.
For security reasons planing to restrict access for ReadFile,
ReadFileLines, WriteJSONFile, ReadJSONFile, ListDirectoryFiles,
FileExists to the following folders/files:
"gui, simulation, maps, campaigns, saves/campaigns,
config/matchsettings.json, config/matchsettings.mp.json"
adding "moddata" if some mods need to access and ship custom files that
don't fit into other locations mentioned above
Differential revision: D4617
Reviewed by: @phosit
Comments by: @Stan @vladislavbelov
Fixes: #5850
This was SVN commit r27202.
L10 falls back to language code, that means if "pt_x" is not available
it falls back to "pt", but we do not provide "pt", same for "en" or
after uninstalling and removing language pack and leaving language
selected.
Adding warning.
Related post:
https://wildfiregames.com/forum/topic/96800-terms-display-error
This was SVN commit r27201.
Differential revision: D4818
Reduce how many times configuration is written into the file pointed out
by @nani and @Freagarach in D4616
Also fix bug in 281bb0b2ec
This was SVN commit r27194.
remove path from javascript
path is defined by the configuration scope
combine some calls
remove not needed calls
Differential revision: D4616
Accepted by: @Freagarach, @nani
Comments by: @phosit
This was SVN commit r27192.
Only 4 new textures, as the biome extensively uses the flexibility of
the terrain system to pull assets from other biomes and form a coherent
new biome.
This was SVN commit r27177.
Actual colors will be another commit.
Discussed with: @wowgetoffyourcellphone.
Differential Revision: https://code.wildfiregames.com/D4811
This was SVN commit r27172.
We only use relaxng and that confuses other linters like xmllint.
Patch by: @Langbart
Differential Revision: https://code.wildfiregames.com/D4748
This was SVN commit r27170.
Rebased from a
Patch by: @elexis
Accepted by: @asterix
Comments by: @smiley
Differential Revision: https://code.wildfiregames.com/D1664
This was SVN commit r27163.
It doesn't properly handle mixins / special templates
On python 3.8+, XML elements are no longer sorted and this fails
validation against entity.rng
mixins are not properly applied because the | split is incorrect (3
max items instead of 2)
merge="" is not supported
Parents aren't always passed when they should be.
on windows it is incorrectly assumed that the encoding is 1252
Patch by: @baco
Tweaks by: @Stan
Based on a patch by: @wraitii
Differential Revision: https://code.wildfiregames.com/D4698
This was SVN commit r27161.
It is unused at this point and causes their farming upgrades to be
non-functional
Accepted by: @Silier @wowgetoffyourcellphone
Differential revision: https://code.wildfiregames.com/D4791
This was SVN commit r27144.
Only entities which have capture attack themselves will contribute to
the regen-rate of a structure.
The `garrisonRegenRate` is now a multiplier how much each unit
contributes their strength.
Quite some gameplay change, but we can experiment with this.
Differential revision: https://code.wildfiregames.com/D4679
Comments by: @chrstgtr, @marder, @wraitii
This was SVN commit r27142.
First patch for an emergency mode. This implements a rudimentary
detection strategy.
The current effect is a shout-out for help.
Patch by: @JCWasmx86
Differential revision: https://code.wildfiregames.com/D4645
Refs. #2195
This was SVN commit r27141.
VictoryConditions.js gamesetting sends multiple updates to 'active' and
'disabled', instead of just one single update at the end. This is
listened to by amongst others the regicide 'hero garrison' setting, thus
`HeroGarrison` is deactivated, and then tries to be reactivated from the
init attributes, and then disabled again later.
This implements a simple fix, VictoryConditions only sends a single
update in FromInitAttributes with the end-state.
Differential Revision: https://code.wildfiregames.com/D4793
This was SVN commit r27135.
Windows now builds the actor editor for autobuilds, and stores the test
results.
All bundle now has an option to only build the macOS bundle and uses the
number of cores available to build.
docker-translations now builds the long string locale. Fixes#5009.
New script that is run periodically to check if the nopch build still
works.
Docker docs now builds the template analyser data and uploads it to the
server.
Add the design docs script.
Add a new script to build the game using linux with custom flags, such
as gles, clang, special linker etc.
This was SVN commit r27096.
Patch by @s0600204.
This lets all technologies show up correctly in-game and in the
structure tree again.
accepted by: @marder @Freagarach
Fixes: #6587
Differential Revision: https://code.wildfiregames.com/D4755
This was SVN commit r27042.
Brute forcing the right arrangement, which is unnecessary but accepted
since it has only a negligible performance impact overall.
accepted by: @lyv @andy5995
Fixes: #6390
Differential revision: https://code.wildfiregames.com/D4747
This was SVN commit r27039.
After feedback on the first RC's :
https://wildfiregames.com/forum/topic/83323-balancing-the-han/
This version of the roster seems to have a minimal concensus.
This removes some units from the very big roster of the Han,
restructures it and changes the cavalry crossbow champion for an
infantry one due to histrorical issues.
It furthermore reverts the changes to the champion infantry crossbow
template introduced in 9411d8c98e as that nerf wasn't necesarry.
This means that the Han and the Macedonians now have a champion crossbow
unit with the same stats.
Also:
Fixes#6560 by only keeping the "academy" templates, so that the Han can
now only train champions from the academy. Therefore, this reverts parts
of c4bdbe4dd9 and all of 2c9a6704e0.
Discussion with : @borg- @real_tabasco_sauce @wowgetoffyourcellphone
AIEND @Stan and other people on the forums and the Diff.
Differential revision: https://code.wildfiregames.com/D4713
This was SVN commit r27009.
- Allows the immortals to be "upgraded" between sword and bow yielding.
- Reduces batch training time per progressing phase.
- Don't kill the immortals partly when reducing their training time.
- More units from the CC.
- Enable the Ice House.
Patch by: @borg-
Differential revision: https://code.wildfiregames.com/D4724
Accepted by: @chrstgtr, @real_tabasco_sauce
Comments by: @marder, @Stan
This was SVN commit r26996.
The motion parameters were calculated even without members, which caused
us to try set a undefined passclass.
Also were members added to previously merged twin-formations. Once
merged (i.e. disbanded), they are moved out of world now.
Some cleanups/deduplication whilst at it.
Reported by: @andy5995 at the forums
(https://wildfiregames.com/forum/topic/71578-feedbacks-from-a26-svn-tests/page/8/#comment-505078)
Differential revision: https://code.wildfiregames.com/D4727
Comments by: @Langbart, @marder
Tested by: @Langbart
Fixes#6580
This was SVN commit r26993.
Similar dps as a slinger now, but with higher repat time. Normal citizen
soilder cost.
Nerf the crossbow training technology a bit.
Make the archer & crossbow technology availabe in the stable as well, as
it they also affect cavalry units.
accepted by : @real_tabasco_sauce
positive comment from: @borg-
Differential revision: https://code.wildfiregames.com/D4721
This was SVN commit r26988.
Misscommunication if this was the right move or not.
Leave the size as it was until someone has time to fix all buttons at
once.
This was SVN commit r26987.
ON large screens like 5120x1440 calculated shadow map was 32768. That
was 16x more than high setting, 32x more than medium setting and 64x
more than low setting.
After this change shadow map sizes using very high setting by resolution
will be following:
1920x1080 - 4096
2560x1440 - 4096
3840x1440 - 4096
5120x1440 - 8192
3840x2160 - 4096
7680x4320 - 8192
Patch by: @karmux
Reviewed by: @vladislavbelov, @Stan
Differential Revision: https://code.wildfiregames.com/D4723
This was SVN commit r26983.
Seemed a bit strong, especially with the hero.
accepted by : @borg-
Differential revision: https://code.wildfiregames.com/D4714
This was SVN commit r26982.
Add a little bit of food cost. Not enough to hugely change stuff, but
just an addition to make it a little bit harder to mass them.
Conceptual agreement from @chrstgtr @real_tabasco_sauce
Differential revision: https://code.wildfiregames.com/D4710
This was SVN commit r26974.
192 worked as well but the error spam isn't really nice going above 256
is madness anyway.
Reported by: @Langbart
Fixes: #6578
This was SVN commit r26969.
The bottom deco on the right is 2 pixels wider than the one on the left.
Patch by @Langbart
Differential revision: https://code.wildfiregames.com/D4717
This was SVN commit r26968.
Which had the Trainer component, but not the user-required
ProductionQueue.
Differential revision: https://code.wildfiregames.com/D4695
Reviewed by: @Stan
Comments by: @jprahman
Fixes#6570
This was SVN commit r26958.
Improves their functioning significantly.
Based on a patch by @lyv
Differential revision: https://code.wildfiregames.com/D4666
Reviewed by: @marder
Comments by: @Stan
This was SVN commit r26956.
They make problems on several maps where they either float (e.g.
harbor.js) as they are placed to close to a cliff/ on a hill or they
cover way too much (e.g. D4699 / wild_lake.js).
Related: https://code.wildfiregames.com/D4699#199688
one could adjust all maps, but it is so much easier to just change the
actors here.
accepted by: @wowgetoffyourcellphone
Differential revision: https://code.wildfiregames.com/D4701
This was SVN commit r26943.
Without shadow filtering, artifacts may appear at some angle (shadow
bias issue). This change ssome settings so that these are less common.
Reported by: langbart
Accepted by: marder
Refs #6552
Differential Revision: https://code.wildfiregames.com/D4681
This was SVN commit r26934.
Follows f8d2927748.
There is an issue with text-wrapping and word separators (aka spaces).
Because 0 A.D. collates the space after a word to the same TextCall, we
occasionally need to ignore it when considering line-wrapping, because
we don't want empty spaces on the right-side of right-aligned text.
However, the logic to handle this is currently broken and inconsistent.
The method introduced here uses the SFeedback structure to properly
report it and generalises the checks.
Note that multiples spaces are not collapsed in 0 A.D., and for
consistency the word-separator-collapsing behaviour is ignored.
Comments by: phosit, vlasdislavbelov
Fixes#6551
Differential Revision: https://code.wildfiregames.com/D4662
This was SVN commit r26915.
Follows d86148defc.
Resetting the wonder time when an ally to the wonder-owner is defeated
seems like double-punishment, and should not happen.
Resetting on explicit diplomacy change remains in Allied victory mode.
Fixes#6527
Reported by: Langbart
Differential Revision: https://code.wildfiregames.com/D4661
This was SVN commit r26914.
Rename the file to be consistent with its title.
Also `centre` -> `center` as per the style guide. Reported by @nwtour at
https://code.wildfiregames.com/D3530#171291.
Reported by: @Langbart
Essentially a patch by: @Langbart
Fixes#6548
This was SVN commit r26913.
and also patch the AI by partly reverting 87ec9457c3
based on a patch by @Langbart
Fixes#6309
accepted by : @Freagarach
conceptual agreement from @chrstgtr @borg- @Stan
Differential revision: https://code.wildfiregames.com/D4249
This was SVN commit r26898.
reported by @Langbart ; Fixes#6503 , also adjusts the footprint to fit
better to the actor
comments by: @Stan
accepted by : @phosit
Differential revision: https://code.wildfiregames.com/D4655
This was SVN commit r26897.
While it may be historically correct, it arguably can lead to very
broken looking behavior where siege towers try to get out of the min
range, but fail since the are attacked and end up shifting and turning
around uselessly, which just looks broken.
And since the min distance for siege towers is very small, I doubt that
it will actually change anything about the gamplay.
accepted by : @chrstgtr
Differential revision: https://code.wildfiregames.com/D4657
This was SVN commit r26894.
Fixes 08e7efc76a.
The SM build script worked on its own, but the mac OS libraries script
passes it an unexpected value.
This also fixes cross-compilation arm -> x86.
Harfbuzz is explicitly not used when compiling freetype to avoid
pkgconfig using it.
Reorganize the logic a little bit around architecture handling.
Differential Revision: https://code.wildfiregames.com/D4647
This was SVN commit r26882.
- Update GMP to a version that supports arm64 darwin
- Patch spidermonkey 78 to build and run on arm64 darwin
- Choose the correct architecture dynamically in build scripts
- Include python workaround that fixes python related errors on
spidermonkey build
Based on a patch by: kumikumi
Based on a patch by: Langbart
Fixes#6474
Differential Revision: https://code.wildfiregames.com/D4607
This was SVN commit r26881.
Follows 8eecc39e71.
Piping the autostart through a GUI page is easy but requires using the
GUI in non-visual mode, which is problematic since it's not initialized.
The GUI is not needed, only its ability to load scripts, so this diff
fixes the problem by adding an 'entrypoint' script in the new
`autostart` folder that gets called with this unique ability, setting
things up properly. The mod mod gets a placeholder.
Other changes:
- Fix some issues with networked autostart:
- Players were not assigned slots.
- The host didn't actually wait for other players.
- Move gamesettings from `gui/gamesettings/` to `gamesettings/`. This
moves attributes as well.
- Move autostart files from `gui/autostart/` to ` autostart/`. Note that
`gui/autostart/` still exists as it's used in the tutorial button from
the main menu.
- Rename the JSI_VFS functions to be explicitly about their function:
the ability to write and the potential restricted folders.
- Don't require `autostart` when using `--autostart-client` in
non-visual mode.
Starting the autostart client/host has poor UX in some situations, but
improving that feature is beyond the scope of this diff.
Suggestions for future work:
- Some files in gui/common should probably be moved elsewhere
- Template loading code is duplicated
- The gamesetup code still needs work for proper UI/logic separation.
Help & comments by: smiley
Reported by: vladislav / Langbart
Fixes#6513
Differential Revision: https://code.wildfiregames.com/D4628
This was SVN commit r26879.
The function that is calculating the difference between the two angles
is missing some parentheses.
Didn't notice it sooner as it works in 95% of all cases without them,
but sometimes you can see the formation doing a wrong turn.
reviewed by : @Freagarach
Differential revision: https://code.wildfiregames.com/D4626
This was SVN commit r26874.
Improves pathfinding for the general case (no large entities in a
formation).
Differential revision: https://code.wildfiregames.com/D4605
Comments by: @marder, @Stan, @wraitii
This was SVN commit r26873.
Correctly fetch the civ from the player's Identity.
Also remove the notions of the CivChanged message, since it was
effectively deleted already.
Differential revision: https://code.wildfiregames.com/D4486
Reviewed by: @wraitii
Comments by: @bb, @Silier, @smiley, @Stan, @vladislavbelov
Fixes#6444
This was SVN commit r26872.
Follows ea72437739. Fixes it by providing a convenience function in the
component Manager that matches the API in the GUI / AI
Refs #6444
Differential Revision: https://code.wildfiregames.com/D4630
This was SVN commit r26867.
Fixes 5de50c447c
Changing the passability class at runtime breaks some UnitMotion
assumptions in unrecoverable ways and will lead to units getting into
impassable terrain.
Formation controllers can tolerate it since units still check their own
obstruction.
Until some code is added to recover from the above bad case,
de-activated changing passability class for non-formation controllers.
This also fixes serialization issues related to clearance & passability
classes following that diff.
Reviewed By: Freagarach
Differential Revision: https://code.wildfiregames.com/D4629
This was SVN commit r26865.
Having a small instant turn angle apparently makes units (not only
formations) lag when spamclicking.
Patch by: @marder
Differential revision: https://code.wildfiregames.com/D4593Fixes#6440
This was SVN commit r26855.
Allow to modify pixel distance when mouse input is detected as drag e.g.
for selection box.
Differential revision: D4624
Refs: #6506
Comments by: @vladislavbelow @Freagarach
Tested by: @psypherium
This was SVN commit r26843.
People shouldn't be punished in a competitive setting for having high
graphic settings.
Patch by: @marder
Differential revision: https://code.wildfiregames.com/D4596
Reviewed by: @wowgetoffyourcellphone
This was SVN commit r26838.
Number groups from 1 - 10 replacing group 0 with group 10 for default
hotkey 0.
Differential revision: D4615
Reviewed by: @Langbart
Fixes: #6509
This was SVN commit r26837.
Also improve the terrain for Cycladic Archipelago 2p.
Fix naming conventions for Acropolis Bay, Chang Jiang, and Tarim Basin.
Add these new and updated maps to the "New Maps" campaign.
This was SVN commit r26818.
60befbd1cf added the exact same implementation to the rmgen tool,
469d0fe5c5 removed the rmgen tool along with the original implementation
of noise.
Patch By: smiley
Differential Revision: https://code.wildfiregames.com/D4611
This was SVN commit r26810.
- Better fitting decals
- Player color
- Warships use the larger, easier to see projectile like buildings do
- Upgrading variants
- Standardized decals for Stables
- Fix a few death variants
- Some better tree props
- Fixed sheath position for the Roman Centurion
- Add Cavalry variants for Gallic heroes (templates will come later)
- A more "British" shield for the Brit fanatic
- Add a new Atlas building for the Spartans, the "Persian Stoa"
- Add distinct actors between lit and non-lit Fireships
This was SVN commit r26764.
- Different dirt decals for 3 Iberian structures
- Variations for the trees on the Kushite wonder
- Spec maps for a couple Athenian units
- Changed textures for Gallic elite javelineer
- New textures for the Ptolemy war elephant driver
- Peytral for the Elite Seleucid jav cav
- More helmet variants for the Elite Seleucid spear cav
This was SVN commit r26757.
Since formations have `cmpIdentity` now (b778caf146), they were
incorrectly selected when cycling through idle entities.
Reported and tested by: @Langbart
Differential revision: https://code.wildfiregames.com/D4588Fixes#6490
This was SVN commit r26756.
It was overlayed with the FPS overlay which rendered it unreadable.
Introduced in 7c3aed5f36
Reported by: @Langbart
Patch by: @phosit
Differential revision: https://code.wildfiregames.com/D4585
Comments by: @elexis
Fixes#6484
This was SVN commit r26755.
- Gymnasium to the second phase.
- Allow training the marines and cretan archers there.
- Move the above mentioned tech to that structure and the dock.
Patch by: @marder
Differential revision: https://code.wildfiregames.com/D4537
Comments (implied acceptence) by: @chrstgtr, @ValihrAnt
This was SVN commit r26754.
Currently garrisoned ships easily kill organic units that dare to get to
close to them. A garrisoned ship is a killing machine like nothing else
in the game.
This patch solves their absurd deadliness against organic units. Ships
get 12 pierce attack and a 3x multiplier against other ships so they can
sink enemy ships at comparable rate as in A24 and A25.
Differential revision: D4507
Patch by: @LetswaveaBook
Reviewed by: @wowgetoffyourcellphone
Comments by: @marder @wraitii @Freagarach
This was SVN commit r26753.
As well as patrolling.
Formations kept moving, finding targets and instructing their members to
attack (thereby resetting their attacking state every time).
We now move into `MEMBER` upon finding a target.
Differential revision: https://code.wildfiregames.com/D4550
Comments by: @Stan
Fixes#6461
This was SVN commit r26741.
Introduced in 20bb3ea4a3.
We assume at many places that an entity has cmpIdentity and as such we
add it here as well.
Patch by: @Langbart
Differential revision: https://code.wildfiregames.com/D4583Fixes#6416
This was SVN commit r26740.
- Date Palm actor variations for use on structures and elsewhere
- Fixed missing player color on the Celtic battering ram
- Unit actor fixes and updates
- Updated a Spartan unit texture and added a spec map for weapons
This was SVN commit r26709.
So decrease their attack spread to 3, increase their crush damage and
also increase their vision range slightly, so you can actually see what
they attack.
This still means they are primarily useful against buildings, and not
unit killer as in a23.
Patch by: @marder
Differential revision: https://code.wildfiregames.com/D4511
Accepted by: @chrstgtr, @ValihrAnt, @wowgetoffyourcellphone
Comments by: @Langbart, @Stan
This was SVN commit r26703.
As opposed to the Starting Economy Walkthrough, which is less
beginner-friendly.
Patch by: @azayrahmad
Differential revision: https://code.wildfiregames.com/D4194Fixes#6347
This was SVN commit r26702.
Lowers default terrain grid height, which helps with shadow
sharpness on old shadows and allows for more vertical height
A nicer Skybox as default
One of the new higher-quality Terrain Textures by default
Patch by: @wowgetoffyourcellphone
Accepted by: @marder
Differential Revision: https://code.wildfiregames.com/D4446
This was SVN commit r26700.
Add a normal variant.
Patch by: @marder
Accepted by: @wowgetoffyourcellphone
Differential Revision: https://code.wildfiregames.com/D4555
This was SVN commit r26698.
World pop was added with edb956424e, words (no preposition & articles)
for the title heading in the game setup are all capitalized except
population.
Patch By: @Langbart
Accepted by: @wowgetoffyourcellphone, @marder
Differential Revision: https://code.wildfiregames.com/D4564
This was SVN commit r26674.
Move the Han head textures to the proper folder and delete the bad
folder. Adjust the head actors to the correct texture folder.
Improve the han_fem_c.png face texture and the Han female citizen
portrait.
Improve the Han fisherman actor to use better textures.
This was SVN commit r26670.
Requested by @Silier at 93b22c5f86.
This notifies players when using a non-numeric value and guards the
simulation against such cases.
Previous behaviour was that a cheat was executed with its default value.
Now the cheat is not used.
Differential revision: https://code.wildfiregames.com/D4485
Comments by: @bb, @Silier
This was SVN commit r26657.
The function was redundant for a long time, but made an error in
73f741d266.
Reported by: @marder
Differential revision: https://code.wildfiregames.com/D4541
Tested by: @marder
Fixes#6458
This was SVN commit r26656.
This increases their damage slightly from 10 to 11
Differential revision: D4510
Patch by: @marder
Reviewed by: @wowgetoffyourcellphone
Comments by: @chrstgtr
This was SVN commit r26640.
Discussion:
https://wildfiregames.com/forum/topic/71582-fixing-chinese-han/
This removes the Champion training aspect and reduces the GarrisonHolder
from 2x to a 1.5x bonus, the same as the health and capture points
bonus. 2x garrisoning caused there to be a prohibitive number of arrows.
Replaces the champions with faster batch training speed. Unlocked heroes
still remain.
This was SVN commit r26634.
Discussion:
https://wildfiregames.com/forum/topic/71582-fixing-chinese-han/
Previously, one could capture an enemy Barracks or Stable and train Han
champions there without researching the champion unlocking techs. This
rectifies this (in an admittedly hacky way) by creating duplicate Han
champion templates with suffix "_academy" and putting those in the Han
Academy with the RequiredTechnology of City Phase.
The original Han champion templates, which are what can be trained in
captured Barracks and Stables, are given the unlocking
RequiredTechnology respective to their class (as most of civs'
champions).
Both Templates have the same SelectionGroupName, so should be selectable
together with a double-click with no problem.
Please report problems in the above linked thread.
This was SVN commit r26632.
- Make his capture attack be 20% less than heroes, but 40% more than
champions (previously his capture attack was a whopping 20)
- Add an attack-move soundgroup
- Discussion:
https://wildfiregames.com/forum/topic/71582-fixing-chinese-han/
This was SVN commit r26631.
They fled whilst healing and not when idle. That is the other way around
than expected.
Introduced in healing introduction (c56f96040e); #999 specifically made
them flee, but it left quite undefined behaviour.
Reported by @BreakfastBurrito_007 on the forums somewhere.
Differential revision: https://code.wildfiregames.com/D4532
This was SVN commit r26618.
- Remove GarrisonHolder from the Han Dock, as it messed up the trade
route waypoint feature.
- Maybe investigate a way to get around this.
This was SVN commit r26591.
- Fixing Thespian Melanochitones and Theban Sacred Band errors
introduced in 8c8d765c06
- Fixing some shield errors introduced in f2346b6796
This was SVN commit r26589.
Add deepCompare function to utilities to easy and reliably compare js
variables.
Comments By: Langbart, Stan, asterix
Differential Revision: D4521
This was SVN commit r26583.
- Attempt to fix all instances where there caused a problem. Still on
the lookout for anymore gremlins.
- Will hunt down and remove unused meshes in a later commit.
This was SVN commit r26566.
Implement a threshold between "turning" the formation and "rearranging"
it.
Patch By: marder
Based on Patch By: alre
Comments By: Freagarach, Stan, Silier
Glanced good By: Freagarach
Differential Revision: D4294
Forum Topic:
https://wildfiregames.com/forum/topic/44848-proposals-for-formations/#comment-452917
This was SVN commit r26520.
Attempt at making Crossbow teching less OP:
- Remove "Repeating Crossbows" as it was historically problematic and
was also OP for crossbows.
- Reduce the RepeatTime bonus in "Crossbow Training" from -33% to -20%.
This was SVN commit r26519.
Removed the ability of the Han to research 'Will to Fight' from a
captured Fortress. Reported by @faction_02 here:
https://wildfiregames.com/forum/topic/71578-feedbacks-from-a26-svn-tests/?do=findComment&comment=482636
Increased the cost and research time of 'Art of War' to match the other
two Han special Fortress techs.
On the backend moved the Han techs to the Fortress parent template.
Seemed cleaner.
This was SVN commit r26516.
This allows for more accurate textures for female units with intricate
patterns on their long skirts. Boudicca is the first example, provided
here.
This was SVN commit r26508.
Chariot Crossbowman -> Chariot Archer
- Adjusted Actors and template
Champion Cavalry
- Took away shield and gave cataphract animations
Champion Swordsman -> Champion Spearman
Liu Bang
- Gave him a different base animation variant
This was SVN commit r26507.
- Major thing is added the Chinese Chariot as a champion, trainable at
the Academy.
- Replaced Crossbowman with Archer as the starting ranged infantry. This
is still open for changing as there is a poll on the forum about it.
This was SVN commit r26482.
Remove obseleted function RemoveAllPlayers in 354bd8b088.
Linter stuff.
Don't initialise undefined world population value.
Differential revision: https://code.wildfiregames.com/D4494
This was SVN commit r26477.
Reduces duplication across components.
Allows to provide specific names and history for formations.
Differential revision: https://code.wildfiregames.com/D4476
Comments by: @bb, @Stan
Fixes#6400
This was SVN commit r26476.
Deep discussion here:
https://wildfiregames.com/forum/topic/71582-fixing-chinese-han/
Participants: @Yakaterina @BreakfastBurrito_007 @Lionkanzen @chrstgtr
Changes:
- New Starting units (Spearman, Crossbowman, Cavalry Swordsman)
- Farms 60 wood, 30 seconds
- Practice Range disabled (may be re-enabled in a future alpha)
- Infantry and Cavalry Crossbowmen rebalance
- New technology for the Han at the Forge: "Repeating Crossbows";
"Crossbow Training" at barracks tweaked to allow crossbows to fire
faster
This was SVN commit r26469.
Fix displaying unknow civilisation when civilisation defined by map is
not selectable but exists by switching two lists based on if selection
is locked or not.
Differential revision: D4429
Fixes: #6145
Reviewed by: @bb
This was SVN commit r26438.
This also creates a player_trans_norm.xml material, which was
conspicuously missing. Changed the material for the headband from a
parallax material to this new normal map material.
This was SVN commit r26427.
While at it fix the messages.json from ea72437739 (missing excludeMask
and make the keywords objects not arrays)
Comments By: Freagarach
Differential Revision: D4483
This was SVN commit r26422.
- Removed obsolete C++-side `addPlayer`, introduced in 4fed9b8242, moved
out of Atlas in 1c0536bf08, unused after 9ee44bd9b8.
- Get the player settings from a local function (avoids passing
arguments).
- Removed setting the standard diplomacy (done in cmpPlayerManager since
132020f88e).
- Create entity when adding a player instead of creating it and
instructing the playermanager to add it.
- Changed/Removed some comments.
Differential revision: https://code.wildfiregames.com/D4482
Comments by: @Stan
This was SVN commit r26404.
- Add support for mul_round
- Correct table
- BUGFIX: correct roster table via the mixin Civ fix
- avoid long lines for PEP8 compliance
- for mod development outside .svn repo, create symlink
- replace all TAB indents to 4 spaces for PEP8
- TAB to 4 spaces to be PEP8 compliant
- refactor complex inline logic to compute and formatting
- beautify and avoid long lines to be PEP8 compliant
- beautify and simplify JS table format code
- Using more accessible color scheme
- Better color scheme
- main analysis file
- Rename the new version back to keep consistancy
- dependency JS library
- Unit analysis result
- Rewrite specilized table logic to only show changed
- Prefer numeric flag over string flag to refactor
- Re-format HTML templates into readable source code
- Civ specific table now renders non-empty
- Update computeCivTemplate to parse A25 template dir
- Cleanup debugging flags
- Update copyright notice to 2022
- Explain how the code works for future development
- Initial README
- Refactor: put HTML IO code in a single function
- Refactor: include JavaScript as verbatim str
- Refactor: separate computation from IO
- Refactor: compute templates before HTML IO
- Refactor: compute CivTemplates before HTML IO
- Refactor: compute separate from IO code
- Fixed melee and ranged attack damage parsing
- Fixed Resistance parsing
- Implement the undefined function complain
- Rename Armour -> Resistance
- Simplify NumericStatProcess logic
Patch by: @hyiltiz
Differential Revision: https://code.wildfiregames.com/D4445
This was SVN commit r26403.
Fixing issues in dc18d94030
Everyone make sure to delete savegames, saved campaigns an most
importantly your matchsettings.json's (regular alpha players won't
notice since there is a version check, but if you already have your
stuff at A26/svn, you will have some issues)
Reported By: elexis
Comments By: wraitii, Freagarach
Differential Revision: D4240
This was SVN commit r26393.
- Actor texture refs updated to reflect the move.
- A couple of Atlas-only hero units.
- Maurya Sandbox scenario changed up.
This was SVN commit r26385.
When the victory conditions dictate that someone loses when e.g. losing
their CC, the message that the other player(s) had won was sent before
the former player was actually defeated.
When the victory conditions dictate that someone wins when e.g.
capturing all relics, the message that they have won was sent after the
message that the rest has lost.
This changes those.
Differential revision: https://code.wildfiregames.com/D4478
Comments by: @bb, @Silier
This was SVN commit r26382.
Which is more generic. It means we don't have `chicken = oPeacock` and
the like anymore.
It adds a default scaling function such that people replacing the
animals are puzzled by the different number of starting animals./To keep
the amount of food roughly equal to the amount standard provide by
chicken.
Patch by: @marder
Differential revision: https://code.wildfiregames.com/D4472
Comments by: @smiley, @Stan
This was SVN commit r26381.
- Actor texture refs updated to reflect the move.
- A new Roman champion unit added for fun, "Praetorian."
- An "infantry" version of Scipio Africanus to match the other 2 Roman
heroes.
- New Roman helmet models and actors.
- A bunch of unused textures deleted.
This was SVN commit r26371.
- Renamed many textures to the new texture naming standards.
- Adjust many unit actor refs for these textures (and improve the look
of the actors while I'm at it).
- A bunch of unused texture deleted.
This was SVN commit r26357.
- Renamed many textures to the new texture naming standards.
- Adjust many unit actor refs for these textures (and improve the look
of the actors while I'm at it).
- A bunch of unused texture deleted.
This was SVN commit r26355.
- Use stencils by Lion.Kanzen for Ptol and Sele
- Use the lotus pattern from the Maurya civ emblem to better match
visually
- Tweak the Macedonian star a little
This was SVN commit r26351.
- Add support for tips
- Fix other scripts not writing to the correct output (they were writing
info messages to stderr)
Based on a patch by: @mammadori and @cyrille
Differential Revision: https://code.wildfiregames.com/D3213
This was SVN commit r26350.
Use the class for the chat to accomodate size issues in some languages.
Chat size issue reported by: Zeldt on forums
Initial solution by: Nescio
Comments By: elexis, nwtour, Freagarach, vladislav, wraitii
Differential Revision: D2623
fixes#4252
This was SVN commit r26349.
- Renamed many textures to the new texture naming standards.
- Adjust many unit actor refs for these textures (and improve the look
of the actors where applicable).
- A bunch of unused texture deleted.
This was SVN commit r26347.
- Renamed some textures to the new texture naming standards.
- Adjust unit actor refs for these textures (and improve the look of the
actors where applicable).
- A bunch of unused texture deleted.
This was SVN commit r26337.
- Renamed some textures to the new texture naming standards.
- Adjust unit actor refs for these textures (and improve the look of the
actors where applicable).
- Fix some file refs in some previously committed actors and variant
files noticed by silier and stan.
- Delete an old, unused elephant prop.
This was SVN commit r26336.
- Delete old and (now) unused examples.
- Renamed textures to the new texture naming standards.
- Adjust unit actor refs for these textures (and improve the look of the
actors where applicable).
- Attempt to set all txt/xml files to EOL-native
This was SVN commit r26329.
This allows the "wololo" cheat to switch units to an arbitrarily defined
player. If no player is specified, it defaults to the player entering
the cheat.
The player manager will warn when using a wrong player number.
Patch by: @Nullus
Differential revision: https://code.wildfiregames.com/D4479
Comments by: @Stan
This was SVN commit r26328.
(Not with dragging, since that would be hard to use, UX-wise.)
It allows easier debugging; less switching between players.
Differential revision: https://code.wildfiregames.com/D4477
Comments by: @asterix, @Silier, @Stan
This was SVN commit r26327.
- Delete old and (now) unused examples.
- Renamed textures to the new texture naming standards.
- Adjust unit actor refs for these textures (and improve the look of the
actors where applicable).
- Attempt to set all txt/xml files to EOL-native
This was SVN commit r26318.
- Renamed them to the new texture naming standards.
- Adjust unit actor refs for these textures (and improve the look of the
actors while I'm at it).
- Fix texture refs for some spart textures noticed by @Stan.
This was SVN commit r26314.
- Renamed them to the new texture naming standards.
- Adjust unit actor refs for these textures (and improve the look of the
actors while I'm at it).
- Attempting to use the correct SVN move commands this time.
This was SVN commit r26313.
- Boeotian cavalry helmet with "plume" as seen in many references.
Bronze, Gold, and Silver variants. Silver crested Boeotian helmet with
laurel wreath.
- Custom pelte shield for the Spartan Phalangite.
- Special helmet for the '300' Leonidas.
This was SVN commit r26311.
- Renamed them to the new texture naming standards.
- Adjust unit actor refs for these textures.
- Accidentally used the wrong svn move option this time. Will use
correct one moving forward.
- Thanks be to @Stan for his assistance.
This was SVN commit r26310.
Introduced in b4fbbed379
Use Date.now() to calculate passed time.
Rewrite to class.
Also actually pass timeout from json.
Differential revision: D4318
Comments by: @vladislavbelov, @Stan
This was SVN commit r26306.
Patch by: @nwtour
Differential revision: D4340
Reviewed by: @Silier
The patch adds a description from the technology file to tooltip when
hovering over rank icon.
This was SVN commit r26300.
Since the players/civs already have cmpIdentity, use it.
This forces civs to have corresponding XML in the `special/players/`
folder.
Also moves the files from `special/player/` to `special/players/`
consistent with other folders. And moves the generic `player.xml` one
level up.
Differential revision: https://code.wildfiregames.com/D4473
Help and comments by: @Stan, @wraitii
This was SVN commit r26298.
Reduced resolution of a bunch of unit textures to the consistent 256x256
(and some animals from 1024 to 512)
Introduce some new textures and texture improvements
Begin to introduce some civ folders (that reorganization is coming
later)
Adjust some unit actors to look nicer
This was SVN commit r26295.
This makes it possible to make units heavier, which both push more & get
pushed less by other units.
In particular, the diff does it for siege units & elephants.
This improves movement for these units in crowd situation, since they
will now basically not move when other regular units push into them.
Supported By: asterix, marder
Refs #6127
Differential Revision: https://code.wildfiregames.com/D4452
This was SVN commit r26275.
This is a paradigm change for AI computation.
Historically, the AI was intended to be run in a separate thread from
the simulation. The idea was that slow AI wouldn't stop the renderer
from being smooth.
In that original design, the AI received a copy of the game world and
used that to run its logic. This meant the simulation could safely do
whatever it wanted in the meantime. This copy was done via AIProxy &
AIInterface.
This design ended up having significant flaws:
- The copying impacts the simulation negatively, particularly because
AIProxy subscribes to a lot of messages (sometimes sent exclusively to
it). This time cannot be threaded, and impacts MP games without AIs.
- Copying the data is increasingly difficult. Modifiers are a headache,
LOS is not implemented. Lots of logic is duplicated.
The intended benefits of the design also failed to realise somewhat:
- The AI was never threaded, and in fact, it is probably better to try
and thread Sim + AI from the renderer than just the AI, at which point
threading the AI specifically brings little benefit.
The new design is much simpler and straighforward, but this has some
side-effects:
- The AI can now change the simulation. This can be used for cheating,
or possibly for a tutorial AI.
- The AI runs in the same GC zone as the simulation, which may lead to
more frequent Sim GCs (but overall we might expect a reduction in
temporary objects).
- The AI state was essentially cached, so replacing some functions with
Engine.QueryInterface might be slower. The tradeoff should be balanced
by lower AIProxy computation times.
Future work:
- Threading some specific AI tasks could still be worthwhile, but should
be done in specific worker threads, allowed to run over several turns if
needed.
Technical note: the AI 'global' is in its own Realm, which means name
collisions with the same are not possible.
Other notes:
- The RL Interface uses the AI Interface and thus will gradually lose
some data there. Given that the RL Interface can now request data
however, this should be dine.
Refs #5962, #2370
Differential Revision: https://code.wildfiregames.com/D3769
This was SVN commit r26274.
Users sometimes ended up with bad (wrong version) XMB files in the user
mod. This resulted in A25 loading a black screen.
There is a combination of unfortunate code paths that lead to this. The
core issue is that:
- cdd75deafb changed the XMB loading code that if there is an error in
Init from a cached XMB, it reports an error. This error happens to be
silent, because the GUI expects CXeromyces to do its own error reporting
(a pretty poor decision, all in all, but whatever). This explained why
the black screen showed no errors.
- The code flow attemps to load an 'archive' XMB first, then only a
loose cache. _But_ if the XMB that fails to load is an archive (which
generally never happens except when using incompatible mods, which is
generally less easy in A25 since we added code to stop that), then the
game will try to recreate the XMB as an 'archived' path, not a 'loose
cache' path as it would usually do.
- Because the 'archived' path already exists in the VFS, the game will
attempt to overwrite that. It so happens that in non-dev copies, this
writes to the user mod.
- Because the user-mod is always loaded, this was unexpected for users.
Fixing this is rather simple: the game should never attempt to write
'archive' XMBs in that function. Added explicit barrier, which shouldn't
matter performance-wise but fixes the issue by writing in the proper
place, and also properly recovering in case of read failure.
I will note that the game will still try to load the archived file, and
recreate it every time, but I don't think that's a particularly big
deal, in general having engine-incompatible mods in the future should be
harder because of A25 changes there.
(NB: users that have used both A24 and A25 should perhaps still be
advised to check their user mod folder, otherwise they'll end up
recreating those files forever).
Reported by: dave_k
Fixes#6320
Differential Revision: https://code.wildfiregames.com/D4275
This was SVN commit r26272.
The UnitManager already lists all units, so we do not need to go through
the visual actor of entities to update them. This is faster and
decouples simulation & graphics code slightly.
Further, the simulation does not need to know about texture changes (see
also 410d2e883a), so remove those calls in Atlas.
Differential Revision: https://code.wildfiregames.com/D4455
This was SVN commit r26270.
6581796103 removed the ability for terrain to affect movement speed. The
JPS pathfinder cannot support it, and the approach was poor anyways,
coupling rendering data with simulation data.
This lets us remove the dependency on CTerrainTextureManager everywhere.
Tested by: langbart
Differential Revision: https://code.wildfiregames.com/D4459
This was SVN commit r26269.
The new values in 158cf8ea8d were too high, units would push each other
too much when building. This lower value should fix that, though further
adjustements may be necessary.
Reported by: Freagarach.
Differential Revision: https://code.wildfiregames.com/D4461
This was SVN commit r26261.
There is no need to have BuildAnimation in CModel when everything is
done in CObjectEntry anyways.
This removes a pointer in every CModel object, which is nice.
Accepted By: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D4454
This was SVN commit r26254.
Moves the work done from cmpResearcher to cmpTechnologyManager.
No functional changes.
It allows fancy stuff in the future (#6364).
Differential revision: https://code.wildfiregames.com/D4438
This was SVN commit r26252.
RENDERDATA_UPDATE_COLOR was used to precompute lightEnv-dependent data
on the CPU. This is no longer done following engine upgrades, and in
particular d7d02a4740 which explictly always did this on the GPU.
ModelAbstract had a 'SetDirtyRec' hack for it because of decals, which
can also be removed. The 'dirty' bit of CRenderableObject is renderdata
for the specific item, never its props, so it never actually needs to be
recursive.
CheckLightEnv is also useless as a result, and removed.
Differential Revision: https://code.wildfiregames.com/D4453
This was SVN commit r26249.
The main change is the introduction of a 'pushing pressure' counter on
units. This counter increases when units get pushed around, and
decreases over time. In essence, units under high pressure move slower &
are harder to push around.
The major effect is that units can now get bogged down when very dense
groups start colliding. This makes movement more realistic, makes unit
movement more 'chokepointy', and generally improves the mathematical
soundness of the system (lower values are easier to handle for our 200ms
turns).
Other changes:
- The logic to detect units crossing each other's path has been
reworked. Units that run towards each other should not more obviously
avoid each other.
- New parameters: 'Spread' is a measure of how strong the pushing effect
is based on distance. With the current settings, static-pushing is
rather 'on/off', whereas moving-pushing is more gradual (and thus the
max influence distance was increased when moving).
- Default values have been tweaked for lower overlap.
- Units only looked at other units within their grid region. This led to
overlap near grid-borders. Units now look at neighboring grid elements,
which largely removes this issue. While this may be slower, the
performance of pushing was largely negligible before, so it is unlikely
to become a main cause of lag (and overlap was generally disliked by
players).
- Units no longer orient in the direction of pushing, but instead keep
facing their target. This can look slightly odd under very heavy pushing
forces, but vastly improves behaviour of very slow units such as rams
(since they spend much less time turning around). As a side-effect,
clean up angle code following acc780bcbb .
Engine changes:
- Add a debug rendering mode at compile-time to help understand what is
happening.
- Make it possible to constexpr initialise fractional fixed numbers by
using FromFraction
The 'pressure' change was inspired by alre's suggestion at
https://wildfiregames.com/forum/topic/56436-for-a-better-unit-movement/#comment-461987
Refs #6127
Differential Revision: https://code.wildfiregames.com/D4439
This was SVN commit r26245.
dropsiteSupplies kept a list of resources and did not remove exhausted
resources, leading to possibly buggy resource-management in the AI code
(and needless computations).
Differential Revision: https://code.wildfiregames.com/D4442
This was SVN commit r26244.
One needs UnitAI to be able to use a formation, so include the spec
therein (to keep information close to where it is used).
Modders can change their templates with the following script:
https://code.wildfiregames.com/P261.
Differential revision: https://code.wildfiregames.com/D4443
Comments by: @Stan
Idea accepted by: @wraitii
Fixes: #6399
This was SVN commit r26235.
The ResourceTrickle component has been changed to a global aura instead.
It increases the trickle slightly, but catafalques are unbalanced
anyway.
Patch by: @Grapjas
Differential revision: https://code.wildfiregames.com/D4383
Refs. #6032 by fixing the Macedonian specific case, but not showing the
tooltips, as requested.
This was SVN commit r26234.
As requested by @wowgetoffyourcellphone to be more in line with
afc77e20a4.
Differential revision: https://code.wildfiregames.com/D4433
Tested by: @astrix, @wowgetoffyourcellphone
This was SVN commit r26221.
In GL3.0 alpha test mode was deprecated and removed in GL3.3. We should
use discard/kill in shaders instead.
In shaders alpha test was removed in d3a24c26ba, in FFP it was removed
with FFP in b7e6811ea6.
Differential Revision: https://code.wildfiregames.com/D4434
This was SVN commit r26211.
This allows cross-compiling for x86_64 on mac ARM machines, and sets
things up for a switch later.
SDL upgrade is necessary for compilation with the GLES headers in
different SDKs.
Tested by: langbart, minohaka
Differential Revision: https://code.wildfiregames.com/D4424
This was SVN commit r26208.
8d80a2186e removed the values for the tech cost multipliers from the
templates, since the component uses those default values, but failed to
account for modifications thereof.
Those weren't applied since the template value didn't exist.
This changes that to iterating over all resources.
Reported by: @Langbart
Differential revision: https://code.wildfiregames.com/D4409
Tested by: @Langbart
Fixes: #6408
This was SVN commit r26192.
Issue noticed by Exodarion.
After researching technology for resourcetrickle modifiers were
returning old cached value because modifiers were not cleared for
structure when it was build and changed owner from invalid_owner to the
player so old values were kept.
Cause:
global cache depends on originalvalue.
Health and other modifiers use also player-wide modifiers and result
from that is used as the key, what means global cache is never used
because originalvalue will differ in that case.
That does not look to be case for resourcetrickle and possibly for
another scenarios.
Modifiers that get cached on init and do not get changed by player-wide
modifiers in combination with ownership being changed afterwards will
bug.
Since we dont reset cache for ownership going from invalid_player, the
old global cache is kept and used.
Another solution would be to not cache on init, but thats workaround to
hide the issue.
Differential revision: D4395
This was SVN commit r26134.
To catch e.g. typos.
- Use the same structure in the ProductionQueue item (de)serialisation
as in Trainer and Researcher.
- Also iterate over the serialisable attributes on deserialize, as
proposed by @elexis (on IRC), for its symmetry.
Proposed by: @Stan
Differential revision: D4388
This was SVN commit r26133.
For it was not really clear.
Patch by: @nwtour
Differential revision: https://code.wildfiregames.com/D4362
Accepted by: @asterix
This was SVN commit r26130.
When signature is invalid, it does not comunicate the reason clearly.
Fix this.
Also remove silent failure in case of signature is not valid.
Differential revision: D3478
Reviewed by: @bb
This was SVN commit r26111.
This patch attempts a more systematic approach, by standardizing the
<Loot/xp> to 20% of <Health/Max>.
Differential revision: D3681
Patch by: @Nescio
Reviewed by: @borg- @wowgetoffyourcellphone
Comments by: @Palaxin
This was SVN commit r26110.
A typo in the serialisation function.
Also just serialise the properties that are assigned in cmpResearcher
and cmpTrainer.
Introduced in e4925e02d0
Reported by: @nwtour
Differential revision: https://code.wildfiregames.com/D4386
Tested by: @nwtour
This was SVN commit r26105.
Some languages use singular form for another counts than 1, what makes
singular strings in english with hardcoded number causing incorrect
string to be displayed.
Adding special branch for english singular string since it looks nicer.
Differential revision: D4377
Patch by: @nwtour
This was SVN commit r26096.
Comments by: @nwtour, @Langbart, @bb
Based on patch by: @echotangoecho
Tested on Windows 7 & 10, Ubuntu and macos.
Differential Revision: https://code.wildfiregames.com/D721
This was SVN commit r26093.
Reported by @nani:
Sorting by "has password" in lobby game list does nothing
Add sorting value.
Differential revision: D4382
Reviewed by: @Freagarach
Fixes: #6392
Introduced in: c2155e31c0
This was SVN commit r26090.
-Standardize naming convention (sample_01_01, where first 01 = type and
following, 01 = subtype)
-Add new variants
-Minor update to previous textures
This was SVN commit r26086.
Since it needs a better UX. (Introduced in a70a20fd42.)
Users can choose to still use it.
Differential revision: https://code.wildfiregames.com/D4360
Comment by: @wowgetoffyourcellphone
This was SVN commit r26076.
It was deemed unintuitive to select the whole formation when clicking an
icon.
Differential revision: https://code.wildfiregames.com/D4295
Comments by: @alre, @Langbart, @marder, @wowgetoffyourcellphone
This was SVN commit r26075.
`ElevationBonus` is vague, as discussions proved. Therefore it is
renamed to `Origin`, which, describes better what the value stands for.
`Delay` is also quite vague, so renamed to `EffectDelay`.
Differential revision: https://code.wildfiregames.com/D2016
Comments by: @bb, @nani, @Nescio, @Silier, @Stan, @wraitii
This was SVN commit r26074.
And define it (the attack_move sound) in the templates, such that
modders can change it at will.
Patch by: @wowgetoffyourcellphone
Differential revision: https://code.wildfiregames.com/D4364
This was SVN commit r26073.
- Use the correct material, as texture has no alpha, therefore no player
color
- Add missing textures where necessary
- Use null_white for hele_blacksmith_bucket_water instead of loading
useless textures.
Refs: #6326
This was SVN commit r26054.
In 2f24006afb, the siege state for no trainer was not assigned to
variable but used in condition.
Making use of that state actually.
Differential revision: D4367
Patch by: @JCWasmx86
This was SVN commit r26053.
There was an infinite loop:
Order.Gather -> MustKill (L497) -> PushOrderFront(Attack) (L526) ->
NotInRange (L410) -> NotAbleToMove, thus finish order (L426/427) ->
Restart from Order.Gather.
We do two things here:
- Assume we don't have vision when garrisoned, which is not a bad
assumption.
- Check the range and if we are not able to move and not in range,
finish the order.
Introduced in: d3c3072c83
Reported by: @Langbart
Differential revision: https://code.wildfiregames.com/D4349Fixes: #6377
Tested by: @Langbart
Comments by: @Silier, @Stan
This was SVN commit r26044.
It was explicitly allowed in 0c4f59d0a7, but not all references to
`this.template` were properly checked.
Noticed by: @nwtour
Differential revision: https://code.wildfiregames.com/D4357
Tested by: @nwtour
Comments by: @Stan
This was SVN commit r26043.
In 5d3902498f there was a wrong substitution.
`AttackManager` -> `AttackPlan` for the attack types.
Patch by: @JCWasmx86
Differential revision: https://code.wildfiregames.com/D4369
Reviewed by: @Silier
Tested by: @nwtour
This was SVN commit r26041.
-Sword sheath position switch
-Make heroes look more historically accurate
-New hero textures (Caradoc and Boudicca)
Reviewed by: Genava55, wowgetoffyourcellphone and other community
members
This was SVN commit r26037.
This would cause fishes to be spawned on land under a specific set of
conditions. Cases where the concerned land is not painted clPlayer for
example (which fish also avoids).
Added by @marder: spacing of the forest and wood amount was corrected as
the above ^ pushed the wood away from the player.
Original patch by: @smiley
Additional changes by: @marder
Differential revision: https://code.wildfiregames.com/D1729
Comments by: @elexis
Tested by: @Freagarach
Fixes: #5797
Refs. #3746
This was SVN commit r26003.
The task of the production queue should first and foremost be that; a
queue for production items.
Hence, the specifics of training/researching are delegated to specific
components.
As a side effect, this improves the test coverage and fixes:
- Resource not refunding when hitting the entity limit. Introduced in
b8758c8941.
- Autoqueue changing when unable to spawn. Introduced in 956b3f96db.
Modders can change their templates using
https://code.wildfiregames.com/P256.
Differential revision: https://code.wildfiregames.com/D4333Fixes: #6363
Comments by: @Silier
Refs. #6364
This was SVN commit r26000.
344d1cc837 introduced a tech that percentually increased the required XP
for archers, showing a decimal value.
This rounds that up, for 150/150 without being promoted looks bad as
well.
Patch by: @Langbart
Differential revision: https://code.wildfiregames.com/D4322
Reviewed by: @Angen
This was SVN commit r25984.
Allows devs (and players) to skip the summary page when they don't need
them.
Patch by: @Schweini
Differential revision: https://code.wildfiregames.com/D3958
Reviewed by: @Langbart
Fixes: #4300
Comments by: @nwtour, @Stan
This was SVN commit r25978.
Triple click should have been an <Alt>+DoubleClick.
While at it, removed the unneeded brackets at the hotkey translations.
Patch by: @Langbart
Differential revision: https://code.wildfiregames.com/D4314Fixes: #5409
This was SVN commit r25977.
Cursor should not blink in read-only.
The path was too similar to the list and thus easy to miss, it has been
changed to a 'golden' colour.
A tooltip was added to the path.
The border colour of input fields was changed from white to gold.
The buttons at the bottom of the page are spread evenly.
Patch by: @Langbart
Differential revision: https://code.wildfiregames.com/D4296
Refs: #6350
This was SVN commit r25976.
Required experience can be set to 0 initially and because entity is
upgrated after simulation starts, there was division by 0 in atlas for
such entities causing experience bar going to infinity.
Differential revision: D4317
Fixes: #6362
Patch by: @Langbart
Reviewed by: @Angen
This was SVN commit r25974.
Our bridges are nothing more than actors, so using one is correct.
We also delete the template files to prevent others from making the same
mistake (if someone encountered and fixed the bug in a mod they have
modified templates anyway).
Patch by: @Langbart
Differential revision: https://code.wildfiregames.com/D4297
Reviewed by: @bb
Comments by: @Angen
Fixes#6352
This was SVN commit r25972.
Use dropdown with values. Implement confirmation box with countdown to
revert scale change because buttons can get unable to click.
Differential revision: D3037
Comments by: @vladislavbelov, @Stan, @wraitii, @pieq, @sera
Tested by: @Langbart
This was SVN commit r25966.
If someone would try to copy petra and use it as base of own ai, one
would not be able to run both ais at the same time and had to fix that
global constant anyway.
Differential revision: D4301
Reviewed by: @Freagarach
This was SVN commit r25957.
It was reported that the word farm in the Introductory Tutorial is
incorrect and it should be replaced with Field.
Game refers to them as 'Field' so change is correct.
Differential revision: D4299
Patch by: @Langbart
Fixes: #6345
This was SVN commit r25955.
Deselecting a part of a formation didn't deselect the whole formation,
since the logic was done quite weirdly.
This clarifies and fixes that.
Reported by: @Langbart on D4282.
Differential revision: https://code.wildfiregames.com/D4285
Comments by: @Angen, @Langbart
Tested by: @Langbart
This was SVN commit r25948.
FinishOrder called SetWaitingOnController, although the order
(constructing) had pushed another order (gather).
This is done now by telling we finished the order only when really idle.
This seems to boil down to the question: If we issued an order to a
formation, and its members have wandered off (imagine attacking an
entity and our members have finished the initial target but attack
nearby ones) do we want the whole formation to continue attacking or
execute the next order.
Also fixes reforming whilst attacking when an attack order was issued by
the player.
Reported by: @Langbart at https://code.wildfiregames.com/D2175#182343
Differential revision: https://code.wildfiregames.com/D4282
Tested by: @Langbart
This was SVN commit r25947.
Fixes an infinite loop when the next treasure is outside LOS.
Differential revision: https://code.wildfiregames.com/D4286
Comments by: @Angen, @bb
Fixes: #6329
This was SVN commit r25946.
This adds minor regeneration to fish (when not gathered) and fruit
(always) as a nice extra for casual players.
The values are chosen to be low, as to not affect competitive play much.
Patch by: @Nescio
Differential revision: https://code.wildfiregames.com/D3868
Comments by: @chrstgtr, @marder, @Stan, @wraitii
This was SVN commit r25940.
One can override this behaviour by using a hotkey when (de)selecting
entities.
The aim of this system is to reduce micromanagement a bit.
Differential revision: https://code.wildfiregames.com/D2175
Comments by: @Angen, @azayrahmad, @Langbart, @marder, @Stan,
@submariner, @wowgetoffyourcellphone, @wraitii
Refs. #4545
This was SVN commit r25939.
We now make use of `pkg-config` on Linux, BSD, and macOS systems to find
the headers and libs for the following dependencies, where we weren't
previously:
* `enet`
* `fmt` (on macOS only)
* `gloox`'s dependencies on macOS:
* `gnutls`
* `gmp`
* `nettle`
* `libcurl`
* `libogg`
* `libsodium`
* `miniupnpc` (on macOS only)
* `openAL`
* `openGL`
* `vorbis`
* `zlib`
Please see revision (https://code.wildfiregames.com/D3611) for details.
NOTE: All those building on macOS will need to rebuild their libraries
(`build-osx-libs.sh --force-rebuild`)
Tested by: Langbart (macOS), Freagarach (Ubuntu 18.04), Jenkins CI
(Debian Buster)
Comments by: Stan, wraitii, Freagarach
Differential Revision: https://code.wildfiregames.com/D3611
This was SVN commit r25938.
It removes the software implementation intentionally. Because it
duplicates SDL functionality. But it might be added in future on demand.
Tested By: bb, Langbart
Differential Revision: https://code.wildfiregames.com/D4278
This was SVN commit r25936.
If a *nix user wishes to build `pyrogenesis` with support for Valgrind
(such as
it is), then can do so by passing `--with-valgrind` to
`update-workspaces.sh`.
(They will need Valgrind installed and locateable via `pkg-config`.)
Reviewed By: sera, Stan
Fixes: #2904
Differential Revision: https://code.wildfiregames.com/D3646
This was SVN commit r25933.
Since f1acd22455, mods are checked for compatibility. However, they can
incorrectly be checked & added to inompatible mods several time, leading
to a potential crash.
The new code can also be simplified slightly.
Reviewed By: Angen
Differential Revision: https://code.wildfiregames.com/D4276
This was SVN commit r25926.
Don't try to research some techs which are useless when we have no ally.
Ideally we don't put these techs in the config as well, but check the
usefulness and/or dependencies.
Differential revision: https://code.wildfiregames.com/D4218
Reviewed by: @Angen
Comments by: @Stan
This was SVN commit r25923.
With the addition of the new resource icons for stone and metal, the
text was too close to the icon so the distance between the text and the
icon is increased.
Also, synchronises the colour of the number of gatherers in the top
panel with the colour in the tooltip explanation.
Patch by: @Langbart
Differential revision: https://code.wildfiregames.com/D4032
Comments by: @Stan, @wraitii
This was SVN commit r25922.
Message is translated correctly.
Issue was sprintf replaced %(unit)s before message was going to be
translated so string was never found in dictionary.
Introduced in b97d251322
Differential revision: D4254
Patch by: @Ceres
Based on code by: @nwtour
Reviewer: @Angen
This was SVN commit r25916.
After 738b200dda, where the mirage should be queried in the
Start/StopAttacking functions.
Reported by: @bb
Differential revision: https://code.wildfiregames.com/D4267
Reviewed by: @bb
This was SVN commit r25914.
Introduced in c888844b3a.
The problem was trying to set the amount to Infinity by substracting
Infinity from it.
Differential revision: https://code.wildfiregames.com/D4263
Tested by: @Langbart
Fixes: #6317
This was SVN commit r25912.
Introduced in 4e664dd712.
The basesManager assumed at least one base (as was the case earlier).
`this` was used in a passed function, which therefore was undefined.
Differential revision: https://code.wildfiregames.com/D4253
Tested by: @marder
Comments by: @Langbart, @Stan
This was SVN commit r25911.
Not done in afd1eaee0d.
Also remove references to `queued` and `pushFront` in the `setStance`
functions, since they (currently) have no meaning.
Reported by: @bb
Differential revision: https://code.wildfiregames.com/D4261
Reviewed by: @bb
This was SVN commit r25902.
Put passability values to prototype variables.
Code looks more readable.
Differential revision: D4236
Refs: #6256
Comments by: @Freagarach, @Stan
This was SVN commit r25883.
public mod does not have to be activated, moving compatibilityColor to
mod
Differential revision: D4237
Refs: #6294
Comments by: @bb
This was SVN commit r25881.
Tell user about help command, when requested command is not supported
Differential revision: D4229
Reviewed by: @Langbart, @Freagarach
Comments by: @bb
This was SVN commit r25880.
The HQ should only care about high-level stuff, hence something like
managing/looping individual bases is now done in a `BasesManager`,
similar to the `AttackManager`.
Differential revision: https://code.wildfiregames.com/D4192
Comments by: @Angen
Fixes: #6185
This was SVN commit r25876.
Removes the manual hotkey tooltips from summary and gamesetup in favor
of the general one.
Based on patch By: ffffffff
Reviewed By: Freagarach
Comments By: elexis, Stan
Differential Revision: D1264
This was SVN commit r25872.
At some point make clean should take care of this.
Proposed By: elexis in D256
Approach suggested by: leper
Reviewed By: Freagarach
Differential Revision: D4219
This was SVN commit r25871.
This allows a player to task entities to drop off their resources and
subsequently attack-move to a specified location with one button.
Patch by: @JCWasmx86
Icon by: @Stan
Differential revision: https://code.wildfiregames.com/D4149Fixes: #1364
Comments by: @Langbart
Based on a patch by: @Freagarach (https://code.wildfiregames.com/D1868)
This was SVN commit r25868.
Background pause does require a game restart to take effect.
Adding function to update it on runtime since only place where it is
used is in main.cpp.
Differential revision: D4181
Fixes: #6236
Tested by: @Langbart
This was SVN commit r25866.
Currently script checks only singular translations
Add branch to check plural strings as well
Differential revision: D4199
Refs: #4250
Comments by: @Stan
This was SVN commit r25865.
Metadata are stored in an object {} making check for key in the object
irrelevant, since not existing key will result in returning undefined
value.
On top of that, merging metadata existance if condition into returning
statement.
Differential revision: D4195
Reviewed by: @Freagarach
This was SVN commit r25862.
about: "This is a special issue template for planning releases. DO NOT USE it for normal issue reports."
title: "[RELEASE PROCESS] Release XX"
labels:
- "Type/Task"
- "Theme/Build & Packages"
---
*Please fill out relevant information in the next line, set Milestone to the relevant Release, then delete this line.*
# Release XX Process
This task tracks the progress of the next release. **Please do not report issues with the nightly build or with release candidates here:** instead create a new issue and set its Milestone to the relevant release.
All details about each step are documented in [ReleaseProcess](wiki/ReleaseProcess).
After performing steps, post a comment on the task, so that it appears in the activity feed and notifies followers.
**Release Manager:** @
**Translations Officer:** @
## Outstanding Issues
**All the following issues must be fixed in `main` (which closes the issue) and then cherry-picked to the release branch (after that, you can tick the checkbox below).**
Here are the Release Blocking issues currently delaying the release:
- [x] None currently
## Progress Tracking
### Release Branching
- [ ] [Test the tutorials](wiki/ReleaseProcess#test-the-tutorials)
- [ ] [Organize a first staff match](wiki/ReleaseProcess#organize-a-first-staff-match)
- [ ] [Prepare for branching](wiki/ReleaseProcess#prepare-for-branching)
- [ ] [Create a `release-XX` branch](wiki/ReleaseProcess#create-a-release-xx-branch)
- [ ] [Adapt Jenkins for the release](wiki/ReleaseProcess#adapt-jenkins-for-the-release)
- [ ] [Announce the start of the process](wiki/ReleaseProcess#announce-the-start-of-the-process)
- [ ] [Prepare next multiplayer lobby in `main`](wiki/ReleaseProcess#prepare-next-multiplayer-lobby-in-main)
- [ ] [Generate next signing key for mods in `main`](wiki/ReleaseProcess#generate-next-signing-key-for-mods-in-main)
- [ ] [Update the Changelog](wiki/ReleaseProcess#update-the-changelog)
- [ ] [Create the next Changelog and Porting guide](wiki/ReleaseProcess#update-the-changelog)
When RCs are released, a planned release date is decided with the team and published here. This improves internal coordination and allows us to release announcements on all platforms at the same time.
---
Release Preparation: Please list here all the changes to BuildInstructions and System requirements that will have to be published on release day.
- [ ] Linux changes: TBD
- [ ] Windows changes : TBD
- [ ] macOS changes: TBD
- [ ] BSD changes: TBD
---
### Eve of Release
- [ ] [Schedule the video publication](wiki/ReleaseProcess#schedule-the-video-publication)
### Release
- [ ] [Tag the release commit](wiki/ReleaseProcess#tag-the-release-commit)
- [ ] [Create torrents and checksum files](wiki/ReleaseProcess#create-torrents-and-checksum-files)
progressdescription=false ; Whether to display the progress percent or a textual description
[gui.session]
dragdelta=4 ; Number of pixels the mouse can move before the action is considered a drag
camerajump.threshold=40 ; How close do we have to be to the actual location in order to jump back to the previous one?
timeelapsedcounter=false ; Show the game duration in the top right corner
ceasefirecounter=false ; Show the remaining ceasefire time in the top right corner
@ -433,8 +515,14 @@ disjointcontrolgroups = "true" ; Whether control groups are disjoint sets or
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)
selectformationasone="true" ; Whether to select formations as a whole by default.
[gui.session.minimap]
; Icons that are displayed for some entities on a minimap.
icons.enabled="true"
icons.opacity=1.0
icons.sizescale=1.0
entityradiusscale=1.0
blinkduration=1.7 ; The blink duration while pinging
pingduration=50.0 ; The duration for which an entity will be pinged after an attack notification
@ -442,11 +530,12 @@ pingduration = 50.0 ; The duration for which an entity will be pin
attack=true ; Show a chat notification if you are attacked by another player
tribute=true ; Show a chat notification if an ally tributes resources to another team member if teams are locked, and all tributes in observer mode
barter=true ; Show a chat notification to observers when a player bartered resources
flare=always ; Show a chat notification when a player sends a flare. Possible values: never, observer, always.
phase=completed ; Show a chat notification if you or an ally have started, aborted or completed a new phase, and phases of all players in observer mode. Possible values: none, completed, all.
[gui.splashscreen]
enable=true ; Enable/disable the splashscreen
version=0 ; Splashscreen version (date of last modification). By default, 0 to force splashscreen to appear at first launch
version=0 ; Splashscreen version (MD5 hash of file content). By default, 0 to force splashscreen to appear at first launch
[gui.session.diplomacycolors]
self="21 55 149" ; Color of your units when diplomacy colors are enabled
@ -466,16 +555,16 @@ extended = true ; Whether to display the chat history
[lobby]
history=0 ; Number of past messages to display on join
room="arena25" ; Default MUC room to join
room="arena29" ; 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)
terms_url="https://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/gui/prelobby/common/terms/"; Allows the user to save the text and print the terms
verify_certificate=true ; Whether to reject connecting to the lobby if the TLS certificate is invalid
terms_url="https://gitea.wildfiregames.com/0ad/0ad/src/branch/main/binaries/data/mods/public/gui/prelobby/common/terms/"; Allows the user to save the text and print the terms
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="wfgbot25" ; Name of the server-side XMPP-account that manage games
echelon="echelon25" ; Name of the server-side XMPP-account that manages ratings
xpartamupp="wfgbot29" ; Name of the server-side XMPP-account that manage games
echelon="echelon29" ; 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
@ -483,22 +572,26 @@ rememberpassword = true ; Whether to store the encrypted password in
gamerating=false ; Show the average rating of the participating players in a column of the gamelist
[lobby.stun]
enabled=true ; The STUN protocol allows hosting games without configuring the firewall and router.
; If STUN is disabled, the game relies on direct connection, UPnP and port forwarding.
server="lobby.wildfiregames.com" ; Address of the STUN server.
port=3478 ; Port of the STUN server.
delay=200 ; Duration in milliseconds that is waited between STUN messages.
; Smaller numbers speed up joins but also become less stable.
delay=10 ; Duration in milliseconds that is waited between checking for retrieved STUN responses.
; Smaller numbers speed up joins but may make them less stable, if max_tries isn't increased proportionally as well.
max_tries=100 ; Maximum number of tries for receiving STUN responses.
[lobby.fw_punch]
delay=200 ; Duration in milliseconds between sending hole punching messages.
num_msg=3 ; Number of hole punching messages to send.
[mod]
enabledmods="mod public"
[modio]
public_key="RWTVElEmCfAMGk/jtMc2I9/ElBvoJituKdbDWqqj6D69qz2cKexU4gv+" ; Public key corresponding to the private key valid mods are signed with
public_key="RWRoZZuNzi1wX+Hs5NKAf+GghHwye3mFePfBzOFt3mqYUZAkqAvs69W2" ; 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]
baseurl="https://api.mod.io/v1"
baseurl="https://g-5.modapi.io/v1"
api_key="23df258a71711ea6e4b50893acc1ba55"
name_id="0ad"
@ -506,23 +599,22 @@ 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".
observermaxlag=-1 ; 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).
enetmtu=1372 ; Lower ENet protocol MTU in case packets get further fragmented on the UDP layer which may cause drops.
[overlay]
fps="false" ; Show frames per second in top right corner
realtime="false" ; Show current system time in top right corner
netwarnings="true" ; Show warnings if the network connection is bad
[profiler2]
autoenable=false ; Enable HTTP server output at startup (default off for security/performance)
gpu.arb.enable=true ; Allow GL_ARB_timer_query timing mode when available
gpu.ext.enable=true ; Allow GL_EXT_timer_query timing mode when available
gpu.intel.enable=true ; Allow GL_INTEL_performance_queries timing mode when available
[rlinterface]
address="127.0.0.1:6000"
[dapinterface]
address="127.0.0.1"
port=9229
[sound]
mastergain=0.9
musicgain=0.2
@ -543,12 +635,13 @@ debug = false ; Print error messages each time a translation
[userreport] ; Opt-in online user reporting system
url_upload="https://feedback.wildfiregames.com/report/upload/v1/" ; URL where UserReports are uploaded to
url_publication="https://feedback.wildfiregames.com/" ; URL where UserReports were analyzed and published
url_terms="https://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/gui/userreport/Terms_and_Conditions.txt"; Allows the user to save the text and print the terms
url_terms="https://gitea.wildfiregames.com/0ad/0ad/src/branch/main/binaries/data/mods/public/gui/userreport/Terms_and_Conditions.txt"; Allows the user to save the text and print the terms
terms="0" ; Version (hash) of the UserReporter Terms that the user has accepted
[view] ; Camera control settings
scroll.speed=120.0
scroll.speed.modifier=1.05 ; Multiplier for changing scroll speed
scroll.mouse.detectdistance=3
rotate.x.speed=1.2
rotate.x.min=28.0
rotate.x.max=60.0
@ -558,6 +651,7 @@ rotate.y.speed.wheel = 0.45
rotate.y.default=0.0
rotate.speed.modifier=1.05 ; Multiplier for changing rotation speed
drag.speed=0.5
drag.inverted=false ; Pan in the opposite direction of drag movement
zoom.speed=256.0
zoom.speed.wheel=32.0
zoom.min=50.0
@ -573,3 +667,56 @@ far = 4096.0 ; Far plane distance
fov=45.0 ; Field of view (degrees), lower is narrow, higher is wide
height.smoothness=0.5
height.min=16
[fonts]
default="LinBiolinum_Rah.ttf", "FreeSans.ttf" ; Default font to use for all text
debugbox=false ; Whether to draw a debug box around text, useful for debugging text rendering issues
; Color of the debug box, if enabled.
; When A8 or R8 "R G B" only take R as alpha channel.
; When R8G8B8A: "R G B" where R, G, B are integers from 0 to 255.