Commit Graph

201 Commits

Author SHA1 Message Date
RoosterDragon
611a928a47 Prevent changing world players after being set once. 2015-12-23 21:53:47 +00:00
RoosterDragon
23a38a08f7 Refactor player setup.
Tweak how players in a world are created. Change the collection to be an array to more strongly imply it will not change during a game.
2015-11-27 15:15:43 +00:00
atlimit8
b6f17df260 Add ActorsHavingTrait<TTrait>([Func<TTrait, bool]) 2015-10-28 16:36:45 -05:00
Paul Chote
ef55d646f7 Unstatic the Sound class. 2015-09-20 14:11:06 +01:00
Paul Chote
257c043e58 Add Timestep property to GlobalSettings. 2015-09-06 17:48:26 +01:00
abcdefg30
dae70321c2 Merge pull request #8792 from deniz1a/reveal-shroud
Changes shroud lobby setting from disabling shroud to revealing it.
2015-08-12 22:04:15 +02:00
RoosterDragon
a0117a3890 Add a method to look up actors by ID.
This can be used to speed up some methods.
2015-08-09 20:25:34 +01:00
deniz1a
7efbf0633e Changes shroud lobby setting from disabling shroud to revealing it. 2015-08-04 17:31:06 +03:00
Paul Chote
86ba26e013 Convert shroud calculations and rendering to PPos. 2015-07-27 19:34:50 +01:00
Oliver Brakmann
4de03e991c Remove revealing views from observer mode in missions 2015-07-25 20:51:39 +02:00
Oliver Brakmann
a725d63b0c Remove World.ObserveAfterWinOrLose
Fixes RenderPlayer for "All Players" view.
2015-07-25 18:56:24 +03:00
deniz1a
ef143e5f8a Freezes map after game ends.
Adds newline.

Disables keyboard hotkeys for units after game ends.
2015-07-25 18:56:23 +03:00
Zimmermann Gyula
57e684d1d9 Implements victory and defeat music. 2015-07-13 15:42:13 +02:00
Zimmermann Gyula
60fafaa5a7 Refactors the music player. 2015-07-12 17:27:02 +02:00
Matthias Mailänder
2768fc88e7 stop all sounds on map change 2015-07-05 18:07:11 +02:00
Matthias Mailänder
e58ce7d59b stop music and video when disposing the world 2015-06-27 11:00:06 +02:00
Oliver Brakmann
fbd5938f3f Do not fire script triggers while the world is being destroyed 2015-06-21 19:37:25 +02:00
Paul Chote
0a2757d0e0 Remove Shroud.IsExplored(Actor) and IsVisible(Actor). 2015-06-19 22:01:48 +01:00
Paul Chote
aee951c86f Remove region assumptions from fast shroud tests. 2015-06-15 18:06:42 +01:00
Paul Chote
66dd3c553c Introduce WPos versions of FogObscures and ShroudObscures. 2015-06-07 19:50:02 +01:00
Paul Chote
4ff309811f Dispose actors when tearing down the world. 2015-05-29 19:21:34 +01:00
Paul Chote
d211fe9fe1 Add the world components of the new editor. 2015-05-15 17:09:20 +01:00
Matthias Mailänder
1f024a8695 Add menu plumbing for the new map editor. 2015-05-15 17:08:33 +01:00
Paul Chote
b889101ba1 Make sure that ScreenMap is initialized before other traits. 2015-05-15 17:08:31 +01:00
David Jiménez
044b51742f Remove plumbing for trait unit tests. 2015-05-01 16:24:14 +12:00
Taryn Hill
96d6ea79ce Remove explicit private.
Remove unnecessary delegate.
Use extension method syntax.
Fix HealthInfo.NotifyAppliedDamage’s desc.
Remove unused using directives.
Remove explicit type declaration in Manifest.
2015-04-09 13:59:20 -05:00
Matthias Mailänder
3bb448b29b warn before loading incompatible replays 2015-03-07 10:06:17 +01:00
David Jiménez
54ae572303 - Introduced Unit Testing capabilities to the PathFinder trait and algorithm.
Introduced also a small Unit test project to prove it.

- Separated caching capabilities from PathFinder class to increase cohesion and maintainability.
Refactored the pathfinding algorithm by extracting methods based on responsibilities like
calculating costs and reordering functions. These changes should provide a in average a small increase in
pathfinding performance and maintainability.

- Optimized the pathfinder algorithm to reuse calculations like the
MovementCost and heuristics.

- Introduced base classes, IPathSearch and IPriorityQueue interfaces,
and restructured code to ease readability and testability

- Renamed the PathFinder related classes to more appropriate names. Made the
traits rely on the interface IPathfinder instead of concrete PathFinder
implementation.

- Massive performance improvements

- Solved error with harvesters' Heuristic

- Updated the heuristic to ease redability and adjustability. D can be
adjusted to offer best paths by decreasing and more performance by
increasing it

- Refactored the CellLayer<CellInfo> creation in its own Singleton class

