Commit Graph
26112 Commits
Author SHA1 Message Date
Fabio Pedretti 97bbe8b49f Create the path StaticConstraint once for all city districts in Jebel Barkal 2026-11-02 11:36:12 +01:00
Fabio Pedretti b3bb4a62ad Create the CityPainter placement constraint once per area
It was recreated for every candidate building.
2026-11-02 11:36:12 +01:00
Fabio Pedretti 28e69c7332 Scan only the bounding box of the area in CityPainter
The whole map was scanned for each district.
2026-11-02 11:36:12 +01:00
Vladislav Belov cedd5e89a0 Uses make_unique_for_overwrite in LinearAllocator
We don't need to initialize that memory. libcxx currently doesn't support
that. Also fixed wrong initialization order in the constructor.
2026-10-30 21:27:33 +01:00
contributor cb9d949f45 Various Text Improvements
- 0 A.D. guidelines for Ancient Greek require the removal of accents.
- A few typos and declination mistakes were addressed.
- Improved Athenian and Spartan descriptions.
- Added specific names for Ostracism, Long Walls and Arsenal of Philon.
- Changed Ploîon Phortēgikón to Holkas and Ploîon Halieutikón to Halias.
- Removed inconsistent parenthesis part from Catafalque names.

Fixes: #9308
2026-10-29 10:33:07 +01:00
Bowen Ho 46a5570281 Fix spidermonkey build rust target detection
Spidermonkey fails to build on newer Rust versions(>= 1.98) on
`x86_64-pc-linux-gnu` or `x86_64-unknown-linux-gnu` targets due to
target matching ambiguity introduced by new vendor targets.

Fix this by backporting the upstream `detect_rustc_target` snapshot into
a new patch `FixRustTargetDetection.diff`.

Fixes: https://wildfiregames.com/forum/topic/169615-building-libraries-error-dont-know-how-to-translate-x86_64-pc-linux-gnu-for-rustc
2026-10-26 16:37:20 +01:00
Simon 3499f18091 Fix warning for unused but set variable in CInput
Delete not used index variable i in updateText method.

Signed-off-by: Simon <simon@fentzl.de>
2026-10-24 12:30:04 +02:00
Vladislav Belov 750fbe44bd Removes legacy allocator functionality from lib 2026-10-22 23:22:37 +02:00
Vladislav Belov 3d8a808b21 Replaces DynamicArena by LinearAllocator for GUI
Also DynamicArena causes an assertion when there are too many GUI
elements. LinearAllocator consumes similar amount of memory in total
but reduces a chance to get the assertion.
2026-10-22 23:22:35 +02:00
Vladislav Belov ddc07f92b9 Replaces legacy ProxyAllocator by AllocatorAdapter 2026-10-22 23:22:33 +02:00
Vladislav Belov 38dff62cff Adds AllocatorAdapter written against C++20 2026-10-22 23:22:30 +02:00
Ceres eb2b48a2f9 Fix pathfinder test lint issues 2026-10-22 16:13:00 +02:00
Ceres cf92509985 Add simRate determinism regression test 2026-10-22 16:13:00 +02:00
Ceres f63fb1578a Remove game startup diagnostic 2026-10-22 16:13:00 +02:00
Ceres 910e6de7d7 Allow headless game updates without a view 2026-10-22 16:13:00 +02:00
Viktor Semenov 642a492c92 Kick players sending commands for out-of-range turns
A command for a huge turn made the server resize saved commands and
clients their command queues to that size, running out of memory.
Reject turns below 0 or beyond MAX_COMMAND_TURN_FACTOR * COMMAND_DELAY_MP
ahead of the ready turn, before relaying, and kick the sender.
2026-10-22 13:34:13 +02:00
Fabio Pedretti 6fb9d7b86b Lobby: Fix broken sender check for connection data replies
iq.from() is empty on a freshly built outgoing IQ, so the sender
check in handleIq() was always skipped. Store iq.to() instead.

Fixes: 3991dd6c38
2026-10-22 09:52:09 +02:00
JynLeazy1 38c2e1a61e Remove destroyed resources from the AI resource maps again
Since d18a6392b3 all resource maps were rebuilt whenever an entity in
SharedScript.resources was destroyed. As every entity was listed there,
not only resources, that happened on almost every turn and took most of
the AI time in big games.

