Commit Graph
47 Commits
Author SHA1 Message Date
f2625bf5c5 Removes IMapManager (#6584)
* Move MapManager queries to SharedMapSystem
Moves all variants of FindGridsIntersecting/TryFindGridAt to SharedMapSystem
Hollows out the MapManager methods and converts them into relays to SharedMapSystem

* Move CreateGrid to SharedMapSystem
Moves the functionality for CreateGrid and its variants to SharedMapSystem
Hollows out the MapManager methods and converts them into relays for the SharedMapSystem methods
Obsoletes them too
Also moves over the GetAllMapGrids and GetAllGrids methods

* Move RaiseOnTileChanged to SharedMapSystem
Also moves the SuppressOnTileChanged flag member to SharedMapSystem
Hollows out and obsoletes the MapManager versions

* Move default value constants to SharedMapSystem

* Converts map pausing events into LocalizedEntityCommands

* Move MapManager related delegates/structs to SharedMapSystem
Moves the GridCreationOptions struct to the same namespace as SharedMapSystem and converts it into a record struct
Move the GridCallback delegates to the same namespace as SharedMapSystem

* Move CullDeletionHistory to SharedMapSystem
Well, that was less painful than I thought it would be

* Actually obsolete the NetworkedMapManager method

* Rename file

* Doc comments for new SharedMapSystem methods

* Doc comment

* Doc comments

* Fix access

* Purge all references to IMapManagerInternal

* Cull easy IMapManager references

* The rest

* Purge IMapManager

* Private internal FindGridsIntersecting method

* please die

* 41

* notes

---------

Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
2026-07-01 19:32:17 -07:00
bd489e9218 A compilation of simple one-line fixes (#5661)
* Fix warnings in SharedJointSystem

* Fix reference to EC TransformComponent method
Replaces call to TransformComponent.GetMapUid with SharedTransformSystem.GetMap

* Fix obsolete calls in SharedPhysicsSystem.Contacts.cs
Fixes a couple calls to obsolete varients of SetAwake and an obsolete call to RegenerateContacts by converting them to their Entity<T> varients

* Fix obsolete call in SharedPhysicsSystem.Components.cs
Adds one set of parenthesis to convert a 'uid, comp, comp, comp' call to an 'Entity<T, T, T> call.

* Removes unused local var
Removes an unused list of broadphases that was being allocated in TryCollideRect

* One-line fixes in SharedPhysicsSystem.Islands.cs
Fixes all of the easy warnings regarding physics island processing, the rest require more complicated changes than a simple argument rearrangement

* Fix obsolete method call in SharedMapSystem

* Fix a few obsolete ToMap calls in EntityLookup.Queries

* Fix calls to obsolete EntityCoordinate methods in SharedMapSystem.Grids

* Fix calls to obsolete EntityCoordinate methods in SharedLookupSystem.ComponentQueries

* Fix a few obsolete method calls in entity spawning

* Fix obsolete method calls in MapLoaderSystem

* Fix obsolete method call in GridFixtureSystem

* Fix obsolete IsMapInitialized call in SaveMap command

* Fix obsolete MapPosition reference in Client.EyeSystem

* Fix obsolete EntitySystem.Get<TSystem> references in DebugLightTreeSystem

* Fix obsolete EntitySystem.Get<TSystem> reference in DebugEntityLookup command

* Fix obsolete method calls in SpriteBoundsOverlay
Slightly more complicated than the rest, but it's really just changing an unused dependency over to use SharedTransformSystem

* Remove unused IClyde references from controls
LineEdit and TextEdit never use their IClyde dependencies and it generates a warning so yeet

* Remove use of EntitySystem.Get from lightbb command

* Fix DebugDrawingSystem
Removes a bunch of unused private IEntityManager vars
Also removes an obsolete use of TransformComponent.GetWorldPositionRotation

* Removes duplicate position set when splitting grids
There's nothing saying why this is this way and the blame looks like it was an oversight when replacing a bit where they set position and then rotation
Please, oh Chesterton's Fence, spare me your wrath

* Fix obsolete method use in PlacementMode

* Fix obsolete method use in Placement Modes

* Removes unused local var in gamestate management

* Fix unreachable code warnings in gamestate management
Use #else sections to make sure they don't complain about being on the wrong side of a throw

* Fix obsolete ToMap use in EyeManager

* Make InputManager use a sawmill to log

* Fix obsolete ContainerManagerComponent method calls in ContainerSystem

* Make ClientPrototypeManager use a sawmill for logging

* poke tests

* Use LocalizedEntityCommands for SpriteBoundsOverlay toggle

* Use LocalizedEntityCommands for system toggles

---------

Co-authored-by: ElectroJr <leonsfriedrich@gmail.com>
2025-04-17 11:57:03 +10:00
metalgearslothandGitHub 45dc9ad80e Inline polygon vertices (#5758)
* FastPoly

* Inline polygon vertices

No more pooling, pooling bad. No more arrays in engine, only span.

I made a slim version that's only the 4 verts so no padding on it compared to Polygon. Slightly more clamplicated code but entitylookup + mapmanager are both hotpaths and it's easy to do. Memory usage will likely go up for now but heap allocations should drop significantly due to removing the pooling.

* Unhide these

* Fixes

* More fixes

* More fixes

* Avoid potential bomb
2025-03-20 21:26:05 +11:00
metalgearslothandGitHub 15f81751f7 Reduce lookup allocs significantly (#5639) 2025-01-29 23:43:20 +11:00
Leon FriedrichandGitHub 9af119f57a Toolshed Rejig (#5455)
* Toolshed Rejig

* shorten hint string

* Try fix conflicts. Ill make with work later

* bodge

* Fix ProtoIdTypeParser assert

* comment

* AllEntities

* Remove more linq from WhereCommand

* better help strings

* Add ContainsCommand

* loc strings

* Add contains command description

* Add $self variable

* Errors for writing to readonly variables

* A
2024-12-21 17:49:11 +11:00
SpaceManiacandGitHub 0c7ace16d1 Fix most non-obsolete warnings (#5555) 2024-12-13 01:25:00 +01:00
metalgearslothandGitHub 3ad760a99e Add another lookup overload (#5477) 2024-10-03 18:56:44 +02:00
KaraandGitHub 48d70a09c6 Remove most fully-obsoleted code (#5433) 2024-09-11 19:38:26 +10:00
metalgearslothandGitHub 5eb5ddd96e Add some entitylookup methods (#5431) 2024-09-08 17:22:48 +10:00
metalgearslothandGitHub 3bb7df3254 Relative lookup fix (#5415)
* Relative lookup fix

Some of the transforms weren't being transformed, added another test.

* test

* better test

* Reduce any-entities-intersecting tests
2024-08-31 14:35:17 +10:00
metalgearslothandGitHub 057a68b366 Minor allocs reductions (#5330)
* Minor allocs reductions

Added a poly struct with the intention of replacing the existing one whenever I finish box2c port.

* fix merges

* Revert some stuff

* Poly tests
2024-08-27 22:58:42 +10:00
metalgearslothandGitHub cd95929ebe Heavily optimise entitylookup (#5400)
* Heavily optimise entitylookup

Previously I made it so MOST of entitylookup goes through the same 4 or 5 codepaths and uses shapes. The downside was some codepaths were made much slower in the process.

This fixes most of the going up and down lookups that some codepaths did. It should also be faster than the pre-shapes version because GetLocalPhysicsTransform is being used for the non-approx queries and most entities are parented directly to their broadphase.

* Tests and confidence

* code

* dang
2024-08-27 21:32:50 +10:00
5cb1901870 Fix local tile enlargement (#5349)
* Fix local tile enlargement

Not used.

* release notes

---------

Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2024-08-21 02:52:41 +02:00
Pieter-Jan BriersandGitHub 05cdb99252 Warning fixes around IMapManager.GetMapEntityId (#5298)
* Add MapSystem.GetMapOrInvalid

This is effectively the same exact behavior as IMapManager.GetMapEntityId. Adding this so I don't have to consider whether warning fixes using MapSystem.GetMap() instead would change behavior.

* Warning fixes around IMapManager.GetMapEntityId

* Fix tests
2024-07-13 15:27:32 +10:00
metalgearslothandGitHub 6b875e6676 Add local entities APIs (#5178)
Need for some vgroid stuff
2024-06-18 21:41:38 +10:00
metalgearslothandGitHub a6bfb5f557 Fix lookupflags oversight (#5233)
The ONE codepath CM-14 used and I forgot to add it.
2024-06-14 09:59:47 +10:00
eoineoineoinandGitHub 56c30edf04 Replace Matrix3 with System.Numerics.Matrix3x2 (#5078)
* Delete Matrix3. Replace with System.Numerics.Matrix3x2

* Feedback

* release notes
2024-06-02 14:08:47 +10:00
2b55d39e51 Make various ValueList enumerators use spans (#5019)
* Make various ValueList enumerators use spans

* Remove reference to EntityEventBus.OrderedRegistration

---------

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2024-03-31 17:01:03 +11:00
fb3da0b53c Add entitylookup methods for parent / map (#4870)
* Add entitylookup methods for parent / map

Content's done it a bunch so make it reusable.

* weh

---------

Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2024-01-31 17:21:41 +01:00
metalgearslothandGitHub d45ce7742e Entitylookup approx / shape changes (#4842)
* Entitylookup approx / shape changes

- Make the shape queries respect the approx flag.
- Make everything use shape queries.
- Hopefully reduce some of the internal cruft.
- Add some new methods I need for trade station.

* Bunch of deduplication

* Remove some more duplication abuse

* Remove intersection duplication

* Bunch more cleanup

* MapManager rejig

* Fix some stuff

* More fixes

* Release notes

* Fix TryFindGrid

* Sensor check

* Fix query

* Fix map queries

* More cleanup

* Fix whatever this is.

* also dis

* Fix entity query

* Smol optimisations

* Also this
2024-01-19 13:02:22 +11:00
metalgearslothandGitHub 6573531d5d GetEntitiesInRange flag + TryDelta (#4749)
Needed for tesla too lazy to split
2023-12-22 14:17:46 +11:00
bc84590a33 Make ChildEnumerator out value non-nullable (#4707)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2023-12-17 03:10:20 +11:00
TemporalOroborosandGitHub 56899b4e64 Some ContainerManagerComponent ECSing (#4622) 2023-12-12 13:24:18 +11:00
metalgearslothandGitHub f5a2a710f0 Nuke some non-approx grid queries (#4637) 2023-11-29 22:55:33 +11:00
Leon FriedrichandGitHub 54d6552164 Fix shape lookups for non-hard fixtures (#4583) 2023-11-20 16:15:27 +11:00
DrSmugleafandGitHub 4a50bc2154 Add AddEntitiesIntersecting for phys shapes, change float range overload to use circles, remove obsolete methods (#4572) 2023-11-16 20:44:21 +11:00
Leon FriedrichandGitHub 773b87672b Fix terminating entity reparenting bug (#4549) 2023-11-08 15:39:08 +11:00
metalgearslothandGitHub ab1e99a0df Add GetEntitiesInRange that takes in a set (#4544) 2023-11-04 15:02:20 +11:00
DrSmugleafandGitHub b737ecf9b3 Add generic EntityUid, remove some usages of .Owner (#4498) 2023-10-19 12:23:48 -07:00
DrSmugleafandGitHub 6b6ec844e8 Replace all T : Component constraints with T : IComponent (#4494) 2023-10-17 19:37:46 -07:00
Leon FriedrichandGitHub 6151a26622 Remove unnecessary component fetch in AnyComponentsIntersecting (#4215) 2023-08-01 12:13:32 +10:00
metalgearslothandGitHub 161b1874c2 Some comp query optimisations (#4203) 2023-07-30 03:34:35 +10:00
metalgearslothandGitHub 7d1ad527d9 Replace Robust Vector2 with System.Numerics (#4092) 2023-07-08 14:08:26 +10:00
e71f1cc8a5 Warning fixes (#4160)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2023-07-01 22:02:12 +10:00
metalgearslothandGitHub d389e30c87 Changes for audio (#4087) 2023-05-28 14:50:21 +10:00
metalgearslothandGitHub 46b4d57a8c Add non-generic comp lookups (#4054) 2023-05-17 03:47:37 +10:00
Leon FriedrichandGitHub 1678a26d0c Remove obsolete Fixture.Body references (#4014) 2023-05-09 17:21:14 +10:00
Leon FriedrichandGitHub 6afd67acea Fix EntityLookup not properly adding nested contained entities. (#4015) 2023-05-09 12:26:51 +10:00
metalgearslothandGitHub fde8a4a91a Revert "Adjust InRange entity lookups" (#3897) 2023-04-01 12:19:15 +11:00
metalgearslothandGitHub de837b1b03 Adjust InRange entity lookups (#3868) 2023-03-31 16:49:12 +11:00
metalgearslothandGitHub b39adf0095 Fix some build warnings (#3573) 2022-12-12 22:12:51 +01:00
metalgearslothandGitHub 3c168f5a31 Replace GridEntityId with Owner (#3530) 2022-12-12 14:58:41 +11:00
Leon FriedrichandGitHub 33ebb99b9c Fix lookups for StaticSundriesTree (#3393) 2022-10-28 14:04:54 +11:00
Leon FriedrichandGitHub 49dfb2d2f1 Lookup fixes (#3390) 2022-10-28 11:23:23 +11:00
ae2f3fe70c Remove EntityLookupComponent and de-dupe AABBs (#3367)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
2022-10-27 23:36:01 +11:00
metalgearslothandGitHub c481b50a8b Remove IEnumerable abuse from entitylookup (#3333) 2022-10-23 15:48:38 +11:00
metalgearslothandGitHub a6c6b22393 Add entitylookup for components (#3065) 2022-09-13 19:52:46 +10:00