Commit Graph

69 Commits

Author SHA1 Message Date
Oliver Brakmann
206c33ed41 Merge pull request #8226 from pchote/actor-disposal
Dispose traits when destroying an actor.
2015-06-02 19:33:22 +02:00
Matthias Mailänder
ea5003cd2d add new long WRange.RangeSquared to avoid integer overflows 2015-05-31 23:51:30 +02:00
Paul Chote
585a43fd8f Rename Actor.Destroy/Destroyed to Dispose/Disposed. 2015-05-29 19:08:38 +01:00
Pavel Penev
9ed7ef10b9 Merge pull request #8227 from obrakmann/fix8219_rise_of_the_undead_bridges
Fix broken bridges being initialized with a non-zero HP value
2015-05-24 15:05:29 +03:00
Oliver Brakmann
d9f0ca362f Fix broken bridges being initialized with a non-zero HP value 2015-05-24 02:02:20 +02:00
Paul Chote
4eb76046f4 Fix deviator gas blending. 2015-05-23 08:50:28 +01:00
Paul Chote
26fd858fc7 Use premultiplied alpha for all textures and blending. 2015-05-23 08:50:28 +01:00
Paul Chote
469f47aeea Add new map editor UI. 2015-05-15 17:09:27 +01:00
Paul Chote
d211fe9fe1 Add the world components of the new editor. 2015-05-15 17:09:20 +01:00
Paul Chote
443bc63fa7 Render terrain grid above actors, too. 2015-05-15 17:08:31 +01:00
Matthias Mailänder
7e1c3047f6 move generic Voxel render traits to Mods.Common 2015-05-14 17:02:47 +02:00
Paul Chote
889360d4c6 Regenerate cached texture indices when the palette size changes. 2015-05-10 00:59:15 +01:00
Oliver Brakmann
622685c8f4 Merge pull request #7968 from pchote/ts-tileset-depth
Load depth data from tmp(ts) sprites.
2015-05-03 22:31:27 +02:00
Paul Chote
89a1bdd4f1 Merge pull request #7475 from abcdefg30/perhealth
Convert the float health percentage to an int percentage
2015-05-03 08:35:58 +12:00
abcdefg30
8d2307db83 Convert the float health percentage to an int one 2015-05-01 14:16:19 +02:00
David Jiménez
044b51742f Remove plumbing for trait unit tests. 2015-05-01 16:24:14 +12:00
Paul Chote
4b1f541f34 Reorganize actor and smudge loading.
The actor and smudge definitions are now stored
as raw MiniYamlNodes in the map.  It is now the
responsibility of the consumers to parse these
into real objects.
2015-04-30 07:06:14 +12:00
Paul Chote
f46e15c63e Separate terrain geometry visualization from DevMode.
Also adds a “terrainoverlay" console command.
2015-04-29 05:26:50 +12:00
Paul Chote
8b7453070a Include all the relevant palettes in the asset browser. 2015-04-27 19:21:55 +12:00
Paul Chote
098d69f120 Prevent resources from spawning on ramps. 2015-04-27 19:21:12 +12:00
abcdefg30
c4a63eee30 Merge pull request #7875 from penev92/bleed_exposePlayerReferences
Add upgrade rules support for map PlayerReferences
2015-04-26 22:53:42 +02:00
penev92
2402b56da7 Reorganize PlayerReference loading to enable upgrade rules for them.
The PlayerReference definitions are now stored
as raw MiniYamlNodes in the map.
2015-04-26 23:16:20 +03:00
Paul Chote
8a171bb452 Don’t export certain Init types. 2015-04-26 18:12:21 +12:00
Paul Chote
3cfa96e7a6 Fix random country display. 2015-04-20 03:33:46 +12:00
Matthias Mailänder
a8b9026876 fix CS0172 2015-04-05 12:46:41 +02:00
Oliver Brakmann
32ed63727d Revert "Expose Plane turn-to-attack delay to yaml."
This reverts commit 02da41e5c5.
2015-04-03 23:42:35 +02:00
Oliver Brakmann
a8d7140c1a Merge pull request #7815 from Phrohdoh/aircraft-turn-timing
Expose Plane turn-to-attack delay to yaml.
2015-04-03 23:15:41 +02:00
Taryn Hill
02da41e5c5 Expose Plane turn-to-attack delay to yaml.
Require Plane in some ctors.
2015-04-01 00:12:20 -05:00
Paul Chote
c0fa025b74 Indicate current mouseover cell in TerrainGeometryOverlay. 2015-03-31 20:59:53 +01:00
Paul Chote
1e54b19bd3 Implement heightmap-aware view -> cell conversion. 2015-03-31 20:59:53 +01:00
Paul Chote
c68cb995f4 Move cell corner state into Map. 2015-03-31 20:59:52 +01:00
Matthias Mailänder
99283da84f Merge pull request #7723 from RoosterDragon/batch-shroud-cell-changes
Batch shroud cell changes
2015-03-28 12:16:30 +01: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
reaperrr
8bc31a4ae2 Make smoke trail palette customisable, add player color trail support to bullets & missiles 2015-03-27 13:59:33 +01:00
abcdefg30
a249302b6b Allow the use of race variants in "StartGameNotification:" 2015-03-20 14:52:58 +01:00
Matthias Mailänder
16ff6e2112 Merge pull request #7561 from RoosterDragon/fast-map-border-shroud
Speed up map border shroud & fix viewport visible cells
2015-03-18 06:36:45 +01:00
Paul Chote
8c4ea20636 Merge pull request #7430 from Rydra/upstream/pf-optimized
[Discussion PR] Complete refactor of Pathfinder
2015-03-03 19:50:25 +00: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
RoosterDragon
d3b93345b4 Fix Viewport.VisibleCells.
Reworked the visible cells calculation to ensure the visible region is actually minimal, which should reduce the amount of rendering to be done by a small amount. Previously, the region would tend to overdraw by 2-3 cells in either direction. For isometric maps, there was also a bug where it would draw far too much vertically above the top of the map.
2015-02-28 13:36:58 +00:00
RoosterDragon
803390c68e Speed up rendering map border shroud when no shroud is visible.
When the map border shroud must be rendered, but no cells at the border are visible, then we know that no shroud will be visible at all. We can bail from rendering early in this case.
2015-02-27 20:07:32 +00:00
Oliver Brakmann
02c4ace0af Change default facing to 0 2015-02-22 16:25:40 +01:00
RoosterDragon
4d5101a7c4 Vastly improve shroud rendering performance.
Changes in the shroud are now tracked. If a cell changes it will mark itself and its neighbors as dirty. During the render phase all dirty cells will have their vertices calculated and cached. If a cell is not dirty, the pre-calculated vertices are retrieved from cache. Then the sprite renderer is provided the sprite and the pre-calculated vertices to draw.

This prevents constant recalculation of vertices for the shroud in the render phase, requiring instead only dirty cells in the visible area. The update phase is reduced to a practical noop, instead incurring the cost only of changed cells each frame, rather than checking the visible area.
2015-02-20 20:03:42 +00:00
ScottNZ
582b6635ff Brace style fixes 2015-02-13 02:32:49 +13: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
Matthias Mailänder
3489794713 replace PlayMusicOnMapLoad trait with Lua Media.PlayMusic method 2015-01-25 14:43:36 +01:00
penev92
52cc69fd1f Move Crate, CrateSpawner and all CrateActions to Mods.Common 2015-01-18 16:40:55 +02:00
RoosterDragon
930d9cbea3 Cache or inline some delegates to avoid repeated allocations. 2015-01-14 22:57:41 +00:00
abcdefg30
8ca61aa917 Updated all year numbers 2015-01-09 21:18:05 +01:00
Oliver Brakmann
c779259462 Merge pull request #7282 from penev92/bleed_moveFiles
Move more traits to Mods.Common
2015-01-08 17:29:19 +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