Keep instead the influence of each resource on the maps, and subtract it
when the resource is destroyed. Like d18a6392b3, this does not need
entityObj.
2026-10-22 09:50:13 +02:00
Fabio Pedretti 88f5cbc922 Compute the data about the foes once per army and turn in DefenseArmy.assignUnit
assignUnit looped over all the foes of the army for every unit assigned
and, for each (unit, foe) pair, fetched the foe entity and its position,
tested its class, read its UnitAI order data (up to four times) and, when
the foe was close to saturation, tested the Hero and siege classes again.
None of this depends on the unit being assigned.

- Add the module function getFoeInfo(), which gathers once for all the
  foes of the army the entity, its position, the unit it is attacking (if
  any) and, lazily, whether it is a hero or a siege unit and its access
  index. The army keeps the result in foeInfo, which is reset when a foe
  is added, removed or renamed, and at the beginning of update(), as
  positions and orders change from one turn to the next.
- assignUnit reads that table instead of querying the entities. The foes
  are still visited in the same order and with the same checks, so the
  chosen foe is unchanged. assignedAgainst is still read live, as it
  changes while units are assigned.
- Read ent.position() only once.
2026-10-21 11:42:19 +02:00
Vladislav Belov 61534d63a1 Removes unused lib CPU functions
All needed information is already provided by SDL.

Refs: #9136, #8855.
2026-10-19 20:48:10 +02:00
Ralph Sennhauser 830c97c521 Use XMPP Roster for BuddyList
This allows the same user to keep the buddy list across clients and
config resets. At the same time this allows for per lobby buddy lists
which is needed as the same nickname may refer to different people.

Use lower case comparison for buddy names. This is in line with the idea
of local part of jid should be seen as normalized nick and is used
server-side to compare user names.

The migration is kept simple. I.e. only attempted if the roster is
empty and the config indicates no migration was done before.

Fixes: #6824
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-10-19 20:31:27 +02:00
Vladislav Belov 72e12ddd6a Removes unused sysdep functions and macro
Removed:

* os_cpu_QueryMemorySize
* os_cpu_MemorySize
* GetCapBits
* rdtsc
* CONFIG2_TIMER_ALLOW_RDTSC
2026-10-19 01:09:22 +02:00
Vladislav Belov 086f9317e0 Removes wfirmware 2026-10-17 15:53:23 +02:00
Vladislav Belov 354232eddf Removes CPU affinity functionality
It was unused and not implemented for some platforms.
2026-10-17 15:53:21 +02:00
Vladislav Belov 1c27664b42 Removes ACPI functionality 2026-10-17 15:53:19 +02:00
Vladislav Belov 8c7dd6f85b Removes APIC functionality 2026-10-17 15:53:16 +02:00
Vladislav Belov dcc66fdc57 Removes CPU frequency calculating functionality 2026-10-17 15:53:14 +02:00
Vladislav Belov 7fcecda91b Removes NUMA functionality 2026-10-17 15:53:12 +02:00
Vladislav Belov a8d31f4353 Increases HW report version 2026-10-17 15:53:09 +02:00
Vladislav Belov 24d9658f44 Replaces x86-64 only cpu features by SDL calls 2026-10-17 15:53:07 +02:00
Vladislav Belov 3f557c7833 Removes os_cpu_NumProcessors from HW reports
The number of possible threads is already reported by SDL and STL.
2026-10-17 15:53:05 +02:00
Vladislav Belov a5b5a57b9c Removes CPU frequency from HW reports
It wasn't represeting maximumum or average CPU frequency. Just a
frequency calculated at the time of HW report. Also it was
working only for Windows and x86-64.
2026-10-17 15:53:03 +02:00
Vladislav Belov f9d4333e4c Removes custom memory counters from HW report
We already count memory reported by SDL.
2026-10-17 15:53:01 +02:00
Vladislav Belov 3d93cf7b4c Removes NUMA from HW reports
NUMA is needed for multiprocessors systems like server ones. We don't
target such platform. OS shouldn't handle that for us.
Also we had NUMA support only for Windows.
2026-10-17 15:52:59 +02:00
phosit a0b92764df Leave g_Game uninitialized when CNetClient throws
When it failed to connect to a host `g_Game` was still initialized.
Retrying that crashed the program.
2026-10-17 09:24:00 +02:00
Vladislav Belov 8bda1d8642 Removes dynamic loading on Windows
All required functions are available on all supported Windows versions.
2026-10-17 01:50:46 +02:00
Fabio Pedretti 862bdd5349 UnitMotion: Compute pushing-grid index once in Move()
pos.X/pos.Y divided by PUSHING_GRID_SIZE twice each (ENSURE, then
m_MovingUnits.get()) instead of once.
2026-10-15 16:56:34 +02:00
Fabio Pedretti 43d8446854 UnitMotion: Fix ShouldAlternatePathfinder() using wrong constant
Used MAX_FAILED_MOVEMENTS (a fixed constant) instead of
m_FailedMovements, making the "every N failures" clause always
false at compile time. Alternation only ever fired once per
failure streak instead of periodically as intended.

