Commit Graph

206 Commits

Author SHA1 Message Date
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
ScottNZ
90894aa03e Use var everywhere 2014-06-15 22:17:34 +12:00
Pavlos Touboulidis
ee4f3e5642 Always allow cheats on single player games 2014-06-13 17:18:12 +03:00
RoosterDragon
d1b3d77662 Changed logging in DoTimed/RunActivity to create less overhead.
- Refactored PerfTimer to use less memory.
- Avoid using the PerfTimer in highly called methods DoTimed and RunActivity, instead tracking long ticks manually to reduce overhead and avoid memory allocations.
- Added some helper methods in PerfTimer to output information when a tick takes too long.
- Changed PerfTimer logging to output the time at the start of the line, and no longer truncate output per line.
- Settings.LongTickThreshold changed from TimeSpan to float and renamed to LongTickThresholdMs.
2014-05-28 16:38:05 +01:00
Pavlos Touboulidis
b8bbd55598 Misc changes
* Use Pair instead of KeyValuePair
* double -> var
* Butcher XML comments
* Change WinState default to Undefined and use it instead of the new GameOutcome
* Other changes
2014-05-22 21:57:07 +03:00
Pavlos Touboulidis
de0a5ebd43 Improve replay metadata and the replay browser
List of changes:

* Better and more filters with new layout, for both mods.

* Rename/Delete/Detele all functionality.

* Simplified ReplayMetadata class considerably by introducing a new
GameInformation data object. The new GameInformation class contains
more information than previously available so the new solution is not
compatible with old replays, meaning it can't read old replays.

* Better and cleaner game information gathering in order to be written
at the end of the replay file.

* Revert changes to ReplayConnection, no longer necessary.

* Better exception message on missing sprites and fonts.

* New "SpawnOccupant" class that holds all the information needed by the
MapPreviewWidget to visualize a spawn point. It was using Session.Client
before and it was necessary to separate it to be able to show information
not available at lobby time.

* Fix keyboard focus UI bug when closing a window would not remove focus.
2014-05-22 21:54:14 +03:00
Pavlos Touboulidis
98a05b61b3 Add metadata block to replays
The replay files are just streams all network communication so to
get any info out of them it is necessary to play back the stream
until the wanted information is reached.

This introduces a new metadata block placed at the end of the
replay files and logic to read the new block, or fall back to
playing back the stream for older files.

The replay browser is also updated to use the metadata information
instead of reading the replay stream directly.
2014-05-22 21:54:14 +03:00
Pavlos Touboulidis
df0d1360dd Give PerfTimer the ability to write only slow operations to the log
This is useful to ignore fast operations that just spam the log.

The class had to be reworked because it couldn't properly handle cases
where all of a node's children where below the threshold.

