Commit Graph

272 Commits

Author SHA1 Message Date
teinarss
6b74093c04 Add readonly to structs 2021-03-14 15:17:57 +01:00
teinarss
4a1e4f3e16 Use expression body syntax 2021-03-07 13:00:52 +00:00
teinarss
ed295ae315 Change throw exceptions to use nameof in parameter 2021-02-28 18:43:51 +01:00
Paul Chote
16d0f8a5a6 Add a setting to pause the shellmap. 2021-01-10 00:23:30 +01:00
abcdefg30
bf14a4ce80 Remove an unused variable from LoadComplete 2020-11-15 09:38:02 +01:00
abcdefg30
ea3c7a3c34 Remove the Stances dictionary 2020-11-14 11:04:41 +00:00
abcdefg30
eda9966d27 Rename Stance to PlayerRelationship 2020-11-14 11:04:41 +00:00
Trevor Nichols
d66e0bb22e Right click lobby spawns to disable or remove players. 2020-11-07 19:33:28 +01:00
Paul Chote
6b6b1e56e6 Resolve random players and spawn points in server replays. 2020-10-31 14:31:44 +01:00
Vapre
38f1f1e5c2 Replace TraitContainer.AllEnumerator with ApplyToAll.
As proposed in the past in #13577.

Replace TraitContainer.All() that uses the custom AllEnumerator with
TraitContainer.ApplyToAllX() that takes an action as argument.

The AllEnumerator.Current function show up in profiling reports since it is
used each tick multiple times for multiple traits. The function is 'heavy'
because it creates TraitPair<T>'s temporary objects for each actor
trait combination.

In the past about 20k ITick trait pairs were present during an average
multi player game.

Using an Apply function that takes an action avoid the need to create
these temporary objects.

To be able to still use 'DoTimed' somewhat efficiently the measurement
was moved to inside the trait container method.

Results in a 25% performance improvement in accessing all traits of
a certain type.

Apply function could be used for other TraitContainer functions as well
for further improvements.

Test result for calling on a dummy trait on 20k actors a 1000 times:
  1315 ms traitcontainer.AllEnumerator (current)
   989 ms traitcontainer.Apply (this commit)