Introduced in 70ec781.
2026-10-15 16:56:34 +02:00
Fabio Pedretti f10fe18d7a Create the water constraint once
Deduplicate the stayClasses(tileClassWater, 0) constraint by creating
it once before the placement loop, instead of constructing a new
identical one for every placed dock.
2026-10-15 16:55:16 +02:00
Fabio Pedretti f08832b60d Search the closest water point among boundary points only
Area.getClosestPointTo scans every point of the water search area, and
it was called up to count * retryFactor times in placeDocks.

The nearest point of a set to a point outside of it is always a
boundary point, so compute the boundary once and scan only that. The
logic lives in two small helpers, getBoundaryPoints (Uint8Array mask
based) and getClosestPointInList, so it can be reused and read apart
from placeDocks. getBoundaryPoints returns the original point objects,
while getClosestPointInList returns a clone of the point it finds, so
callers cannot mutate the points stored in the list.
2026-10-15 16:55:16 +02:00
Fabio Pedretti a8ba4945e9 Bail out early and guard against an empty start area
Create the water search area first and return before computing the land
search area if there is no water at all, so that work is not wasted.

Also return if the land search area is empty. Previously pickRandom
would have been called on an empty array and returned undefined, making
getClosestPointTo fail on an undefined position.

Cache the start points instead of calling getPoints() on every try.
2026-10-15 16:55:16 +02:00
Fabio Pedretti 79c0a48ce3 Remove unused areaLand and areaWater areas
areaLand and areaWater were created with a MapBoundsPlacer, which
evaluates the tileclass constraint on every tile of the map. However,
createArea only has an effect if either a painter is specified or the
returned Area is used. Here no painter was passed and the returned
values were never read, so these calls did nothing except waste time.
2026-10-15 16:55:16 +02:00
Ralph Sennhauser f5bcb3fcaa Bump premake to 5.0.0
The first non prerelease of premake5 was released. Update to a stable
version.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-10-12 18:48:10 +02:00
Fabio Pedretti 78ca04310e Precalculate abn in VertexPathfinder
Avoid calculating it in each of the 5 CheckVisibility functions.
2026-10-12 18:22:20 +02:00
Fabio Pedretti 36eb25de3a Return early on an exact match in getClosestPointTo()
If a point at squared distance 0 is found, no closer point can exist, so
return it immediately instead of scanning the rest of the points. The
returned point is the same as before, since the first point with the
smallest distance was already the one kept.
2026-10-12 16:24:13 +02:00
Fabio Pedretti dda1e6c1a3 Use an indexed loop in getClosestPointTo()
Iterate with an indexed loop over a local reference to the points array
instead of for...of over this.points, which avoids iterator and property
lookup overhead in a loop that can run over thousands of points.
2026-10-12 16:24:13 +02:00
Dunedan 40b8794eec Fix link to AGENTS.md in issue templates 2026-10-11 09:42:15 +02:00
Dunedan 691e9273b3 Add checkbox for authorship to the issue templates 2026-10-11 07:38:02 +02:00
Dunedan d06647fc97 Add an AGENTS.md 2026-10-11 07:38:01 +02:00
Fabio Pedretti 25592e9f5d Avoid Vector2D allocations in the inner loops
Every neighbor sample created a new Vector2D and went through
validHeight() and getHeight(). Use plain integer coordinates, an inline
bounds check and direct access to the height array instead, which also
removes the per-vertex allocation and the setHeight() call.
2026-10-10 16:42:53 +02:00