Also changed DoTimed() and RunActivity() to use PerfTimer.
2014-05-22 03:40:36 +03:00
Matthias Mailänder
187362e80e rename OpenRA.Support.Random aka XRandom to MersenneTwister 2014-05-18 21:53:21 +02:00
Pavlos Touboulidis
6f3d9e9c97 Remove unused "Manifest" argument from World constructor 2014-05-17 14:33:16 +03:00
Pavlos Touboulidis
63ec6d60e7 Refactoring to remove static Rules & SequenceProvider 2014-05-17 14:32:03 +03:00
Paul Chote
fdd4437c52 Re-enable shellmaps. 2014-05-02 22:08:41 +12:00
Pavlos Touboulidis
45944a053c Replace (and remove) custom Set<T> with HashSet<T> 2014-04-27 00:01:33 +03:00
Pavlos Touboulidis
2d8cd8299f Add more perf measurements 2014-04-23 03:43:46 +03:00
Paul Chote
4935266945 Merge FileFormats dll into Game and reorganise namespaces. 2014-04-17 01:20:47 +12:00
Oliver Brakmann
4d71e37ab0 Disable shellmaps temporarily 2014-04-03 17:24:01 +02:00
Matthias Mailänder
0c20e38443 add a pause/slowdown/play/fastforward button for replays
closes #4633
2014-03-14 10:07:54 +01:00
Paul Chote
20b88fd904 Remove World.FrameNumber. 2014-03-12 17:19:29 +13:00
Paul Chote
a7d6f717c4 Overhaul ingame timer displays. Fixes #3062. 2014-03-12 17:19:06 +13:00
ScottNZ
e4e6169f7f Add a function to World for setting just the local pause state, and add a lock variable to prevent further pause state changes 2013-11-29 23:01:18 +13:00
Matthias Mailänder
8a13cd6c6a additional checks to avoid giving dead actors a rank sign
closes #4134
2013-11-17 23:28:02 +01:00
Matthias Mailänder
6f8e78761c StyleCop cleanup 2013-11-02 23:18:23 +01:00
Paul Chote
4a2a747556 Pull ActorMap back out into a trait. 2013-09-27 15:36:49 +12:00
Paul Chote
dfd51c0caa Introduce ScreenMap trait for caching screen-coord queries. 2013-09-27 15:36:25 +12:00
Paul Chote
cad46e43c5 Add WorldRenderer parameter to WorldLoaded. 2013-09-27 15:29:44 +12:00
Matthias Mailänder
bdfdaac092 sync effects 2013-08-29 17:37:35 +02:00
Paul Chote
f6d0ea4b0f Remove TileSet rendering code. 2013-08-14 23:08:25 +12:00
Paul Chote
c7350b704e Add trait interfaces for added/removed from world. 2013-08-04 18:22:57 +12:00
Paul Chote
c3c5321e1d Predict local pause state to avoid order lag. Fixes #3223. 2013-05-09 22:42:55 +12:00
Paul Chote
2c680a1831 Fix shroud for observers observing a player after win/loss. 2013-04-11 21:26:49 +12:00
Paul Chote
248e815d99 More shroud refactoring.
This introduces a hash on Shroud which ShroudRenderer
can observe, removing the need to explicitly twiddle
a dirty flag between objects.

Shroud disabling is now done via RenderPlayer, so
enabling the cheat or winning/losing will now give
vis equivalent to an observer.
2013-04-10 21:08:22 +12:00
Paul Chote
c428cad70c Refactor per-player shrouds & fix shellmap shroud. 2013-04-10 19:36:03 +12:00
Paul Chote
096d95f391 Fix bogus pause logic. 2013-04-07 23:38:52 +12:00
Paul Chote
fe091487cc Fix C&C options menu fade effect. 2013-04-06 16:41:13 +13:00
Sascha Biedermann
1eb7c62c62 closes #2874: improved ingame chat 2013-03-28 18:39:26 +01:00
Matthias Mailänder
0a82bfe552 format TODO: uniformly to auto-generate task list in MonoDevelop 2013-03-27 09:45:17 +01:00
Matthias Mailänder
baacad8432 add Shroud selector to spectator mode, closes #2463 2013-03-24 10:42:58 +01:00
Kenny
f41fb32d60 Introducing per-player shrouds.
- Each player has their own shroud and their visibility does not extend outside of the shroud. 
- Units and buildings can no longer target other units outside of their visibility. Buildings can still be targetted if they have been explored.
- GPS will provide visibility in the fog-of-war.
- Spies that infiltrate radar domes will gain their victim's exploration and reset it on all clients (if the victim does not have GPS)
2012-12-13 15:16:56 -08:00
Remco van der Zon
b99e664726 A Game-tick can execute viewport.Tick itself,
removed this dependency from World.
2012-05-10 19:54:57 +02:00
Chris Forbes
dadc496c19 beef up OpenRA.FileFormats.Set a little; use it in CncMenuPaletteEffect rather than making new List<string> every frame 2012-04-25 21:43:00 +12:00
Chris Forbes
85eeb8b819 tidy 2011-12-28 08:16:51 +13:00
Tirili
4f505eb6a1 Add ability to disable the shellmap 2011-10-23 13:24:26 +13:00
Tirili
6174ccc882 Change World.DisableTick to World.EnableTick 2011-10-23 13:11:39 +13:00
Chris Forbes
bc6af1841b fix indents everywhere 2011-10-18 15:10:17 +13:00
Chris Forbes
55036cd58c fix trailing whitespace everywhere 2011-09-26 08:40:39 +13:00
Paul Chote
532bd42aed Remove obsolete Player index cruft 2011-06-20 22:50:26 +12:00