- Extracted the graph abstraction onto an IGraph interface, making the
Pathfinder agnostic to the definition of world and terrain. This
abstraction can help in the future to be able to cache graphs for similar
classes and their costs, speeding up the pathfinder and being able to feed
the A* algorithm with different types of graphs like Hierarchical graphs
2015-03-03 20:11:11 +01:00
David Jiménez
8659a3e71e Introduced the interfaces IActor, ICacheStorage, ILog, IMap, IWorld a
nd IMobileInfo to separate concrete implementations and abstractions
2015-02-22 23:14:12 +01:00
RoosterDragon
82bea961ba Checked LINQ queries and collections for inefficiencies.
- Made Array.IndexOf available via extension method.
- Made ToHashSet extension method.
- Change collections queried often via Contains into sets.
- Avoid Count() extension if Count or Length property exist.
- Made Count() > 0 checks and variations calls to Any() instead.
- Don't call ToList/ToArray if there is no benefit to materializing the sequence.
- If the sequence does benefit from materialization, follow this general pattern:
  - Collection queried often via Contains use ToHashSet to speed up lookups.
  - Short lived variables use ToList. This is because ToArray requires an extra copy to output the final size.
  - Collections persisted into fields or for a long time use ToArray to minimize memory overhead.
2015-01-29 19:20:11 +00:00
abcdefg30
8ca61aa917 Updated all year numbers 2015-01-09 21:18:05 +01:00
Matthias Mailänder
89b2f4d5d3 Merge pull request #7217 from Mailaender/chrome-init-cleanup
Cleaned up the ingame widget initialization
2015-01-08 07:40:36 +01:00
RoosterDragon
7cfece6dc0 Introduce a new type for representing map coordinates.
To resolve the ambiguity introduced when the introduction of isometric maps meant that cell and map coordinates were no longer equivalent, a new type has been introduced so they can each be represented separately.
2015-01-07 17:30:34 +00:00
RoosterDragon
a6cda967c2 Formatted all files.
Automatically formatted all files via VS. This generally corrects indentation, removes trailing whitespace and corrects misplaced tabs or spaces. Manually tweaked a few files where required.
2015-01-06 21:28:50 +00:00
Matthias Mailänder
9d2f33d42c add a World type 2015-01-04 17:57:38 +01:00
Matthias Mailänder
bc3acfeee7 StyleCop clean OpenRA.Game 2015-01-04 15:38:54 +01:00
Hellhake
5a97a4b63b Fix StyleCop warnings in OpenRA.Game 2015-01-02 12:11:01 +01:00
RoosterDragon
c37a691c33 Convert some keys users of CellLayer to index via map-coords for efficiency. 2014-12-20 23:39:03 +00:00
Matthias Mailänder
10edb7a621 also measure render performance bottle necks
closes #4133
2014-11-01 15:33:03 +01:00
Oliver Brakmann
a3bf3e7403 Add support for mission objectives
Objectives can be either primary or secondary objectives. Primary ones
influence the outcome of the game.  If all primary objectives are
completed the game is won, and lost when any of them fails.

Objectives can be added at any stage during the game, allowing to react
dynamically to game events.

The objectives backend only contains the information about the
objectives themselves. It does not check if objectives are completed or
failed.  Instead, the state of objectives must be manually marked. The
backend, however, does check whether the game is won or lost.
2014-08-07 16:56:17 +02:00
atlimit8
0319b8cbda INotifyCreated 2014-07-25 17:07:15 -05:00
Paul Chote
1d77cd5391 Merge pull request #5851 from RoosterDragon/shroud-perf
Speed up shroud checks
2014-07-23 11:02:27 +12:00
Paul Chote
802b6a652c Revert "new PauseState to differentiate game and editor pausing"
This reverts commit d1e18cad7a.
2014-07-08 10:42:00 +12:00
Paul Chote
3c2d9910e3 Revert "Undo changes to World::SetLocalPauseState to unbreak Lua"
This reverts commit 77e3d17527.
2014-07-08 10:39:18 +12:00
Oliver Brakmann
77e3d17527 Undo changes to World::SetLocalPauseState to unbreak Lua
Fixes #5864.
2014-07-07 21:50:37 +02:00
RoosterDragon
a512d9ad0a Sped up shroud rendering.
- Only update shroud within the visible screen area, rather than the whole map. This improves performance on larger maps significantly when scrolling around since large portions of the shroud do not need to be updated.
- Provide methods in Shroud to return delegates to check for explored/visibility for tiles within a certain region. This allows it to return more efficient delegates whenever the region is within the map bounds, or shroud/fog is disabled. In the typical case where the region is in bounds and shroud/fog is enabled, the fast check is almost twice as fast as the slow check.
- Use the Shroud delegate functions in shroud rendering, frozen actors, minimap rendering and resource layer areas to provide a speedup since these areas of code can often take advantage of the fact they perform checks within the map boundary.
- Cache current element in CellRegionEnumerator to prevent repeated work if the element is accessed more than once.
- Decrease the size of elements in some arrays in hopes of reducing memory needs and improving cache hits.
2014-07-07 17:34:31 +01:00
RoosterDragon
2351c43237 Refactoring pass.
- Extract an enum for edges rather than using magic numbers for everything.
- Remove duplicated code between FoggedEdges and ShroudedEdges by hosting the visibility function into a delegate.
- Make minimap methods more readable.
- Tidy formatting.
- Make some fields readonly.
- Remove unused usings.
2014-07-07 17:34:25 +01:00
Matthias Mailänder
d1e18cad7a new PauseState to differentiate game and editor pausing 2014-07-06 08:24:08 +02:00
Paul Chote
2a466d08c3 Remove the now-unused ExploredBounds optimization. 2014-06-27 22:07:03 +12:00
RoosterDragon
909c5c7037 Some minor cleanup in TraitDictionary and affected callsites. 2014-06-17 22:10:41 +01:00