2020-10-29 21:21:12 +00:00
Paul Chote
a375f0e58a Rewrite spawn point assignment logic. 2020-10-13 20:41:39 +02:00
reaperrr
904a5f60d1 Cache IOrderValidator traits on World 2020-10-10 13:59:40 +01:00
Clément Bœsch
815bbc6ee8 Save disconnect frame in the GameInformation
This information is useful to infer a winner in case the winstate is
unknown.
2020-10-10 01:17:39 +02:00
teinarss
9c4fd0e3d3 Use Null-Propagation Operator 2020-08-19 18:11:07 +01:00
teinarss
27f1a7ab27 Use out var syntax 2020-08-19 18:11:07 +01:00
Paul Chote
c6c3a8c60d Make ActorPreview and EditorActorPreview wrap ActorReference. 2020-06-19 17:57:56 +02:00
abcdefg30
52a9fcef3c Rename "Created" to "Initialize" and let it handle adding to the world 2020-05-30 19:47:29 +02:00
abcdefg30
23b3c237b7 Update the year numbers in all license headers to 2020 2020-01-05 17:00:34 +00:00
teinarss
a47f60d3a6 Add a trait PlayerRadarTerrain to track explored terrain 2019-11-20 16:24:56 +01:00
abcdefg30
56726a0533 Add an ICreationActivity interface 2019-10-06 14:42:50 +01:00
Paul Chote
999ad0e18a Convert CustomTerrainDebugOverlay to IRenderAboveShroud. 2019-09-14 18:49:44 +02:00
teinarss
277906c657 Fixes on blocking logic 2019-08-10 17:34:11 +02:00
teinarss
3a17b26405 Creating PlayerMask 2019-07-26 15:54:22 +02:00
Paul Chote
862a274357 Merge ServerOrder into Order and 0xFE order type into 0xFF. 2019-06-20 22:50:17 +02:00
teinarss
4fae77ed1c Writing benchmark data at the end of the game 2019-06-02 00:00:48 +02:00
Evgeniy S
3a30b013a5 Move Selection into a Trait 2019-05-31 15:50:53 +02:00
teinarss
e801537d96 Hide cursor and render the placeholder directly 2019-04-22 21:51:49 +02:00
Paul Chote
1f3b30c2d2 Implement game save/load backend. 2019-04-20 14:54:48 +02:00
Paul Chote
5d43417a5f Add player trait support for IWorldLoaded. 2019-04-20 14:54:48 +02:00
abcdefg30
cadbd0d9ab Change the year number in all cs headers from 2018 to 2019 2019-01-26 23:15:21 +01:00
Paul Chote
0df159e73b Cache world INotifySelection traits in Selection. 2019-01-26 21:40:31 +00:00
Jeremy
85a97998aa Added final game tick to replay meta data for completion percentage on replay. 2018-12-24 20:51:03 +01:00
reaperrr
16e78b8ca8 Add LocalRandom to World
To - in the long term - reduce or remove Game.CosmeticRandom.
2018-11-11 19:50:16 +01:00
reaperrr
422ba16ed9 Run TickIdle from inside Actor.Tick instead of World.Tick
Avoids calling ActorsWithTrait<INotifyIdle> every tick and allows caching all INotifyIdle traits at creation.
2018-10-15 22:53:57 +02:00
Paul Chote
8c0f4fde81 Fix newlines in C# files. 2018-07-01 11:08:32 +02:00
Paul Chote
ebf3ec0e90 Add some basic safeguards around RenderPlayer.set. 2018-05-31 18:54:07 +02:00
reaperrr
3c34330925 Skip check for ITemporaryBlocker entirely if rules don't contain any temporary blockers
This benefits all mods without temporary blockers like gates or energy walls.
2018-05-04 19:40:18 +02:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
RoosterDragon
b1e2ee9b79 ScreenMap should TickRender, rather than just Tick.
This is as FrozenUnderFog.TickRender queues an update to the screen map. If this is not processed in the same tick, this results in screen bounds for the frozen actor being 1 tick behind. By making ScreenMap TickRender, it ensures changes from both Tick and TickRender traits are processed, rather than just Tick traits.
2018-01-06 15:16:59 +01:00
RoosterDragon
5b51f2a0fa Avoid format strings in some places.
Where it is possible to directly concat strings, prefer this in some often-called methods.
2017-12-16 17:26:29 +01:00
Paul Chote
46f6263061 Update ScreenMap state in a single pass at the end of the tick. 2017-12-11 19:45:07 +01:00
Paul Chote
9e18ec7314 Simplify ScreenMap bounds checking. 2017-12-11 19:45:07 +01:00
RoosterDragon
8ef8c60a1a Remove allocations when enumerating sync hashes on an actor.
Exposing Actor.SyncHashes as an array allows allocation free enumeration, we just need to adjust the SyncHash type to run the hash function.
2017-12-10 13:49:52 +00:00
reaperrr
be290cfabd Split Actor.Bounds into RenderBounds and SelectableBounds
Additionally, internally renamed VisualBounds to SelectionOverlayBounds to avoid confusion with RenderBounds.

This step was necessary to prevent actors with selectable area smaller than their graphics to be removed too early from ScreenMap even though part of the graphics should still be visible.
RA cruisers were a prime example, but to a lesser extent several other actors were affected as well.

This separation also serves as preparation to determine the final RenderBounds from multiple source bounds later, to fix the remaining ScreenMap issues (building 'bibs', aircraft shadows).
2017-11-21 01:00:09 +02:00
Paul Chote
1376ad674e Remove Player.CanViewActor and .CanTargetActor. 2017-11-03 09:56:00 +01:00
Matthias Mailänder
1aebf9857c Add support for only rendering effects inside screen bounds 2017-09-17 12:52:04 +01:00
Paul Chote
0e3bfcfb35 Replace WorldCommandWidget with individual logic classes. 2017-09-15 23:06:38 +02:00
Paul Chote
e1cd00c1dd Add backend plumbing for model loaders. 2017-06-14 18:56:06 +02:00
Paul Chote
695a572dc3 Move ActorMap to mod code. 2017-01-29 18:57:36 +00:00
Taryn Hill
43317e0f5d Update copyright notice year to 2017 2016-12-31 23:46:13 -06:00