Commit Graph

28777 Commits

Author SHA1 Message Date
Mustafa Alperen Seki
1b1868fca6 Render every available ProductionIconOverlay. 2022-08-16 15:08:51 +03:00
Mustafa Alperen Seki
54340591e3 Unhardcode VeteranProductionIconOverlay. 2022-08-16 15:08:51 +03:00
Gustas
d438508994 Added try/catch for TypeDictionary errors in Lint code
TypeDictionary errors are very hard for modders to debug as they don't mention which actor is causing the error
2022-08-15 23:19:18 +02:00
Matthias Mailänder
cc58fe1a0f Extract translation strings. 2022-08-14 16:11:51 +02:00
Matthias Mailänder
8201a57b10 Don't complain about re-usable terms not getting referenced. 2022-08-14 16:11:51 +02:00
Matthias Mailänder
2c8c6e50da Code cleanup 2022-08-14 16:11:51 +02:00
Gustas
10ac07bf9f Fix ChooseInitialMap 2022-08-13 17:14:21 +02:00
RoosterDragon
8339c6843e Fix actors not being visible when created within sight range of an enemy.
Since bbf5970bc1 we only update frozen actor state on demand rather than every tick. However when the actor was initially created we were failing to set the initial visibility state if the frozen actor was invisible.

With this fix, we now set the visibility states on creation correctly. This fixes an issue where enemy actors created within line of sight would not appear.
2022-08-13 12:05:03 +03:00
RoosterDragon
2599cb26d8 Allow custom cost to exclude source locations in path searches.
During the refactoring to introduce HierarchicalPathFinder, custom costs were no longer applied to source locations. The logic being that if we are already in the source location, then there should be no cost added to it to get there - we are already there!

Path searches support the ability to go from multiple sources to a single target, but the reverse is not supported. Some callers that require a search from a single source to one of multiple targets perform their search in reverse, swapping the source and targets so they can run the search, then reversing the path they are given so things are the correct way around again. For callers that also use a custom cost like the harvester code that do this in order to find free refineries, they might want the custom cost to be applied to the source location. The harvester code uses this to filter out overloaded refineries. It wants to search from a harvester to multiple refineries, and thus reverses this in order to perform the path search. Without the custom cost being applied to the "source" locations, this filtering logic never gets applied.

To fix this, we now apply the custom cost to source locations. If the custom cost provides an invalid path, then the source location is excluded entirely. Although this seems unintuitive on its own, this allows searches done "in reverse" to work again.
2022-08-13 11:58:45 +03:00
RoosterDragon
df858e06d6 Fix HierarchicalPathFinder failing to consider multiple source locations.
When asked to find a path from multiple source locations, the abstract search is used to determine which source locations are viable. Source locations that cannot be reached on the abstract graph are excluded from the local path search. As we know the locations are unreachable, this prevents the local path search from expanding over the entire search space in an attempt to find these unreachable locations, preventing wasted effort.

In order to determine these reachable locations, the abstract search is expanded successively trying to reach each source location each time. However, this failed to account for a property of the ExpandToTarget for which a comment is now added. If the location was found previously, then expanding to try and find it again will fail. If the source locations were close together, it was likely that the initial expansions of the search space would have included them, and thus they would not be found on a later expansion. This would mean these locations would incorrectly be thought unreachable.

To fix this, we check if the location has already been explored (has CellStatus.Closed in the graph). If so we can check the cost to determine if it is reachable.
2022-08-13 11:58:45 +03:00
abcdefg30
f49536ea12 Use Attribute.IsDefined over GetCustomAttributes 2022-08-12 20:14:54 +02:00
Matthias Mailänder
aa14c9c570 Add VTOL landing exhaust animation. 2022-08-12 00:54:44 +03:00
Matthias Mailänder
1073a7124f Remove an unused field from TakeOff.cs 2022-08-12 00:54:44 +03:00
Gustas
542c5dcfc3 Cleanup directional cursor yaml 2022-08-08 23:28:51 +02:00
Gustas
88e2314776 Add directional support powers to D2K ornithopters 2022-08-08 23:28:51 +02:00
Gustas
fd9758dcbf Make game timer only blink on pause 2022-08-08 10:47:05 +02:00
RoosterDragon
bbf5970bc1 Update frozen actors only when required.
Previously, actors that were visible would refresh their frozen actor state every tick in preparation for the actor becoming hidden, and the frozen actor appearing as a placeholder instead.

By using ICreatesFrozenActors.OnVisibilityChanged when can avoid refreshing the state constantly, and instead just refresh it the moment the frozen actor needs to appear. This provides a nice performance improvement on the cost on managing frozen actors.
2022-08-07 16:50:53 +02:00
darkademic
e827e9952e Additional performance graph colors so same color is not used multiple times. 2022-08-06 22:33:27 +02:00
abcdefg30
dc6be0fd77 Change the IRC link from Freenode to Libera in the issue template config 2022-08-06 16:12:25 +02:00
abcdefg30
47b6f564e3 Add a link to Discord to the PR template and change Freenode to Libera 2022-08-06 16:12:25 +02:00
abcdefg30
d830bca706 Fix force fire opportunity targets not being persisted properly 2022-08-06 15:38:46 +02:00
abcdefg30
5f86f56bed Reduce code duplication in AttackFollow 2022-08-06 15:38:46 +02:00
abcdefg30
0134f63f4d Fix actors with AttackFollow moving away from their targets on amove 2022-08-06 15:38:46 +02:00
Unrud
b88ebd8499 Make Red Alert SVG artwork square
Fix typo in height (128 instead of 138).
2022-08-04 20:02:44 +02:00
RoosterDragon
93998dc4a7 Add a PathFinderOverlay to visualize path searches.
Activated with the '/path-debug' chat command, this displays the explored search space and costs when searching for paths. It supports custom movement layers, bi-directional searches as well as visualizing searches over the abstract graph of the HierarchicalPathFinder. The most recent search among selected units is shown.
2022-08-03 23:12:42 +02:00
RoosterDragon
aef65d353d Replace DomainIndex internals with a lookup from HierarchicalPathFinder instead
Teach HierarchicalPathFinder to keep a cache of domain indices, refreshing them only on demand and when invalidated by terrain changes. This provides an accurate and quick determination for checking if paths exist between given locations.

