Commit Graph

112 Commits

Author SHA1 Message Date
Matthias Mailänder
56e9bcd96e rename RangeSquard to LengthSquared 2015-07-09 21:16:01 +02:00
Matthias Mailänder
413baf9d8b rename WDist.Range to WDist.Length 2015-07-09 10:55:38 +02:00
Matthias Mailänder
7447e0bf93 rename WRange to WDist 2015-07-09 10:55:38 +02:00
Paul Chote
8206c3c453 Enable VisibilityType for shroud revealing.
VisibilityType.Footprint reveals from each footprint cell.

VisibilityType.CenterPosition reveals from the
actor’s CenterPosition only (as the original
games did).
2015-07-04 17:07:05 +01:00
Paul Chote
7d8ee64ce5 Reorganize shroud cell queries.
This is in preparation for a future PR that will
remove GetVisOrigins.
2015-06-21 17:01:45 +01:00
Paul Chote
10716f8979 Move shrouded/revealed tile calculation outside Shroud. 2015-06-21 16:58:07 +01:00
Paul Chote
b5550102db Move world state tracking to Creates/RevealsShroud. 2015-06-21 16:58:06 +01:00
Paul Chote
0677c309f3 Move Shroud.IsTargetable to Player. 2015-06-19 22:02:08 +01:00
Paul Chote
0a2757d0e0 Remove Shroud.IsExplored(Actor) and IsVisible(Actor). 2015-06-19 22:01:48 +01:00
Paul Chote
6738b8b977 Undo an invalid optimisation.
Fixes a regression from #7746.
2015-06-15 18:06:43 +01:00
Paul Chote
aee951c86f Remove region assumptions from fast shroud tests. 2015-06-15 18:06:42 +01:00
Paul Chote
da3abb4e2e Tweak shroud revealing logic
The per-actor visibility now tracks all cells
inside the map area (including those outside the
currently visible bounds), but the shroud/fog is
only cleared if the cell is inside the currently
visible bounds.
2015-06-15 18:06:42 +01:00
Oliver Brakmann
ce1eed6bcc Merge pull request #8432 from pchote/shroud-wpos
Add WPos shroud visibility queries.
2015-06-07 21:57:39 +02:00
Paul Chote
66dd3c553c Introduce WPos versions of FogObscures and ShroudObscures. 2015-06-07 19:50:02 +01:00
Paul Chote
cac7ec39f4 Rework shroud rendering using TerrainSpriteLayer. 2015-06-07 17:02:56 +01:00
Paul Chote
bf4722fb9f Distinguish between all map cells and cells inside map bounds. 2015-06-02 21:53:25 +01:00
Matthias Mailänder
ea5003cd2d add new long WRange.RangeSquared to avoid integer overflows 2015-05-31 23:51:30 +02:00
deniz1a
e290975952 Reverts #8097.
It caused units not targeting enemies under fog even with satellite.
2015-05-21 00:24:27 +03:00
deniz1a
db38f52721 Fixes location of phase transport being revealed by attack line. 2015-05-16 15:20:07 +03: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
RoosterDragon
1853ddde94 Use MPos indexer for CellLayer in Shroud.
This reduces us to one conversion per cell rather than two or three.
2015-03-27 19:50:07 +00:00
RoosterDragon
1584018dcd Batch shroud cell changes.
By maintaining a set of changed cells we can avoid repeating work for cells that change multiple times before being rendered. The shroud renderer and radar widget now delay their work until they must render, and thus process each changed cell only once. This avoids significant repetition that was causing major slowdown when many actors were in the world.
2015-03-27 19:50:05 +00:00
RoosterDragon
6234e311ca Speed up shroud visibility updates.
A unit with the CreatesShroud or RevealsShroud trait must update all shrouds when it changes position. Calculating the tiles it can currently see is an expensive calculation that previously had to be repeated for every shroud that needed to know these tiles.

Now, we lazily populate a ref parameter to allow it to be reused for an actor if possible. The biggest improvement comes from the fact that allied players can re-use this calculation when updating their shrouds. Since many games includes a neutral player allied to both sides, most games will see a decent speedup.
2015-03-02 22:18:06 +00:00
abcdefg30
8ca61aa917 Updated all year numbers 2015-01-09 21:18:05 +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
Matthias Mailänder
bc3acfeee7 StyleCop clean OpenRA.Game 2015-01-04 15:38:54 +01:00
Matthias Mailänder
44cd174a8d StyleCop clean OpenRA.Game 2015-01-03 19:00:48 +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
Paul Chote
5e402e95cb Update only dirty radar pixels and refresh every tick. 2014-12-04 21:18:45 +13:00
obrakmann
022c1ae4d1 Merge pull request #6310 from pchote/shroud-reset-fix
Fix shroud hash updating.
2014-08-23 10:43:56 +02:00
Paul Chote
531e3cfaf3 Fix shroud hash updating. Fixes #6308.
This ensures that multiple Invalidations() in one tick will each update the shroud rendering.
2014-08-23 15:25:39 +12:00
Paul Chote
2acfc23f18 Account for map edges in Shroud.IsExploredCore. 2014-08-23 10:54:01 +12:00
Paul Chote
80c4870a0f Don’t clear shroud outside the map. Fixes #6097. 2014-08-23 09:53:27 +12:00
Paul Chote
1d77cd5391 Merge pull request #5851 from RoosterDragon/shroud-perf
Speed up shroud checks
2014-07-23 11:02:27 +12:00
Matthias Mailänder
1071a94d1d document traits 2014-07-20 14: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
Paul Chote
9487f49cd5 Replace WPos.ToCPos -> Map.CellContaining. 2014-06-27 23:30:40 +12:00
Paul Chote
7b52fa52b6 Replace CPos.CenterPosition -> Map.CenterOfCell. 2014-06-27 23:30:40 +12:00
Paul Chote
5560f276ca Map: Rename IsInMap -> Contains. 2014-06-27 22:07:03 +12:00
Paul Chote
fd4d3b40d0 Simplify shroud range checks. 2014-06-27 22:07:03 +12:00
Paul Chote
2a466d08c3 Remove the now-unused ExploredBounds optimization. 2014-06-27 22:07:03 +12:00
Paul Chote
baf27bc4cd Use CellLayers for shroud. 2014-06-27 22:07:02 +12:00
ScottNZ
7e6f7c51e1 Refactor AutoTarget scan and GPS interaction, and cache trait lookup for a slight performance boost 2014-06-07 12:01:50 +12:00
Paul Chote
20b88fd904 Remove World.FrameNumber. 2014-03-12 17:19:29 +13:00
Chicken man
cf3cc43a28 Changed things to do with Shroud to WRange. Updated Utility. 2014-03-05 17:30:33 -05:00
Paul Chote
4d70996012 New shroud renderer. Fixes #2162. Fixes #3024. Fixes #4034.
Uses the original tile sprites in C&C and D2K and uses a smoother transition in all mods.
2013-12-11 20:51:49 +13:00
ScottNZ
00ec1ca87a Remove unused usings 2013-11-12 19:39:33 +13:00
Paul Chote
8fcbe7bb9e Fix world visibility checks when shroud is disabled. 2013-08-10 20:15:05 +12:00
Paul Chote
c08f602661 Add lobby options for Shroud and Fog. 2013-08-04 13:04:09 +12:00