Commit Graph
88 Commits
Author SHA1 Message Date
metalgearslothandGitHub 13ae59dbf6 Revert "Don't defer moveevents anymore (#3048)" (#3060) 2022-07-19 21:30:41 +10:00
metalgearslothandGitHub d5c0776278 Don't defer moveevents anymore (#3048) 2022-07-19 18:36:45 +10:00
Leon FriedrichandGitHub fa2b0233c3 ECS detach to null (#2997)
* ECS detach to null

* fix crash
2022-06-29 13:17:58 +10:00
metalgearslothandGitHub 62a24a320c Make raiselocalevent not broadcast by default (#2972)
* Make raiselocalevent not broadcast by default

* I forgor to commit
2022-06-22 09:52:50 +10:00
Leon FriedrichandGitHub 4171b3ec4e Make Grid Uid Nullable (#2942)
* Make Grid Uid Nullable

* Fix recursion

* fix detach to null

* change obsolete text
2022-06-20 10:08:23 +10:00
metalgearslothandGitHub c866c6b59b Optimise grid traversal for pop-in (#2825)
This was like 1/3 of the frame spikes from PVS pop-in. The main benefit is just checking if the entity is anchored for grid traversal and the secondary was earlying-out handling component state if it's sent to nullspace.
2022-05-16 07:37:01 +10:00
4307509402 ECS even more transform (#2742)
Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
2022-05-05 13:20:23 +10:00
442de12b99 Grid splitting (#2743)
Co-authored-by: Vera Aguilera Puerto <gradientvera@outlook.com>
2022-04-24 00:57:56 +10:00
Vera Aguilera PuertoandGitHub 5a5cfa1eba Adds GetGridOrMapTilePosition to SharedTransformSystem. (#2759)
A little helper method that would be VERY useful for many content things... Such as atmos.
2022-04-24 00:55:11 +10:00
metalgearslothandGitHub 0ab3131964 ECS transform states (#2710)
* ECS transform states

Turns out it also saves us a GetComponent on the parent too which is nice.

* Fix test
2022-04-17 14:55:29 +10:00
AcruidandGitHub 31764d3c2d Mark C# events on MapManager as Obsolete (#2586)
* Obsoleted C# grid events from MapManager.GridCollection. Use the ECS EventBus events instead.

* Obsoleted C# events from MapManager.MapCollection. Use the ECS EventBus events instead.
2022-03-07 15:51:00 -08:00
metalgearslothandGitHub 33251222cd EntityLookup as a system (#2573) 2022-03-03 21:17:01 +11:00
mirrorcultandGitHub 9b263417b9 Merge pull request #2541 from metalgearsloth/2022-02-14_1 2022-02-19 12:33:46 -07:00
metalgearslothandGitHub 9ec38b5538 Optimise PVS recursion (#2524) 2022-02-17 18:03:14 +11:00
metalgearsloth 7692ff736b Some more ECS stuff
- Proxy methods on EntityManager
- Transform system stuff
2022-02-14 18:24:52 +11:00
Leon FriedrichandGitHub 561699b26e Replace EntityDirtyEvent with C# event. (#2495) 2022-02-05 12:23:51 +11:00
3024094584 Add IsQueuedForDeletion (#2421)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2022-01-18 19:02:10 +11:00
Leon FriedrichandGitHub d68d803709 Prevent disembowelling on tile removal. (#2418) 2022-01-16 18:51:04 +11:00
Leon FriedrichandGitHub 42e91e8c4d Deparent entities on grid tile delete (#2415) 2022-01-11 18:55:23 +11:00
Pieter-Jan Briers 069ebbc8d0 Make disabled prediction work again.
Simulation input and Update() does not happen when prediction is disabled. Both of these can be re-opted in on a per-handler/system basis with a bool flag. Stuff like physics opts out of this now.
2021-12-30 03:03:39 +01:00
Vera Aguilera PuertoandGitHub fcc16d67f7 Remove Eye Lerping from engine. (#2371) 2021-12-25 19:05:07 +01:00
metalgearslothandGitHub ed4267df50 Minor xform optimisations (#2335) 2021-12-14 09:49:30 +01:00
Vera Aguilera Puerto db996b9fb3 A bunch more resolves removed wooo 2021-12-08 11:37:11 +01:00
20kdc 8aa6fb478b Susser Todd: Robust.Shared, Error Pass 2 "It Now Compiles" 2021-12-03 19:36:16 +00:00
Vera Aguilera Puerto 7a06db60cf Inline UID 2021-12-03 15:53:10 +01:00
Vera Aguilera Puerto b44a1cde88 Inline HasComponent entirely 2021-12-03 12:23:18 +01:00
Vera Aguilera Puerto 7769252109 Inline Deleted 2021-12-03 11:30:03 +01:00
metalgearslothandGitHub a4ff5d65ec Dirty changes (#2174) 2021-11-02 16:05:45 +11:00
metalgearslothandGitHub 526ed31b0d Re-parent unanchored entities (#2046) 2021-10-10 14:27:19 +11:00
Vera Aguilera PuertoandGitHub fbcdd63988 Gets rid of most ComponentManager usages. (#2076)
- Obsoletes more `ComponentManager` fields/properties.
2021-09-28 13:36:18 +02:00
e5013d9e3f Add support for struct directed events, add by-ref directed/broadcast events. (#1931)
* Add support for struct directed events.
- Turn transform events into readonly structs

* TransformComponent events have readonly fields.

* Reduce boxing allocations, add DirectedRegistration readonly struct.

* Use typeof in a few places instead of GetType

* Add overloads to allow passing directed events by ref.

* Raise transform events by ref.

* Fix occluder AnchorStateChangedEvent subscription

* Fix broadphase subscriptions

* Fix bug oops

* Fix transform system raising moveevents by value

* Don't reflect the test entity systems.

* Directed EventBus uses ref everywhere, internally
Deduplicates a bunch of code. Whoo!

* Add broadcast by-ref events

* Fix by-ref events bug using Unsafe, add new tests for sorted by-ref events.

* Port broadcast events to by-ref.

* Speed, more correctness, reduce generics bloat.

* Clean up subscription code some.

* Remove bad test.

Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2021-08-21 11:37:02 +02:00
metalgearslothandGitHub a9791d2033 Fix potential SetTile crash when it unanchors entities (#1903) 2021-07-29 13:15:50 +02:00
metalgearslothandGitHub 7bac32d18e Don't use DeferMoveEvent if the position is NaN (#1896)
The issue is that currently moving around means any non-anchored entities have their positions updated to / from NaN. As you can imagine this is a performance nightmare for anything subscribing to it, especially considering it leads to the broadphase getting desynced for physics.

Realistically we need one of the alternatives Acruid has laid out because flooding the eventbus with NaNs will kill performance.
2021-07-28 00:28:07 +10:00
AcruidandGitHub 713f702064 Engine Entity Anchoring (#1829)
* Added unit tests for the new anchor system design.

* Amend ME!

* SnapGridComponent now anchors the entity when added or removed.
TransformComponent.Anchored properly replicates it's state to clients.

* Converted all SnapGridPositionChangedEvent subscriptions to AnchorStateChangedEvent.
Removed SnapGridPositionChangedEvent.
Obsoleted SnapGridComponent.

* Allows setting Transform.Anchored in prototypes.

* Changing tile to empty under anchored ents unanchors them.

* More unit testing.

* Migrated transform gamestate tests to RobustServerSimulation.

* Fixed nasty off-by-one error when sending a full server state.

* Adds lifetime stages to Component.

* More test fixing.

* Review changes.
2021-06-19 17:26:18 -07:00
AcruidandGitHub f7e8178736 Added new ComponentEvents system in IEventBus. (#1601)
* Added new ComponentEventBus, combined it with IEventBus.

* Removed all traces of IEntity from ComponentDependencies.
Removed IEntityManager dependency from ComponentManager.

* Added entity create/delete events to IEntityManager.

* ComponentEvents now use EntitySystemMessages instead of their custom ComponentEvent class.

* Component events are now just overloads of entity events.

* Removed obsolete EntitySystemMessage, now everything uses the base EntityEventArgs.

* Add a bool argument for if the message should be broadcast as well as directed.
Fix ordering and init issues of events in EntityManager.

* Changed names from Component/Entity events to Directed/Broadcast.

* Fix bugs and unit tests.
2021-03-09 11:02:24 -08:00
Pieter-Jan Briers cecc4dfcf2 Improve SharedTransformSystem:
Do not fire events for deleted entities.
Optimize to remove allocations & LINQ.
2021-02-23 22:05:49 +01:00
AcruidandGitHub 2183cd7ca1 Massive Namespace Cleanup (#1544)
* Removed the Interfaces folder.
* All objects inside the GameObjects subfolders are now in the GameObjects namespace.
* Added a Resharper DotSettings file to mark the GameObjects subfolders as not providing namespaces.
* Simplified Robust.client.Graphics namespace.
* Automated remove redundant using statements.
2021-02-10 23:27:19 -08:00
DrSmugleafandGitHub 58560f589f Defer MoveEvent out of TransformComponent.HandleComponentState (#1453)
* Defer MoveEvent out of TransformComponent.HandleComponentState

* Imports

* Make the update loop more readable and call ToArray

* Fix tests

* Fix tests HALLELUJAH
2020-12-19 13:09:16 +01:00