Commit Graph

29664 Commits

Author SHA1 Message Date
Gustas
b59bb998eb Fix DropPods only using definitions only of the first drop pod
Cache permanent variables
2023-09-09 17:09:08 +02:00
Gustas
9845306b68 Cache unitTypes
And rename variables to names that more sense
2023-09-09 17:09:08 +02:00
Gustas
4eb683ab46 Add TS mobile EMP 2023-09-09 16:53:22 +02:00
Gustas
9d7feb176a Add offset to WithVoxelBody 2023-09-09 16:53:22 +02:00
dnqbob
eab0bf8f82 Fix bug that AI producion pause when there is too many unit in UnitDelays 2023-09-09 15:15:08 +03:00
Gustas
085a4c421b Add back to editor button 2023-09-09 13:46:35 +02:00
Gustas
4fc4fb2fb3 Add Play button to map editor 2023-09-09 13:46:35 +02:00
Gustas
0e5ed6a30c Extract ExitMapEditor in IngameMenuLogic 2023-09-09 13:46:35 +02:00
Gustas
5cc59ae3ac Move ValidRelations from Capturable to Captures
To better match weapon definitions
2023-09-09 13:24:33 +02:00
Gustas
161f4cbdff Fix inconsistent ordering 2023-09-09 13:24:33 +02:00
dnqbob
5b0f69b411 Fix the inaccuracy used when lock on in Missile. 2023-09-08 13:49:12 +03:00
RoosterDragon
23f3f8d90c Add helper methods to locate actors that can be reached via a path.
Previously, the ClosestTo and PositionClosestTo existed to perform a simple distance based check to choose the closest location from a choice of locations to a single other location. For some functions this is sufficient, but for many functions we want to then move between the locations. If the location selected is in fact unreachable (e.g. on another island) then we would not want to consider it.

We now introduce ClosestToIgnoringPath for checks where we don't care about a path existing, e.g. weapons hitting nearby targets. When we do care about paths, we introduce ClosestToWithPathFrom and ClosestToWithPathTo which will check that a path exists. The PathFrom check will make sure one of the actors from the list can make it to the single target location. The PathTo check will make sure the single actor can make it to one of the target locations. This difference allows us to specify which actor will be doing the moving. This is important as a path might exists for one actor, but not another. Consider two islands with a hovercraft on one and a tank on the other. The hovercraft can path to the tank, but the tank cannot path to the hovercraft.

We also introduce WithPathFrom and WithPathTo. These will perform filtering by checking for valid paths, but won't select the closest location.

By employing the new methods that filter for paths, we fix various behaviour that would cause actors to get confused. Imagine an islands map, by checking for paths we ensure logic will locate reachable locations on the island, rather than considering a location on a nearby island that is physically closer but unreachable. This fixes AI squad automation, and other automated behaviours such as rearming.
2023-09-07 17:46:35 +03:00
RoosterDragon
2ac855488b Validate order targets when resolving orders. 2023-09-07 17:46:35 +03:00
Bryan Quigley
c08ddb61b3 Better Naval AI
I noticed even on a naval only map, the naval AI doesn't necessarily beat a Normal AI. This makes it much more likely that it will.

 - Drop number of ore refineries and ore trucks. As Naval AI is mostly suited for islands I haven't found a map that really needs as many as the other AIs.
 - Reduce number of ground based base defenses - and delay Tesla coil a lot.
 - Reduce number of migs as yaks more useful if they just get blown up.
 - Add Flak trucks and v2s for base defense for Soviet
 - Add Jeep and Arty for base defense for Allied
 - Add delay for building ore truck so now chance of building one first from War Factory
 - A service depot is not useful for this AI except for building an MCV so delay it a lot.

Tested with Ukraine and Germany and can consistently beat normal on island map.
2023-09-07 17:00:04 +03:00
dnqbob
fb55f2824e UnitBuilderBotModule and BaseBuilderBotModule fix on muti-queue performance:
1. Only allow new item being queued when cash above a certain number

2. Only tick one kind of queues at one tick, reduce the pressure on the actived tick