By exposing PathExistsForLocomotor on the IPathFinder interface, we can remove the DomainIndex trait entirely.
2022-08-03 23:12:42 +02:00
RoosterDragon
5a8f91aa21 Add a hierarchical path finder to improve pathfinding performance.
Replaces the existing bi-directional search between points used by the pathfinder with a guided hierarchical search. The old search was a standard A* search with a heuristic of advancing in straight line towards the target. This heuristic performs well if a mostly direct path to the target exists, it performs poorly it the path has to navigate around blockages in the terrain. The hierarchical path finder maintains a simplified, abstract graph. When a path search is performed it uses this abstract graph to inform the heuristic. Instead of moving blindly towards the target, it will instead steer around major obstacles, almost as if it had been provided a map which ensures it can move in roughly the right direction. This allows it to explore less of the area overall, improving performance.

When a path needs to steer around terrain on the map, the hierarchical path finder is able to greatly improve on the previous performance. When a path is able to proceed in a straight line, no performance benefit will be seen. If the path needs to steer around actors on the map instead of terrain (e.g. trees, buildings, units) then the same poor pathfinding performance as before will be observed.
2022-08-03 23:12:42 +02:00
abcdefg30
cea9ceb72e Support multiple With(Turret)AimAnimation traits 2022-08-03 21:11:03 +02:00
abcdefg30
f2eb42a4b2 Make With(Turret)AimAnimation support multiple AttackBase traits 2022-08-03 21:11:03 +02:00
abcdefg30
ee3c54b572 Disallow starting a game without players 2022-08-03 21:03:46 +02:00
abcdefg30
ea72c50fb4 Fix GrantConditionOnPowerState not being usable on player actors 2022-08-03 20:58:21 +02:00
abcdefg30
1628ce64db Fix lobby error messages from the server being untranslated 2022-08-03 20:54:13 +02:00
dnqbob
8d3ff9d2fc UnhardcodeBaseBuilderBotModule rule update 2022-08-03 11:22:59 +02:00
dnqbob
013ec52108 Unhardcode defenses in BaseBuilderBotModule 2022-08-03 11:22:59 +02:00
Vapre
e8748200f7 Demolishable, trivial optimization. 2022-08-02 00:29:59 +03:00
Vapre
3f3687f71d Widget, avoid copying child list when reverse iterating. 2022-07-31 22:10:49 +02:00
N.N
a9d1b771a0 Align ORA d2k to original D2k
Align ORA D2k weapons to better match original d2k.
2022-07-28 23:42:00 +02:00
RoosterDragon
8dec998d8f Fix tab completion to work for all available commands.
Commands are registered in WorldLoaded event handlers, and IngameChatLogic takes all registered commands and provides tab completion. However IngameChatLogic is also created during WorldLoaded via LoadWidgetAtGameStart. No initialization order is enforced between commands and LoadWidgetAtGameStart, so they can appear in any order.

If a command gets registered before LoadWidgetAtGameStart runs, then it will get tab completion. If it gets registered after then no tab completion is available, even though the command can still be used and appears when using '/help'.

To fix this, we allow the tab completion to check for available commands lazily, meaning it will check for available commands every time the tab key is pressed. This means it will always have the full list of commands available regardless of the initialization order.
2022-07-26 16:42:18 +02:00
teinarss
999af0c05b Add OrderBuffer and time synchronisation. 2022-07-26 15:09:08 +03:00
abcdefg30
4435bdec3c Fix a crash when there is no briefing text 2022-07-25 20:19:36 -05:00
Gustas
e00887e4e1 Make support power fakes infiltratable 2022-07-25 20:07:02 -05:00
N.N
75554123f6 make ornithopter targetable
make ornithopter targetable by anti-air units

update to use just one Targetable type
2022-07-24 21:17:28 +02:00
Gustas
bf5bd63635 Refactor checkbox 2022-07-23 18:32:43 +02:00
Vapre
804bff1b0e TooltipWidgetContainer, load tooltip ui only when visible. 2022-07-18 17:54:57 +02:00
Andre Mohren
0e5f33ef93 PlayerColorPalette now using the full palette if no RemapIndex is set. 2022-07-18 12:23:39 +03:00
Andre Mohren
df72d303b8 Added PaletteFromGrayscale. 2022-07-18 12:23:39 +03:00
Gustas
b597c000d6 Update LobbyLogic to use the new MapCache map tracking 2022-07-17 22:23:13 +02:00
Gustas
6bcf194874 Add map update tracking to MapCache and fix crash when restarting a game 2022-07-17 22:23:13 +02:00
AspectInteractive2
a1a50d6c98 Added rotation logic to the renderer to enable the use of Interpolated Facings. 2022-07-17 17:03:53 +02:00
Sieds Aalberts
e060d6eb05 CellLayer TryGetValue. Return a value if within cell layer bounds. 2022-07-15 20:41:26 +03:00