3. 'BaseBuilderBotModule' will check all buildings in producing, avoid queue mutiple same buildings.
2023-09-07 16:40:57 +03:00
dnqbob
1b0c93e5ff Fix new NewProductionCashThreshold check ignore player cash. 2023-09-07 16:40:57 +03:00
dnqbob
19c8c36030 Replace Cash + Resources with GetCashAndResources() 2023-09-07 16:40:57 +03:00
dnqbob
931118e1d8 Add GetCashAndResources() to PlayerResources, to get overall credits. 2023-09-07 16:40:57 +03:00
RIP-webmaster
61f1660b38 Update OpenRA.Mods.Common.csproj 2023-09-06 08:59:23 +03:00
RIP-webmaster
634cf900e6 Remove reference to obsolete package 2023-09-06 08:59:23 +03:00
Gustas
a148f30070 Simplify matrix utils 2023-09-03 22:58:04 +02:00
dnqbob
3e0daa62c4 Fix Target.Invalid comparion bug in AutoTarget 2023-09-01 20:28:20 +03:00
RoosterDragon
aac1bae899 Prefer ReadUInt8 over ReadByte.
The former will throw when the end of the stream is reached, rather than requiring the caller to check for -1.
2023-08-29 16:17:27 +02:00
RoosterDragon
f5f2f58664 Use Stream.Write(int) extension method where possible. 2023-08-29 16:17:27 +02:00
Matthias Mailänder
f428a44bfc This is not just about difficulty. 2023-08-28 23:34:48 +03:00
Matthias Mailänder
ce412e4404 The description is optional so don't crash when it is null. 2023-08-28 23:34:48 +03:00
JovialFeline
7bd4b4558e Add text fix, polish to Controlled Burn 2023-08-28 19:32:18 +02:00
Gustas
619fb6633a Cache uniform locations 2023-08-28 19:18:05 +02:00
Matthias Mailänder
bf64339890 Automatically move blockers when transform deploying. 2023-08-26 20:43:50 +03:00
Gustas
d9787b168d Add shuriken island 2023-08-25 21:11:52 +02:00
Gustas
4a81d9b6f7 Remove haos ridges 2023-08-25 21:11:52 +02:00
michaeldgg2
4370c47f6e Make FloatingSprite public 2023-08-23 23:40:11 +03:00
RoosterDragon
f69e6289b5 Handle re-entrant RunUnsynced correctly.
If nested calls to RunUnsynced are running, then using a bool would cause the flag to be reset once the inner function completes, but an outer function may still be running and not yet ready for the flag to be reset. To correctly handle nested calls, we track a count and only reset the flag once all functions have completed.
2023-08-23 20:56:20 +03:00
Gustas
bfd0cd7108 Report all OpenGL errors 2023-08-22 20:18:44 +02:00
RoosterDragon
df534736a1 Don't enforce style rules that require .NET 7.
As the solution currently targets .NET 6, a variety of style rules only introduced in .NET 7 are not suitable for enforcing as warnings (which are treated as errors in the CI pipeline). Anybody compiling locally with a .NET 6 SDK won't be able to trigger these rules locally, but the Linux CI agent comes with the .NET 7 SDK and will trigger these rules. This provides a poor dev experience as the CI run will report errors that don't reproduce locally.

To remove this developer friction, reduce the severity of these rules to avoid CI runs failing.
2023-08-22 18:22:19 +02:00
RoosterDragon
93a97d5d6f Fix CA1851, assume_method_enumerates_parameters = true 2023-08-20 20:41:27 +02:00
RoosterDragon
3275875ae5 Fix CA1851 2023-08-20 20:41:27 +02:00
abcdefg30
88f830a9e5 Fix Folder.GetStream using FileNotFoundExceptions to detect if a file exists 2023-08-20 17:44:31 +03:00
Matthias Mailänder
c609c4af14 Extract text feedback messages. 2023-08-19 20:46:04 +03:00
Matthias Mailänder
94c8339e17 Allow for optional localised text notifications. 2023-08-19 20:46:04 +03:00
Matthias Mailänder
b742a776eb Refactor LocalizedMessage. 2023-08-19 20:46:04 +03:00
Matthias Mailänder
1899eed839 Add localisation support to transient lines. 2023-08-19 20:46:04 +03:00
Matthias Mailänder
43d1a20d8c Fix missing init-only modifier. 2023-08-19 20:46:04 +03:00
dnqbob
1692f32ffc Make aircraftInfo in carryall private 2023-08-19 11:55:27 +03:00
dnqbob
e07869e71f Autocarryall put down unit if destination is cancelled when picking up 2023-08-19 11:55:27 +03:00
dnqbob
c9dfb215ae Auto carry action can be controlled by condition 2023-08-18 20:47:48 +03:00
Matthias Mailänder
98896f9a75 Make Cargo and Carryall conditional. 2023-08-13 18:38:17 +03:00
michaeldgg2
a14cc8cc4d Make Bullet projectile extensible 2023-08-13 18:00:16 +03:00
abcdefg30
e1940eec77 Remove a bogus CanDeploy check from order resolving for charge deploys 2023-08-11 20:21:58 +03:00
RoosterDragon
a1dfb42812 Fix IDE0251 2023-08-11 15:51:53 +02:00